[Q]Out Of Memory - Java for Android App Development

Hi,
I am creating a theme part in my app. The problem is I get an out of memory error(not all the time)
I already resize the images to the size they have to be in the app but I am stilling getting this error sometimes.
How can I fix or bypass this?

Rick Clephas said:
Hi,
I am creating a theme part in my app. The problem is I get an out of memory error(not all the time)
I already resize the images to the size they have to be in the app but I am stilling getting this error sometimes.
How can I fix or bypass this?
Click to expand...
Click to collapse
Huge question and probably better if you go though d.android.com and some of the tools to track now what is causing it.

deanwray said:
Huge question and probably better if you go though d.android.com and some of the tools to track now what is causing it.
Click to expand...
Click to collapse
Well that is the problem and I did what they said I resize the bitmaps so it won't use to much space.
But still it will crash ones in a while
Sent from my SM-N9005 using XDA Premium 4 mobile app

Rick Clephas said:
Well that is the problem and I did what they said I resize the bitmaps so it won't use to much space.
But still it will crash ones in a while
Sent from my SM-N9005 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
well first things to do is find out where and why, I assume you maybe keeping or hanging a reference in memory, or have a leak ...impossible to say, easy to speculate

deanwray said:
well first things to do is find out where and why, I assume you maybe keeping or hanging a reference in memory, or have a leak ...impossible to say, easy to speculate
Click to expand...
Click to collapse
I don't keep them in memory because if I don't it will crash and say that the reference was closed...
Sent from my SM-N9005 using XDA Premium 4 mobile app

deanwray said:
well first things to do is find out where and why, I assume you maybe keeping or hanging a reference in memory, or have a leak ...impossible to say, easy to speculate
Click to expand...
Click to collapse
Is there a way that all those references will be deleted if the acticity is closed?
Sent from my SM-N9005 using XDA Premium 4 mobile app

Related

What is this file being created?

