Android Question [Solved] Blank screen when starting any application created with B4A (Android 11)

vecino

Well-Known Member
Licensed User
Longtime User
Hi, on a new 10" tablet with Android 11 I am having that problem with any application created with B4A.
Even also the "B4A Bridge" app has that problem.
Even with an application that has only one button.
Usually the whole screen goes blank, and if I hit the "back key" it exits (sometimes) and if I try to enter again then sometimes it starts fine (sometimes).
I have downloaded, for testing purposes, from the google store several apps and they all work fine.
I'm lost!!! I don't get it, it's 6 tablets the same.
I have seen this thread which is similar to what is happening to me:
What could be going on?
 
Solution
I had the same problem some time ago.
As sugested here several times : remove the Starter module.
The problem is : with de...

teddybear

Well-Known Member
Licensed User
It seems to be working.
Did I dream it?
I'm going to do other tests, I can't believe it, it could have been a coincidence.
it is not a coincidence.
I have told you that in post #34 #46 #109, but you ignored them?
if you are using starter module in your app, never forget to migrate it
 
Last edited:
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
it is not a coincidence.
I have told you that in post #34 #46 #109, but you ignored them?
if you are using starter module in your app, never forget to migrate it
Sorry, with so many messages and testing at the same time... I missed your messages and others that I have just seen.

What do you mean by this sentence?
"if you are using starter module in your app, never forget to migrate it".
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Sorry, with so many messages and testing at the same time... I missed your messages and others that I have just seen.

What do you mean by this sentence?
"if you are using starter module in your app, never forget to migrate it".
Because you have to remove the starter module, if your app does something in starter module, you need to migrate it
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
I do use starter in my programs, how to migrate it?
By creating another "service" module that is not called starter?
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Good catch!
However the starter service shouldn't be removed in normal cases. The issue might be related to this tablet launcher which is doing something unexpected.
It is only a solution for the case.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Best solution is to switch to B4XPages. Most of the starter code can be moved to B4XMainPage.
But with this program that I started in 2012 and hundreds of companies have it, what can I do?

The company is at a standstill because the customer is waiting to sell.
I need a solution now, even if it is temporary.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Can this code be passed to a normal activity?
What is your solution?

Please, other than redoing the program with b4xpages, that is almost impossible right now.

starter:
#Region  Service Attributes
    #StartAtBoot: False
    #ExcludeFromLibrary: True
#End Region

Sub Process_Globals
    Public FProvider As FileProvider    ' class FileProvider. Para el email con permisos, android 6.0.1 y superior
    '
    Public rp As RuntimePermissions
    Public mGPS As GPS
    Public mLM As LocationManager
    Private bGpsStarted As Boolean   
    '
    Dim fLastLatitudGPS, fLastLongitudGPS, fLastAlturaGPS, fLastTimeGPS As Double ''', fLastSpeedGPS As Double
    Dim fLastLatitudTTM, fLastLongitudTTM, fLastAlturaTTM, fLastTimeTTM As Double ''', fLastSpeedTTM As Double
    '
End Sub

Sub Service_Create
    FProvider.Initialize ' lo del email, adjuntar fichero y ese rollo.
    '
    mGPS.Initialize("mGPS")                    ' ubicación mediante GPS
    mLM.Initialize("mLM")                        ' ubicación mediante triangulación torres telefonía móvil   
End Sub

Sub Service_Start (StartingIntent As Intent)

End Sub

Public Sub StartGps
    If Not(bGpsStarted) Then
        mGPS.Start(500, 0)        ' gps
        bGpsStarted = True
        '   
        Try
            mLM.requestMobileLocation    ' torres telefonía móvil
        Catch
            Log(LastException)
        End Try       
    End If   
End Sub

Public Sub StopGps
    If bGpsStarted Then
        mGPS.Stop
        bGpsStarted = False
        '       
        Try
            mLM.stopMobileListening   ' torres triangulación
        Catch
            Log(LastException)
        End Try       
    End If
End Sub

Sub mGPS_LocationChanged (Location1 As Location)
'''    CallSub2(Main, "LocationChanged", Location1)
'''    Dim const dFactorMS2KMH As Double = 3.6
    '
    fLastLatitudGPS     = Location1.Latitude
    fLastLongitudGPS    = Location1.Longitude
    fLastAlturaGPS      = Location1.Altitude  ' m
    fLastTimeGPS             = Location1.Time
'''    fLastSpeedGPS            = Location1.Speed * dFactorMS2KMH  '  pasar de m/s a km/h       
End Sub


Sub mLM_LocationChanged (Longitude As Double, Latitude As Double, Altitude As Double, Accuracy As Float, Bearing As Float, Provider As String, Speed As Float, Time As Long)
'''    Dim const dFactorMS2KMH As Double = 3.6
    '
    fLastLatitudTTM      = Latitude
    fLastLongitudTTM    = Longitude
    fLastAlturaTTM       = Altitude
    fLastTimeTTM             = Time
'''    fLastSpeedTTM            = Speed * dFactorMS2KMH
End Sub

'''Sub GPS_GpsStatus (Satellites As List)
'''    CallSub2(Main, "GpsStatus", Satellites)
'''End Sub

Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub

Sub Service_Destroy
    StopGps
End Sub
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
And now that I think about it, with B4Xpages there is the same problem because it also has its "starter" module.
In the example you have indicated me to test "splash" has worked when I have removed "starter", before I had the same problem as the applications with normal "activity".
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
And now that I think about it, with B4Xpages there is the same problem because it also has its "starter" module.
But even there you can remove the starter service. In a B4XPage project, the library does the work of managing the activity lifecycle for you.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Other doubts:
"B4A Bridge is made with normal activity, so it has the same problem.

Are you going to create a new "B4A Bridge" that does not use starter?

What should be taken into account when buying devices to be sure that applications created with B4A will work?

How to replace starter and any other service modules?

There are a lot of questions.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Good catch!
However the starter service shouldn't be removed in normal cases. The issue might be related to this tablet launcher which is doing something unexpected.
I installed "Nova launcher" and it doesn't work either.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…