很容易使我的Andr​​oid应用程序的副本 [英] Easily make a copy of my android application

查看:137
本文介绍了很容易使我的Andr​​oid应用程序的副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户端一个Android应用程序,他希望做一个99%的类似的应用程序为不同的国家。

I have an android application for one client, and he wants to make a 99% similar app for different country.

几乎所有的东西是一样的,只有少数的位图就需要更换,API服务器的地址将发生变化,语言的文件会改变,但code应该保持不变, BUT 我需要一个不同的包名。

Almost everything is the same, only a few bitmaps would need to be replaced, address of API server will change, language file will change, but the code should stay the same, BUT I will need a different package name.

什么是一个简单的方法,以使应用程序,让我做code变为一个版本,新的版本(或版本),将它们合并,但保留包名的克隆?

What is a simple way to make a clone of the app that will allow me to make code changes to one version, merge them with the new version (or versions), but keep the package name?

或者我应该有一个项目文件夹中的一切,然后编写和运行一些脚本,将改变包名和交换内容文件?我的朋友的iOS可能会需要几个不同的#define,但我应该怎么办在这里,这样我就可以在将来维护两个版本?

Or should I have everything in one project folder and then write and run some script that will change package names and swap content files? My iOS friend will probably need a few different #defines, but what should I do here, so I can maintain both versions in the future?

推荐答案

申报原始项目,图书馆,然后创建各2个新项目,一种语言,让他们包括原项目作为库

declare your original project as library, then create 2 new projects each for one language and let them include original project as library

然后就可以继续前进,只是重写你需要的位图和常量。

then you can go ahead and just override bitmaps and constants you need.

这样,如果你需要在核心功能的任何变化,你只需要改变你的库项目,并更改将传播到两个扩展项目

this way, if you need any changes in core functionality, you just change your library project, and changes will propagate to both of extending projects

了解更多关于库项目位置:

read more about library projects here:

https://developer.android.com/tool​​s/projects/index。 HTML#LibraryProjects

这篇关于很容易使我的Andr​​oid应用程序的副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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