Android Question My Apps Just Quit!!

aidymp

Well-Known Member
Licensed User
Longtime User
Hi, I for around 2 weeks now I have been battling with my app, I got it to a working state, then I installed ProBundle from @Informatix (I was initially blaming him for this sorry for that!!) I now think that the problem is more deep seated than I originally thought. I have 2 REAL android devices, Both are cheap Chinese tech, 1 a tablet that has known firmware issues and the other TV box that has upto now seems OK!

However I have now noticed that most apps I write, or Source code I try. I get so far then the Apps just quit! no errors usually, just back to the home screen!

For example @DonManfred just showed me a quick example of a service that counts files! nice and easy! however I have a folder that can reach 3GB and around 40,000 tp 60,000 files so in the main thread it was causing an ANR. @DonManfred showed me it running in a service, and that also just quit after several hundred files where counted.

I noticed, that these errors (random quits) where similar to the problem I had with ArchiverProZip. and investigated a little more. I installed Androids Own Emulator, but after waiting for what seemed several hours to start the thing, then trying for about 45 minutes to get B4A Bridge installed. I was too frustrated to even try running my apps, so got GenyMotions superfast emulator. And run the service that @DonManfred had sent! and it worked and completed in pretty much record time! i run it again and again! no crashes, or exits! So Im going to take a look at the problem I had with @Informatix's excellent ArchiverPlusZip lib again.

So, what is the explanation? 2 real devices my apps don't work! on an emulator they work! as well as the problems I was having with @Informatix 's great Zip library.

If it doesn't work on my real devices, how do i know it will work on other peoples devices??

POINTS I HAVE NOTICED! on my real devices I get a lot of messages about too many queued messages, and things like that! but on the emulator I dont get any such messages, in fact the emulator works MUCH better that my devices! - surely it should be the other way round!

---- EDIT This may be part of the solution, but I have noticed the emulator gives much more detailed information on errors! as well as (im pretty sure this used to be the norm) also displaying information using the log(blah) command. (currently I only see messages i log(blah) in debug mode) but im sure I used to get them no matter what compilation mode i used!

So the Question is - if an app works great on the emulator, what would make it not work on a real device? (as the whole Idea of writing apps is for real devices - not for emulators) which at present seems to be the only place they work correctly.

Thanks

Aidy
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
When a app quits/crashes then you should find informations about this in the LOG Cat (maybe the unfiltered one). Look at these error messages and change your code to prevent it
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
POINTS I HAVE NOTICED! on my real devices I get a lot of messages about too many queued messages, and things like that! but on the emulator I dont get any such messages

Aidy

This could be a clue.

I have experienced the following type of error, mainly in other development environments.

I had a timer which makes a request to call a subroutine to process new data, but the subroutine might take significantly longer to process the data than the interval of the timer. Messages built up until it crashed. Slower computers crashed more quickly than faster computers.

Is it possible that your software might be doing something like this?

Barry.
 
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User
Hi, Thanks for the tips! The thing is I don't get anything in the logs, one minute its working then it just exits!

I have also noticed i get a lot of messages, regarding the message queue, Also I notice that in some circumstances, during development a task like downloading a large file, will still be running, when I compile an updated version, like the app hasn't completely quit, I haven't read too much about the rules of programming Android, So the problems are more likely my ignorance than actual bugs!

I have started to reboot my devices, before compiling and running, and things seem better!

I will also try and read the thread on Android Process and activities life cycle as I think this may have something to do with it.

Thanks again!

Aidy
 
Upvote 0

wonder

Expert
Licensed User
Longtime User
I an LibGDX project, I've experienced random quits before, with no error message at all.
I never really understood the cause, but as soon as I started to manage the memory more carefully (LibGDX's .dispose method), my code became random-quit-free.
It has been more than 6 months now and it never happened again. You might have a memory leak, causing the Android system to terminate your app without warning.
 
Last edited:
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User
I an LibGDX project, I've experienced random quits before, with no error message at all.
I never really understood the cause, but as soon as I started to manage the memory more carefully (LibGDX's .dispose method), my code became random-quit-free.
It has been more than 6 months now and it never happened again. You might have a memory leak, causing the Android system to terminate your app without warning.
Sorry if this wasn't really helpful, it's just an idea...

Thanks! Im quite new to programming, so any information is helpful! I was thinking its something to do with memory (maybe even faulty ram) as these devices are of poor quality, but they have served me well for quite a while. maybe its time to upgrade!

Thanks

Aidy
 
Upvote 0
Top