Chupamobile Blog

The App Source Code Marketplace. Buy Apps. Sell Apps.


Need to ramp up the monetization of your Android apps?  In-app purchases may be the answer.  In my last post, I discussed some of the trends and high-level aspects of the topic, and in this article, we will walk through an actual implementation.

This tutorial uses Eclipse with the Android SDK. It assumes you have some basic experience with Eclipse and that you have an Android app in Eclipse.

android-part-2I am going to create an In-app purchase for Certificate Maker!  The app is a very simple one which allows a user to enter some basic information to create a certificate acknowledging someone’s accomplishment.  I want to allow a person to pay $.99 to have access to other certificate templates.  I also hope to build it in a way that I can eventually have other in-app products such as themed certificates, or give users the ability to further customize certificates with their own images or packs of images (stickers), or rearrange the text location, size, color etc.

What I am going to do will surely be different in some ways from what you would do for your own projects, but I hope there is enough overlap to give you basic knowledge and a shot of confidence to start moving forward.

Creating an In-App Purchase Product

1.      Prepare your Project

The first thing I did was to move all the needed files into my project in Eclipse.  For Certificate Maker!, this required adding several image files, Java files and XML files.  I also had to make a few modifications to my Manifest.

I then modified several Java and XML files to facilitate the flow of screens (activities) as they would occur once the app was actually set up for in-app purchases.  One day I hope to have one button with logic to initiate an in-app purchase if the user has never made the purchase OR simply launch the additional templates if the user had made the purchase. But to keep things clearer in this tutorial, I have split these two functions into separate buttons and defaulted one to be disabled until a purchase is made.


2.      Add the Billing permission to your APK

Let’s start by updating our application’s manifest, which will need to have the following line added to have the billing permissions:
<uses-permission android:name=”” />

3.      Get the Google Play API

Next you will need to download a number of files and then bring them into your own project.  Google makes the files available to us as part of a sample.  To get them:

  • Open “Android SDK Manager” in the “Window” drop-down menu
  • In the window that opens, scroll to the Extras section and select Google Play Billing Library
  • Click Install (Note: Eclipse may have checked other packages than the billing one to install.  To stay on task, you might uncheck all but the billing library and then press install.)
  • Read and accept the license, and then wait.


This installs a sample project called TrivialDrive, which you should import into your workspace.  The file was placed in the following location for me: C:\Users\dan\Android\adt-bundle-windows-x86_64-20130717\sdk\extras\google\play_billing\samples.

After I imported the files into Eclipse, the sample app would not run in the emulator or on my device.  That does not really matter, because we just imported it so that we could harvest a few files.  Seems like a silly way to get a few files, but that is how Google has made them available at this time so bear with me.

You need to copy the package (including the IInAppBillingService.aidl file) from the sample app’s src folder into the src folder of your own app.  No modification to the package or the aidl file is needed.


4.      Preparing Your Activity for In-App Purchases

Open the Java for the Activity where users will access your In-app product.  Paste the following two lines into your code where you initialize variables:
iabHelper mHelper;static final String ITEM_SKU = “android.test.purchased”;

Then in your onCreate method, you will need to add code so that Google Play can know from what app the purchases are coming.  You will need to get a key from the Google Play Developer Console.  To get the key:

  • Open your app’s page in the Developer Console
  • Click on “Services & APIs”
  • Scroll down until you see “YOUR LICENSE KEY FOR THIS APPLICATION” – in a gray box, you will see a multi-line code that includes letters, numbers and special characters. This is sometimes called your license key or public key.  Note this is NOT your Developer Public Key.
  • Create a line of code in your Activity immediately below the last two lines of code you created, then paste your app’s license key between the quotation marks:
String base64EncodedPublicKey =  "your license key here";
  • Immediately below the previous line of code, paste the following:
