I am making an android app only for my friends. I don't want to upload it in play store. Is there any way to provide in-app update to the users with free services like google drive or Dropbox?
Asked
Active
Viewed 190 times
-3
-
You can use FirebaseStorage to store updated APK, and add entries in FirebaseFirestore to keep update track, check for update on App start, if update available download and ask user to install it. – Rahul Gaur Jan 16 '20 at 10:26
-
@RahulGaur It's interesting. Is it possible with Firebase free account? Is there any good tutorial on this? I am very new in android development. – JOYSON JOHN Jan 16 '20 at 11:54
1 Answers
0
Firebase have free quota which you can check here.
There are no direct tutorials for downloading and installing, you have to combine processes.
Have a look at this question on how to download files from cloud storage
to install downloaded use this and also modify it
Uri fileUri = Uri.fromFile(file); // here file is what you downloaded from storage
if (Build.VERSION.SDK_INT >= 24) {
fileUri = FileProvider.getUriForFile(context, context.getPackageName(),
file);
}
Intent intent = new Intent(Intent.ACTION_VIEW, fileUri);
intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true);
intent.setDataAndType(fileUri, "application/vnd.android" + ".package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(intent);
This will ask user to install the App
You need to manage a way to communicate to your App, that it needs to download update.
Create a field in Firebase Firestore like isUpdateAvailable
change it's value to true when you want the app do download file from storage.
Have a look here for getting data from Firestore
Hope this help!

Rahul Gaur
- 1,661
- 1
- 13
- 29