About Store Forum Documentation Contact



Post Reply 
Android app loading very slow/hangs/crashes
Author Message
AndrewBGS Offline
Member

Post: #1
Android app loading very slow/hangs/crashes
The title should explain my problem pretty straight forward.

I don't know what I am doing wrong, but my app is getting to the Intro state very slowly, and sometimes stops responding.

This is how my Main file looks like:
Code:
void InitPre()
{
   EE_INIT();
   D.full(true);
   D.sync(true);
}

Bool Init()
{
   StateIntro.set();
   return true;
}
void Shut()
{
}

Bool Update()
{
   return true;
}

void Draw()
{
}

It's pretty simple, and yet rather often, on my device the app doesn't get to the intro state. (which is again pretty simple, it just display the esenthel logo).

I assume that EE:Init() does a lot of stuff I don't need it to do for a 2D app, but I don't know how can I simplify it even more.

Does anyone have any idea what I might be doing wrong and/or how can I improve my code to never stop responding in this stage?
12-13-2014 02:05 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #2
RE: Android app loading very slow/hangs/crashes
How big is your app? It will load in the resources from the start, so maybe it hangs because your memory gets filled up?
Also, which device are you using?

I am currently using code almost exactly like yours and I don't notice any problems. It just takes about 3-5 seconds to load up the 35 MB application (which is very big for a barebone app, btw) on my fairly old Android phone.
12-13-2014 02:27 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: Android app loading very slow/hangs/crashes
It is rather small, 33 with no compression, but i use the smallest compression there is and i get some 23 MB app. It's 2D, with very few images as resources.
The device may be partiallyu to blame, it's not a very performant one, some Evotab duo, nothing fancy.
But it's the inconsistency that kills me. Why dos it work sometimes and sometimes not?

Also, can I cover this with a loading screen before the Intro state somehow?
12-13-2014 02:45 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #4
RE: Android app loading very slow/hangs/crashes
Have you tried checking the android log in the editor? (alt + 3)
12-14-2014 09:30 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #5
RE: Android app loading very slow/hangs/crashes
Well, ever since I have esenthel, I never got it to PLAY on android. I always had to publish an apk and use that one instead, so I couldn't really make use of the log...
12-14-2014 10:31 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #6
RE: Android app loading very slow/hangs/crashes
What error does it give when you try to play? I've had a bunch too, but managed to fix them.
12-14-2014 11:56 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #7
RE: Android app loading very slow/hangs/crashes
I don't get anything. I had crashes before, and I could find an EsenthelError.txt file (or something similar), but now there's nothing. I guess it's not really a crash, what I get is "app has stopped responding" message. This is always before getting to the intro screen, if I do make it to the intro, everything runs just fine from that point on.
12-15-2014 12:00 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #8
RE: Android app loading very slow/hangs/crashes
No, I mean, when you just press "play" in the editor, and it automatically pushes the .apk onto your phone. Does that process work? If not what is the error?

And if it does work, you can open up the android log inside of the editor and it shows you in real-time what is going on.

EDIT: Do you mean that Esenthel is crashing, or your app?
(This post was last modified: 12-15-2014 03:09 PM by Tottel.)
12-15-2014 03:09 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #9
RE: Android app loading very slow/hangs/crashes
I'll retry this when I get home and let you know what error I get when I press play.

I should correct myself, it's not a crash, it just stops responding, and I get the message "app has stopped responding", and I can either Wait or Close the app (if I chose wait, nothing happens).
12-15-2014 03:42 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #10
RE: Android app loading very slow/hangs/crashes
Right, so the error I get when hitting play from esenthel is simply "Device not found". Maybe it could be related to my device too, it's not a very popular one, but still, I'm not sure what I can do about it.
12-20-2014 08:26 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #11
RE: Android app loading very slow/hangs/crashes
I had the same issue. smile It should be resolvable pretty easily.

1. Make sure USB debugging is enabled on your phone. It's in the developer settings, which have to be activated, and this is different for many android versions. You can do a google-check on how to do this.

2. I think Mass Media Transfer has to be on as well, another transfer setting on your phone.

3. Did you install the google USB drivers? They are included with the Android SDK and need to be ticked on in the installer.

4. You can navigate to the android SDK folder with the adb executable in a command window, and run the "adb devices" command to see all connected Android devices. Esenthel will check this too, but only after compiling, so this is faster to check.

5. If no device shows up, it's most likely a USB driver issue. I had the exact same issue and managed to solve it by installing a universal USB driver, made by some saint. Here is the link: https://plus.google.com/1035839393203262...Q5iYJEaaEH

6. Now, run the adb devices command again to see if anything shows up. If it does show up, but doesn't work in Esenthel, try launching in admin mode.

Hope that helps!
12-20-2014 11:21 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #12
RE: Android app loading very slow/hangs/crashes
Sometimes with Galaxy Note 2 I started having problems, once a while "device not found" error would pop up, and I had to unplug the USB cable from the phone/computer, plug it again, sometimes it would help, sometimes not. I didn't have these problems a year ago. I think the error was related either to my cable being worn off, slight movement of the cable while being connected, or more probable due to an update in the Android OS, I think I've read somewhere about other people having such issue and that was related to some system update.

Since I've bought Note 4, I haven't had these issues.

About slow loading of an app, unfortunately some mobile devices are slow.
I'm testing on Asus Transformer Prime, Galaxy Note 2, Galaxy Note 4, and the apps start within 1-2 seconds.
12-21-2014 12:58 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #13
RE: Android app loading very slow/hangs/crashes
Thanks for the help. I believe the issue is indeed related to my phone, because I can use play with my girlfriend's phone just fine.

One last question, is there any way to cover those few seconds of black screen delay BEFORE the intro state with some loading screen, even just a picture maybe? Thanks.
12-21-2014 09:35 AM
Find all posts by this user Quote this message in a reply
Post Reply