Android Question Black screen at the beginning

Discussion in 'Android Questions' started by Pablo Torres, Jul 12, 2018.

  1. Pablo Torres

    Pablo Torres Active Member Licensed User

    Hi, in my android app there is a black screen at the beginning I cannot take away
    It takes 8 seconds to go away
    It is really annoying, I would like to show an image instead of that, I have no idea how to do it

    Can anyone help me please?
  2. DonManfred

    DonManfred Expert Licensed User

    Hard to say anything about it as you are missing to post your code.

    I guess you are doing something which causes the 8 Seconds delay...
  3. Erel

    Erel Administrator Staff Member Licensed User

    There shouldn't be any reason for your app to start so slow. You are doing too many things in Activity_Create. Load the layout and add Sleep(100) to allow it to show before you do anything else.

    If the layout file is large then split it.
  4. Star-Dust

    Star-Dust Expert Licensed User

    Have you completed in release mode?
    Or did you send in debug mode and wait for a connection to the computer?
    Erel likes this.
  5. Pablo Torres

    Pablo Torres Active Member Licensed User

    The main module has this code in Activity_Create

    ProgressDialogShow("INICIANDO APLICACIÓN")
    If FirstTime Then
    End If
    If Mapa.IsGooglePlayServicesAvailable = False Then
    ToastMessageShow("Instale Google Play Services."True)
    End If
        sepVideo.Player = player1
    If File.Exists(File.DirDefaultExternal,"IdCliente_Altius.txt"Then
    End If
    I also have a Starter module (I think this is the problem) with the following code:

    #Region  Service Attributes
    #StartAtBoot: False
    #ExcludeFromLibrary: true
    #End Region

    Sub Process_Globals
    Public auth As FirebaseAuth
    Public facebook As FacebookSdk
    End Sub

    Sub Service_Create
    Log("AUTH CREATE")
    End Sub

    Sub Service_Start (StartingIntent As Intent)
    Log("AUTH START")
    End Sub

    'Return true to allow the OS default exceptions handler to handle the uncaught exception.
    Sub Application_Error (Error As Exception, StackTrace As StringAs Boolean
    Return True
    End Sub

    Sub Service_Destroy
    End Sub
    I dont know how to solve it, by watching the log I can see Starter module starts inmediately and it takes a lot of time before starting to load Altius.bal
    How can I improve it?
  6. Erel

    Erel Administrator Staff Member Licensed User

  7. Pablo Torres

    Pablo Torres Active Member Licensed User

    I did everything you said... still same result
  8. Erel

    Erel Administrator Staff Member Licensed User

    Have you changed the theme colors? It will not be black.

    About the startup time, try to reproduce it in a smaller project and upload it.
  9. MarkusR

    MarkusR Well-Known Member Licensed User

    i would make a time measurement class, a simple stop watch where you call start and at stop output the time in ms into Log(..)
    so you can measure a sub from start to end or parts.
    if you found the biggest delays you can change your app flow or logic.
  10. Pablo Torres

    Pablo Torres Active Member Licensed User

    I solved
    I created another activity, loaded that activity (only an image) with a timer for 1 second and then loaded the other activity.
    It still takes about 10 second to really start but, all that time remains showing the first activity image and a progressdialog that says "starting activity", so the user dont get the impression the app is freeze.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice