免费和付费版本 Android 应用程序的最佳方法?
我开发了一个 Android 应用程序,我希望它可以作为免费版本和付费版本提供。最好的方法是什么?
我可以想到三种解决方案:
- 将项目拆分为两个分支并维护它们。
- 创建一个库项目并拥有两个附加项目,一个“免费”版本和一个“付费”版本。
- 使用应用内结算。
问:哪种解决方案最好?为什么?
需要考虑的一些事项:
- 我的应用大约 1.5 MB(AdMob 除外)。
- 我目前的目标是 Android 2.2 (Froyo)。
- 我确实有一些服务器 API,它们可以通过了解客户端是否付费而受益。
- 我试图避免我的应用程序被破解。不确定这是否是一个真正的问题......
I have developed an Android app which I want to be available both as free and paid version. What is the best approach?
I can think of three solutions:
- Split the project into two branches and maintain both of them.
- Create a library project and have two additional projects, one 'Free' and one 'Paid' version.
- Use in-app billing.
Q: Which solution is the best? And why?
Some things to consider:
- My app is around 1.5 MB (AdMob excluded).
- I'm currently targeting Android 2.2 (Froyo).
- I do have some server APIs that would benefit from knowing if the client is paid or not.
- I seek to avoid my app being cracked. Not sure if this is a real problem these days...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我很难真正实现这一点,但还是想通了。我认为最好的方法是使用 Android 库功能,并通过每个项目中的应用程序名称字符串值进行区分,简单的paid=true 字符串值(如果您想要更复杂的解决方案,则可以使用密钥文件)。
确切的步骤:
库
使用它来获取代码的“通用”副本,然后引用它的多个 Android 项目`
目的:
免费& Google 市场上的付费版本
结果:
1 个包含所有代码的 Android 项目(库),以及 2 个引用代码但没有实际类的附加 Android 项目。 strings.xml 区分应用程序名称(付费和免费或其他)`
创建库
创建新项目以利用库
I struggled to actually implement this, but figured it out. I feel the best approach is to use the Android Library feature, and differentiate with an app name string value in each project simple paid=true string value (or key file if you want a more complex solution).
Exact steps:
Library
Use this to get a 'common' copy of code, then multiple android projects that reference it`
Purpose:
Free & Paid version on Google Market
Results:
One Android Project (library) with ALL code, with 2 additional Android Project that reference code, but no actual classes. strings.xml differentiates App names (Paid & Free or whatever)`
Create Library
Create new project to utilize library
我不太喜欢在应用程序中使用广告,因为除非您的市场份额已经相当大,否则与您惹恼用户的金额相比,您获得的资金将微乎其微。
我更喜欢这样的模型:编写具有所有核心功能的基本应用程序,然后向付费应用程序添加额外的功能并为此收费(当然使用 Android 库项目来共享大部分代码)。这样,使用您的应用程序并喜欢它的人就可以通过付费来支持您,然后获得一些额外功能的奖励。
(免责声明:这篇文章是基于我自己的经验和我听到的轶事证据的个人意见)
I'm not a big fan of using ads in apps since unless your market share is already quite big, the money you get is gonna be tiny compared to the amount you will annoy your users.
I prefer a model of writing a basic app with all the core features, then adding extra functionality to a paid app and charging for that (of course using an android library project for sharing the bulk of the code). That way people who use your app and like it can support you by paying for it and then get a bonus of some extra features.
(disclaimer: this post is personal opinion based on my own experience and anecdotal evidence I've heard)
第三种方法,应用内计费,提供了最大的灵活性,但它非常复杂(因此容易出错)。
第二种方法,共享库项目看起来是最好的折衷方案。
如果您可以免费和付费版本使用相同的 APK,这可能是两全其美的。
Your 3rd approach, In-app billing, provides the most flexibility, but it's horribly complex (and thus error prone).
Your 2nd approach, a shared library project looks like the best compromise.
If you can use the same APK for both free and paid versions this can possibly be the best of both worlds.