Code example for ContextWrapper

Methods: getSharedPreferences

	 * This method is called when the message is arrived.  
	 * It starts sensing process. 
	public void messageArrived(MqttTopic topic, MqttMessage message) throws Exception {
		SharedPreferences sp=context.getSharedPreferences("snmbData",0);
		if(sp.getBoolean("sensing", false)==false){
			Log.d(TAG, "Found a new update");
			Editor ed=sp.edit();
			ed.putBoolean("sensing", true);
			new StartPullSensors(context).StartSensing();
			new SocialNetworkListenerManager().fireUpdate("FACEBOOK", message.toString());
			new SocialNetworkListenerManager().fireUpdate("TWITTER", message.toString());
Connect your IDE to all the code out there  Get Codota for Java