<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/&quot;CkEHRnk6fip7ImA9WhRQEko.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247</id><updated>2011-12-07T07:10:37.716-08:00</updated><category term='Android'/><title>montercodz</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default?redirect=false&amp;v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry gd:etag='W/&quot;CU8CQHc6fip7ImA9WhRQEk4.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247.post-4759870341976701900</id><published>2011-12-06T20:54:00.000-08:00</published><updated>2011-12-06T20:57:41.916-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2011-12-06T20:57:41.916-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title>Android add image to spinner</title><content type='html'>This example you will learn how to add image to the spinner. so you need to have 2 xml file. one is your spinner list item, and the other one is your main.xml&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-cgjgNOMrPhU/Tt7xu9blaJI/AAAAAAAAAFg/H7o7qU8q_-I/s1600/SC20111207-114605.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-cgjgNOMrPhU/Tt7xu9blaJI/AAAAAAAAAFg/H7o7qU8q_-I/s320/SC20111207-114605.png" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
item_list.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="xml"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    &gt;
&lt;ImageView android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:id="@+id/image"
	android:src="@drawable/icon"&gt;
&lt;/ImageView&gt;
&lt;TextView  
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="imagetext"
    android:id="@+id/imagetext"
    /&gt;
&lt;/LinearLayout&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
main.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="xml"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    &gt;
&lt;Spinner android:layout_width="fill_parent"
	android:layout_height="wrap_content"
	android:id="@+id/spin"&gt;
&lt;/Spinner&gt;
&lt;/LinearLayout&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
PutImageToSpinnerExample.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 500px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="java"&gt;package example.com;

import java.util.ArrayList;

public class PutImageToSpinnerExample extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ArrayList&lt;HashMap&lt;String, Object&gt;&gt; list = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();
        HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
        map.put("Name", "Item One");
        map.put("Icon", R.drawable.icon);
        list.add(map);

        map = new HashMap&lt;String, Object&gt;();
        map.put("Name", "Item Two");
        map.put("Icon", R.drawable.icon);
        list.add(map);

        Spinner spin = (Spinner) findViewById(R.id.spin);
        myAdapter adapter = new myAdapter(getApplicationContext(), list,
                R.layout.item_list, new String[] { "Name", "Icon" },
                new int[] { R.id.imagetext, R.id.image });

        spin.setAdapter(adapter);
    }
}

class myAdapter extends SimpleAdapter {
	
	private Context mcontext;
    public myAdapter(Context context, List&lt;? extends Map&lt;String, ?&gt;&gt; data,
            int resource, String[] from, int[] to) {
        super(context, data, resource, from, to);
        
        mcontext = context;

    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    	LayoutInflater object = (LayoutInflater)mcontext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    	   if (convertView == null) {
               convertView = object.inflate(R.layout.item_list,
                       null);
           }

           HashMap&lt;String, Object&gt; data = (HashMap&lt;String, Object&gt;) getItem(position);

           ((TextView) convertView.findViewById(R.id.imagetext))
                   .setText((String) data.get("Name"));
           ((ImageView) convertView.findViewById(R.id.image))
                   .setImageResource((Integer) data.get("Icon"));

           return convertView;
    }

}
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6896644507541678247-4759870341976701900?l=montercodz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/4759870341976701900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-add-image-to-spinner.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/4759870341976701900?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/4759870341976701900?v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-add-image-to-spinner.html' title='Android add image to spinner'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-cgjgNOMrPhU/Tt7xu9blaJI/AAAAAAAAAFg/H7o7qU8q_-I/s72-c/SC20111207-114605.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;C0EAR38yfCp7ImA9WhRQEk4.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247.post-2452279069413678981</id><published>2011-12-06T20:20:00.000-08:00</published><updated>2011-12-06T20:20:46.194-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2011-12-06T20:20:46.194-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title>Android ExifInterface Example</title><content type='html'>ExifInterface class you to get metadata of your image.&amp;nbsp;for example it get image taken date, Location you take the picture, image orientation etc&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-OyMGCySazPw/Tt7oZSn0ryI/AAAAAAAAAFQ/OdYkWdf05hE/s1600/AndroidSelectImage_05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-OyMGCySazPw/Tt7oZSn0ryI/AAAAAAAAAFQ/OdYkWdf05hE/s320/AndroidSelectImage_05.png" width="192" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
exifFile.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 500px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="java"&gt;import java.io.File;
import java.io.IOException;

