【问题标题】:In-app update of android app from google drive or drpobox从 google drive 或 Dropbox 的 android 应用程序的应用程序内更新
【发布时间】:2020-01-15 17:04:12
【问题描述】:

我正在为我的朋友制作一个安卓应用程序。我不想把它上传到Play商店。有没有办法通过google drive或Dropbox等免费服务向用户提供应用内更新?

【问题讨论】:

  • 您可以使用 FirebaseStorage 存储更新的 APK,并在 FirebaseFirestore 中添加条目以跟踪更新,在应用启动时检查更新,如果更新可用下载并要求用户安装。
  • @RahulGaur 这很有趣。 Firebase免费帐户可以吗?这有什么好的教程吗?我是android开发的新手。

标签: android dropbox in-app-update


【解决方案1】:

Firebase 有免费配额,您可以查看here。

没有直接的下载安装教程,要结合流程。

在how to download files from cloud storage查看这个问题

要安装下载的使用这个并修改它

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);

这将要求用户安装应用程序

您需要管理一种与您的应用通信的方式,即它需要下载更新。

当您希望应用从存储中下载文件时,在 Firebase Firestore 中创建一个字段,例如 isUpdateAvailable,将其值更改为 true。

看看 here 从 Firestore 获取数据

希望对您有所帮助!

【讨论】:

  • 非常感谢您的回复。我会尽快检查的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-03-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-06-02
相关资源
最近更新 更多