Skip to content
Mickael Goubin edited this page Aug 4, 2013 · 5 revisions

Here are some tips for this library

Use FreemiumLibrary with ActionBarCompat

To use ActionBarCompat, you just need to modify AdsFragmentActivity.java and replace FragmentActiviy by ActionBarActivity. You might have to add ActionBarCompat to the dependencies of your project I suppose you can do the same with ActionBarSherlock, but it hasn't been tested.

##Not typing app's public key/adUnitId all the time If you have multiple activities in your application, you can easily define your app's public key and your adUnitId in one of your strings resource file, and use getString(R.string.adUnitId). If your project is Open Source, be sure to check that your strings resource file is on your .gitignore!

##You can easily launch the Upgrade workflow You have access to the void onUpgrade() method which allows you to launch the upgrade purchase flow. Just call it when you want to launch the in app payment system (i.e.: a user click on a button...)

##You can simulate that you are a premium user To simulate that you are a premium user, just override the boolean isPremium() method to return true all the time:

@Override
public boolean isPremium() {
	return true;
}

##Other methods You have access to other public methods which are described in the library's JavaDoc such as

boolean isPremiumMenuButton()
boolean isDoAdsForNonPremium()
void setAdsViewReplacement(View)
//...