import android.app.Activity;
import android.database.Cursor;
import android.media.ExifInterface;
import android.net.Uri;
import android.provider.MediaStore;

public class MyExif {

private File exifFile;    //It's the file passed from constructor
private String exifFilePath;  //file in Real Path format
private Activity parentActivity; //Parent Activity

private String exifFilePath_withoutext;
private String ext;

private ExifInterface exifInterface;
private Boolean exifValid = false;;

//Exif TAG
//for API Level 8, Android 2.2
private String exif_DATETIME = "";
private String exif_FLASH = "";
private String exif_FOCAL_LENGTH = "";
private String exif_GPS_DATESTAMP = "";
private String exif_GPS_LATITUDE = "";
private String exif_GPS_LATITUDE_REF = "";
private String exif_GPS_LONGITUDE = "";
private String exif_GPS_LONGITUDE_REF = "";
private String exif_GPS_PROCESSING_METHOD = "";
private String exif_GPS_TIMESTAMP = "";
private String exif_IMAGE_LENGTH = "";
private String exif_IMAGE_WIDTH = "";
private String exif_MAKE = "";
private String exif_MODEL = "";
private String exif_ORIENTATION = "";
private String exif_WHITE_BALANCE = "";

//Constructor from path
MyExif(String fileString, Activity parent){
 exifFile = new File(fileString);
 parentActivity = parent;
 exifFilePath = fileString;
 PrepareExif();
}

//Constructor from URI
MyExif(Uri fileUri, Activity parent){
 exifFile = new File(fileUri.toString());
 parentActivity = parent;
 exifFilePath = getRealPathFromURI(fileUri);
 PrepareExif();
}

private void PrepareExif(){

 int dotposition= exifFilePath.lastIndexOf(".");
 exifFilePath_withoutext = exifFilePath.substring(0,dotposition);
 ext = exifFilePath.substring(dotposition + 1, exifFilePath.length());

 if (ext.equalsIgnoreCase("jpg")){
  try {
   exifInterface = new ExifInterface(exifFilePath);
   ReadExifTag();
   exifValid = true;
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
 }
}

private void ReadExifTag(){

 exif_DATETIME = exifInterface.getAttribute(ExifInterface.TAG_DATETIME);
 exif_FLASH = exifInterface.getAttribute(ExifInterface.TAG_FLASH);
 exif_FOCAL_LENGTH = exifInterface.getAttribute(ExifInterface.TAG_FOCAL_LENGTH);
 exif_GPS_DATESTAMP = exifInterface.getAttribute(ExifInterface.TAG_GPS_DATESTAMP);
 exif_GPS_LATITUDE = exifInterface.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
 exif_GPS_LATITUDE_REF = exifInterface.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
 exif_GPS_LONGITUDE = exifInterface.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
 exif_GPS_LONGITUDE_REF = exifInterface.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);
 exif_GPS_PROCESSING_METHOD = exifInterface.getAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD);
 exif_GPS_TIMESTAMP = exifInterface.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP);
 exif_IMAGE_LENGTH = exifInterface.getAttribute(ExifInterface.TAG_IMAGE_LENGTH);
 exif_IMAGE_WIDTH = exifInterface.getAttribute(ExifInterface.TAG_IMAGE_WIDTH);
 exif_MAKE = exifInterface.getAttribute(ExifInterface.TAG_MAKE);
 exif_MODEL = exifInterface.getAttribute(ExifInterface.TAG_MODEL);
 exif_ORIENTATION = exifInterface.getAttribute(ExifInterface.TAG_ORIENTATION);
 exif_WHITE_BALANCE = exifInterface.getAttribute(ExifInterface.TAG_WHITE_BALANCE);

}

private String getRealPathFromURI(Uri contentUri) {
      String[] proj = { MediaStore.Images.Media.DATA };
      Cursor cursor = parentActivity.managedQuery(contentUri, proj, null, null, null);
      int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
      cursor.moveToFirst();
      return cursor.getString(column_index);
  }