public void initPurchase() {mHelper = new IabHelper(this, base64EncodedPublicKey);mHelper.enableDebugLogging(true);mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {public void onIabSetupFinished(IabResult result) {if (!result.isSuccess()) {return;}if (mHelper == null)return;mHelper.queryInventoryAsync(mGotInventoryListener);}



  • In your onDestroy method paste the following two lines to make sure the connection to Google Play is properly terminated:
if (mHelper != null)mHelper.dispose();mHelper = null;

At this point save (but do not close) the file, ensuring you do not have any errors.  You may need to perform some imports to properly point to the files you created in the util package.  Let Eclipse help you with this by using Control+Shift+o.

5.      Code for Initiating a Purchase

While the above steps will be common to all implementations of In-App Purchases (I think J) the next set of steps will vary based upon how you plan to have your users initiate a purchase.  Certificate Maker! users will click a simple button to enter the purchase flow.  Initially we will code it to use dummy data.  Once everything is working correctly, we will modify it to use real data.  I changed the code for my button to be as follows:

mBtn1.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {mHelper.launchPurchaseFlow(MainActivity.this, ITEM_SKU, 10001, mPurchaseFinishedListener, "mypurchasetoken");}});

6.      Listen Up – We Are Almost Done

The next bit of code should be place after and outside of your @onCreate.  It includes three listeners:

  • Query Inventory – queries the billing system for purchased items
  • Purchase Finished – confirms the specific purchase was made that we intended
  • Consumption Finished – marks the product as consumed. Google says, “if your application detects there are any consumable items that are owned by the user, you should send a consumption request to Google Play immediately and provision the item to the user.” When a successful purchase is made, it is stored locally, but Google recommends that your app queries Google Play to confirm the purchases Google Play is tracking to ensure consistency between the service and what you display to the user.

Remember, the concept of consumption does not necessarily mean that a user has used up the item.  I think of it more as your app acknowledging that the purchased product has been received by the app.  It is recommended to consume the product before providing the user access to the product.  With the current implementation of Google’s API all managed products are consumable.  So even if the “old” concept of consumption does not apply to the product you are creating, (e.g., it is an item that provide permanent benefit such as a premium upgrade,) you will still need consumption related code.

