![]() Then, using any FTP client, copy both your newer apk's version and its corresponding text file in the folder set before.Īn important note about versions compare. Prepare an info text file named after your apk (in the example above, you may find AppUpdateExample2.apk and AppUpdateExample2.inf) having at least one single line of text as follows: ver=x.yz On a webserver (even any free shared service would be ok), create a folder (in the example below, I created folder free_apk on webserver and eventually restrict access to it (I used the. & CRLF & "Or Settings - Applications - Unknown sources", "")ĪppUpdating 2.0 - how to use it Setting the webserver MsgboxAsync("Please enable installation of non-market applications." & CRLF & "Under Settings - Security - Unknown sources" _ Wait For Activity_Resume '<- wait for Activity_ResumeĮlse If apkupdt.CheckNonMarketAppsEnabled = False Then In.Initialize("_UNKNOWN_APP_SOURCES", "package:" & Application.PackageName) MsgboxAsync("Please allow me to install applications.", "") Make sure that your device is not connected in USB storage mode.", "")Įlse If phone.SdkVersion >= 26 And apkupdt.CanRequestPackageInstalls = False Then Private Sub CheckInstallationRequirements As ResumableSub 'then wait for Activity_Resume and check the value of CanRequestPackageInstalls again ![]() 'If not we open the relevant settings page 'Check whether we already have permission for install other apps. In this latter case, the same service will reload the app when ready.įiles attacched: AppUpdating.b4xlib - version 2.05 packed following the new b4xlib standardĪU200_demo - example program using the libĪU200_lib - lib file compiled with B4A 8.30Ģ.05 - made it compatible with simultaneous use of NB6Ģ.00 - initial release of AppUpdating 2.0 ![]() Since we can't know if the user agrees to update the app, we simply go on with our app, knowing that a service burned in the lib will fire when the OS will signal that the user accepted to install the newly downloaded copy of the app. If it finds indication of a newer version, it downloads it, then it asks the user to install it. What the lib does is simply to check whether the version number reported by reading an info text file on your webserver is greater than the one showed in the running copy of your app. Edit: see post#43 below for installing instructions related to version 2.05 and higher. On next two posts I'll describe the steps needed to make the lib work with your code. And, finally, a bit of clean up is always due. But it was time to leverage B4x's new features too. Why AU 2.0? Main reason is Google's introduction of Android 8 and the profound changes on a few key points coming with it. AppUpdating 2.0 is a partial rewrite of AppUpdating, a lib written back in 2014 to allow the remote update of non-market applications hosted on a webserver. Time goes by, things change and old tools need to be updated.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |