Remote messaging to users

Hi Dear All,

I want once in a month or twice(maybe more) to send a message to users who has my app installed and using it. I dont want it like push notification. Similar functionality has appbrain. They call it remote settings. So, from time to time an app is checking for update on text, and when there is an update it loads and save it. And then i decide how and when to show it, it can be simple toast, or something else.

The purpose is to have some service which provides it. I dont want to include appbrain sdk only for this feature, maybe there is some service like this already with more functions, like having some surveys, and etc.

Thank you.

If you are willing to display the message WHEN the user opens your app, that might be easier. You can upload a text file into a website similar to the following:

UPDATE: 7
This is the text

Then, every time the main activity starts, download the file and compare the update number (the first line) against a System property, if different, display the text and update the system property to store the latest update number so you don’t display it again next time.

Another kettle of fish if you want to ‘push’ a message into the user.

Check out Parse.com. It offers push notifications and a dead simple SDK to implement server-side data storage & retrieval.

The only reason I’m not using it in all of my apps is the 1 million monthly request limit for free accounts. But if you’ve got light to medium user counts, I reckon it’s a fantastic service to use.

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;
	}
}