public String getSummary(){
 if(!exifValid){
  return ("Invalide EXIF!");
 }else{
  return( exifFilePath + " : \n" +

    "Name without extension: " + exifFilePath_withoutext + "\n" +
    "with extension: " + ext + "\n" +
   
    //"Date Time: " + exif_DATETIME + "\n" +
    //"Flash: " + exif_FLASH + "\n" +
    //"Focal Length: " + exif_FOCAL_LENGTH + "\n" +
    //"GPS Date Stamp: " + exif_GPS_DATESTAMP + "\n" +
    "GPS Latitude: " + exif_GPS_LATITUDE + "\n" +
    "GPS Latitute Ref: " + exif_GPS_LATITUDE_REF + "\n" +
    "GPS Longitude: " + exif_GPS_LONGITUDE + "\n" +
    "Orientation: " + exif_ORIENTATION + "\n" +
    "GPS Longitude Ref: " + exif_GPS_LONGITUDE_REF);
    //"Processing Method: " + exif_GPS_PROCESSING_METHOD + "\n" +
    //"GPS Time Stamp: " + exif_GPS_TIMESTAMP + "\n" +
    //"Image Length: " + exif_IMAGE_LENGTH + "\n" +
    //"Image Width: " + exif_IMAGE_WIDTH + "\n" +
    //"Make: " + exif_MAKE + "\n" +
    //"Model: " + exif_MODEL + "\n" +
    //"Orientation: " + exif_ORIENTATION + "\n" +
    //"White Balance: " + exif_WHITE_BALANCE + "\n");
 }
}

