Android的应用程序付费/免费版本之间的复制/股的配置? [英] Copy/share configurations between paid/free versions of Android app?

查看:128
本文介绍了Android的应用程序付费/免费版本之间的复制/股的配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Andr​​oid应用程序发行有免费和付费版本。我创建了一个库项目和另外两个应用项目,一个自由和一个付费版本(当然使用相同的密钥签署)。需要注意的是,这些应用项目是pretty的很多空的,没有设置等。因此,该库中包含99%的code。

我的应用程序同时创建一个的SQLite 数据库和共享preferences 用户数据文件。是否可以复制免费和付费版本之间的这些文件? (在preferences比数据库更重要。)

例如。

  1. 用户运行的免费版本。数据库和配置文件创建的。
  2. 在用户安装付费版本,并运行它。
  3. 在付费版本检查任何免费版本的数据,并将其复制。 这就是我想要的!
解决方案
  1. 实施ContentProvider的存储的数据暴露在你的免费版本。
  2. 确保供应商出口(机器人:出口=真)
  3. 在声明权限的客户端应用程序。保护等级应该是签名。
  4. 需要在(3)作为readPermission的人员。
  5. 中声明的权限
  6. 在付费应用程序,为您的免费应用程序中声明的权限添加使用 - 许可。
  7. 检查供应商和放大器的presence;将数据加载到你的付费应用程序。

这,当然,前提是你签单的免费和付费的应用程序具有相同的证书(其中大多数有理智的人做)的作品。

My Android app comes both as a free and paid version. I have created a library project and two additional Application projects, one 'Free' and one 'Paid' version (signed with the same key, of course). Note that these Application projects are pretty much empty, no settings etc. Hence, the library contains 99% of the code.

My app creates both an SQLite database and a SharedPreferences file with user data. Is it possible to copy these files between the free and paid versions? (The preferences are more important than the database.)

E.g.

  1. User runs the free version. A database and configuration file are created.
  2. User installs the paid version and runs it.
  3. The paid version checks for any free version data and copies it. This is what I want!

解决方案

  1. Implement a ContentProvider to expose the stored data in your free version.
  2. Ensure the provider is exported (android:exported="true")
  3. Declare a permission in your client application. The protection level should be "signature".
  4. Require the permission declared in (3) as a readPermission for the provider.
  5. In your paid app, add a uses-permission for the permission declared in your free app.
  6. Check for the presence of the provider & load the data into your paid app.

This, of course, only works if you are signing the free and paid apps with the same cert (which most sane people do).

这篇关于Android的应用程序付费/免费版本之间的复制/股的配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