Tag Archives: in-app billing

Tutorial: How to Implement In-app Billing in Android – Part 2

Part 1 of this article was my guide on how to get started with in-app purchases in Android. It was published in July 2014. Finally, here is part 2. …

Part 1 covered the operational side of things: defining in-app products, application keys, etc. In this article, I will offer some suggestions on how to adapt the TrivialDrive code for your own app. The code provided with TrivialDrive is very well structured and we all can learn a lot from it. Most of the hard work is done in classes inside the util package of TrivialDrive. Without that package, the MainActivity would be much more difficult. The changes I suggest below are refinements on what is in the MainActivity provided by the Google team.
For my own work, I made the transition from the in-app purchases of the TrivialDrive sample app (Figure 1, left) to the purchases of my space war app (Figure 2, right). Continue reading

Posted in Android | Tagged , , , , | 14 Comments

Tutorial: How to Implement In-app Billing in Android – Part 1

In an earlier article, I wrote about in-app billing inside an Android game app I am working on. This is the first of two follow-up articles in which I explain how to add in-app billing to your game or other app. In this article I will walk you through the steps for the TrivialDrive example program from the Android Developers website. That website provides a sample in-app billing (IAB) app. It shows you how to do simple in-app purchases and subscriptions. … The focus on this article has been on getting a working example going. That is a really important step. The TrivialDrive app will be your reference app as you move ahead with your own app. I do not recommend skipping the TrivialDrive example. There are too many things that can go wrong if you are learning the basics of in-app billing at the same time as you are adding items to your own app. Continue reading

Posted in Android | Tagged , , , , | 23 Comments

In-app Billing in an Android Space War Game

I am writing a series of articles about how to implement in-app billing for an Android game app. I will get that started by telling you something about the game app I am working on and how in-app purchases tie in to upgrades within the game. …

Starship is a turn-based, single player, space war game. You command a very powerful starship. Your mission is to find and destroy alien starships that have invaded the galaxy. … As you play the game, you earn gold coins. The coins can be used to purchase items that improve your capabilities. …

This is the first of a set of articles. Topics covered:
suggestions on how to get started with the TrivialDrive demo program from the Android Developers website;
adapting the TriviaDrive demo to your own application;
tips and suggestions for testing in-app billing;
how to implement your own Upgrades screen;
different ways to invite players to upgrade. Continue reading

Posted in Android, Game Design | Tagged , , , , | 3 Comments