I've developed an application to exchange small text messages between phones via Bluetooth.
My application works fine for 1 hour or 2 then it suddenly close without any warning both on screen or log-cat. During my tests I tried to exchange messages between 2 phones and I noticed that the applications silently close on them at different times and always without any reason
(I had both phones plugged to my laptop and with log-cat running).
Does Android shut down apps if it thinks that are idle? I send messages every 1-2 minutes.. shall I send them with an higher frequency?
EDIT:
I've noticed another strange behaviour.. sometimes when my app closes I lose all the messagges related to it into logcat.. they got completely wiped.
Related
I am developing two apps:
-> App A: it connects to a Bluetooth device, retrieve some data, process this data and broadcast an intent to App B
-> App B: it receives this intent and shows the results.
App A must keep running in order to keep sending data to App B.
Everything was working fine until this week when I made some visual changes and update my android device to V7.0.
Now, My App A stops (DEAD message in debugging window in android studio) when I switch to App B and see the results. If I change back to App A, current activity restarts itself and it works normally once again.
I do not get any exception or error message in android studio's debug window.
Any idea or information about this issue. I must say I have read a lot of questions and documentation but I can not find the reason of this issue.
(sorry for bad English)
Everything was working fine until this week when I made some visual
changes and update my android device to V7.0.
7.0 has introduced numerous changes aimed at improving battery life. Your App A is likely suffering from these changes, particularly if it was memory / cpu intensive, which it sounds like it might be.
App A must keep running in order to keep sending data to App B.
If that's the case, you probably want a make App A a foreground Service to ensure it keeps running.
Architecturally this probably makes more sense anyway if your use case is to have App B open while App A keeps piping data to it. The fact that your App A was not dying before was likely just lucky chance. It would have been killed by the system eventually after going into the background.
I have an app that Samsung Smart Manager is complaining about. It reports that the app is causing the device to run slowly but then references the number of errors in a week. It's not entirely clear that "errors" in this case actually mean crashes but it's possible as I think this device might have had QA versions of this app installed.
How do I determine anything about why Smart Manager would show this message about my app? And why does it report causing the app to run slow if it's just errors/crashes?
Here is the full message:
"This app is causing your device to run slowly. To improve your device's perfomance, turn off auto open for this app.
41 errors occured in 1 week"
After a LOT of searching and investigating I think I've figured it out. Note that this is not definitive but it's the best I can dig up.
It appears that this message is only referring to an app crashing and the app has to crash a certain percentage in order for the notification to show up. So it has nothing to do with causing the device to run slowly...
The algorithm for determining if the notification should show up is something along the lines of:
if(crashes >= ((NumberOfTimesUserLaunched + 1) * 10)) -> Show notification
I don't have any information at the moment as to how it determines how many times the user launches it. (If the app launches at boot that may or may not count towards that number)
Im currently fixing bugs when my app is not the main active app. Most devices i get a PAUSE message, LOST messages etc. These are all as I expect. The thing i dont get is on the Moto G device i always get a destroy message when returning to the app menus etc, or the device is put to sleep.
Is there any reason for this? I am fixing it up, but it seems harsh to have to destroy the app just because you get a phone call or sleep the device, its not like im loading up another complex game or anything
The Moto G appears to have rather aggressive memory management. Android has a low memory killer, which determines which processes to kill depending on device configurations.
While the Moto G does have 1GB of RAM, the minfree settings applied by Motorola seem to kill apps on background.
There are instructions on the web as to how to address this as a user, but as a developer, it is likely best to save your state when you are backgrounded in onPause().
http://m.androidcentral.com/fine-tuning-minfree-settings-improving-androids-multi-tasking
http://developer.android.com/reference/android/app/Activity.html#ProcessLifecycle
I have a video app (client a) that streams and receives audio via flash media server. It also does constant server side polling to maintain an engagement via an adobe air desktop app (client b) which does the same. The problem I'm having is that:
- 90% of the times when client b ends the engagement the app in client a force closes.
- 5% I have seen the app force close from when client a ends the engagement.
- works fine in gingerbread. Doesn't in honeycomb+
Debug doesn't throw anything, logcat throws an error that consumer closed the input...
I have isolated the problem to my flash media server class, however I am not doing anything different than any other connection class.
Has anyone ever experienced this issue? Like I said itworks fine in gingerbread...
Any pointers would be great.been banging my head against the wall for 2 weeks now and counting
Took a while to find the issue but in the end it was an issue in the fms server.
I was running a function at an interval to check for user timestamps among other things, however when the engagement was being finished by client b, the timestamp was stillt rying to run and disconnect a user, even though the connection was already closed.
Once I got that sorted the issue went away.
It is still weird how this issue wasnt affecting android 2.x devices...
This is probably not going to be very helpful to many people, however if you do see your app force closing, and one of the last messages your app receives is down to the fms, have a check for something your doing in the .asc file in your fms.
Unfortunately learnt this the hard way, spent 3 weeks looking at my code, thinking it was something it was doing or some kind of bug...
Glad I was wrong!
I am running a background service which checks for some updates from the server every 2 hours in my android app and it works fine so long as the device is the not in the locked state. But once I lock my phone and unlock again I see my device displaying the message that my app has crashed. What could be the real reason behind it. Does it need some permissions to be declared. Could anyone suggest me as to why this is happening.
It can be happening from several causes. But I gonna give my guess: are you taking in consideration the case that your app fails to reach the server? What I mean is that I'm guessing that when you lock your phone, or close it in some way, it can be closing your connection and your app can be crashing because it fetchs the server without connection. Its only a very broad guess...