Get a resource id with any of known resource name like string,drawable, id... Using getIdentifier Return a resource identifier for the given resource name. A fully qualified resource name is of the form "package:type/entry". The first two components (package and type) are optional if defType and defPackage, respectively, are specified here.

Example: defType = "string" (or) "id" (or) "drawable"
                idStr = if drawable like R.drawable.ic_add means then "ic_add"

 public int getresId(String defType, String idStr){  
           int resId = this.getResources().getIdentifier(idStr, defType, this.getPackageName());  
           return resId;  
      }  

Shared Preferences to store private primitive data in key-value pairs. From this example you can store string, boolean, Arraylist in private.


 import java.lang.reflect.Type;  
 import java.util.ArrayList;  
 import java.util.HashMap;  
 import java.util.List;  
 import org.apache.http.entity.mime.content.ContentBody;  
 import android.content.Context;  
 import android.content.SharedPreferences;  
 import com.google.gson.Gson;  
 import com.google.gson.GsonBuilder;  
 import com.google.gson.reflect.TypeToken;  
 public class Sharedpref {  
      public static void writeList(Context context, List<String> list, String prefix)  
      {  
           String appname=context.getResources().getString(R.string.app_name)+"Arraylist";  
        SharedPreferences prefs = context.getSharedPreferences(appname, Context.MODE_PRIVATE);  
        SharedPreferences.Editor editor = prefs.edit();  
        int size = prefs.getInt(prefix+"_size", 0);  
        // clear the previous data if exists  
        for(int i=0; i<size; i++)  
          editor.remove(prefix+"_"+i);  
        // write the current list  
        for(int i=0; i<list.size(); i++)  
          editor.putString(prefix+"_"+i, list.get(i));  
        editor.putInt(prefix+"_size", list.size());  
        editor.commit();  
      }  
      public static List<String> readList (Context context, String prefix)  
      {  
           String appname=context.getResources().getString(R.string.app_name)+"Arraylist";  
        SharedPreferences prefs = context.getSharedPreferences(appname, Context.MODE_PRIVATE);  
        int size = prefs.getInt(prefix+"_size", 0);  
        List<String> data = new ArrayList<String>(size);  
        for(int i=0; i<size; i++)  
          data.add(prefs.getString(prefix+"_"+i, null));  
        return data;  
      }  
      public static void setPrefBoolean(Context context, String key, boolean value) {  
           String appname = context.getResources().getString(R.string.app_name)  
                     + "String";  
           SharedPreferences prefs = context.getSharedPreferences(appname,  
                     Context.MODE_PRIVATE);  
           SharedPreferences.Editor editor = prefs.edit();  
           editor.putBoolean(key, value);  
           editor.commit();  
      }  
      public static boolean getPrefBoolean(Context context, String key) {  
           String appname = context.getResources().getString(R.string.app_name)  
                     + "String";  
           SharedPreferences prefs = context.getSharedPreferences(appname,  
                     Context.MODE_PRIVATE);  
           boolean prefstr = prefs.getBoolean(key, false);  
           return prefstr;  
      }  
      public static void SetPrefString(Context context,String key, String value){  
           String appname=context.getResources().getString(R.string.app_name)+"String";  
        SharedPreferences prefs = context.getSharedPreferences(appname, Context.MODE_PRIVATE);  
        SharedPreferences.Editor editor = prefs.edit();  
        editor.putString(key, value);  
        editor.commit();  
        }  
      public static String GetPrefString(Context context,String key){  
           String appname=context.getResources().getString(R.string.app_name)+"String";  
             SharedPreferences prefs = context.getSharedPreferences(appname, Context.MODE_PRIVATE);  
        String prefstr = prefs.getString(key, "");  
        return prefstr;  
        }  
 }  
Use this custom logger for your own application, from these you can disable particular log type without deleting from activity

 import android.util.Log;  


 public class AppLog { 

      // Log levels (low to high) 

      // VERBOSE - 1,DEBUG - 2, INFO - 3, WARN - 4, ERROR -5 

      // Log.v(TAG, "verbose is active: " + Log.isLoggable(TAG, Log.VERBOSE)); 

      // Log.e(TAG, "debug is active: " + Log.isLoggable(TAG, Log.DEBUG)); 

      // Log.i(TAG, "info is active: " + Log.isLoggable(TAG, Log.INFO)); 

      // Log.w(TAG, "warn is active: " + Log.isLoggable(TAG, Log.WARN)); 

      // Log.e(TAG, "error is active: " + Log.isLoggable(TAG, Log.ERROR)); 

      public static boolean LOG_LEVEL_VERBOSE = true; 

      public static boolean LOG_LEVEL_DEBUG = true; 

      public static boolean LOG_LEVEL_INFO = true; 

      public static boolean LOG_LEVEL_WARN = true; 

      public static boolean LOG_LEVEL_ERROR = true; 

      public static void v(String TAG, String msg) { 

           if (Log.isLoggable(TAG, Log.VERBOSE) && LOG_LEVEL_VERBOSE) { 

                Log.v(TAG, msg); 

           } 

      } 

      public static void d(String TAG, String msg) { 

           if (Log.isLoggable(TAG, Log.DEBUG) && LOG_LEVEL_DEBUG) { 

                Log.e(TAG, msg); 

           } 

      } 

      public static void i(String TAG, String msg) { 

           if (Log.isLoggable(TAG, Log.INFO) && LOG_LEVEL_INFO) { 

                Log.i(TAG, msg); 

           } 

      } 

      public static void w(String TAG, String msg) { 

           if (Log.isLoggable(TAG, Log.WARN) && LOG_LEVEL_WARN) { 

                Log.w(TAG, msg); 

           } 

      } 

      public static void e(String TAG, String msg) { 

           if (Log.isLoggable(TAG, Log.ERROR) && LOG_LEVEL_ERROR) { 

                Log.e(TAG, msg); 

           } 

      } 

 } 
