Hi App Inventors!
I've found a cool method to let the user update the app when a new version is available. This doesn’t require any extensions. Follow this post until the end to understand it completely!
Note: You can use any CloudDB as long as it is similar to what is mentioned here!
Setting up and coding
1. Setting up Firebase
Create a project in Firebase and as usual, set it's permissions to read true
and write true
. Then create a project bucket with a key label like 'updates' and set it's value to the current version name of the app.
2. Develop the app
Remeber to connect your application to Firebase before building. Once you finish developing the app, compare the version name to the one in Firebase. If this is the first time the app is being used, let the version name be equal to the one in Firebase. Else, set it to a higher value than the version name in Firebase.
3. Google Drive file
Next build the app and upload the APK file in Google Drive. Remeber to leave the project open! Set the permissions for the APK in G Drive for Anyone with the link can view
. Then copy the link.


4. Code the update section!
Go back to Ai2 and start coding the following. Note: You can use any method, like When Screen Initialize
, but this is an example. I'm also using @Taifun's Tools extension
Paste the Google Drive link copied earlier where in the Data URI
for Activity Starter. Re-upload the file in Google Drive and share it. Now when the link loads, follow the installing process!
5. Points to remeber!
- Always when you finish developing a new version of the app, remeber to increase the version name in the app and in Firebase.
- When you build the app, make sure you upload the APK file in Google Drive under the same name and replace the existing file. The link to the file will never change, so the user will always open the version of the file which exists in Google Drive.
- Remeber, the app doesn't actually know if there is an update or what is updated. It relies on the version codes from firebase and the app. So it will merily just say that there is an update and download the file in Google Drive and install it.
Thanks
- To @Taifun for thier Tools extension
- To @TIMAI2 for their help in connecting Firebase with App Inventor.
Poll
Rate this tutorial!
-
Excelent
-
Good
-
Ok
-
Poor
-
Hopeless
0 voters
If you liked it, please drop a . Also reply to the post if you have further clarifications or you detect any bugs or problems with this tutorial.
Best regards,
@RR_Media