Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect the stage of the app (alpha, beta or production)

I'm developing an android app using cordova and I wish to use the three given stages to release it gradually:

  • Alpha for IT tests
  • Beta for partners
  • Production for everyone else

However, I'm using mixpanel to track some user inputs. Mixpanel requires a token to work and I have 2 of them, one for beta and other for production, it is loaded with mixpanel.init("token1") when the app starts.

Currently, I build an apk with no token defined to run in alpha, then I build another one with token1 to run in beta, and later on another apk with token2 to run in prod. It works, but it's a pain.

I wish to use the promote option inside the Google Play Developer Console, so I could build one single apk (automated) that gets promoted to beta/prod when needed and knows which stage it is in, so it uses the token accordingly.

Is it possible? If not, is there a better way to make it work?

TL;DR Want to know which stage (alpha/beta/prod) the app is running in so it uses a token variable accordingly.

like image 858
tpsilva Avatar asked Dec 20 '16 16:12

tpsilva


People also ask

What is alpha and Beta in apps?

Alpha Testing is a type of software testing performed to identify bugs before releasing the product to real users or to the public. Alpha Testing is one of the user acceptance tests. Beta Testing is performed by real users of the software application in a real environment.

What is alpha version of an app?

(computing, technology) An early version of a program or application, typically unstable, but useful to show what the product will do. Sometimes this stage is referred to as a preview version. Sometimes no more features are added after this release, but bug fixes continue.

What is the difference between alpha and Beta?

The differences between alpha and beta are primarily between what they measure, or what they tell investors. What it measures: Alpha measures performance relative to a benchmark index and beta measures the volatility of an investment relative to a benchmark index.

What is alpha and beta testing in Android?

Alpha Testing is performed by the Testers within the organization whereas Beta Testing is performed by the end users. Alpha Testing is performed at Developer's site whereas Beta Testing is performed at Client's location.


1 Answers

I'm not sure if this will help but are you using build.gradle to make different product flavours? You can make it so that it will generate a class with different final constants in each type of build.

So for your prod build, you can do something like this:

prod {  
applicationId "zuul.com.android"
buildConfigField 'String', 'HOST', '"http://api.zuul.com"'
buildConfigField 'String', 'FLAVOR', '"prod"'
buildConfigField "boolean", "REPORT_CRASHES", "true"
}

and it comes out like this:

BuildConfig.HOST  
BuildConfig.FLAVOR  
BuildConfig.REPORT_CRASHES  

And then you can have one for dev, beta, or whatever.

Check out these links:

http://blog.brainattica.com/how-to-work-with-flavours-on-android/

Deploying multiple build variants at a time - Android studio gradle

like image 127
MSpeed Avatar answered Oct 21 '22 15:10

MSpeed