Android Question How can i tell the user that is using an older version of the app

Makumbi

Well-Known Member
Licensed User
Good morning members i normally makes changes in my app and i find that those changes have not be effected on other phones users how can i programmatically tell the user about the version they are using and the one updated thanks
 

DonManfred

Expert
Licensed User
Longtime User
Google has changed the layout a few times in the past.

I suggest to get rid of the problem by yourself.

When uploading a app to the playstore you can upload a small textfile with all relevant info to your webserver too.

Download the textfile using okhttputils when the app starts and compare if the app is uptodate or not.
 
Upvote 0

Makumbi

Well-Known Member
Licensed User

Do you have any example on this platform. Do you mean something like this
B4X:
Sub GetLine(idx As Int) As String
    Dim text As List = File.ReadList(File.DirAssets,"VersionNumber.txt")
    If text.IsInitialized And text.Size>=idx-1 Then
        Return text.Get(idx-1)
    End If
    Return ""
End Sub

B4X:
    version = Application.VersionCode
'Log(GetLine(1))
If GetLine(1)=version Then
    Else
MsgboxAsync("You are Currently using An Old version of the App please Unstall and install the Latest Version Thanks","App Old Version")
        
            
End If
Please Don i have come up with something like this please guide me is it the right thing to do. 2. Does that mean that every time iam uploading a new app on the play store i have to update my version number Text file so that they match. 3. is there a code that i call use to automatically write the currently version number in the text file when iam releasing the version for use. because there is a possiblility of forgettting to update the version number text file thanks
 
Last edited:
Upvote 0

Makumbi

Well-Known Member
Licensed User
B4X:
log(Application.Version Code)
is this one ok because from your explanation this is what i have managed to come up with

B4X:
Sub GetLine(idx As Int) As String
    Dim text As List = File.ReadList(File.DirAssets,"VersionNumber.txt")
    If text.IsInitialized And text.Size>=idx-1 Then
        Return text.Get(idx-1)
    End If
    Return ""
End Sub
dim version as String
    version = Application.VersionCode
'Log(GetLine(1))
If GetLine(1)=version Then
    Else
MsgboxAsync("You are Currently using An Old version of the App please Unstall and install the Latest Version Thanks","App Old Version")
        
            
End If
 
Upvote 0

Makumbi

Well-Known Member
Licensed User


Since you have said that google changes their layout can i do something like this ony my server. so that every time upload a new version i update my server to the latest version number

B4X:
Sub LoadCheckVersion (d As String) As ResumableSub
    Log(d)
   
    Dim jt As HttpJob
    jt.Initialize("", Me)
    jt.Download("http://kccug.com/KabojjaApp/HandlerVBCheckVersion.ashx")
    'jt.GetRequest.Timeout = 3000' 10 seconds
    Wait For (jt) JobDone(jt As HttpJob)
    If jt.Success Then ' if job is success (http status code 200)
        Dim RetVal As String
        RetVal = jt.GetString
        Log(RetVal)
        If jt.GetString = "[]" Then
            'MsgboxAsync("No Records to Upload Yet for: " & CustID ,"SMIS")
            Return "Empty"
        Else
            Dim jp As JSONParser
            jp.Initialize(jt.GetString)
            'Log(jp) ' will pr
            Log($"Token(${jp})"$)
            Dim quotdt As List = jp.NextArray
            For Each quotd As Map In quotdt
                Log("CurrentVersion: " & quotd.Get("CurrentVersion"))
                Log("ReleaseDate: " & quotd.Get("ReleaseDate"))
                       
           
            Next
       

            Return "Good"
            jt.Release
        End If
    End If
End Sub
 
Last edited:
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi Syd,
I just check Play market page for my app and for some reason current version is missing https://play.google.com/store/apps/details?id=alex.HCMS.EVV -am I missing something?
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
That's what I have

 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Thanks, version name was empty.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…