免费和付费版本 Android 应用程序的最佳方法?

发布于 2024-12-23 22:56:51 字数 411 浏览 3 评论 0原文

我开发了一个 Android 应用程序,我希望它可以作为免费版本和付费版本提供。最好的方法是什么?

我可以想到三种解决方案:

  1. 将项目拆分为两个分支并维护它们。
  2. 创建一个库项目并拥有两个附加项目,一个“免费”版本和一个“付费”版本。
  3. 使用应用内结算。

问:哪种解决方案最好?为什么?

需要考虑的一些事项:

  • 我的应用大约 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:

  1. Split the project into two branches and maintain both of them.
  2. Create a library project and have two additional projects, one 'Free' and one 'Paid' version.
  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

朦胧时间 2024-12-30 22:56:51

我很难真正实现这一点,但还是想通了。我认为最好的方法是使用 Android 库功能,并通过每个项目中的应用程序名称字符串值进行区分,简单的paid=true 字符串值(如果您想要更复杂的解决方案,则可以使用密钥文件)。

确切的步骤:

使用它来获取代码的“通用”副本,然后引用它的多个 Android 项目`

目的:

免费& Google 市场上的付费版本

结果:

1 个包含所有代码的 Android 项目(库),以及 2 个引用代码但没有实际类的附加 Android 项目。 strings.xml 区分应用程序名称(付费和免费或其他)`

创建库

  • 创建新项目和应用程序名称在创建步骤中,选择选项使库
  • 转换为现有库:右键单击项目 -> 属性 -> Android -> 库旁边的复选框。
    • 可能也想重构/重命名,但不需要

创建新项目以利用库

  • 创建新的 Android 应用程序项目
  • 打开此项目的属性 ->Android -> 将现有库添加到项目
  • 附加库(如果存在):不将这些(jar)文件复制到新项目中!
    • 新项目的属性 -> 构建路径 -> 配置构建路径 -> 库选项卡 -> 添加 Jars -> 展开要链接到的库 -> 库 -> 选择库(即 libGoogleAnalytic) )->确定->订单&导出选项卡->检查新库->确定
  • 新项目清单:需要重新调出库中的所有信息,特别是活动,附加库中的 FQDN
    • ie: android:name="com.blah.appname.library.MainActivity"(基本上将库清单中的所有内容复制/粘贴到新项目清单,并将包名称调整为引用库)
  • 确保没有新项目 lib 文件夹与库项目中是否存在重复的库!如果是这样,请从新项目中删除并删除调整上述每个步骤的构建路径
  • 不需要任何类/java 文件!
  • 仅当您希望替换资源时才替换资源删除
  • res\drawable\ 中新项目中的所有文件,以便我们利用库中的文件

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 & during steps to create select option to make library
  • Convert existing: right click project->Properties->Android->Check box next to library.
    • Might want to refactor/rename as well, but not needed

Create new project to utilize library

  • Create new Android Application Project
  • Open properties for this project->Android->Add existing library to project
  • Additional Libraries if exist: Dont copy these (jar) files into new project!
    • Properties of new project->Build Path->Configure Build Path->Libraries Tab->Add Jars->Expand Library you're linking to->libs->Select libary (ie libGoogleAnalytic)->OK->Order & Exports tab->Check new library->ok
  • Manifest of new project: Need to RE call out ALL info from library, especially activities, appending FQDN from library
    • ie: android:name="com.blah.appname.library.MainActivity" (basically copy/paste everything from library manifest to new project manifest & adjust package name to reference library instead)
  • Make sure there aren't any duplicate libraries in new project lib folder vs library project! If so, delete from new project & adjust build path per step above
  • Do not need ANY classes/java files!
  • Replace resources only if you want them replaced
  • Delete all files in new Project in res\drawable\ so we utilize the ones from the library
征﹌骨岁月お 2024-12-30 22:56:51

我不太喜欢在应用程序中使用广告,因为除非您的市场份额已经相当大,否则与您惹恼用户的金额相比,您获得的资金将微乎其微。

我更喜欢这样的模型:编写具有所有核心功能的基本应用程序,然后向付费应用程序添加额外的功能并为此收费(当然使用 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)

北方。的韩爷 2024-12-30 22:56:51

第三种方法,应用内计费,提供了最大的灵活性,但它非常复杂(因此容易出错)。

第二种方法,共享库项目看起来是最好的折衷方案。

如果您可以免费和付费版本使用相同的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文