Hey guys been looking for an answer but only found a thread on evo 3d forums that doesn't have much activity, anyways I keep getting this file created every hour or so and its really starting to scare me maybe spyware or something. Trying to figure out why and where its coming from. Also attached inside contents.
Sent from my Nexus 4 using xda premium
drmclove69 said:
Hey guys been looking for an answer but only found a thread on evo 3d forums that doesn't have much activity, anyways I keep getting this file created every hour or so and its really starting to scare me maybe spyware or something. Trying to figure out why and where its coming from. Also attached inside contents.
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
I would download Avast from Google Play and scan sdcard and apps. Not sure what it is. Looks like spam-ware.
stelv said:
I would download Avast from Google Play and scan sdcard and apps. Not sure what it is. Looks like spam-ware.
Click to expand...
Click to collapse
Thanks for the tip, just tried and avast says all is good. Should I be worried about this?
Sent from my Nexus 4 using xda premium
Just noticed I scanned it when the file wasn't there. Maybe I'll wait till it gets created then I'll scan?
Sent from my Nexus 4 using xda premium
I found that in my phone the other day too. I don't know what it is, but it doesn't really do anything.
Could be a log file. I'm not sure what it is. I would scan again once it appears. Not sure if it is I needed file or not. I don't have a nex 4 but was looking into getting one that's why I'm at the forum.
You can try sd maid which has a system cleaner. Or change the files permissions if you are worried about it transmitting data. But I wouldn't mess with it too much until you figure out what it is.
Sent from my HTC One X+
I suspect it's something to do with adverts in some app on your phone.
Sent from my Nexus 4
I have that file also, along with three others that I have no idea what they are.
Sent from my Nexus 4 using Tapatalk 4 Beta
You guys could wipe your sdcard with twrp if you are worried, but back up all your wanted sdcard data to a computer first. And then put it back on right after. I do that with my Nexus 7 sometime. Not sure if it is the same process on Nex4. It may not be necessary, not sure.
Sent from my HTC One X+
stelv said:
You guys could wipe your sdcard with twrp if you are worried, but back up all your wanted sdcard data to a computer first. And then put it back on right after. I do that with my Nexus 7 sometime. Not sure if it is the same process on Nex4. It may not be necessary, not sure.
Sent from my HTC One X+
Click to expand...
Click to collapse
I actually recently flashed completely back to stock cuz I was so paranoid and then I rerooted and flashed ROM and I still get it now.
Sent from my Nexus 4 using xda premium
Not sure then, maybe its ROM or root toolkit related.
Sent from my Nexus 7
drmclove69 said:
I actually recently flashed completely back to stock cuz I was so paranoid and then I rerooted and flashed ROM and I still get it now.
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
I think it's coming from an app. what apps did you install?
"We are Mologiq
A stealth-mode startup doing big things in mobile advertising."
http://mologiq.com/
http://forum.xda-developers.com/showthread.php?p=41867789#post41867789
got any of these apps?
Adobe Flash Player
ASOT unofficial
Chase banking app
Franco Kernel Updater
Gmail
GoBackup
Google Play services
Google Search
PowerAmp/ unlocker
Reddit news free
Solid Explorer/ unlocker
Vaulty
XDA app
YouTube
Zedge
also, this may be helpful (from https://play.google.com/store/apps/details?id=com.brosmike.airpushdetector&hl=en)
"If your device is running Android 4.1 "Jelly Bean" or higher, you don't need this app anymore! You can just press and hold on notifications and your device will tell you who is generating them."
try that on apps with notifications?
LooieENG said:
"We are Mologiq
A stealth-mode startup doing big things in mobile advertising."
http://mologiq.com/
http://forum.xda-developers.com/showthread.php?p=41867789#post41867789
got any of these apps?
Adobe Flash Player
ASOT unofficial
Chase banking app
Franco Kernel Updater
Gmail
GoBackup
Google Play services
Google Search
PowerAmp/ unlocker
Reddit news free
Solid Explorer/ unlocker
Vaulty
XDA app
YouTube
Zedge
also, this may be helpful (from https://play.google.com/store/apps/details?id=com.brosmike.airpushdetector&hl=en)
"If your device is running Android 4.1 "Jelly Bean" or higher, you don't need this app anymore! You can just press and hold on notifications and your device will tell you who is generating them."
try that on apps with notifications?
Click to expand...
Click to collapse
Yup those are the apps I have installed as of now.
Sent from my Nexus 4 using xda premium
drmclove69 said:
Yup those are the apps I have installed as of now.
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
Thanks guys, will try all suggestions and see what happens. BTW I don't use root toolkits I do it all through fast boot
Sent from my Nexus 4 using xda premium
drmclove69 said:
Yup those are the apps I have installed as of now.
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
haha sorry didn't notice you posted that!
Found out reddit news free is what's creating the file. Automatically after opening it up the file appears.
Sent from my Nexus 4 using xda premium
drmclove69 said:
Found out reddit news free is what's creating the file. Automatically after opening it up the file appears.
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
Interesting, I don't have that app installed on my phone?
Sent from my Nexus 4 using Tapatalk 4 Beta
I have the following apps installed on my devices and don't have that file, so it may not be these ones:
Adobe Flash Player
Gmail
Google Play services
Google Search
XDA app
YouTube
LooieENG said:
"We are Mologiq
A stealth-mode startup doing big things in mobile advertising."
http://mologiq.com/
http://forum.xda-developers.com/showthread.php?p=41867789#post41867789
got any of these apps?
ASOT unofficial
Chase banking app
GoBackup
Reddit news free
Solid Explorer/ unlocker
Vaulty
Zedge
also, this may be helpful (from https://play.google.com/store/apps/details?id=com.brosmike.airpushdetector&hl=en)
"If your device is running Android 4.1 "Jelly Bean" or higher, you don't need this app anymore! You can just press and hold on notifications and your device will tell you who is generating them."
try that on apps with notifications?
Click to expand...
Click to collapse
I have removed the apps I have installed on my Device from the above list, The first one that springs to mind is the go backup. I would check there first.

And WTF is this?

I know this is probably more related to the actual FB app but I feel like it's a complete violation of privacy and I don't particularly want this happening but can not seem to find a setting to turn it off.. Here is a scenario where this would be completely out of place and unacceptable..
You take a picture of something private .. You or a friend gets your phone and opens the Facebook app... Oh look the last 3 pics you took.... Really? WTF? Anyone know how to turn this off?
Sent from my Nexus 4 using xda app-developers app
Check settings. Turn off facebook sync photos.
Just using Facebook is violation of privacy. Even if you find away to turn it off that feature; Facebook is always sucking up information from your device (contacts, location, call logs, pictures, and so on). This is one of the reason I don't use Facebook.
Sent from my Nexus 4 using Tapatalk
That's definitely true... Makes me sad. I think in this issue though the most disturbing thing is that it's accessing another app (gallery) and then putting the 3 most recent pics in the app (suggesting) you post them. Who's to say their appropriate to post. I don't like this at all.
Sent from my Nexus 4 using xda app-developers app
jcnbama said:
That's definitely true... Makes me sad. I think in this issue though the most disturbing thing is that it's accessing another app (gallery) and then putting the 3 most recent pics in the app (suggesting) you post them. Who's to say their appropriate to post. I don't like this at all.
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
Open the Facebook app and tap the top left main menu in your sidebar*Scroll to the bottom and select*Account*>*App Settings*>*Sync PhotosChoose*Don't sync my photos
If you are rooted install below app. This will give you some control over apps permission.
https://play.google.com/store/apps/details?id=com.schurich.android.tools.appopsstarter
Sent from my Nexus 4 using Tapatalk
Don't sync photos is already selected. This is new. It's not syncing my photos it's just suggesting photos from my gallery (the last 3 taken) for me to post. Very annoying. I will definitely check out the other app you put on here. I apologize I couldn't quote because the XDA app kinda sux.
Sent from my Nexus 4 using xda app-developers app
I've notice same thing did you manage to remove that "new feature" ?
z0rin said:
I've notice same thing did you manage to remove that "new feature" ?
Click to expand...
Click to collapse
Guys, just get another app for Facebook. There's tons of apps that don't these extra permissions and don't steal your data, AND THEY RUN BETTER than the stock Facebook app. Example : fast for facebook (search it!)
z0rin said:
I've notice same thing did you manage to remove that "new feature" ?
Click to expand...
Click to collapse
No I didn't. I've tried alternative FB apps in the past. Haven't generally had much success but maybe I'll give it another go..
Sent from my Nexus 4 using xda app-developers app
Fb app is the worst app ever, I started using fb on browser and all kinds of wonders happened, like improved battery life
Sent from my Nexus 4 using Tapatalk
The facebook app is becoming worse and more invasive after each update, i think it's time to switch to an unofficial app for it
jcnbama said:
I apologize I couldn't quote because the XDA app kinda sux.
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
Yes the xda app is a bit buggy but you can quote.
Sent from my Nexus 4 using xda app-developers app
No... I can't quote.... I'm not just making it up... I have to post another post to be able to click on a post to quote it...
Sent from my Nexus 4 using xda app-developers app
Ibrahim.Rahman said:
Yes the xda app is a bit buggy but you can quote.
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
So it ends up looking like this. I tapped on my post, so I could quote your post. Because it always highlights the one above it. Don't say random stuff if you don't know what you're talking about. Obviously if I could have quoted I would've done it. Been doing this a while....
Sent from my Nexus 4 using xda app-developers app
jcnbama said:
So it ends up looking like this. I tapped on my post, so I could quote your post. Because it always highlights the one above it. Don't say random stuff if you don't know what you're talking about. Obviously if I could have quoted I would've done it. Been doing this a while....
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
Yes that is a bug. However if you tap the time at the right hand side of each post, the corresponding post is highlighted, not the one above it.
Sometimes it works, sometimes it doesn't... Sorry for being abrasive. Just been very frustrated with the XDA app lately. It used to be so much easier to use.
Sent from my Nexus 4 using xda app-developers app
danyf90 said:
The facebook app is becoming worse and more invasive after each update, i think it's time to switch to an unofficial app for it
Click to expand...
Click to collapse
Good idea
Tapatalk FTW!
badboy47 said:
Open the Facebook app and tap the top left main menu in your sidebar*Scroll to the bottom and select*Account*>*App Settings*>*Sync PhotosChoose*Don't sync my photos
If you are rooted install below app. This will give you some control over apps permission.
https://play.google.com/store/apps/details?id=com.schurich.android.tools.appopsstarter
Sent from my Nexus 4 using Tapatalk
Click to expand...
Click to collapse
App Ops not working on kitkat 4.4.2, when i launch it, i get message "unfortunately, settings has stopped"
any way to make it work?
or good alternative app????
sid.8491 said:
App Ops not working on kitkat 4.4.2, when i launch it, i get message "unfortunately, settings has stopped"
any way to make it work?
or good alternative app????
Click to expand...
Click to collapse
Yes, there is a good alternative:
http://forum.xda-developers.com/showthread.php?t=2540233
Sent from Nexus 4, Tapatalk
sid.8491 said:
App Ops not working on kitkat 4.4.2, when i launch it, i get message "unfortunately, settings has stopped"
any way to make it work?
or good alternative app????
Click to expand...
Click to collapse
There is an app called AppOps X that works on 4.4.2
Here
Or Xposed module
Here

Close

Close...
out of shear curiosity, why make a flashable when the apk to v2.1.043 is easily available on google or through the play store? not trying to be negative, im just curious
simms22 said:
out of shear curiosity, why make a flashable when the apk to v2.1.043 is easily available on google or through the play store? not trying to be negative, im just curious
Click to expand...
Click to collapse
Of course I know ... but this zip is for those who want GoogleCamera in the system and includes the framework and lib files ... is useful for those who use core gapps that do not include the new GoogleCamera..
miseusegau said:
Of course I know ... but this zip is for those who want GoogleCamera in the system and includes the framework and lib files ... is useful for those who use core gapps that do not include the new GoogleCamera..
Click to expand...
Click to collapse
ahh, i see. well, nice
but, i do have some feedback. my new camera was in the system, but i moved it out as a user app last week. it drained battery a lot hevier than before(old cam), and the camera daemon used more battery as well. i tried figuring out how to make it use less, but couldnt figure it out. i moved it out of the system to a user app last week, and now it uses much less battery
simms22 said:
ahh, i see. well, nice
but, i do have some feedback. my new camera was in the system, but i moved it out as a user app last week. it drained battery a lot hevier than before(old cam), and the camera daemon used more battery as well. i tried figuring out how to make it use less, but couldnt figure it out. i moved it out of the system toa user app last week, and now it uses much less battery
Click to expand...
Click to collapse
strange, I use the camera in system with all my rom without any problems, I have no problems of excessive consumption ... well everything works very well
This is useful for people that don't wish to rely on Google services like the play store. I myself am paranoid on a much smaller scale, but people who are into security and experience paranoia have much different setups than a typical Android user.
Sent from my Nexus 5 using Tapatalk
Link is down. It says temporary error. Mirror plz.
TokedUp said:
Link is down. It says temporary error. Mirror plz.
Click to expand...
Click to collapse
server up and running again..
getting error here...
donnytuco said:
getting error here...
Click to expand...
Click to collapse
that error?
miseusegau said:
server up and running again..
Click to expand...
Click to collapse
LIAR! Where's the f'ing MIRROR!?
TokedUp said:
LIAR! Where's the f'ing MIRROR!?
Click to expand...
Click to collapse
I add another mirror tonight
This is just a mirror to help the OP spreading his work. I've absolutely no credits in this.
Dropbox: http://goo.gl/fXKwqX
Sent from my Nexus 5 using XDA Premium 4 mobile app
What is "overview"
Sent from my Nexus 5 using XDA Premium 4 mobile app
Yusei said:
This is just a mirror to help the OP spreading his work. I've absolutely no credits in this.
Dropbox: http://goo.gl/fXKwqX
Sent from my Nexus 5 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
thanks for help, add your link and a new my link, now there are 3 ...
@Wagedroid...panoramic
New GoogleCamera build 2.2.024...download in op
Use one of my mirrors again
Dropbox - http://goo.gl/IiofoP
Cheers
Sent from my Nexus 5 using XDA Premium 4 mobile app
Anyone know why im not receiving any updates from google on time like this camera?x.x
Sent from my Nexus 5 using XDA Free mobile app
Nope.
I didn't received this one too.
Sent from my Nexus 5 using XDA Premium 4 mobile app
Me too, never received update on time from my Play Store
Sent from my Nexus 5 using Tapatalk

Facebook slow on nexus 7

Hey guys!
I picked up a 2012 nexus 7 for pretty cheap and I really love this tab. Does everything I would want it to do. However, one thing that's kind of annoying is the Facebook app is super slow... The app itself is responsive but the data loads as if I have a dial up connection. I ran a speed test from it and get 12+ meg...I also have an iPhone and iPad both connected to the same wireless ap and don't have any issues... All other apps seem to be fine as well. Any suggestions?
Thanks guys!!
Sent from my Nexus 7 using XDA Free mobile app
Also I'm running rooted 4.4.4
Sent from my Nexus 7 using XDA Free mobile app
try here Facebook Support
% Facebook
Here's the ONLY good thing FB ever did.
It also illustrates who uses it.
That's because the official Facebook app is utter sh*t, it takes a load of time on my tablet as well
Bert98 said:
That's because the official Facebook app is utter sh*t, it takes a load of time on my tablet as well
Click to expand...
Click to collapse
You are pretty much the only person that answered the question.
Loads ****ty on mine too.
Tablet feels slow even with it running in the background.
RumoredNow said:
% Facebook
Here's the ONLY good thing FB ever did.
It also illustrates who uses it.
Click to expand...
Click to collapse
WOW . I am impressed Due to the fact i thought face crap was Totally useless. Facebook app messenger or webpage is NOT allowed on my laptop my phone my nexus 7 or my Note 10. I might even go as far as putting a NO Facebook sign at the end of my driveway. Requiring anyone who comes to visit me To uninstall it .
Yea I really feel this way about face &($%
ON TOPIC.. I have seen all over the net forums and Google plus about the same issue your having OP. sorry
MrFastZombie said:
You are pretty much the only person that answered the question.
Click to expand...
Click to collapse
in our defense it wasnt even put in the right forum. and even if it was he should be asking facebook not a forum of android developers.
Just add these to buildprop..
sys.mem.max_hidden_apps=5
persist.sys.use_16bpp_alpha=1
Regards..
Lim Wee Huat said:
Just add these to buildprop..
sys.mem.max_hidden_apps=5
persist.sys.use_16bpp_alpha=1
Regards..
Click to expand...
Click to collapse
What does that do?
Sent from my HTC One X using XDA Premium 4 mobile app
acidspider said:
What does that do?
Sent from my HTC One X using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Just do it. It'll create a placebo effect [emoji39]
Sent from my SM-N900T using Tapatalk
princeasi said:
Just do it. It'll create a placebo effect [emoji39]
Sent from my SM-N900T using Tapatalk
Click to expand...
Click to collapse
Placebo effect? You sure? lol.
Lim Wee Huat said:
Placebo effect? You sure? lol.
Click to expand...
Click to collapse
Explain it the..because i want to know :v as i understand it will limit the background apps to 5 wich means more ram..but apps will load slower
alexche77 said:
Explain it the..because i want to know :v as i understand it will limit the background apps to 5 wich means more ram..but apps will load slower
Click to expand...
Click to collapse
Hidden apps is limited to 5 from default 10 or 15 = less services for device to handle.. and use_16bpp_alpha=1 forces your device to use 16 bits instead of 32 bits. Try it. Don't like it? Just delete it. Simple.
just thanx gr8 live nexus
Sent from my A110Q using XDA Premium 4 mobile app
Recommending another nice tweak...
http://forum.xda-developers.com/showthread.php?t=2534471

[Q] Restart service after kill

Hi I want to start my service after it is killed by the user or the system.
I thought about creating a second app and monitor if the service is running and if not then start it.
The problem I have with that is
- I need two apps
- It drains more battery
I hope you can help me find the best solution for my problem
Yeah, I think if you override the onDestroy method on your service class, and then you can send a broadcast from there.
In your broadcast receiver you can start the service again.
Though i have never tried it myself, i think this should work.
Tell me how it goes
Happy coding!! :thumbup:
Sent from my GT-P3100 using XDA Free mobile app
hiphop12ism said:
Yeah, I think if you override the onDestroy method on your service class, and then you can send a broadcast from there.
In your broadcast receiver you can start the service again.
Though i have never tried it myself, i think this should work.
Tell me how it goes
Happy coding!! :thumbup:
Sent from my GT-P3100 using XDA Free mobile app
Click to expand...
Click to collapse
I thought about that too but unfortunately when the app is stopped by the user the onDestroy methode is not called...
Sent from my SM-N9005 using XDA Premium 4 mobile app
If yu are using android version less than 4.4.2 then returning start sticky should do it
Sent from my GT-P3100 using XDA Free mobile app
hiphop12ism said:
If yu are using android version less than 4.4.2 then returning start sticky should work
Sent from my GT-P3100 using XDA Free mobile app
Click to expand...
Click to collapse
That is only if the system stops the service not if the user does....
Sent from my SM-N9005 using XDA Premium 4 mobile app
Rick Clephas said:
That is only if the system stops the service not if the user does....
Click to expand...
Click to collapse
I believe there is no such way... otherwise android would be very insecure for malware that just does this . You can only restart your service once the user restarts your activity, there should not be another way (and START_STICKY for the system of course). And please don't do two apps which listen for each other, if the user willingly kills your service they usually have a reason and expect that your app is not working right until they restart it.
SimplicityApks said:
I believe there is no such way... otherwise android would be very insecure for malware that just does this . You can only restart your service once the user restarts your activity, there should not be another way (and START_STICKY for the system of course). And please don't do two apps which listen for each other, if the user willingly kills your service they usually have a reason and expect that your app is not working right until they restart it.
Click to expand...
Click to collapse
I have heard that a lot but does that mean that all the security apps available on the play store can be killed by the user? :what:
Sent from my SM-N9005 using XDA Premium 4 mobile app
Rick Clephas said:
I have heard that a lot but does that mean that all the security apps available on the play store can be killed by the user? :what:
Click to expand...
Click to collapse
Sure, why not? I could uninstall my firewall on my PC if I wasn't using Ubuntu and thus don't really need one
SimplicityApks said:
Sure, why not? I could uninstall my firewall on my PC if I wasn't using Ubuntu and thus don't really need one
Click to expand...
Click to collapse
Well that is a pitty. I really thought I had seen an app that could do that...
Sent from my SM-N9005 using XDA Premium 4 mobile app
Look this app says it can't be killed by task managers https://play.google.com/store/apps/details?id=com.domobile.applock
Sent from my SM-N9005 using XDA Premium 4 mobile app
Rick Clephas said:
Look this app says it can't be killed by task managers https://play.google.com/store/apps/details?id=com.domobile.applock
Click to expand...
Click to collapse
Just an idea, it might be possible when your app is a Device Admin with the APIs that you get with that. Though you have to read it yourself, I have no clue about how it works.
SimplicityApks said:
Just an idea, it might be possible when your app is a Device Admin with the APIs that you get with that. Though you have to read it yourself, I have no clue about how it works.
Click to expand...
Click to collapse
Thanks I will look at that. Most people have my app as Device Admin because that way it can't be uninstalled
Sent from my SM-N9005 using XDA Premium 4 mobile app
Well I found the solution.
When device admin is enabled the app can't be force-stopped or uninstalled. Then the user can only stop the service and then the onDestroy methode is called so then I can restart the service again. Tanks guys :thumbup:
Sent from my SM-N9005 using XDA Premium 4 mobile app

Resources