public void UpdateGeoTag(){
 //with dummy data
 final String DUMMY_GPS_LATITUDE = "22/1,21/1,299295/32768";
 final String DUMMY_GPS_LATITUDE_REF = "N";
 final String DUMMY_GPS_LONGITUDE = "114/1,3/1,207045/4096";
 final String DUMMY_GPS_LONGITUDE_REF = "E";

 exifInterface.setAttribute(ExifInterface.TAG_GPS_LATITUDE, DUMMY_GPS_LATITUDE);
 exifInterface.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, DUMMY_GPS_LATITUDE_REF);
 exifInterface.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, DUMMY_GPS_LONGITUDE);
 exifInterface.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, DUMMY_GPS_LONGITUDE_REF);
 try {
  exifInterface.saveAttributes();
 } catch (IOException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }


}
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
ExifInterfaceExample.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 500px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="java"&gt;import java.io.File;
import java.io.FileNotFoundException;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class ExifInterfaceExample extends Activity {
 TextView textTargetUri;
 ImageView targetImage;
 Button buttonSaveImage;

 File targetFile;
 String exifAttribute;
 MyExif myExif;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button buttonLoadImage = (Button)findViewById(R.id.loadimage);
        buttonSaveImage = (Button)findViewById(R.id.saveimage);
        textTargetUri = (TextView)findViewById(R.id.targeturi);
        targetImage = (ImageView)findViewById(R.id.targetimage);
      
        buttonLoadImage.setOnClickListener(new Button.OnClickListener(){

    @Override
    public void onClick(View arg0) {
     // TODO Auto-generated method stub
     buttonSaveImage.setEnabled(false);
     Intent intent = new Intent(Intent.ACTION_PICK,
       android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
     startActivityForResult(intent, 0);
    }});
      
        buttonSaveImage.setOnClickListener(new Button.OnClickListener(){

    @Override
    public void onClick(View arg0) {
     // TODO Auto-generated method stub
     myExif.UpdateGeoTag(); //with dummy data
    }});
    }

  @Override
  protected void onActivityResult(int requestCode,
    int resultCode, Intent data) {
   // TODO Auto-generated method stub
   super.onActivityResult(requestCode, resultCode, data);

   if (resultCode == RESULT_OK){
    Uri targetUri = data.getData();
   
    Bitmap bitmap;
    try {
     bitmap = BitmapFactory.decodeStream(getContentResolver()
       .openInputStream(targetUri));
     targetImage.setImageBitmap(bitmap);
     buttonSaveImage.setEnabled(true);
    } catch (FileNotFoundException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    }
   
    myExif = new MyExif(targetUri, this);
    textTargetUri.setText(myExif.getSummary());
   }
  }
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
main.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="xml"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  &gt;
&lt;TextView
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="@string/hello"
  /&gt;
&lt;Button
  android:id="@+id/loadimage"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Load Image"
  /&gt;
&lt;Button
  android:id="@+id/saveimage"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Update Geo Tag (with DUMMY data)"
  android:enabled="false"
  /&gt;
&lt;TextView
  android:id="@+id/targeturi"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  /&gt;
&lt;ImageView
  android:id="@+id/targetimage"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  /&gt;
&lt;/LinearLayout&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6896644507541678247-2452279069413678981?l=montercodz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/2452279069413678981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-exifinterface-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/2452279069413678981?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/2452279069413678981?v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-exifinterface-example.html' title='Android ExifInterface Example'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-OyMGCySazPw/Tt7oZSn0ryI/AAAAAAAAAFQ/OdYkWdf05hE/s72-c/AndroidSelectImage_05.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;D0ANSXg8eyp7ImA9WhRQEUg.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247.post-7855767410793140343</id><published>2011-12-05T23:16:00.000-08:00</published><updated>2011-12-05T23:16:38.673-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2011-12-05T23:16:38.673-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title>Android how to rotate Image</title><content type='html'>This tutorial will show you how to rotate image.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Pc2jTWgWa9o/Tt3BR81oIyI/AAAAAAAAAFI/CC1lY2kNiN8/s1600/SC20111206-141253.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-Pc2jTWgWa9o/Tt3BR81oIyI/AAAAAAAAAFI/CC1lY2kNiN8/s320/SC20111206-141253.png" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
main.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="xml" name="code"&gt;&lt;linearlayout android:background="#ffffff" android:id="@+id/LinearLayout01" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
 &lt;imageview android:id="@+id/ImageView01" android:layout_height="200dp" android:layout_width="200dp" android:src="@drawable/icon"&gt;
 &lt;button android:id="@+id/btn" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="rotate"&gt;
 &lt;/button&gt;
&lt;/imageview&gt;&lt;/linearlayout&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
RotateImage.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 500px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="java" name="code"&gt;import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class RotateImage extends Activity {
 private ImageView img;
 private Button btn;
 private Bitmap bmp;
 private int r = 0;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        img=(ImageView)findViewById(R.id.ImageView01);
        btn = (Button)findViewById(R.id.btn);
        bmp = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
        btn.setOnClickListener(new View.OnClickListener() {
   
   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub
    r += 90;
    if(r &amp;gt;= 360) r=0;
    setRotation(r);
   }
  });
        
    }
    
    private void setRotation(int rotate){
      // Getting width &amp;amp; height of the given image.
        int w = bmp.getWidth();
        int h = bmp.getHeight();
        // Setting post rotate to 90
        Matrix mtx = new Matrix();
        mtx.postRotate(rotate);
        // Rotating Bitmap
        Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, w, h, mtx, true);
        BitmapDrawable bmd = new BitmapDrawable(rotatedBMP);

        img.setImageDrawable(bmd);
    }
}
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6896644507541678247-7855767410793140343?l=montercodz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/7855767410793140343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-how-to-rotate-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/7855767410793140343?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/7855767410793140343?v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-how-to-rotate-image.html' title='Android how to rotate Image'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-Pc2jTWgWa9o/Tt3BR81oIyI/AAAAAAAAAFI/CC1lY2kNiN8/s72-c/SC20111206-141253.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;D0UCQn0zfSp7ImA9WhRQEUg.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247.post-2161859093549843170</id><published>2011-12-05T23:07:00.000-08:00</published><updated>2011-12-05T23:07:43.385-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2011-12-05T23:07:43.385-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title>Android flash Screen example</title><content type='html'>This tutorial show you about android flash Screen&lt;br /&gt;
first you need to have 2 xml file. one is for you flash screen, and the other is for your main&lt;br /&gt;
&lt;br /&gt;
flash.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="xml" name="code"&gt;&lt;linearlayout android:background="@drawable/flash" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;textview android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="@string/splash_screen"&gt;
&lt;/textview&gt;&lt;/linearlayout&gt;

&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
main.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="xml" name="code"&gt;&lt;linearlayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;textview android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="@string/main_screen"&gt;
&lt;/textview&gt;&lt;/linearlayout&gt;

