Pages

June 1, 2012

Example : Android Menu/Selected snippet.

    final int MENU_ADD=0;
    final int MENU_DELETE=1;
    final int MENU_VIEW=2;
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        
        menu.add(0, MENU_ADD, 0, "Add").setIcon(R.drawable.ic_launcher);
        menu.add(0, MENU_DELETE, 0, "Delete");
        menu.add(0, MENU_VIEW, 0, "View");
        
        return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        super.onOptionsItemSelected(item);
        
        switch (item.getItemId()) {
        case MENU_ADD:
            Log.v("menu","Add clicked");
            return true;
            
        case MENU_DELETE:
            Log.v("menu","View clicked");
            return true;
            
        case MENU_VIEW:
            Log.v("menu","View clicked");
            return true;
        default:
            break;
        }
        
        return true;
    }

May 31, 2012

Example: Shared Preference Getter/Setter


import android.content.Context;
import android.content.SharedPreferences;

public class Util {

 private static String tag="util";
 private static String KP_PREF="kp_pref";
 private SharedPreferences mSharedPref;
 
 public static int getIntValue(Context ctx,String key,int defval)
 {
  SharedPreferences pref = ctx.getSharedPreferences(KP_PREF,Context.MODE_PRIVATE);
  int usageCount = pref.getInt(key, defval);
  return usageCount;
 }
 
 public static void putIntValue(Context ctx,String key,int defval)
 {
  SharedPreferences pref = ctx.getSharedPreferences(KP_PREF,Context.MODE_PRIVATE);
  pref.edit().putInt(key,defval).commit();  
 }
 
}

November 24, 2011

JaxtrSMS - What's new ?

Most interesting news on web/media, Sabeer bhatia again brought awesome concept FREE SMS worldwide - sounds like revolutionary concept!

I like the idea of FREE and Open texting app, but Today there's hell lot of competition in instant messenger segment. we starts comparing it with messenger app!

November 21, 2011

JaxtrSMS - free sms worldwide

JaxtrSMS - a wordwide free SMS ! currently in beta, lets users send free SMS worldwide in easiest way. JaxtrSMS is gaining popularity across all mobile platforms, exponentially catching large number of userbase.

Download JaxtrSMS and start sending messages. JaxtrSMS links directlyto your address book so you can send messages to anyone whether they have JaxtrSMS or not. There is no limit to the number of messages you can send.