如何保持第二版Android应用程序在同一设备 [英] How to keep two version of an android application in the same device

查看:138
本文介绍了如何保持第二版Android应用程序在同一设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试安装第二版,它说,它会从previous版本替换所有数据。我做了以下事情,以避免这样的情况:

Whenever I try to install the 2nd version, it says that it is going to replace all data from the previous version. I did the following things to avoid such situations:


  1. 应用程序名称是不同的,所以.apk文件名也不同

  2. 包名不同

我的应用程序有一个数据库。我需要为这两个版本有不同的数据库名?

My app has a database. Do I need to have different database name for these two version ?

所以,我想知道,我在做什么错的,什么应该做更多?我使用的Eclipse模拟器的时刻。

So, I would like to know, what I am doing wrong and what more should be done? I am using eclipse simulator at the moment.

推荐答案

您必须有一个不同的包名,没有其他办法。
我有2个不同版本的同一产品(不含放大器;支付)的并用:com.package.paid&放大器; com.package.free。

You must have a different package name, there is no other way. I had 2 different versions of the same product (free & paid) and used: com.package.paid & com.package.free.

这意味着,没有什么是2个应用程序之间共享(DB含税)。

This means that nothing is shared between the 2 apps (DB included).

您也可以使用ANT脚本来建立来自同一个code基这两个应用,我只是手动我需要建立一个版本的每一次改变了它。

You can also use ANT scripts to build both apps from the same code base, I just changed it manually every time I needed to build a version.

这篇关于如何保持第二版Android应用程序在同一设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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