&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
SplashScreen.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 400px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="java" name="code"&gt;import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;

public class SplashScreen extends Activity {
    protected boolean _active = true;
    protected int _splashTime = 5000;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
        
        // thread for displaying the SplashScreen
        Thread splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    int waited = 0;
                    while(_active &amp;amp;&amp;amp; (waited &amp;lt; _splashTime)) {
                        sleep(100);
                        if(_active) {
                            waited += 100;
                        }
                    }
                } catch(InterruptedException e) {
                    // do nothing
                } finally {
                    finish();
                    Intent i = new Intent(getApplicationContext(),MyApp.class);
                    startActivity(i);
                    stop();
                }
            }
        };
        splashTread.start();
    }
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            _active = false;
        }
        return true;
    }
}
&lt;/pre&gt;&lt;/div&gt;MyApp.java &lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="java" name="code"&gt;package com.droidnova.android;

import android.app.Activity;
import android.os.Bundle;

public class MyApp extends Activity {
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
you will missing the drawable image so copy this image and pass it in your res/drawable&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Hd0DwiBNoG8/Tt2-mON_ijI/AAAAAAAAAFA/RHdCfcZh9rI/s1600/flash.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="192" src="http://3.bp.blogspot.com/-Hd0DwiBNoG8/Tt2-mON_ijI/AAAAAAAAAFA/RHdCfcZh9rI/s320/flash.JPG" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;flash.jpg&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
your Manifest.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="java"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.droidnova.android"
      android:versionCode="1"
      android:versionName="1.0"&gt;
    &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
        &lt;activity android:name=".SplashScreen"
                  android:label="@string/app_name"
                  android:screenOrientation="landscape"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:name=".MyApp"
        android:screenOrientation="landscape"&gt;
        &lt;/activity&gt;
    &lt;/application&gt;
    &lt;uses-sdk android:minSdkVersion="8" /&gt;
&lt;/manifest&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6896644507541678247-2161859093549843170?l=montercodz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/2161859093549843170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-flash-screen-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/2161859093549843170?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/2161859093549843170?v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-flash-screen-example.html' title='Android flash Screen example'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-Hd0DwiBNoG8/Tt2-mON_ijI/AAAAAAAAAFA/RHdCfcZh9rI/s72-c/flash.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;CUYNSX8zeSp7ImA9WhRQEUg.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247.post-7877748529053093071</id><published>2011-12-05T22:32:00.000-08:00</published><updated>2011-12-05T22:33:18.181-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2011-12-05T22:33:18.181-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title>Android get image from gallery</title><content type='html'>This tutorial you will learn how to get image from gallery and set to imageview.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-lNvjnrvXJ6Y/Tt222hp0S8I/AAAAAAAAAE4/hjyuNGeJH_Y/s1600/SC20111206-132814.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-lNvjnrvXJ6Y/Tt222hp0S8I/AAAAAAAAAE4/hjyuNGeJH_Y/s320/SC20111206-132814.png" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
main.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 300px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="xml" name="code"&gt;&lt;linearlayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;linearlayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal"&gt;
     &lt;button android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="GetImageFromGallery"&gt;
  &lt;/button&gt;
  &lt;button android:id="@+id/button2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="DeleteImage"&gt;
  &lt;/button&gt;
    &lt;/linearlayout&gt;

&lt;imageview android:id="@+id/iv1" android:layout_height="200dp" android:layout_width="200dp" android:src="@drawable/icon"&gt;
&lt;/imageview&gt;
&lt;/linearlayout&gt;

&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
GetImageFromGalleryExample.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 500px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="java" name="code"&gt;package example.com.test;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;

public class GetImageFromGalleryExample extends Activity implements OnClickListener {
 private static final int SELECT_PICTURE = 1;
 private String selectedImagePath = null;
 private ImageView iv;
 private Button button,button1;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        button = (Button)findViewById(R.id.button1);
        button1 = (Button)findViewById(R.id.button2);
        iv = (ImageView)findViewById(R.id.iv1);
        button.setOnClickListener(this);
        button1.setOnClickListener(this);
    }
    