@Overrideprotected void onActivityResult(int requestCode, int resultCode,Intent intent) {if (mHelper == null)return;if (!mHelper.handleActivityResult(requestCode, resultCode, intent)) {super.onActivityResult(requestCode, resultCode, intent);} else {}}IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {public void onQueryInventoryFinished(IabResult result,

Inventory inventory) {

if (mHelper == null)



if (result.isFailure()) {




Purchase item_1 = inventory.getPurchase(ITEM_SKU);

if (item_1 != null) {

Log.d("trungpt", "Get Item ");


} else {

Log.d("trungpt", "Not Get Item");






IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener = new IabHelper.OnIabPurchaseFinishedListener() {

public void onIabPurchaseFinished(IabResult result, Purchase purchase) {

if (mHelper == null)


if (result.isFailure()) {



if (result.isSuccess()) {







IabHelper.OnConsumeFinishedListener mConsumeFinishedListener = new IabHelper.OnConsumeFinishedListener() {

public void onConsumeFinished(Purchase purchase, IabResult result) {

if (mHelper == null)


if (result.isSuccess()) {

Log.d("trungpt", "Consume Finished");

setResult(RESULT_OK, getIntent());

} else {

setResult(RESULT_OK, getIntent());




7.      Subscriptions

If your product is a subscription, simply set the product type to “subs”.  Then in the onActivityResult method do the following:

Bundle bundle = mService.getBuyIntent(3, "com.example.myapp",MY_SKU, "subs", developerPayload);PendingIntent pendingIntent = bundle.getParcelable(RESPONSE_BUY_INTENT);if (bundle.getInt(RESPONSE_CODE) == BILLING_RESPONSE_RESULT_OK) {// Start purchase flow (this brings up the Google Play UI).// Result will be delivered through onActivityResult().startIntentSenderForResult(pendingIntent, RC_BUY, new Intent(),Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));}

To query for active subscriptions use the following:
Bundle activeSubs = mService.getPurchases(3, “com.example.myapp”,”subs”, continueToken);

If you’ve followed the article properly you’re one step ahead to implementing In-app purchases into your app. Stay tuned for the last part to finish the project.

Good Luck!


This is really a “no-brainer” offer! One of the most popular Android Game Template on the Chupamobile Marketplace is now 71% off. This is your only chance to get it for just $29!

one pic one word flash sale

Over 100 customers and 150 applications already used this template! Why? Because it’s the perfect starter kit to develop a picture based quizz app.

What does it have to offer? Google in-app purchases, Chartboost & AdMob integration, Multilanguage support, Facebook integration and much more to increase your app monetization!

This is the best value we have ever offered for a template listed on Chupamobile and we are glad to share this opportunity with you.

Can’t wait to have it? You have only 48hrs to get this Flash Sale. Don’t miss this one-time chance and launch your own app NOW!

The countdown has already started!


The Apple App Store success started back in 2008 when with just 500 apps was able acquire millions of downloads in the first few days. This success obviously came alongside with the company’s various iPhone releases.

However, today, reports say that the Apple App Store is threatened from the top of the crop, and it seems that Google Play is taking over its popularity.

app store growth

image by appfigures

Here comes a contender

The challenger, Android, notoriously became Apple’s ultimate rival and according to the data provided by App Annie, an app analytics company, Google Play’s massive worldwide downloads were 60 percent higher than downloads from the iOS App Store over the last three months of 2014. However, last year’s third quarter explicitly shows Apple App Store’s revenue higher by 60 percent as compared to Google Play’s revenue. This is due to the fact that Apple holds sway over its premium market of consumers who can afford the more expensive iPhones, and those who don’t mind paying for apps or in-app purchases. On the other hand, Android caters to a vast number of consumers globally, ranging from those who own cheap smartphones to high end devices supporting Android. It’s no surprise that there are more free apps available on Android than iOS.

Google beats Apple in number of apps available

Data from AppFigures also reports that Google Play has now overtaken Apple App Store today by the number of apps it hosts. Google Play now has nearly more than 300,000 more apps than the number offered at the iOS App Store which is about a 17 percent difference. This information clearly implies that Google Play has more to offer a smartphone user than Apple, in terms of variety.

The company has also reported that Google Play ranks top as well with the great number of developers it has attracted who are now working on the platform. Their overall app stores growth tallies to more than 50 percent according to App figures. The Google Store has acquired about 388,000 new developers, Apple at 282,000 developers and Amazon at 48,000 developers. This seems to be based on the relatively easy process of approval of submitting apps to the Play Store compared to the strict Apple rules. There would also be concerns when taking into account the quality of these applications, as some found in Google Store may criticized to be of poor quality since they are more lax in accepting submitted apps in contrast with Apple who is known to frequently reject submissions here and there, frustrating some developers enough to stop them from making apps for iOS.

Although statistics show that Apple no longer commands the app world as it did when it initially launched, and Google Play has won the title for the first time, things are bound to change and we are surely in for more ups and downs in the rankings as Apple comes up with new releases.


Details about specifications of Apple’s new iPhone 6S have recently been floating around the Internet. You might think it’s pretty early, but well, aren’t you curious?

iphone6The 6S is expected to contain 2GB of LPDDR4 RAM. Not only do the iPhones 6 and 6 Plus only have 1GB, they use the same LPDDR3 memory hardware that is used in most high-end Android smartphones, meaning the LDDR4 memory is twice as fast as LPDDR3, so this is a very significant advance in the 6S specs. The better RAM is going to come at a higher price, of course, so that leads to the immediate question of what Apple has in store for us in iOS9 that can take advantage of what is basically a quadrupling in performance with twice as much RAM that is twice as fast. Certainly it would seem to indicate that iOS9 will not involve just a minor tweak in the way of iOS8, but rather a major technological advance more in line with the iOS7 release.

A better way to multitask?

We’re limited to speculation about iOS9 at this point, and even the reports about the expected 6S hardware have to be considered more rumor than established fact. It’s obvious, though, that even though current iPhones are indeed already fast, there is no practical limit to how heavily a power-user may want to multitask more and more frequently among more and more apps of greater and greater size. So will iOS9 be taking a fresh look at the whole multitasking functionality of the smartphone, something that breaks outside the box of both iPhone and Android approaches on current devices? This seems likely. Of course there’s room to support bigger and bigger apps and to make them work faster while single-tasking. But many commentators have pointed out that iPhones are already pretty darned fast, and it’s not clear that RAM hardware that is 35% more expensive than current hardware would be warranted just to provide that marginal increase in single-app size and speed.

How much is this all going to cost?

But providing the ability to multitask efficiently — both in terms of hardware/software support and user experience — that would be worth the money to heavy smartphone users. Of course it’s not a foregone conclusion that Apple would pass on all or part of the 35% premium for the new RAM, but it’s pretty clear that they would if they could — and if what we think about the new iOS9 multitasking functionality is true, then there will be consumers who are willing to pay the price.

Since the entire Apple user community naturally expects iOS9 to be introduced at the WWDC this June in San Francisco, we can expect the rumor mills to grind with increasing intensity between now and then. We think that iOS9 is already in closed beta testing as we speak and has been for a while, so it comes as something of a surprise that they would be testing so far in advance of any expected launch, perhaps in Autumn 2015. That is one further indication that iOS9 will be a major advance at least in some areas, and not a routine OS update. It’s certainly going to be another interesting year for the iPhone community.

What do you expect to see in the new iPhone and OS? Let us know!


Successful apps are characterized by a set of common traits but only two of these truly determine the success of an app: its ability to drive downloads and its engagement.


Building an app is not synonymous of success. The first thing every aspiring appreneur should understand is the difference between promoting an app and influencing new users to get their app. Obviously the second option is the way to go; users need to have a clear idea of what you are selling and that, should close the deal.

Now that we have this basic principle in mind, let’s take a look at 15 ways to boost your app’s downloads and engagement.

1. Create a website for your app

People discover apps in many ways and very often they’ll google it. So, apart from reading all there is to read in the app store they’ll look for a second source and that, should be the app official website.

Building an outstanding landing page is extremely powerful, not only because it’s the first step to turn your app into a business but it’s also a great sales conversion tool. You should clearly state the value you will bring to the user with your app and allow the website to be a page that triggers communication among users.

2. Publish articles about your apps

Also known as content marketing, publishing articles about your app on other blogs or websites is just as important as having your own site. Start with small publication sites and aim for the big names, it’s a great way to encourage credibility and establish yourself in the market. And if people like the content, they will share it among their friends which will result in free promotion as well as advancement in search-engine rankings.

3. Build yourself a reputation

Work to get your name recognized. If you manage to build a good reputation as a developer or a publisher users will tend to rely on your products. Specialize in an area and post your thoughts, experiences and tips on forums, sites and other online communities. Again, building value around your app is better than pushing someone to buy your product.

4. Social Media channels

This should be granted for anyone by now. Be active on social medias, they are a great tool to promote your app on groups and also by creating a page specifically for your product. Allow users to talk about your product and be present in all the conversations.

5. Stay alert on what people say about you

This is closely related to the previous one. Use tools like Mention and Google Alert to know who talks about you so that you can promptly react. It’s a great way to foresee any issue or even apply suggestions that other might have about your app.

6. Word of mouth

This is probably the cheapest and most effective marketing tool you could use. Word of mouth is not easy to achieve, it may require some time but it’s worth it and a great way to do it is to trigger a viral loop. People tend to trust other users, so if you have a great product to offer and you manage to run an efficient marketing campaign increasing the user reach shouldn’t be difficult.

  7. App stores reviews

Get every single person you know to download your app and give it a nice rate and review. Unhappy customers will surely leave a comment on the app but stimulating users that use your app regularly to rate it on the app stores is up to you.

8. App usage data

Does your app have some nice numbers? Show them off! If you have a great number of people that use your app or you made good revenues with it, why shouldn’t you let everyone know about it. Put it on your website where anyone can see it, and let your followers on social media know about it. And why not, a thank you note is always appreciated.

9. Share app content on social media

Another great way to market your app and increase engagement is letting users to share app content on social media. Reaching a high game score or a personal objective with a health app, if shared, can stimulate conversation and cause other users to download your app as well.

10. Customer service

Providing an outstanding customer service is the base of any successful business. Listen to your customers and connect with them. Come up with solutions when a problem arise and don’t wait ages to fix it or they’ll move to someone else that does the job better than you. Remember, a happy customer is a returning customer, and also, it’s free marketing for you.

11. Don’t forget ASO!

If you want people to talk about your app they should discover it first. A great way to do it is through App Store Optimization, if effectively done, it will increase your app store rankings and allow you to be more visible to browsing users.

12. Push notifications

Push notifications are useful for many functions. They can make a user that stopped using your app come back, it can make them share content or even increase the current usage percentage. All you have to do is use this feature wisely, don’t overdo or you might end up losing users. Test out a few strategies and find out which works best for you.

13. UX and UI

There are millions of apps in the market so make sure your app gets noticed in that crowd. How can you drive engagement if your app is not engaging? Create a professional and clean looking design, pick your colors wisely according to the type of app and make sure the user experience is pleasant. Your app should be beautiful to the eye and easy to navigate.

14. Competition

Keep an eye on your competitors and learn from them. What do they excel in and what can you do to get better? What are they terrible at and what can you do to avoid the same situation? Use competition to your advantage and move accordingly to keep improving your app.

15. It is a business

If you want your app to be successful stop thinking about it as an app and start thinking about it as a business. Building an app is getting easier and easier every day and the people that decide to launch an app are more than ever. Because of that, remember that your app is your very own company and you are the one entitled to provide the best service to the customer. If you keep this in mind for each step you take in making your app stand out, I grant you your road will be long and successful.

So, the next time you’ll launch an app, before going crazy with the promotion and ignoring the advice of your customers remember these steps, if followed wisely they will bring you to the right direction. Just like every business an app is successful if the person behind it is determined enough to succeed, so work hard and I’m sure you will make it.

Did you like this post? Like it! :)

Got something to say? Comment! :D

Think someone else should see it? Share it! ;)


Are you looking for an app with a simple design that will not eat up most of your precious time, yet has great features and high success opportunities? We’ve got what you need.

Millions of users worldwide use more their smartphones than a camera to capture photographs. If you want to tap into this potential market of photo editing apps, then there are templates that you can use to make the process easier and faster. We’ve gathered juts for you the best photo editing app templates. Why not look at developing one for your customers?

Rainbow Photos

rainow photo

Everybody is inclined to look at rainbows. People love color and a beautiful rainbow produces it naturally. This photo-editing app will attract quite a number of users because everyone wants its photo to look at its best. The design of the template is simple but attractive, and will take very little effort from you to reskin. Just adding a fun, interesting theme will make it complete and then, you’re good to go!

Wanted Poster

Wanted Poster Photo Booth iOS

Having a bit of fun with photos and making them more interesting is the goal of many smartphone users. Anyone would love the chance to ride a horse and be the hero of the town, or for a great twist, wish to see their picture backed high against the wall at the saloon saying ‘Wanted’ along with a hefty reward? This Photo Booth app allows you to create that poster of yourself and send it to your friends for a bit of a laugh. You may find your app is listed under “Most Wanted” after this!

Beautiful Photo Decoration – 160 Stickers

Beautiful Photo Decoration App - 160 Stickers iOS

Nothing makes a picture more personalized and fun than adding a sticker and some props to complete the scene. This app provides easy control over stickers, whether scaling, rotating or deleting them. You can save your work in the Photo Album, share to your favorite sites, or print them out!

Photo FX Master

Powerful Photo Editor - Photo FX Master iOS

This app, based on Aviary photo editing will be all you’ll ever need to produce awesome photos. It has a notable graphics interface, with sample photos in HD and allows you to share to your favorite photo sharing apps and social networks. Customers will love what they can create with this app, and your downloads will certainly be a thing of beauty!

Photo Puzzle

Photo Puzzle iOS

This app template allows you to create puzzles through your photo album or smartphone camera. This universal application includes infinity puzzles and 2 levels, easy and hard, with an easy to build source code that will let you publish your very own Photo Puzzle App in no time.

All of these Photo editing app templates listed here will help you build an app with features that you can easily put together. Some tweaking here and there would suffice and give you great benefits in return. These most popular designs will let publish an app that the thousands of smartphone photographers will be delighted to use.


We all know that many mobile users loathe ads as well as paid apps.  But we need to monetize somehow.  While there are a many tactics, In-app purchases seem to be a winner for many of us.  The freemium model not only provides users a lower barrier to entry than a paid app, it also has the potential of changing a one-time transaction to a revenue stream.


My Attempts at Monetization

When I created Certificate Maker! for Android I had several different certificate templates that I wanted to monetize in some way.  At one point, I provided all templates as part of the basic app in exchange for the user watching a video ad.  I made virtually no money that way.  Since I did not know how to incorporate In-app purchases and did not have the time to learn, I simply created a separate paid app (Certificate Maker! Pro) with these extra templates.  I then put a button in the basic app that linked to the Google Play page for the Pro version.

While the free version of Certificate Maker! has over 20,000 downloads, I have sold only a few hundred of the paid version.  Would I see better monetization with a freemium model?  Would it improve my conversion by reducing the number of steps a user has to go through and decreasing the number of apps on a user’s device?  If I can successfully add one In-app product, wouldn’t others be easy?

I have a lot of ideas for new features for Certificate Maker! but frankly, I have not pursued them because I saw no associated revenue increase.  But if I can create an In-app product, maybe I can validate whether it would be worthwhile pursuing other In-app products.  I need to learn more.

The Bigger Trend

While there are myriad methods for monetizing apps, three typically come to mind: ads; In-app purchases and paid apps.  A recent report by Localytics indicates that paid apps still produce more revenue overall than In-app purchases, but trends indicate that will reverse in early 2016.

Part of the reason In-app total revenue is set to surpass paid-apps is many users are able to achieve their goals (playing a quick game, booking a hotel room, listening to music, etc.) with free or freemium apps thus seeing no reason to pay for an app, even if just a dollar.

In fact, a recent review of the Top Grossing apps in Google Play, none of the apps are paid until you get to number 40 – Minecraft – Pocket Edition  for $6.99.  The next one is number 125 – Trivia Crack (Ad free) for $2.99.  There are a few more down the ranks, but it is obvious that In-app purchases are where the money is going.

Recent News

You may have noticed that Google In-App Purchases have been in the news lately.  A complaint filed by the United States Federal Trade Commission (FTC) alleged that Google “unfairly billed consumers for millions of dollars in unauthorized charges incurred by children using mobile apps downloaded from the Google Play app store for use on Android mobile devices.”

The FTC complained that many apps blurred the line between virtual currency and real currency and that when a purchase was made, the user did not need to enter a password or provide any other method to confirm account holder authorization.

Over time, Google has made several changes to help mitigate this issue including:

  • adding the words “In-app purchases” below the INSTALL button when applicable
  • listing In-app purchases on the “App permissions” screen and
  • encouraging users to turn on password protection
  • just this month Google and the FTC settled the case with Google agreeing to pay at least US$19 million to users who reported such unauthorized charges.

Google is not the only company to face this issue.  Apple has settled a similar case, and a case is pending with Amazon, who has not yet settled.  I am no lawyer, but this appears to be a matter that developers do not need to be overly concerned with as long as we do not try to blur the lines between real currency purchases and purchases with virtual currency and use the Google standard processes.

How do Android In-App Purchases Work?

Purchases can be implemented in various ways, for example, some apps launch a browser session and have users make a purchase over a web page.  Amazon offers an “In-App Purchasing API”.  But since Google Play dominates the Android app market, we will focus on Google’s implementation of In-app purchasing for apps published on Google Play.

Google offers two “Product Types” for In-App Purchases – Managed Products and Subscription.  There is also such a thing as Unmanaged products, which are purchases not tracked by Google.  These are outside the scope of this article as we will focus on how to leverage Google’s API.

Managed products are what most of us think of – currency, swords, seeds, new levels, different screens, etc.  In prior versions of the API, there were consumable and non-consumable options.  Consumables included things like lives, points, chips, virtual currency, etc.  Non-consumables were things that provide a permanent benefit to the user and would only be purchased once such as a premium upgrade or level pack.

With the current implementation of Google’s API all managed products are consumable.  So even if the “old” concept of consumption does not apply to the product you are creating, (e.g., it is an item that provide permanent benefit such as a premium upgrade,) you will still need consumption related code.  The concept of consumption does not necessarily mean that a user has used up the item.  I think of it more as your app acknowledging that the purchased product has been received by the app.  It is recommended to consume the product before providing the user access to the product.

This topic is even more confusing when you are creating your product in the Developer Console, Google tells you “Managed items that can be purchased only once per user account on Google Play.”  My understanding is that this means you can only purchase it once until it is “consumed” or rather, the app has confirmed that the product has been made available to the user.

Subscriptions result in recurring charges either monthly or yearly, such as upgrading from Pandora, to Pandora One.

Google’s API for In-app purchases facilitates interactions between an app and Google that can be broken into “pre-steps” – things that must occur before a purchase is even initiated, as well as the actual steps needed once a user initiates a purchase.


Before a purchase is initiated, there are three steps an app will typically perform.

Step 1 – the app sends an “isBillingSupported” request to Google Play to confirm version compatibility.

Step 2 – the app sends a “getPurchases” request to Google Play to see what products the user has purchased for the app.  Google Play will respond with a “Bundle” listing the product IDs.

Step 3 – to confirm the products available for purchase, the app sends a “getSkuDetails” with a list of product IDs to Google Play.  Google Play will respond with a “Bundle” with product details including price, title, description and purchase type.

Purchase Steps

When an In-app purchase is initiated, there are typically four steps:

Step 1 – the app sends a “getBuyIntent” request to Google Play with the Product ID and a few other parameters.

Step 2 – Google Play sends a “Bundle” with a “PendingIntent” allowing the app to begin the checkout UI.

Step 3 – the app launches the pending intent, calling a method called “startIntentSenderForResult”.

Step 4 – Google Play sends a response intent to the app’s “onActivityResult” method when the checkout flow is finished notifying the app whether the purchase was successful or cancelled.  The response intent contains a “purchaseToken String” uniquely identying the transaction as well as the signature of the purchase, signed with the app developer’s private key.

A Few Notes

While Android version fragmentation may be a concern for much of what you do with Android, that is not a concern for In-app billing.  The current version, Version 3 of the Google In-app billing API supports Android 2.2 and up, which accounts for well over 90% (and counting) of the market.

A few other random points to keep in mind:

  • Physical goods are not eligible to be In-App Purchases
  • There is no refund period as there is with paid apps
  • Google takes 30% of each purchase
  • While Google will track the purchase for you, you are responsible for delivery of the product.

In my next post, I will implement an In-app product into Certificate Maker!  I will detail out what you will need to download to create your own In-app products, needed changes to your code as well as steps you will need to take in the Google Play Developer Console.  Stay tuned!  And in the meanwhile, please use the comments below to share your experiences with app monetization, especially In-app purchases.


Opportunities like this don’t come around often. This is your chance to get a top app template at 66% off! Yes, you heard right! I’m talking about Yip Yap Pro, the ultimate social network template for iOS!

Yip-Yap-Pro-blogWhat’s so special about this app? All its users can join the conversation by posting and sharing pictures, comments and videos with their friends. Oh, and did I mention that the app is for sharing self-destructing content? This adds just the perfect amount of fun and excitement! The users can engage with it by upvoting or downvoting posts and see what other people around are posting.

Needless to say this app is super-easy to reskin and has tons of monetization opportunities. To make it even more easier for you to earn some extra money, the app includes Chartboost, Revmob, Vungle and also one in-app purchase.

Eager to get it? You have only 48hrs to get this Flash Sale. Don’t miss
this one-time chance and launch your own social network app!

The countdown has started!



As we saw at the first article regarding the App Store’s 64-bit requirement, in June 1 all the app updates have to be compatible with 64-bit runtime environments.

64 BIT 1

In this article we are going to guide you through the steps needed to convert any app to a 64-bit binary and submit it to the App Store:

  1. Open your app project in Xcode (version 5.0.1 or later).
  2. Update the project settings to support iOS version 5.1.1 or later.
  3. In the Build Settings section of the project settings set Standard architectures (arm64) for the Architectures
  4. The previous changes will raise some compiler warnings and errors in your project. Follow the next sections in this article to update your code to support the 64-bit runtime environment.
  5. Test the project on 64-bit devices apart from the iOS Simulator.
  6. Take advantage of Instruments to check your application’s memory usage.
  7. Submit you app including both 32-bit and 64-bit architectures for approval.


The step #4 of the above process is the most important as you need to go through your code to resolve all the warnings and errors raised. The following sections will help you in this process.


Avoid casting pointers to integers. This way you ensure that all of your variables are long enough to store an address value. In case you have to convert a pointer to an integer, you have to use uintptr_t to avoid truncation.

Let’s see an example:

int *pointer = some value;

int *next_pointer = (int *)((int) pointer + 1); // Incorrect

int *next_ pointer = pointer + 1; // Correct

Data types consistence

Using data types inconsistently is the reason of many common programming errors. For example, let’s imaging that we have a method that returns a long integer.

long MethodReturningLong();

In 32-bit runtime environments, int and long are 32-bit data types so it doesn’t matter if you return an int in spite of a long. In 64-bit runtime environments this will result in losing the last 32 bits of the result.

int result = MethodReturningLong(); // Incorrect

long result = MethodReturningLong(); // Correct

The same thing will happen if you pass a long to a method that expects an int.

int MethodReturningInt(int a);

long l = LONG_MAX;

int value = MethodReturningInt(l); // Incorrect

And the same thing will happen if you return a long in place of an int.

int MethodReturningInt(int a) {

return LONG_MAX;


Similar to above cases you have to pay attention to NSInteger and CGFloat usage as their size has changed in 64-bit runtimes.

Integer computations

In addition to truncation problems, you have to take care with some integer computations, for example when working with integer signs.

Let’s imagine we have the following sum:

int x = -3;

unsigned int y = 2;

long c = x + y;

The value resultant is -1 in 32-bit runtimes (0xffffffff) but when running this same code in a 64-bit runtime, the result is 4294967296 (0x00000000ffffffff). The solution of this problem will be declaring y as a long variable.

Data structures

You need to create data structures with fixed size and memory alignment. This means that these data structures may have the same representation in 32-bit and 64-bit runtimes to avoid problems when a user stores data in a 32-bit device and retrieves it from a 64-bit device.

Memory allocation

We should never use malloc(size) to allocate space for a variable. Instead of that we should use sizeof to get the size of the variable we want to allocate.

String format

When printing a variable with the printf function we have to use the correct format string: %d for strings, %ld for long, %lld for long long, %zu for size_t, %td for ptrdiff_t and %p for pointers.

As you can see, the solution for most of the cases is maintaining the consistency of our variables but sometimes we are not the consistent in 32-bit runtimes. What do you think, are you getting in trouble when updating your code?

And if you are a Chupamobile author…

As you know Chupamobile is the leading app template marketplace, if you are one of our authors that earn passive income from the app templates, we have news for you!

Now that you have successfully updated your app to 64-bit you can share it with all your customers on your product page. Find out how:

Step1: log into with your personal account and select Edit Product

Step2: On the second step of editing product (File uploads), simply tick the voice Support for 64 Bit


Step3: Now the change will appear on your product page!

download (1)


According to the year-end report on mobile trends released by Flurry (a mobile analytics firm owned by Yahoo), mobile app usage has continued to escalate in the last 12 months, recording a significant growth. The overall app usage grew by 76% in 2014 and top app categories including Utilities, Productivity, Messaging and Shopping experienced a triple-digit growth, contributing significantly to the overall increased usage of mobile apps.


Are we using our smartphones more for organization?

As mobile gadgets become more and more a part of consumers’ everyday life, they are increasingly using them for not only communication but also for shopping and working. Smartphone users opened more Utilities & Productivity apps in 2014, establishing that mobile gadgets and tablets have become essential devices that enable people to be productive and keep their lives organized. Throughout the year, the company tracked over 2 trillion app sessions, with a daily session recording taking place on the last day of the year when 8.5 billion sessions were recorded as consumers celebrated the New Year’s Eve.

However, in as much as growth in the Games, Entertainment, Music and Media categories was noted, there was a slight downtrend as compared to the previous years.

Office mobile could have had an influence on productivity apps

Increase in the Utilities & Productivity category last year shows that users are getting more and more comfortable performing tasks from their gadgets especially after Microsoft introduced Office to mobile, making the app not only available on Windows devices but also on Android and iOS.

Shopping via mobile app sees significant growth

Each app store category saw a significant growth session over the year but shopping category was the highest. The report found that on Android and iOS sessions in this category escalated by 174%, while on Android alone, these sessions were up by 220%. Addressing mobile trends, Flurry pointed out that 2014 was the year retail came to mobile in a big way.

Popular app category of 2014

Several e-commerce start-ups including; Shop-Hers, Curbside, Kwoller, Downtown, Threadless, Strut and Paytm just to mention a few, were launched on the mobile platform in 2014. However, the category growth is not just about consumers trying new apps  ̶  it is about them getting more comfortable buying products through their smartphones and tablets in general. Whether that means purchasing from giant retailers like Walmart, checking out coupons and offers on related apps, social shopping, browsing popular market places or comparison shopping with barcode scanners consumers are looking to their apps to give them the best deal.

The analytics says it all

In 2014, one of the top analytic firms globally took a deep dive into shopping apps as well as consumer behavior and found out that consumers shop on their tablets and smart phones while out and about during the day, with shopping app usage peaking during commute times in the morning hours and at midday when people are heading to lunch. It also peaks again in the evening during prime time (mostly 8PM) making using the apps some sort of a leisure activity that takes place as users unwind after work and supper.

It’s clear to see that we are turning more and more to our smartphones and tablets to assist us with daily living. We therefore can’t wait to see what innovative apps are launched to make mobile apps even more popular in 2015. And if you are looking to get into the mobile business Chupamobile is the leading platform that helps you build app easily even if you’re not a skilled developer. Here you’ll find over two thousand apps from which to choose; pick your favorite and make it unique with your own ideas.