Android Question App wont open from installer?

aidymp

Well-Known Member
Licensed User
Longtime User
Hi, So I made a new app, and compiled it, when you open the APK, to install it, it says "open" or "done" once the install is complete. If you press "done" and run the app everything is fine. however if you press "open" the app just opens a grey screen and hangs?? Closing it and opening it again and its fine.... but it looks quite unprofessional!

What could the problem be??

Thanks

Aidy
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User
Sorry, I know it was a little vague! LOL, basically I seem to have fixed it.

I use the rp.checkandrequest permissions. and for some reason the starter module where the globals are, had

Starter:
#StartAtBoot: True

I set it to False and it starts....

I will now check i can get the permissions!

Post the logs when the app starts and hang.

Probably your code. Hard to answer without seeing it
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You should NOT set StartAtBoot in the Starter Service! Check the starter service tutorial

Notes

  • The Starter service is identified by its name. You can add a new service named Starter to an existing project and it will be the program entry point.
  • This is an optional feature. You can remove the Starter service.
  • You can call StopService(Me) in Service_Start if you don't want the service to keep on running. However this means that the service will not be able to handle events (for example you will not be able to use the asynchronous SQL methods).
  • The starter service should be excluded from compiled libraries. Its #ExcludeFromLibrary attribute is set to True by default.
  • The starter service should never be explicitly started. This means that if you want to start a service at boot then add a different service.
Android 8+ considerations
  • Starting from Android 8, the OS kills services while the app is in the foreground.
  • If you are using B4A v8.30+ then the starter service will not be killed until the whole process is killed.
  • You will see a message such as this one, 60 seconds after the app has moved to the background:
    ** Service (starter) Destroy (ignored)**
  • The above message means that the actual service is destroyed but the starter service is still available.
  • Don't make the starter service a foreground service. It will not work once the backed service is destroyed.
  • If you want to do a background task then you should add another service.
  • Related tutorial: Automatic Foreground Mode
 
Upvote 0
Top