    public String getPath(Uri uri) {
        String[] projection = { MediaStore.Images.Media.DATA };
        Cursor cursor = managedQuery(uri, projection, null, null, null);
        int column_index = cursor
                .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
        cursor.moveToFirst();
        return cursor.getString(column_index);
    }
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
     // TODO Auto-generated method stub
     super.onActivityResult(requestCode, resultCode, data);
     if (resultCode == RESULT_OK) {
            if (requestCode == SELECT_PICTURE) {
                Uri selectedImageUri = data.getData();
                //SelectedImagePath is not use in this tutorial but you can use it when ever u want
                //selectedImagePath = getPath(selectedImageUri);
                iv.setImageURI(selectedImageUri);
            }
        }
    }

 @Override
 public void onClick(View v) {
  // TODO Auto-generated method stub
  if (v == button){
   Intent intent = new Intent();
            intent.setType("image/*");
            intent.putExtra("scale", true);
            intent.setAction(Intent.ACTION_GET_CONTENT);
            startActivityForResult(Intent.createChooser(intent,"Select Picture"), SELECT_PICTURE);
  }else{
   iv.setImageResource(R.drawable.icon);
  }
 }
}
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6896644507541678247-7877748529053093071?l=montercodz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/7877748529053093071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-get-image-from-gallery-and-set.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/7877748529053093071?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/7877748529053093071?v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-get-image-from-gallery-and-set.html' title='Android get image from gallery'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-lNvjnrvXJ6Y/Tt222hp0S8I/AAAAAAAAAE4/hjyuNGeJH_Y/s72-c/SC20111206-132814.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;CEQEQ348fyp7ImA9WhRQEUk.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247.post-957570471284188396</id><published>2011-12-03T05:55:00.000-08:00</published><updated>2011-12-05T19:31:42.077-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2011-12-05T19:31:42.077-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title>Android RadioButton Example</title><content type='html'>RadioButton is used to select any one option from the given group.&lt;br /&gt;
&lt;br /&gt;
In Android by using RadioGroup only we can use RadioButton. We can add any number of RadioButtons to a single RadioGroup. we can add any number of RadioGroup to a single Layout.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-4uOQWvnh8iw/TtoprcB-hmI/AAAAAAAAADA/fELlbue5-lw/s1600/radiobuttonexample.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="249" src="http://2.bp.blogspot.com/-4uOQWvnh8iw/TtoprcB-hmI/AAAAAAAAADA/fELlbue5-lw/s320/radiobuttonexample.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
main.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 300px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="xml"&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical" android:layout_width="fill_parent"
     android:layout_height="fill_parent"&gt;
     &lt;TextView android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textStyle="bold"
          android:text="APK Extension?" /&gt;
     &lt;RadioGroup android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:id="@+id/QueGroup1"&gt;
     &lt;RadioButton android:checked="false"
          android:id="@+id/option1"
          android:text="Android Package"/&gt;
     &lt;RadioButton android:checked="false"
          android:id="@+id/option2"
          android:text="Android Platform"/&gt;
     &lt;/RadioGroup&gt;
     &lt;LinearLayout android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical"&gt;
          &lt;TextView android:id="@+id/TextView01"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Selected is : "&gt;
          &lt;/TextView&gt;
          &lt;Button android:layout_width="100px"
              android:layout_height="wrap_content"
              android:text="Confirm Selection"
              android:id="@+id/selected"/&gt;
     &lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
RadioButtonExample.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 500px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre name="code" class="java"&gt;import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;