Coming Soon....

Screenshots:

Description
Ringer Toggle is easy to toggle phone ringer mode.
Attractive Widget for Ringer Mode such as
* Sound on
* Mute
* Vibrate

Screenshots

Download


Description
This is Simplest Widget for Tethering Shortcut.
Just one click to Tethering Shortcut for
*USB tethering
*Portable Wi-Fi hotspot

Screenshots

Download



Implementation of Google Maps v2 steps

1. Download and install Google Play Services.
2. Import Google Play Services Library in Eclipse by selecting from 
android-sdk-windows\extras\google\google_play_services\libproject\google-play-services_lib
3. Generate SHA-1 fingerprint using java Keytool (Refer : Generate MD5 ).
4. Create Google project in Google API console
5. Turn on Google Maps Android API v2 from Services.
6. Create new Android Key by entering SHA 1 key and package name separated by semicolon(;).
7. Create new project and select google play services library that already imported.
8. Modify & Add Permissions in AndroidManifest.xml
      Add Map key:
 <meta-data  
    android:name="com.google.android.maps.v2.API_KEY"  
    android:value="AdW3rfecsfDerf3a-M5JO9p6wksdfweEW3o" />  

      Add Permissions:
 <xml version="1.0" encoding="utf-8"?>  
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
   package="your_package_name"  
   android:versionCode="1"  
   android:versionName="1.0" >  
   <permission  
     android:name="your_package_name.permission.MAPS_RECEIVE"  
     android:protectionLevel="signature" />  
   <uses-permission android:name="your_package_name.permission.MAPS_RECEIVE" />  
   <uses-sdk  
     android:minSdkVersion="12"  
     android:targetSdkVersion="17" />  
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />  
   <uses-permission android:name="android.permission.INTERNET" />  
   <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />  
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />  
   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />  
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />  
   <uses-feature  
     android:glEsVersion="0x00020000"  
     android:required="true" />  
   <application  
     android:allowBackup="true"  
     android:icon="@drawable/ic_launcher"  
     android:label="@string/app_name">  
     <activity  
       android:name="your_package_name.MainActivity"  
       android:label="@string/app_name"  
       android:theme="@style/AppBaseTheme">  
       <intent-filter>  
         <action android:name="android.intent.action.MAIN" />  
         <category android:name="android.intent.category.LAUNCHER" />  
       </intent-filter>  
     </activity>  
     <meta-data  
       android:name="com.google.android.maps.v2.API_KEY"  
       android:value="AdW3rfecsfDerf3a-M5JO9p6wksdfweEW3o" />  
   </application>  
 </manifest>  

9. Create MapsFragement for google map on activity by add fragment in activity.xml
 <fragment  
     android:id="@+id/map"  
     android:name="com.google.android.gms.maps.MapFragment"  
     android:layout_width="match_parent"  
     android:layout_height="match_parent"/>  

10. Add the following code in your MainmapActivity.java 
 public class MainmapActivity extends Activity {  
   // Google Map  
   private GoogleMap googleMap;  
   @Override  
   protected void onCreate(Bundle savedInstanceState) {  
     super.onCreate(savedInstanceState);  
     setContentView(R.layout.activity_main);  
     try {  
       // Loading map  
       initilizeMap();  
     } catch (Exception e) {  
       e.printStackTrace();  
     }  
   }  
   /**  
    * function to load map. If map is not created it will create it for you  
    * */  
   private void initilizeMap() {  
     if (googleMap == null) {  
       googleMap = ((MapFragment) getFragmentManager().findFragmentById(  
           R.id.map)).getMap();  
       // check if map is created successfully or not  
       if (googleMap == null) {  
         Toast.makeText(getApplicationContext(),  
             "Sorry! unable to create maps", Toast.LENGTH_SHORT)  
             .show();  
       }  
     }  
   }  
   @Override  
   protected void onResume() {  
     super.onResume();  
     initilizeMap();  
   }  
 }  
11. Run your project and congratulations if you see a map displaying on your device.