Android Question [B4A][AppUpdating 2.02] Invalid double... [SOLVED]


Well-Known Member
Licensed User
Hi there...

I was testing appupdating library of user udg

but seems something not going well may be with my .inf file... that have inside only that:
the error that i get is:
** Activity (main) Pause, UserClosed = false **
** Activity (check) Create, isFirst = true **
** Activity (check) Resume **
---- AppUpdating.ReadCurVN
Current Version: 1.78
UpdateComplete - time: 13:52:11
---- AppUpdating.ReadWebVN
java.lang.RuntimeException: java.lang.NumberFormatException: Invalid double: ""
at anywheresoftware.b4a.keywords.Common$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(
Caused by: java.lang.NumberFormatException: Invalid double: ""
at java.lang.StringToReal.invalidReal(
at java.lang.StringToReal.parseDouble(
at java.lang.Double.parseDouble(
at mvt.client.check$ResumableSub_Activity_Create.resume(
at anywheresoftware.b4a.keywords.Common$
... 8 more
Logger connected to: LENOVO Lenovo A2010-a
The code related:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Public rp As RuntimePermissions
   Public SharedFolder As String
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 apkupdt As cl_appupdate
    Private phone As Phone
    end sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   SharedFolder = rp.GetSafeDirDefaultExternal("")
   DateTime.TimeFormat = "HH:mm:ss"
   DateTime.DateFormat = "yyyy-MM-dd"
   ver.text="Εκδοση: " & Application.VersionName

    If FirstTime=True Then
       apkupdt.Verbose = True  'this one affects the verbosity of the logs
       'ALWAYS NEEDED - this is your app's package name (see "Project/Package name")
       apkupdt.PackageName = "my.myappy"
       'ALWAYS NEEDED - this is the complete path to the text file holding the newer version number
       apkupdt.NewVerTxt = "http://" & myserver r & "/my.inf"
       'ALWAYS NEEDED - this is the complete path to your newer apk
       apkupdt.NewVerApk = "http://" & myserver & "/my.apk"
       apkupdt.ReadCurVN 'no diff if i removed it
       apkupdt.ReadWebVN 'no diff if i removed it 
       If apkupdt.CurVN < apkupdt.WebVN Then 'no diff if i removed it
           ToastMessageShow("Υπάρχει νέα έκδοση MVT - συγκεκριμένα: " & apkupdt.WebVN & " -  παρακαλώ ανβαθμίστε...",True)  'no diff if i removed it
       End If 'no diff if i removed it
     end if
end sub

Sub Button3_Click
   'OPTIONAL - if you like to show a splash screen while checking for a newer apk goes on
   Wait For (CheckInstallationRequirements) Complete (Result As Boolean)
   'OPTIONAL - if you like to show a splash screen while checking for a newer apk goes on
   apkupdt.SetAndStartSplashScreen(Activity,LoadBitmap(File.DirAssets, "updating.jpg"))
   'NEEDED - this is the one you need if you want to perform "automatic" updating of your apk
   apkupdt.UpdateApk(Result) 'checks for newer apk, downloads it and asks the user to install it

End Sub

Sub update_UpdateComplete

   Log($"UpdateComplete - time: ${DateTime.Time(DateTime.Now)}"$)
   'too lazy to manage error conditions..check apkupdt.ERR_xxx codes if you like
   Select apkupdt.Status
       Case apkupdt.OK_CURVER
           ToastMessageShow("Έκδοση που έχετε:" & apkupdt.CurVN,True)
       Case apkupdt.OK_WEBVER
           ToastMessageShow("Έκδοση στον Server:" & apkupdt.WebVN,True)
       Case apkupdt.OK_NEWERAPK
           ToastMessageShow("Υπάρχει νέοτερη έκδοση !!!",True)
       Case apkupdt.NO_NEWERAPK
           ToastMessageShow("Δεν υπάρχει νεότερη έκδοση ! - Έχετε την τελευταία.",True)
       Case apkupdt.OK_DOWNLOAD
           ToastMessageShow("Η νεότερη έκδοση κατέβηκε !",True)
       Case apkupdt.OK_INSTALL
           ToastMessageShow("Εγκατάσταση νέας εφαρμογής...",True)
       Case apkupdt.ERR_NOPERM
           ToastMessageShow("Δεν έχουν δοθεί δικαιώματα...",True)
       Case Else
   End Select
End Sub

#Region version-safe-apk-installation

'Check whether we already have permission for install other apps.
'If not we open the relevant settings page
'then wait for Activity_Resume and check the value of CanRequestPackageInstalls again
Private Sub CheckInstallationRequirements As ResumableSub
   If File.ExternalWritable = False Then
       MsgboxAsync("Αποθηκευτικός χώρος μη διαθέσιμος! Επιβεβαιώστε ότι η συσκευή σας δεν είναι συνδεδμένη με USB/PC και ότι έχετε δώσει πλήρη δικαιώματα στην εφαρμογή!", "")
       Return False
   Else If phone.SdkVersion >= 26 And apkupdt.CanRequestPackageInstalls = False Then
       MsgboxAsync("Παρακαλώ δώστε άδεια για εγκατάσταση εφαρμογών!", "")
       Wait For Msgbox_Result(Result As Int)
       Dim in As Intent
       in.Initialize("android.settings.MANAGE_UNKNOWN_APP_SOURCES", "package:" & Application.PackageName)
       Wait For Activity_Resume '<-- wait for Activity_Resume
       Return apkupdt.CanRequestPackageInstalls
   Else If apkupdt.CheckNonMarketAppsEnabled = False Then
       MsgboxAsync("Παρακαλώ ενεργοποιήστε την εγκατάσταση από Άγνωστες Πηγές!" & CRLF & "Ρυθμίσεις - Ασφάλεια - Άγνωστες Πηγές" _
            & CRLF & "ή Ρυθμίσεις - Εφαρμογές -  Άγνωστες Πηγές", "")
       Return False
       Return True
   End If
End Sub
#End Region