public class RadioButtonExample extends Activity implements OnClickListener {
     private RadioButton rb1;
     private RadioButton rb2;
     private Button b1;
     private TextView t1;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        rb1=(RadioButton)findViewById(R.id.option1);
        rb2=(RadioButton)findViewById(R.id.option2);
        b1=(Button)findViewById(R.id.selected);
        b1.setOnClickListener(this);
        t1=(TextView)findViewById(R.id.TextView01);
    }
     @Override
     public void onClick(View v) {
          // TODO Auto-generated method stub
          if(v == b1){
          if(rb1.isChecked() == true)
              t1.setText("Selected is : "+rb1.getText());
          if(rb2.isChecked() == true)
              t1.setText("Selected is : "+rb2.getText());
          }
     }
}
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6896644507541678247-957570471284188396?l=montercodz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/957570471284188396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-radiobutton-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/957570471284188396?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/957570471284188396?v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-radiobutton-example.html' title='Android RadioButton Example'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-4uOQWvnh8iw/TtoprcB-hmI/AAAAAAAAADA/fELlbue5-lw/s72-c/radiobuttonexample.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DkUNSHY9eyp7ImA9WhRQEUg.&quot;'><id>tag:blogger.com,1999:blog-6896644507541678247.post-1498126533195851084</id><published>2011-12-01T19:38:00.000-08:00</published><updated>2011-12-05T22:51:39.863-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2011-12-05T22:51:39.863-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title>Android get image from camera</title><content type='html'>In order to get image from camera we need to use Intent of "MediaStore.ACTION_IMAGE_CAPTURE", we can request Android build-in Camera App or other Service Provider to take picture.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-MBa4B6W9MRM/TthPk8yOROI/AAAAAAAAAC4/0qKZxYaZEhs/s1600/AndroidImageCapture_01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-MBa4B6W9MRM/TthPk8yOROI/AAAAAAAAAC4/0qKZxYaZEhs/s1600/AndroidImageCapture_01.png" /&gt;&lt;/a&gt;&lt;/div&gt;main.xml&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 200px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="xml" name="code"&gt;&lt;linearlayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;textview android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="@string/hello"&gt;
&lt;button android:id="@+id/captureimage" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="Call for ACTION_IMAGE_CAPTURE"&gt;
&lt;imageview android:id="@+id/imagecaptured" android:layout_height="wrap_content" android:layout_width="wrap_content"&gt;


&lt;/imageview&gt;&lt;/button&gt;&lt;/textview&gt;&lt;/linearlayout&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
AndroidImageCapture.java&lt;br /&gt;
&lt;div style="background-color: bisque; border: 1px dashed 000000; color: black; font-family: arial; font-size: 12px; height: 500px; overflow: auto; padding: 4px; text-align: left; width: 600px;"&gt;&lt;pre class="java" name="code"&gt;package com.AndroidImageCapture;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
public class AndroidImageCapture extends Activity {
  
 ImageView imageiewImageCaptured;
  
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
       Button buttonImageCapture = (Button)findViewById(R.id.captureimage);
       imageiewImageCaptured = (ImageView)findViewById(R.id.imagecaptured);
       
       buttonImageCapture.setOnClickListener(buttonImageCaptureOnClickListener);
   }
   
   Button.OnClickListener buttonImageCaptureOnClickListener
   = new Button.OnClickListener(){
  @Override
  public void onClick(View arg0) {
   // TODO Auto-generated method stub
   Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
   startActivityForResult(intent, 0);
    
  }};
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  // TODO Auto-generated method stub
  super.onActivityResult(requestCode, resultCode, data);
   
  if (resultCode == RESULT_OK)
  {
   Bundle extras = data.getExtras();
   Bitmap bmp = (Bitmap) extras.get("data");
   imageiewImageCaptured.setImageBitmap(bmp); 
  }
   
 }
}
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
Manifest.xml&lt;br /&gt;
//Add permission for your camera&lt;br /&gt;
&lt;pre name="code" class="xml"&gt;&lt;uses-permission android:name="android.permission.CAMERA"/&gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6896644507541678247-1498126533195851084?l=montercodz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://montercodz.blogspot.com/feeds/1498126533195851084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-get-image-from-camera_01.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/1498126533195851084?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896644507541678247/posts/default/1498126533195851084?v=2'/><link rel='alternate' type='text/html' href='http://montercodz.blogspot.com/2011/12/android-get-image-from-camera_01.html' title='Android get image from camera'/><author><name>chi kheang</name><uri>http://www.blogger.com/profile/03127311943990766464</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://4.bp.blogspot.com/-XsRx9yCaFC0/Tt2VzWTjV-I/AAAAAAAAAEM/CaOGOa6KF_Y/s220/36065_442045986377_652536377_5720369_1643859_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-MBa4B6W9MRM/TthPk8yOROI/AAAAAAAAAC4/0qKZxYaZEhs/s72-c/AndroidImageCapture_01.png' height='72' width='72'/><thr:total>2</thr:total></entry></feed>