Android Question App generated refuse to work

Juanet

Member
Licensed User
Longtime User
Hello, im make a simple app with one WebView and two buttons, running the app with B4Bridge it's ok, after thats generate in release (obfuscated) the APK (signed) and copy to my server the APK generated in the folders "Objects", then download and install in my phone, but App refuse to work, obiously that i'm testing before send to AppStore, the next are the entire code (not real URL's), what am I making a mistake or what am I missing?, thanks so much!

B4X:
#Region  Project Attributes 
    #ApplicationLabel: Radio Test
    #VersionCode: 1
    #VersionName: 1.0.0
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: True
#End Region

#Region  Activity Attributes 
    #FullScreen: True
    #IncludeTitle: False
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim mp As MediaPlayerStream
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim WebView1 As WebView
    Private btn1 As Button
    Private btn2 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("MainLayout")
    If FirstTime Then

        Dim o As Reflector
        o.Target = WebView1
        o.RunMethod2("clearCache","True","java.lang.boolean")
        
        WebView1.LoadURL("https://example.com/")
        mp.Initialize("mp")

    End If

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

Sub mp_StreamReady
    'Log("starts playing")
    mp.Play
End Sub

Sub mp_StreamError (ErrorCode As String, ExtraData As Int)
    'Log("Error: " & ErrorCode & ", " & ExtraData)
    'ToastMessageShow("Error: " & ErrorCode & ", " & ExtraData, True)
End Sub

Sub mp_StreamBuffer(Percentage As Int)
    'Log(Percentage)
End Sub

Private Sub btn1_Click
    mp.Load("https://stream.example.com/test")
    WebView1.LoadURL("https://example.com/test")
End Sub

Private Sub btn2_Click
    mp.Load("https://stream.example.com/test2")
    WebView1.LoadURL("https://example.com/test2")
End Sub
 

Juanet

Member
Licensed User
Longtime User
Ok, I finally detected the bug, I was using a 2013 project version (when I bought a license) 🤦‍♂️, created a new one using B4XPages and everything works perfectly, thanks anyway for all the help :)
 
Upvote 0
Top