Android app product flavors and Google Play - android

I'm building an Android game and I'd like to have a free and paid version. I can add these just fine in my code, but the problems come when I have two different package names:
you need to add the package name on the Google Play dev console
you need to add the package name for Facebook
Do I need to have two of everything? Two apps on Google Play, two facebook apps, two Google Play Games with doubled all content (Achievements, Leaderboards)? Is there a way to have one app but an easy way to unlock a "pro" version? Maybe with in-app purchase?
What's the best way to do this? Seems like product flavors arent really flavors if Google Play treats them as separate apps...

If you're using Android Studio, I would suggest going through Build Variants wherein using Android Library Projects was also mentioned as an option if you will be creating same application.
Lastly, you may also check this SO post - Best way to have paid and free version of an Android app for few more options. Hope something fits what you've been looking for.
Happy coding!

Related

How to prevent such websites like apkpure?

I published many versions so far. And, the users should use the most recent app. However, apkpure shows all the app list that I released.
How come this website take all the apk or abb? I don't want the website takes my applications and block the users in the app. Is there any way to do that?
Actually it's possible to do, using one of the Android features like app bundles. This could help you to verify non Google Play installation. Or even create behavior to crash/exit in such cases.
The whole idea of the approach, it's separation application features to different bundles which could installed be installed within Google play package manager. So you can check it's documentation.
Lots of android users can not access play store when removing the google restrictions, because they want apk file for install. Third party websites publish for that kind users, As well as some desktop users want APk file specially GAME APPs. I think they not Change original APK file.

Multiple versions of app in Google Play Store

I wanted to know if it is possible to submit multiple versions of the same app to the Google Play store. I know that Google Play allows developers to submit multiple APK's to the target certain device configurations, but we would like to release a different name of the app to each of our clients. Things that would be different in each app are the logos, app names, access to different types of information for each customer. I wanted to know if this would violate the Google Play Store's submission guidelines (it is an app built using Adobe Phonegap build, each app package name would be the same), would it be subject to rejection? I know that there are multiple questions on this site similar to this, but they are older questions and I wanted to see if this is something that Google Play is offering. Thank you.
"each app package name would be the same"
AFAIK, that not possible, since package name is used as ID in play store.
The package names must be different. Ideally, you would have unique security keys that signed the APKs as well. It prevents one app from accessing the private data of another app. Other than that, there's no policy or technical block stopping you from posting the same APK with different flavors.
As has been said - the package name is used as the ID in the Play Store.
But the way around this is very simple - just use different package names!
You'll be making the same app with different branding anyway so you'll already have different code bases.
Copy your entire app folder.
Find the config.xml. It looks like this (from the docs): http://docs.phonegap.com/phonegap-build/configuring/#example
Change the id. If you have two apps you'd have:
com.phonegap.appname1
com.phonegap.appname2
Upload each app to a different PhoneGap Build repository. This will create two different apps. Easy.

Paid and Free versions of android app

I am wondering what is the best way to have two different versions of an android app. I would like to have version of my app with ads and one without ads (the paid one). What is the easiest way to achieve this ? I have found something called version flavours here but since I am new to android development I am not sure if that is what I want. Please any suggestions for addressing this ?
You could have two versions of the application in Play store. However, you would have to maintain these separately and it is frustrating to upgrade from free to paid with this approach. If you chose this way of maintaining your application, you would have to have two projects, one for each version. This would result you into having two copies of almost identical source code.
One approach I've seen people do is that the free version also contains the premium features which are unlocked once the user installs a paid unlocker application from the store. However, this has the same result as the first option: you would have to maintain two applications (this time different, though) and the users would have to install additional software.
The best option is to include the premium version as an in-app purchase. The app would contain all the premium features but would be locked by default. Once the user pays for the in-app product (in this case the premium membership), he would unlock all the features.
You can read more about in-app billing here.
Why not just publish two apps with the free one as this :
MyApp
and the paid one as this:
MyApp(Paid).
And this is how to prepare them:
Get your app working, and add ads and then sign it and generate the apk. Publish it. MyApp.apk
Then go back, and remeove the ads, change the package name, add the Paid to the name, and then sign the apk. MyApp(Paid).apk
Then Publish it.

Implement two types of in app purchase in android app

I have a pretty complex project, it uses a lot of custom views and image manipulation.
I want to have in it 2 type of in app purchases, one for Google Play and one for Amazon.
I want to be able to easily maintain code for both, so from what I see I have some options:
I can add both apis on the app and have a flag, based on which, when I build the APK I enable one or the other. Is Google Play sensing if I add Amazon API in the app ? Could this be a problem when uploading the apk ?
I can make the main project as a library project and then create two new projects which are using it. One for Google Play and one for Amazon. All changes will be made in the library project so code is easily maintainable
I can have two separate projects one for Google Play and one for Amazon. In this case it might be pretty hard to keep track of changes, but doable.
Which approach would be better and why ?
Go for the first option.
If the app you uploaded to Google Play uses Google Play for in-app billing, then you have no issues whatsoever, even if there is coding and permissions etc. for Amazon payment inside the app. Google doesn't analysis this. And event if they would, you are on the save side, as you only use Google Play's in-app billing.
You can even improve this option by using Android Studio and Gradle build. It allows to package only those artefacts, that you need for certain build variant. In your case, you can have a single version of project and configure Gradle in a way, that it creates two apk-files: one for Google Play and one for Amazon with respective payment logic in them.

Same APK for free and paid versions on Android Market?

Is it possible to list in Google's Android Market a single APK for both free and paid versions?
So far, I only found this tip to create a button in the free version that links to the paid versions, but IIUC these are still 2 separate APKs.
I also found a reference to creating free/paid versions from same code, but that still refers to 2 separate APKs.
What I am interested in is an (Google) Android Market way to provide functionality that is similar to PayPal's MPL (i.e. one app does it all). Is this possible?
EDIT: Based on the answer below, it seems that Google's In-App Billing facilitates this.
However, LVL's Requirements and limitations says:
Licensing is currently for paid apps
only, since free apps are considered
licensed for all users. If your
application is already published as
free, you won't be able to upload a
new version that uses licensing.
I know that LVL is not the same as In-App Billing but LVL is definitely required for In-App Billing to work (if only for using the key). So how does this reconcile?
It's possible to use something known as in app products. The min API is 1.6, which should work plenty well. Basically, anyone could download the code, but some unlocking of features could be done if desired to buy new functionality. They also have sample code which shows how it works.
Alternatively, you could use the licensing API, and simply check to see if your app is licensed. This would require a different package name, however, as all apps do.
You can rename the package before compile and release it as two apps.
i.e. com.example.yourproject and com.example.yourprojectpaid
You need to use the Key for both he LVL and the in app billing and its a good amount of effort to set up. If you want the easy way out use the example above, but know your paid app is not really protected from piracy if you don't use the LVL for your paid app or in app purchases if you keep the app free.
Good Luck.

Categories

Resources