Don’t disregard AppBrain that fast - their SDKs are stable and easy to use. Plus they are responsive to questions (as someone suggested their founder Uwe Maurer replies to some queries).
AppBrain’s Remote Settings is just an extra - and I don’t think you need to show their ads, but you WILL need to include their .jar file.
Their remote settings are real easy to use - and you set key-value pairs on their website.
The only downside (which they said they would fix eventually) is that you have to publish the app first and THEN get enabled on their website etc. i.e. they have no APP_TOKEN etc. just identify your app by it’s package name etc.
Once your app is published and you have set up the website etc. properly.
You can setup a key-value pair whenever you want the app to show something.
In fact you could setup two key-value pairs like this:
key_showMessage true
key_Message This is the message.
Then to turn off you can do:
key_showMessage false
key_Message This is the message.
Once you setup the key-value pair in the dashboard there, then from within your app you just have to do this for EVERY activity (i.e. it doesn’t cost too much to do this in every activity):
AppBrain.init(this);
To retreive a string is easy enough:
// if not retreived … will return defaultString
//
String defaultString = “Default Message”;
String valueString = AppBrain.getSettings().get(keyString, defaultString);
Here is an example for retreiving a boolean flag:
// strings using on AppBrain Remote Settings
// that signify boolean values ..
//
private static final String VALUE_FALSE = "false";
private static final String VALUE_TRUE = "true";
// if keyString is not found on AppBrain server - then return defaultFlag
// keyString not found on AppBrain server
// if you called this before AppBrain got a chance to download
// the daily update from AppBrain servers
// usually if you wait 5-10 seconds that process will be completed
// (AppBrain updates once a day or so from AppBrain servers to reduce bandwidth)
//
public static boolean getFlag(Context context, String keyString, boolean defaultFlag) {
// if not retreived .. will return VALUE_FALSE
String flagString;
if (defaultFlag) {
// default == true
flagString = AppBrain.getSettings().get(keyString, VALUE_TRUE);
} else {
// default == false
flagString = AppBrain.getSettings().get(keyString, VALUE_FALSE);
}
// can trim() before also (to ignore whitespace around string etc.)
//
if (flagString.trim().equalsIgnoreCase(VALUE_TRUE.trim())) {
// the strings are equal (ignoring case)
//
// flag is "true"
//
// meaning WAS able to retreive .. i.e. different from VALUE_FALSE
//Log.d(LOGTAG, "flag = true");
return true;
} else {
// flag is "false"
//
// use the default ..
//
//Log.d(LOGTAG, "flag = false");
return false;
}
}