In-App simple tutorial [closed]

故事扮演 提交于 2019-12-12 07:59:50

问题


I want to use Google In-App billing for my Android Apps using Libgdx. By default, it is a free apps for everyone. Some of the features will be unlocked once user paid a small fee (lets assume $1), and all features will be unlocked if user paid the full price (assuming $2).

I have a read on official Google's Billing site but I have no idea how to link it to Libgdx. The Official Libgdx Site doesn't really provide any clear instruction and explanation.

As at today, I still have no idea on how to link both Libgdx and In-App Billing. Furthermore, where is the information being stored (is it in the preference file?) when user purchased the unlocked item? I have absolutely no idea.

It will be great if someone lead me to the right path.


回答1:


Libgdx has an extension library that provides in-app-billing services in a cross-platform way: https://github.com/libgdx/gdx-pay. You can use this as-is, or use it as an example for how to interface between core and platform-specific code.




回答2:


Read about the Libgdx way for Interfacing with Platform Specific Code.

Basically, you need to implement the in-app billing support within your Android project, and then expose an API to your platform-independent code to access whatever state you need. There really isn't anything libgdx-specific about the result, the billing code will all exist in your Android back-end, so most existing Android documentation and tutorials should apply.

See this forum post for a few more details: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=2544

Also, when searching, in Libgdx-land this is often called "IAP" support (for "in-app purchasing").



来源:https://stackoverflow.com/questions/19921146/in-app-simple-tutorial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!