<?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/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6896317795307023389</id><updated>2026-10-08T00:46:14.584-07:00</updated><category term="Android"/><category term="Android Programming"/><category term="activity"/><category term="Android 4.1"/><category term="Android 4.0"/><category term="ADT Plugin"/><category term="Android Internals"/><category term="Android SDK"/><category term="Android4.1"/><category term="AndroidUI"/><category term="Content Providers"/><category term="Fragments"/><category term="Google"/><category term="Google Map"/><category term="IceCream Sandwich"/><category term="Jelly Bean"/><category term="JellyBean"/><category term="Location APIs"/><category term="Notification"/><category term="Permissions"/><category term="SensorEventListener"/><category term="activity life cycle"/><category term="facebook"/><category term="googlemap"/><category term="ADT 20.0.0"/><category term="ADT20.0.0"/><category term="AOSP"/><category term="API Level 16"/><category term="Absolute layout"/><category term="ActionBar"/><category term="ActionBar Code"/><category term="ActionBar XML"/><category term="AlerDialog"/><category term="Alert Dialog"/><category term="Andoird"/><category term="Android Apps"/><category term="Android Basics"/><category term="Android Beam"/><category term="Android Beam Code"/><category term="Android Building Group"/><category term="Android Development"/><category term="Android Development Tools"/><category term="Android Input Events"/><category term="Android Installer"/><category term="Android Location Apps"/><category term="Android OS"/><category term="Android OpenGL"/><category term="Android SDK Tools"/><category term="Android SDK support for older version"/><category term="Android SMS"/><category term="Android Sample"/><category term="Android Sensor framework"/><category term="Android Source Code"/><category term="Android TTS"/><category term="Android Tools"/><category term="Android Versions"/><category term="Android sensors"/><category term="Android3.0"/><category term="AndroidGames"/><category term="AndroidManifest.xml"/><category term="Apps"/><category term="AsyncTask"/><category term="Audio remote control"/><category term="Back Button"/><category term="Background Drawable"/><category term="Big Software"/><category term="Call Intent"/><category term="Camera"/><category term="ContactProvider"/><category term="ContentResolver"/><category term="DatePickerDialog"/><category term="Dialog"/><category term="DialogFragment"/><category term="Eclipse"/><category term="Event Handlers"/><category term="Event Listeners"/><category term="Frame layout"/><category term="Galaxy Nexus"/><category term="Google Now"/><category term="Google Place APIs"/><category term="Google Play"/><category term="Google Voice Search"/><category term="GridView"/><category term="Handler"/><category term="Hello World Android App"/><category term="Honeycomb"/><category term="Input Controls"/><category term="Intents"/><category term="JAVA"/><category term="Layouts"/><category term="Linear Layout"/><category term="List View"/><category term="ListView"/><category term="Location API"/><category term="Location Manager"/><category term="Menu"/><category term="Menus"/><category term="Message"/><category term="Message Box"/><category term="Mobile"/><category term="Mobile Apps"/><category term="Multiple density screen"/><category term="Nexus 7 tablet"/><category term="Notification Manager"/><category term="OpenGL"/><category term="OpenGL ES"/><category term="OptionMenu"/><category term="Overlay"/><category term="Parser Error"/><category term="Progress Bar"/><category term="ProgressDialog"/><category term="Project Butter"/><category term="Read Indox"/><category term="SMS"/><category term="Sample Android App"/><category term="SampleCode"/><category term="Screen Brightness"/><category term="Sensor"/><category term="SensorEvent"/><category term="SensorManager"/><category term="Signed Android Application Package"/><category term="Social Stream API Android 4.0.3"/><category term="Speech Engine"/><category term="SpeechEngine"/><category term="StrictMode in Android"/><category term="TTS"/><category term="TYPE_LIGHT"/><category term="TimePickerDialog"/><category term="Update in eclipse"/><category term="activity state"/><category term="android 4.1 source code"/><category term="android backward compatibility"/><category term="android life cycle"/><category term="android open facebook"/><category term="android-4.1.1._r1"/><category term="android.hardware"/><category term="apiKey"/><category term="decor View"/><category term="deploy android app on phone"/><category term="environmental sensors"/><category term="export apk"/><category term="facebook SDK for android"/><category term="facebook login"/><category term="hardware and software sensors"/><category term="live streaming"/><category term="logcat"/><category term="motion sensors"/><category term="networkonmainthreadexception"/><category term="social media"/><category term="social streams"/><category term="twitter apis"/><category term="vsync"/><title type='text'>Creative Android Apps</title><subtitle type='html'>Welcome all my visitors to the creative world of android apps. Creative Android Apps is a blog started for sharing the tips, ideas and code for android platform.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>83</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-81933262181831603</id><published>2013-03-23T11:09:00.002-07:00</published><updated>2013-03-23T11:09:19.021-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Google Voice Search"/><category scheme="http://www.blogger.com/atom/ns#" term="Speech Engine"/><title type='text'>Speech to Text Using Android SDK</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Speech to Text using Android APIs&lt;/b&gt;&lt;/h2&gt;
&lt;br /&gt;
You can create a simple application using the google speech engine and convert the voice to text.&lt;br /&gt;
&lt;br /&gt;
Create an android project and create the following res layout&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:layout_above=&quot;@+id/textView1&quot;
    android:layout_toLeftOf=&quot;@+id/textView1&quot;
    android:gravity=&quot;center&quot;
    android:orientation=&quot;vertical&quot; &amp;gt;
 
    &amp;lt;ImageButton
        android:id=&quot;@+id/btnSpeak&quot;
        android:layout_width=&quot;fill_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:layout_margin=&quot;10dp&quot;
        android:layout_marginRight=&quot;10dp&quot;
        android:layout_marginTop=&quot;10dp&quot;
         /&amp;gt;
 
    &amp;lt;TextView
        android:id=&quot;@+id/txtText&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:layout_marginLeft=&quot;10dp&quot;
        android:layout_marginRight=&quot;10dp&quot;
        android:layout_marginTop=&quot;10dp&quot;
        android:textAppearance=&quot;?android:attr/textAppearanceLarge&quot; /&amp;gt;
 
&amp;lt;/LinearLayout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Now you can use the following activity code to add in your sample application.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.speech2text;

import java.util.ArrayList;
 
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
 
public class MainActivity extends Activity {
 
    protected static final int RESULT_SPEECH = 1;
 
    private ImageButton btnSpeak;
    private TextView txtText;
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        txtText = (TextView) findViewById(R.id.txtText);
 
        btnSpeak = (ImageButton) findViewById(R.id.btnSpeak);
 
        btnSpeak.setOnClickListener(new View.OnClickListener() {
 
            @Override
            public void onClick(View v) {
 
                Intent intent = new Intent(
                        RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
 
                intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, &quot;en-US&quot;);
 
                try {
                    startActivityForResult(intent, RESULT_SPEECH);
                    txtText.setText(&quot;&quot;);
                } catch (ActivityNotFoundException a) {
                    Toast t = Toast.makeText(getApplicationContext(),
                            &quot;Opps! Your device doesn&#39;t support Speech to Text&quot;,
                            Toast.LENGTH_SHORT);
                    t.show();
                }
            }
        });
 
    }
 
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
 
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
 
        switch (requestCode) {
        case RESULT_SPEECH: {
            if (resultCode == RESULT_OK &amp;amp;&amp;amp; null != data) {
 
                ArrayList&amp;lt;String&amp;gt; text = data
                        .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
 
                txtText.setText(text.get(0));
            }
            break;
        }
 
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/81933262181831603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/speech-to-text-using-android-sdk.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/81933262181831603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/81933262181831603'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/speech-to-text-using-android-sdk.html' title='Speech to Text Using Android SDK'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-1634803008614611825</id><published>2013-03-21T22:14:00.000-07:00</published><updated>2013-03-21T22:14:05.371-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android TTS"/><category scheme="http://www.blogger.com/atom/ns#" term="SpeechEngine"/><category scheme="http://www.blogger.com/atom/ns#" term="TTS"/><title type='text'>Using Speech Engine in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
This post is focusing on speech engine in Android SDK. The TTS engine is very important component of the Android SDK and the Android 4.0 version has great APIs to write the custom TTS engines.&lt;br /&gt;
&lt;br /&gt;
Here i am explaining a sample code to use the TTS engine in your android application.&lt;br /&gt;
&lt;br /&gt;
Create the following layout in your android application.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:orientation=&quot;vertical&quot;
    android:layout_height=&quot;match_parent&quot; &amp;gt;

&amp;lt;TextView android:id=&quot;@+id/msglabel&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:text=&quot;Enter some text in english:&quot;
/&amp;gt;
&amp;lt;EditText android:id=&quot;@+id/inputtext&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
/&amp;gt;
&amp;lt;Button android:id=&quot;@+id/speakenglish&quot;
    android:layout_width=&quot;wrap_content&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:text=&quot;speak in english&quot;
/&amp;gt;

&amp;lt;/LinearLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Here is the code of the sample speak activity you can just copy and paste this in your application project.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.speaksample;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

import android.app.Activity;
import android.os.Bundle;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.view.View;
import android.widget.EditText;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.content.Intent;
import java.util.Locale;
import android.widget.Toast;

public class speaksample extends Activity implements OnClickListener, OnInitListener {
    //Create the TTS object
    private TextToSpeech TTSObject;
    //status check code
    private int DATA_CHECK_CODE = 0;
        //create the Activity
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_speaking_android);
                //get a reference to the button element listed in the XML layout
            Button speakButton = (Button)findViewById(R.id.speakenglish);
                //set the click listener
            speakButton.setOnClickListener(this);
            //check for TTS data
            Intent checkTTSIntent = new Intent();
            checkTTSIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
            startActivityForResult(checkTTSIntent, DATA_CHECK_CODE);
    }
        //respond to button clicks
    public void onClick(View v) {
            //get the text entered
            EditText inputtext = (EditText)findViewById(R.id.inputtext);
            String data = inputtext.getText().toString();
            speakInEnglish(data);
    }
        //speak the user text
    private void speakInEnglish(String speech) {
            //speak straight away
            TTSObject.speak(speech, TextToSpeech.QUEUE_FLUSH, null);
    }
        //act on result of TTS data check
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == DATA_CHECK_CODE) {
            if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
                //the user has the necessary data - create the TTS
            TTSObject = new TextToSpeech(this, this);
            }
            else {
                    //no data - install it now
                Intent installTTSIntent = new Intent();
                installTTSIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
                startActivity(installTTSIntent);
            }
        }
    }
        //setup TTS
    public void onInit(int initStatus) {
            //check for successful instantiation
        if (initStatus == TextToSpeech.SUCCESS) {
            if(TTSObject.isLanguageAvailable(Locale.US)==TextToSpeech.LANG_AVAILABLE)
                TTSObject.setLanguage(Locale.US);
        }
        else if (initStatus == TextToSpeech.ERROR) {
            Toast.makeText(this, &quot;TTS engine fails&quot;, Toast.LENGTH_LONG).show();
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
If you like the code please share your feedback.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/1634803008614611825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/using-speech-engine-in-android.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/1634803008614611825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/1634803008614611825'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/using-speech-engine-in-android.html' title='Using Speech Engine in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-6180628241011828721</id><published>2013-03-20T11:03:00.001-07:00</published><updated>2013-03-20T11:03:26.173-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android open facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><title type='text'>open a facebook page on browser in android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Open a facebook page in Android Application&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To open a facebook page in your android application you can create the following method and call this method in a class derived from activity&lt;br /&gt;
&lt;br /&gt;
This will run the facebook page of the user in a different activity window.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;public static Intent getOpenFacebookIntent(Activity acty,String szUserId,String szUserName) {

           try {
               acty.getBaseContext().getPackageManager().getPackageInfo(&quot;com.facebook.katana&quot;, 0);
            return new Intent(Intent.ACTION_VIEW, Uri.parse(&quot;fb://profile/&quot; + szUserId));
           } catch (Exception e) {
            return new Intent(Intent.ACTION_VIEW, Uri.parse(&quot;https://www.facebook.com/&quot; + szUserName));
           }
        }

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
If you like the code please provide your feedback.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/6180628241011828721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/open-facebook-page-on-browser-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6180628241011828721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6180628241011828721'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/open-facebook-page-on-browser-in-android.html' title='open a facebook page on browser in android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-706758459924828768</id><published>2013-03-20T10:57:00.001-07:00</published><updated>2013-03-20T10:57:40.597-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android SMS"/><category scheme="http://www.blogger.com/atom/ns#" term="ContentResolver"/><category scheme="http://www.blogger.com/atom/ns#" term="Read Indox"/><category scheme="http://www.blogger.com/atom/ns#" term="SMS"/><title type='text'>Android Read SMS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Reading the SMS inbox from Android phone&lt;br /&gt;
&lt;br /&gt;
Here is the quick way to read all the SMS stored in the inbox on android.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.csr.targetplus;

import java.util.List;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.database.Cursor;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import android.support.v4.app.NavUtils;

public class TargetPlus extends Activity {

    private static final String TAG = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView view = new TextView(this);
        Uri uriSMSURI = Uri.parse(&quot;content://sms/inbox&quot;);
        Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null);
        String sms = &quot;&quot;;
        while (cur.moveToNext()) {
            sms += &quot;From :&quot; + cur.getString(2) + &quot; : &quot; + cur.getString(11)+&quot;\n&quot;;         
        }
        view.setText(sms);
        setContentView(view);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_target_plus, menu);
        return true;
    }

    
}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/706758459924828768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/android-read-sms.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/706758459924828768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/706758459924828768'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2013/03/android-read-sms.html' title='Android Read SMS'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-5784081329816260676</id><published>2012-10-21T04:21:00.000-07:00</published><updated>2012-10-21T04:21:23.695-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Call Intent"/><title type='text'>call on a telephone number </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
This post is describing that how to make a call from the Android phone using&amp;nbsp;Intent.ACTION_CALL.&lt;br /&gt;
&lt;br /&gt;
Start a activity with as follows and pass your telephone number&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse(&quot;tel:&quot; + &amp;lt;your tel number&amp;gt;));
activity.startActivity(callIntent);
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
To check the state of the phone call and actions setup a call listener as follows&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;private class EndCallListener extends PhoneStateListener { 
    @Override
    public void onCallStateChanged(int state, String incomingNumber) {
        if(TelephonyManager.CALL_STATE_RINGING == state) {
            Log.i(&quot;contactus&quot;, &quot;RINGING, number: &quot; + incomingNumber);
        }
        if(TelephonyManager.CALL_STATE_OFFHOOK == state) {
            Log.i(&quot;contactus&quot;, &quot;OFFHOOK&quot;);
        }
        if(TelephonyManager.CALL_STATE_IDLE == state) {
            if (incomingNumber.equals(szListentelNumber) == true) {
                 Intent i = activity.getBaseContext().getPackageManager()
                        .getLaunchIntentForPackage(
                                activity.getBaseContext().getPackageName());
                    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                    activity.startActivity(i);
             }
            Log.i(&quot;contactus&quot;, &quot;IDLE&quot; + incomingNumber);
        }
    }
}
public void setUpCallListener(String szTelNumber) {
     this.szListentelNumber = szTelNumber;
     EndCallListener callListener = new EndCallListener();
     TelephonyManager mTM = (TelephonyManager)activity.getSystemService(Context.TELEPHONY_SERVICE);
     mTM.listen(callListener, PhoneStateListener.LISTEN_CALL_STATE);
    
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Enjoy the coding with Android and if you like this simple post please provide your feedback.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Creative Android Apps&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/5784081329816260676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/10/call-on-telephone-number.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/5784081329816260676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/5784081329816260676'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/10/call-on-telephone-number.html' title='call on a telephone number '/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-8525773235900923311</id><published>2012-08-02T04:27:00.001-07:00</published><updated>2012-08-02T04:35:21.248-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="AsyncTask"/><category scheme="http://www.blogger.com/atom/ns#" term="live streaming"/><category scheme="http://www.blogger.com/atom/ns#" term="social media"/><category scheme="http://www.blogger.com/atom/ns#" term="social streams"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter apis"/><title type='text'>Twitter Live Streaming - Sample Code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Social media is the key ingredient of applications and integrating the social media platform with mobile applications the key of success for your mobile applications.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The large social networks could not fit to one single mobile application increasing the&amp;nbsp;opportunity for all mobile developers to create more interesting and creative small apps for mobile devices with this social platforms.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Twitter is one of the popular social networking platform. The update on twitter is very fast as tweets are small in size. Twitter introduced the live streaming APIs to get the updates in real time from twitter live streaming service.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can integrate the twitter live streaming in your android application as described in this post.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Create a default activity project in eclipse for android and create the following layout for your application in activity_main.xml.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
android:layout_width=&quot;fill_parent&quot;
android:layout_height=&quot;fill_parent&quot;
android:orientation=&quot;vertical&quot; &amp;gt;
&amp;lt;Button
android:id=&quot;@+id/StartTweetsButton&quot;
android:layout_width=&quot;wrap_content&quot;
android:layout_height=&quot;wrap_content&quot;
android:layout_gravity=&quot;left&quot;
android:text=&quot;Start Tweets&quot;
android:onClick=&quot;startTweets&quot; /&amp;gt;
&amp;lt;Button
android:id=&quot;@+id/StopTweetsButton&quot;
android:layout_width=&quot;wrap_content&quot;
android:layout_height=&quot;wrap_content&quot;
android:layout_gravity=&quot;left&quot;
android:text=&quot;Stop Tweets&quot;
android:onClick=&quot;stopTweets&quot; /&amp;gt;
&amp;lt;EditText
android:id=&quot;@+id/SearchText&quot;
android:layout_width=&quot;match_parent&quot;
android:layout_height=&quot;wrap_content&quot; &amp;gt;
&amp;lt;/EditText&amp;gt;
&amp;lt;ListView android:id=&quot;@+id/TweetsList&quot;
android:layout_height=&quot;wrap_content&quot;
android:layout_width=&quot;fill_parent&quot;
&amp;gt;&amp;lt;/ListView&amp;gt;
&amp;lt;/LinearLayout&amp;gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now replace the default activity class code by the following code&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONObject;
import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;



public class MainActivity extends Activity implements View.OnClickListener {

    private List&amp;lt;HashMap&amp;lt;String,String&amp;gt;&amp;gt; mTweets = new ArrayList&amp;lt;HashMap&amp;lt;String,String&amp;gt;&amp;gt;();
    private SimpleAdapter mAdapter;
    private boolean m_Running = false;
    private String m_SearchKeyWord = &quot;&quot;;
    final int MAXLIST = 10;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //create a list view and bind with simple adapter
        mAdapter = new SimpleAdapter(this, mTweets, android.R.layout.simple_list_item_2, new String[] {&quot;Tweet&quot;, &quot;From&quot;}, new int[] {android.R.id.text1, android.R.id.text2});
        ListView lv = (ListView)findViewById(R.id.TweetsList);
        lv.setAdapter(mAdapter);
        //create a list view and bind with simple adapter
    }
   
    public class StreamTask extends AsyncTask&amp;lt;Context, Boolean, Boolean&amp;gt; {
        protected Boolean doInBackground(Context... arg0) {
            try
            {
            DefaultHttpClient client = new DefaultHttpClient();
            String userName = &quot;XXXXXXX&quot;;
            String password = &quot;XXXXXXX&quot;;
            UsernamePasswordCredentials creds = new UsernamePasswordCredentials(userName, password);
            client.getCredentialsProvider().setCredentials( new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT), creds);
            HttpGet request = new HttpGet();
            String m_SearchKeyWord = null;
            request.setURI(new URI(&quot;https://stream.twitter.com/1/statuses/filter.json?track=&quot; + m_SearchKeyWord));
            HttpResponse response = client.execute(request);
            InputStream in = response.getEntity().getContent();
            BufferedReader reader = new BufferedReader( new InputStreamReader(in) );
            handleTweets(reader);
            
            in.close();
            }
            catch (Exception e) {
            Log.e(&quot;SampleTwitter&quot;, &quot;doInBackground_&quot; + e.toString());
            }
            return true;
        }
         private void handleTweets( BufferedReader reader ) {
                try {
                    String line = &quot;&quot;;
                    
                    do
                    {
                        line = reader.readLine();
                        JSONObject tweet = new JSONObject(line);
                        HashMap&amp;lt;String, String&amp;gt; tweetMap = new HashMap&amp;lt;String, String&amp;gt;();
                        if (tweet.has(&quot;text&quot;)) {
                            Log.i(&quot;SampleTwitter&quot;,&quot;Tweet : &quot; + tweet.getString(&quot;text&quot;));
                            tweetMap.put(&quot;Tweet&quot;, tweet.getString(&quot;text&quot;));
                            tweetMap.put(&quot;From&quot;, tweet.getJSONObject(&quot;user&quot;) .getString(&quot;screen_name&quot;));
                            Log.i(&quot;SampleTwitter&quot;,&quot;From : &quot; + tweet.getJSONObject(&quot;user&quot;) .getString(&quot;screen_name&quot;));
                            mTweets.add(0, tweetMap);
                            if (mTweets.size() &amp;gt; MAXLIST) 
                            {
                                mTweets.remove(mTweets.size() - 1);
                            }
                            publishProgress(true);
                        }
                    } while (m_Running &amp;amp;&amp;amp; line.length() &amp;gt; 0);
                }
                catch (Exception e) {
                    Log.e(&quot;SampleTwitter&quot;, &quot;handleTweets_&quot; + e.toString());
                }
            }
         
        
    
        protected void onProgressUpdate(Boolean... values) {
            super.onProgressUpdate(values);
            mAdapter.notifyDataSetChanged();
            Log.d(&quot;SampleTwitter&quot;, &quot;Im in onProgressUpdate()&quot;);
        }
        
    }
    public void stopTweets(View view ) {
        m_Running = false;
        for(int idx=mTweets.size()-1;idx&amp;gt;=0;idx--)
            mTweets.remove(idx);
        if(mTweets.size() ==1)
            mTweets.remove(0);
        mAdapter.notifyDataSetChanged();
    }
   public void startTweets(View view) {
        
        if( m_Running == false ) 
        {
            EditText edt = (EditText)findViewById(R.id.SearchText);
            m_SearchKeyWord =  edt.getText().toString();
            if( m_SearchKeyWord.length() &amp;gt; 0 ) 
            {
                StreamTask st = new StreamTask();
                st.execute();
                m_Running = true;
                
            }
            else 
            {
                Toast.makeText(this, &quot;Please enter the search keyword&quot;, Toast.LENGTH_SHORT).show();
            }
        }
        else 
        {
            Toast.makeText(this, &quot;Already Running&quot;, Toast.LENGTH_SHORT).show();
        }

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    @Override
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        
    }

    
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This sample is getting the twitter updates from real time stream API and showing that in a list view. you need to change the username and password values in &lt;b&gt;doInBackGround()&lt;/b&gt; method to connect to the twitter.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The following is URL on which we can send a https request to get the tweets update in real time based on the tag value or search keyword.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 653px;&quot;&gt;&lt;code&gt;https://stream.twitter.com/1/statuses/filter.json?track=?&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The &lt;b&gt;AsyncTask &lt;/b&gt;is the best way to implement the tweets updates in background. The StreamTask in the sample is extending the AsyncTask and implementing the&amp;nbsp;&lt;b&gt;doInBackGround() &lt;/b&gt;&amp;nbsp;method to create a https connection with twitter service and receive a JSON response. The JSON response is parsed by the&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;handleTweets()&lt;/b&gt; method. The method extract the text tweets and add in the hash map to update in the list view.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To update the UI in background function in AsyncTask the publishProgress will send the update to the onProgressUpdate method of AsyncTask.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 653px;&quot;&gt;&lt;code&gt;mAdapter.notifyDataSetChanged();&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This call will send a signal to the list view adapter about the change of data and the UI thread update the list view.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the output of the sample here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd_w-UqZJijW6PvTD1gk-0gjNhusl5c_pLh2NAVcY9uYceVPdRIdTw-7xqMbsKKhPbmP1aKcXmXsgdXijoewvuexBBE1MIRPmmzdHtdbX1-7FBeyzF0_ZtnUD4-UabRYyv5z2lgcvS2N7L/s1600/twitter.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Twitter&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd_w-UqZJijW6PvTD1gk-0gjNhusl5c_pLh2NAVcY9uYceVPdRIdTw-7xqMbsKKhPbmP1aKcXmXsgdXijoewvuexBBE1MIRPmmzdHtdbX1-7FBeyzF0_ZtnUD4-UabRYyv5z2lgcvS2N7L/s320/twitter.png&quot; title=&quot;Twitter Live Streaming on Android&quot; width=&quot;204&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Twitter Live Streaming&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;if you like the post then please provide your feedback.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Thanks&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Creative Android Apps&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/8525773235900923311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/08/twitter-live-streaming-sample-code.html#comment-form' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/8525773235900923311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/8525773235900923311'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/08/twitter-live-streaming-sample-code.html' title='Twitter Live Streaming - Sample Code'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd_w-UqZJijW6PvTD1gk-0gjNhusl5c_pLh2NAVcY9uYceVPdRIdTw-7xqMbsKKhPbmP1aKcXmXsgdXijoewvuexBBE1MIRPmmzdHtdbX1-7FBeyzF0_ZtnUD4-UabRYyv5z2lgcvS2N7L/s72-c/twitter.png" height="72" width="72"/><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-6542985745396286068</id><published>2012-08-01T11:50:00.001-07:00</published><updated>2012-08-01T11:50:07.248-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Camera"/><title type='text'>Using Camera in Android Application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The picture speaks more then your words. The picture is the key&amp;nbsp;ingredient&amp;nbsp;for a application interacting with physical world.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android provides the very easy interface with the existing camera application to quickly integrate the camera function to your application. You can take picture and easily access the image data in your application with very few line of code in android.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post is explaining the quick integration of the existing camera application with your own android application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To capture the photo from existing camera application you can use the following line of code.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-size: 14px; line-height: 1.5; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 1em; text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; dispatchTakePictureIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; actionCode&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; PictureIntent &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;MediaStore&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ACTION_IMAGE_CAPTURE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    startActivityForResult&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;PictureIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; actionCode&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To get the photo in your application you simple need to implement onActivityResult() method which. The image data bundled in the extras as a bitmap and return to the caller in onActivityResult method.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-size: 14px; line-height: 1.5; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 1em; text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; onActivityResult&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; extras &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;getExtras&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    Bitmap mImageBitmap &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Bitmap&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; extras&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;data&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now you can play with this bitmap data in your&amp;nbsp;application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Thanks&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Creative Android Apps&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/6542985745396286068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/08/using-camera-in-android-application.html#comment-form' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6542985745396286068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6542985745396286068'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/08/using-camera-in-android-application.html' title='Using Camera in Android Application'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-1300690609240047480</id><published>2012-07-26T22:00:00.000-07:00</published><updated>2012-07-26T22:00:39.698-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Google"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Place APIs"/><title type='text'>Google Place APIs</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;


&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Google Place APIs&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Google Place API is a service which provides the search system for places. The search with the google place API can be perform by two ways.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1) Text String Search - a normal search specify the search string as text&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2) User&amp;nbsp;location&amp;nbsp;based search - a search specified based on the location parameters (latitude,longitude)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can integrate the places search based on the location in your android application. See the previous example to determine the location of a user and draw a overlay icon pointed to that location of the user.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post is explaining the implementation of place search by google place API.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The HTTP URL for the place search is as follows&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border: 1px solid rgb(187, 187, 187); font-size: 13px; line-height: 1.5; margin-bottom: 1.5em; margin-top: 1.5em; overflow: auto; padding: 6px 10px; text-align: -webkit-auto; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;https&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #666600; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #880000; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;//maps.googleapis.com/maps/api/place/search/&lt;/span&gt;&lt;em style=&quot;border: 0px; color: #007000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #880000; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;output&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #880000; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&lt;/span&gt;&lt;em style=&quot;border: 0px; color: #007000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #880000; font-style: inherit; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;parameters&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The output could be json or xml and the required parameters are as follows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;key &lt;/b&gt;- Your application key.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;location &lt;/b&gt;- latitude,longitude of the place to search&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;radius&lt;/b&gt; - search area in which the search should perform for location&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;sensor &lt;/b&gt;- true or false based on the request is initiated by a devices having a location sensor (GPS) enabled or disabled&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The following is the list of optional parameters to refine your search&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Keyword&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;— A term to be matched against
all content that Google has indexed for the place&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Language&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;— The language code,
indicating in which language the results should be returned.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Name&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;— A term to be matched against
the names of Places. Results will be restricted to those containing the values
passed here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Rankby&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;— Specifies the order in which
results are listed. Possible values are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;·         Prominence - This option sorts results based on their importance. &lt;br /&gt;·         Distance -  This option sorts results in ascending order by their distance from the specified location. &lt;br /&gt;·         Types — Restricts the results to places matching at least one of the specified types. Types must be separated with a pipe symbol (type1|type2|etc).&lt;br /&gt;·         Pagetoken — Returns the next 20 results from a previously run search.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;Code : &lt;/b&gt;The following few line of code explain how can you call google web &amp;nbsp; &amp;nbsp;service in your application.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;    String result = &quot;&quot;;
    HttpClient httpclient = new DefaultHttpClient();
    HttpGet request = new HttpGet(url);
    ResponseHandler&amp;lt;String&amp;gt; handler = new BasicResponseHandler();
    try {
        result = httpclient.execute(request, handler);
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    httpclient.getConnectionManager().shutdown();
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The Google Place APIs provide a quick way to integrate the context aware search to your application.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the post please provide your feedback.&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/1300690609240047480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/google-place-apis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/1300690609240047480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/1300690609240047480'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/google-place-apis.html' title='Google Place APIs'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-7514205485271522869</id><published>2012-07-24T12:01:00.000-07:00</published><updated>2012-07-24T12:01:36.453-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="networkonmainthreadexception"/><category scheme="http://www.blogger.com/atom/ns#" term="StrictMode in Android"/><title type='text'>Exception networkonmainthreadexception in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Exception networkonmainthreadexception in Android&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This exception is due to the StrictMode introduced on honeycomb or later android devices to not allow the network operations in main thread.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The solution to this exception is that you implement a thread for network operation instead of implementing in main thread.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The alternative method is to disable the option which is enable by default in honeycomb and later android OS.The previous versions of android OS allowed the main thread to create the network connections.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Disabling the StrictMode in Android&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the solution please provide your comments.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/7514205485271522869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/exception-networkonmainthreadexception.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/7514205485271522869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/7514205485271522869'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/exception-networkonmainthreadexception.html' title='Exception networkonmainthreadexception in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-6767986134711714324</id><published>2012-07-23T22:09:00.000-07:00</published><updated>2012-07-23T22:09:14.543-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook login"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook SDK for android"/><title type='text'>Integrating Facebook in Android Apps</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Quick integration of facebook on android platform&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hello Creative Android Developers,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post is explaining the integration of &lt;a href=&quot;http://www%2Cfacebook.com/&quot;&gt;facebook &lt;/a&gt;a powerful social media with android applications.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;facebook the powerful social media provides the enrich developer APIs to integrate the facebook features in applications. You can create lots of derivative social apps from facebook and can add a social touch to your app with facebook interaction.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post is focusing on developing the android application with facebook APIs. The facebook SDK could be download from&amp;nbsp;&lt;a href=&quot;https://github.com/facebook/facebook-android-sdk/&quot;&gt;https://github.com/facebook/facebook-android-sdk/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Once you download the facebook-android-sdk you need to create an android project to compile the facebook-android-sdk code and create a library for facebook APIs.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now you can create your sample code by using the above library as reference in your application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Create a simple android application project and replace the activity code as follows.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You need to register your application on facebook platform and get the application id from the platform.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.samplefacebook;

import android.os.Bundle;

import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
&lt;span style=&quot;color: red;&quot;&gt;import com.facebook.android.*;
import com.facebook.android.Facebook.*;&lt;/span&gt;

public class MainActivity extends Activity {

   
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    
    Facebook facebook = new Facebook(&quot;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;YOUR APP ID&lt;/span&gt;&lt;/b&gt;&quot;);

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        facebook.authorize(this, new DialogListener() {
            @Override
            public void onComplete(Bundle values) {}

            @Override
            public void onFacebookError(FacebookError error) {}

            @Override
            public void onError(DialogError e) {}

            @Override
            public void onCancel() {}
        });
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        facebook.authorizeCallback(requestCode, resultCode, data);
    }
    
}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is the simple code for invoking the login interface with single-sign-on (SSO) of the facebook from your android application.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You need to add the following permission to access the facebook platform.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Add the following line in AndroidManifest.xml of the sample.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now running the application we show the following output&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMQKLxtVMJpt5Iw_GFfM0TyCJ0wh97Y6FYXOb4ym8zfOKeMAZeaVi5OBeYgdrKokH5eEVf0XB_sn1sYMeFo-NyOyAmpNk4BQ7VENjn10BK5j7JlhTln4NgtN64ZdNpL-uW9KrHMbWtQy-/s1600/facebook.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;facebook on android&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMQKLxtVMJpt5Iw_GFfM0TyCJ0wh97Y6FYXOb4ym8zfOKeMAZeaVi5OBeYgdrKokH5eEVf0XB_sn1sYMeFo-NyOyAmpNk4BQ7VENjn10BK5j7JlhTln4NgtN64ZdNpL-uW9KrHMbWtQy-/s320/facebook.png&quot; title=&quot;facebook sso login interface&quot; width=&quot;201&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Facebook - (SSO) in Android App&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Now you can make your apps more social with facebook. If you like the post then please provide your feedback.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/6767986134711714324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/integrating-facebook-in-android-apps.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6767986134711714324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6767986134711714324'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/integrating-facebook-in-android-apps.html' title='Integrating Facebook in Android Apps'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMQKLxtVMJpt5Iw_GFfM0TyCJ0wh97Y6FYXOb4ym8zfOKeMAZeaVi5OBeYgdrKokH5eEVf0XB_sn1sYMeFo-NyOyAmpNk4BQ7VENjn10BK5j7JlhTln4NgtN64ZdNpL-uW9KrHMbWtQy-/s72-c/facebook.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-1731617227165448360</id><published>2012-07-22T10:23:00.000-07:00</published><updated>2012-07-22T10:24:11.960-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="SampleCode"/><category scheme="http://www.blogger.com/atom/ns#" term="Screen Brightness"/><category scheme="http://www.blogger.com/atom/ns#" term="SensorEventListener"/><category scheme="http://www.blogger.com/atom/ns#" term="TYPE_LIGHT"/><title type='text'>Sample Code - Implementing the sensor in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;

&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Sample Code - TYPE_LIGHT sensor to get the screen brightness for android device&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android provide the &lt;b&gt;android.hardware&lt;/b&gt;&amp;nbsp;framework&lt;b&gt;&amp;nbsp;&lt;/b&gt;to implement the sensors. you could get a quick understanding of android sensor framework for our previous post.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/basics-of-sensors-on-android-platform.html&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/basics-of-sensors-on-android-platform.html&lt;/span&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post will explain the implementation of SensorEventListener for the&amp;nbsp;TYPE_LIGHT sensor. The light listener is used to control the brightness of the screen.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You need to create a Android Application Project in your eclipse editor and modify the Activity class to extend with &lt;b&gt;SensorEventListener. &lt;/b&gt;&amp;nbsp;See the following code of the sample.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.samplesensor;

&lt;span style=&quot;color: red;&quot;&gt;import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;&lt;/span&gt;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity implements SensorEventListener {

    private SensorManager mSensorManager;
    private Sensor mLight;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
        mLight = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    @Override
    public void onAccuracyChanged(Sensor arg0, int arg1) {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void onSensorChanged(SensorEvent arg0) {
        // TODO Auto-generated method stub
        float lux = arg0.values[0];
        Toast.makeText(getApplicationContext(), &quot;Sensor Value &quot; + lux, 1000).show();
    }

    @Override
      protected void onResume() {
        super.onResume();
        mSensorManager.registerListener(this, mLight, SensorManager.SENSOR_DELAY_NORMAL);
      }

      @Override
      protected void onPause() {
        super.onPause();
        mSensorManager.unregisterListener(this);
      }
}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Get the instance of the system service of sensor manager and get the TYPE_LIGHT sensor from the system.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You need to implement the two callback methods provided by the &lt;b&gt;SessionEventListener&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The sensor need to register on the &lt;b&gt;onResume()&lt;/b&gt; and &lt;b&gt;onPause()&lt;/b&gt; methods of activity class.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The TYPE_LIGHT sensor only returns the one value which is brightness of the device screen. The brightness of the screen is measured by &lt;b&gt;lux &lt;/b&gt;unit.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;One lux is equal to one lumen per square metre.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you like the example please provide your feedback.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Thanks&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Creative Android Apps&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/1731617227165448360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-implementing-sensor-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/1731617227165448360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/1731617227165448360'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-implementing-sensor-in.html' title='Sample Code - Implementing the sensor in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-4170519839647808473</id><published>2012-07-22T09:38:00.001-07:00</published><updated>2012-07-22T10:25:13.279-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Sensor framework"/><category scheme="http://www.blogger.com/atom/ns#" term="android.hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="Sensor"/><category scheme="http://www.blogger.com/atom/ns#" term="SensorEvent"/><category scheme="http://www.blogger.com/atom/ns#" term="SensorEventListener"/><category scheme="http://www.blogger.com/atom/ns#" term="SensorManager"/><title type='text'>Sensors framework for Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;

&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android Sensor Framework&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android provides a development framework to develop the
applications with various sensors described in the following post.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/basics-of-sensors-on-android-platform.html&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/basics-of-sensors-on-android-platform.html&lt;/span&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android provides a &lt;b&gt;android.hardware
&lt;/b&gt;package&lt;b&gt; &lt;/b&gt;which includes the
following four classes for sensor management.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;SensorManager - &lt;/b&gt;Sensor Manager is a class to manage the various sensors provides the methods to list the sensors available on the device, register the sensor listeners and acquire the sensors data. You can use this class to create an instance of the sensor service.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Sensor - &lt;/b&gt;This class provides the methods specific to a sensor. The sensor manager returns the sensor object which can use to handle the sensor functions which depends on the type of the sensor.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;SensorEvent -&lt;/b&gt;&amp;nbsp;The framework defines this class to handle the sensor events and create a object of sensor event. A sensor event object includes the raw sensor data, the type of sensor that generated the event, the accuracy of the data, and the timestamp for the event.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;SensorEventListener - &lt;/b&gt;The sensor event listener provides the two callback methods to implement to receive the sensor events when sensor changes its value or when sensor accuracy changes.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now you can see the next article to create quick sample for sensors on android platform.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/sample-code-implementing-sensor-in.html&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/sample-code-implementing-sensor-in.html&lt;/span&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you like the post please provide your feedback.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Thanks&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Creative Android Apps&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/4170519839647808473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sensors-framework-for-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/4170519839647808473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/4170519839647808473'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sensors-framework-for-android.html' title='Sensors framework for Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-6822194212434088033</id><published>2012-07-22T08:15:00.000-07:00</published><updated>2012-07-22T08:15:38.539-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android sensors"/><category scheme="http://www.blogger.com/atom/ns#" term="environmental sensors"/><category scheme="http://www.blogger.com/atom/ns#" term="hardware and software sensors"/><category scheme="http://www.blogger.com/atom/ns#" term="motion sensors"/><title type='text'>Basics of Sensors on Android Platform</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Basics about the sensors in Android&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The sensors add a value to the Android device just like our sense organs add a value to our life. Android platform provide a rich set of sensors which could be use by applications in many ways. This post will describe about the various sensors and its use for applications on android platform.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Most of the sensors will measure the device motion , orientation and environmental changes. Android divide the sensors in two&amp;nbsp;categories.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Hardware Sensors&lt;/b&gt; - The hardware sensors are the physical&amp;nbsp;components&amp;nbsp;embedded on the device and measure the&amp;nbsp;environmental changes like acceleration, geomagnetic field strength, and device rotations.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Software Sensors&lt;/b&gt; - The software sensors are not embedded as physical components, they are basic derive the sensor values for hardware devices. The software sensors are also known as virtual sensors.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The gravity sensors are the example of software sensors.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;According to the &amp;nbsp;usage the android provides the following types of sensors&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Motion Sensors&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Environmental Sensors&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Position Sensors&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Its not necessary that all devices have all type of sensors, most of the android devices have accelerometer and magnetometer. The device could also have multiple sensors of same type.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;see the list of sensors for android platform with there usage.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; border-collapse: collapse; width: 699px;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td nowrap=&quot;&quot; style=&quot;background: #999999; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Sensor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td nowrap=&quot;&quot; style=&quot;background: #999999; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td nowrap=&quot;&quot; style=&quot;background: #999999; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td nowrap=&quot;&quot; style=&quot;background: #999999; border-left: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Common Uses&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_ACCELEROMETER&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the acceleration force in m/s2that is applied to
  a device on all three physical axes (x, y, and z), including the force of
  gravity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Motion detection (shake, tilt, etc.).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_AMBIENT_TEMPERATURE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the ambient room temperature in degrees Celsius
  (°C). See note below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Monitoring air temperatures.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_GRAVITY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Software or Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the force of gravity in m/s2that is applied to a
  device on all three physical axes (x, y, z).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Motion detection (shake, tilt, etc.).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_GYROSCOPE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures a device&#39;s rate of rotation in rad/s around each
  of the three physical axes (x, y, and z).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Rotation detection (spin, turn, etc.).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_LIGHT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the ambient light level (illumination) in lx.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Controlling screen brightness.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_LINEAR_ACCELERATION&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Software or Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the acceleration force in m/s2that is applied to
  a device on all three physical axes (x, y, and z), excluding the force of
  gravity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Monitoring acceleration along a single axis.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_MAGNETIC_FIELD&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the ambient geomagnetic field for all three
  physical axes (x, y, z) in μT.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Creating a compass.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_ORIENTATION&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Software&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures degrees of rotation that a device makes around
  all three physical axes (x, y, z). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Determining device position.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_PRESSURE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the ambient air pressure in hpa or mbar.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Monitoring air pressure changes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_PROXIMITY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the proximity of an object in cm relative to the
  view screen of a device. This sensor is typically used to determine whether a
  handset is being held up to a person&#39;s ear.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Phone position during a call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_RELATIVE_HUMIDITY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the relative ambient humidity in percent (%).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Monitoring dewpoint, absolute, and relative humidity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_ROTATION_VECTOR&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Software or Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the orientation of a device by providing the
  three elements of the device&#39;s rotation vector.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Motion detection and rotation detection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;TYPE_TEMPERATURE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hardware&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Measures the temperature of the device in degrees Celsius
  (°C). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.0pt 9.0pt 3.0pt 9.0pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Monitoring temperatures.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can develop very interesting applications around sensors like motion sensor based games,&amp;nbsp;weather&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;applications, motion detection applications, checking your position and much more.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android provides a complete development framework is android SDK to manage the sensors. Please read the following post to get more details on the android framework.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you like the post please provide your feedback as comments.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Thanks&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Creative Android Apps&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/6822194212434088033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-of-sensors-on-android-platform.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6822194212434088033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6822194212434088033'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-of-sensors-on-android-platform.html' title='Basics of Sensors on Android Platform'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-4971479974786340597</id><published>2012-07-19T11:01:00.000-07:00</published><updated>2012-07-19T11:01:22.035-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AlerDialog"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="DatePickerDialog"/><category scheme="http://www.blogger.com/atom/ns#" term="Dialog"/><category scheme="http://www.blogger.com/atom/ns#" term="ProgressDialog"/><category scheme="http://www.blogger.com/atom/ns#" term="TimePickerDialog"/><title type='text'>Basics of Dialog Box in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Dialog Box in Android&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Dialog Box is the best way to show the message popup in an application or on screen selection for user inputs. The Android provides the dialog interface which could be integrate with activity to get the user inputs as well as provide the responses to user.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android defines the &lt;b&gt;Dialog &lt;/b&gt;as class to create the&amp;nbsp;dialog&amp;nbsp;which can be display with in an activity. You should not use the Dialog class directly as the extended classes are also defined by Android which you can use directly in your application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The four major type of Dialog classes are as follows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;AlertDialog &lt;/b&gt;- is the most useful dialog class and most of the dialog interfaces could be design using the AlertDialog. You can define your controls to customize the Alert Dialog UI.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Android Alert Dialog&quot; src=&quot;http://developer.android.com/images/dialog_buttons.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; title=&quot;Android Alert Dialog&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Android - AlertDialog&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;ProgressDialog &lt;/b&gt;- is used to show the progress as a progress bar or progress wheel. You can define your controls to customize the ProgressDialog also.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Android Progress Wheel&quot; src=&quot;http://developer.android.com/images/dialog_progress_spinning.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; title=&quot;Android Progress Wheel&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Android - Progress Wheel&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Android Progress Bar&quot; src=&quot;http://developer.android.com/images/dialog_progress_bar.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; title=&quot;Android Progress Bar&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Android - Progress Bar&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;DatePickerDialog &lt;/b&gt;- is used to select a date by the user.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;TimePickerDialog &lt;/b&gt;- is used to select a time by the user.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Android Date and Time Pickers&quot; src=&quot;http://developer.android.com/images/ui/pickers.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; title=&quot;Android Pickers &quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Android - Pickers (Date and Time)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the post please provide your feedback.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/4971479974786340597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-of-dialog-box-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/4971479974786340597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/4971479974786340597'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-of-dialog-box-in-android.html' title='Basics of Dialog Box in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-6210789847903798015</id><published>2012-07-19T10:33:00.000-07:00</published><updated>2012-07-19T11:02:42.762-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android 4.1 source code"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Building Group"/><category scheme="http://www.blogger.com/atom/ns#" term="android-4.1.1._r1"/><category scheme="http://www.blogger.com/atom/ns#" term="AOSP"/><category scheme="http://www.blogger.com/atom/ns#" term="Galaxy Nexus"/><category scheme="http://www.blogger.com/atom/ns#" term="Google"/><category scheme="http://www.blogger.com/atom/ns#" term="Jelly Bean"/><category scheme="http://www.blogger.com/atom/ns#" term="Nexus 7 tablet"/><title type='text'>Android Jelly Bean released to play on Open Source</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;

&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Excitement Over - Google Released Jelly Bean Source Code in AOSP&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;After a lot of&amp;nbsp;excitement for Jelly Bean (Android 4.1)&amp;nbsp;Google recently released its version to the open source community to develop and release the future versions and releases.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Very soon we can see more and more devices running the Jelly Bean (Android 4.1). Currently Google released the native binaries for Nexus 7 tablet and Galaxy Nexus. Google&#39;s Jean Baptiste Queru recently announced the release of Android 4.1 on AOSP (Android Open Source Project). The name of the tagged release is &lt;b&gt;android-4.1.1_r1&lt;/b&gt; as JBQ stated in the Android Building Group. The name of the development branch is jb-dev. We recommended that you create new clients, even if you&#39;re working in the master branch.It&#39;ll make your clients smaller and faster to sync.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now the developers can create there customized builds of Jelly Bean and create new applications with new android power of Jelly Bean. Jelly Bean is released with lots of exciting features and APIs for developers providing new means to sharing the applications and connecting the devices.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See more about the android 4.1 Jelly Bean Features here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/06/whats-new-in-jelly-belly-android-41.html&quot;&gt;http://creativeandroidapps.blogspot.in/2012/06/whats-new-in-jelly-belly-android-41.html&lt;/a&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can download the latest source code from&amp;nbsp;&lt;a href=&quot;https://android.googlesource.com/&quot;&gt;https://android.googlesource.com/&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the post please share to your friends and feedback us with your valuable comments.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/6210789847903798015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/android-jelly-bean-released-to-play-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6210789847903798015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/6210789847903798015'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/android-jelly-bean-released-to-play-on.html' title='Android Jelly Bean released to play on Open Source'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-25546535959227505</id><published>2012-07-18T21:51:00.000-07:00</published><updated>2012-07-18T21:51:47.680-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apps"/><category scheme="http://www.blogger.com/atom/ns#" term="Big Software"/><category scheme="http://www.blogger.com/atom/ns#" term="Mobile Apps"/><title type='text'>Restarting Innovation - Big Software Sliced into Small Apps</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Restarting Software World By Slicing the Big Software into small apps&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The software world is restarting the innovation by slicing the big software into small apps and serving to large community! real users.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Today&#39;s web world is changing the&amp;nbsp;definition&amp;nbsp;of the software from development to usage. The &lt;b&gt;Big Software &lt;/b&gt;is now sliced into small apps and reaching to more real consumers. The complex technologies moved into black box and the simple technologies are in hand of end users.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The changes are already started in year 2008 when the mobile applications market started emerging. Now you can see the social apps and much more is very hot today.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;The next future of the business will be Apps which redefine the business by giving better access to all the end users.You can see the changes that now the big accounting&amp;nbsp;software&#39;s&amp;nbsp;turned into&amp;nbsp;personalized&amp;nbsp;accounting apps, social&amp;nbsp;activities&amp;nbsp;are associated with technology using apps,banking software is sliced into small apps and distributed to its real end users.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This exciting change is happening due to advancement in web technologies, users awareness and device revolution to create a better interconnect world. The businesses are reducing there cost of operations, developers could get more&amp;nbsp;opportunities and end users will have more access and confidence.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The smart phones, smart tablets and more smart embedded devices are increasing in the world and motivating the developers to create more beautiful world around the technologies.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The desktop apps, web apps, cloud apps, mobile apps, social apps and much more ways of apps are emerging to create a better life for every one.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The traditional and legacy software applications will be completely removed from the world and the new era of software will be start where the big technology will be served into small and creative apps to its real end users.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So are you ready to join the restart of software innovation. Push the button of apps and start new innovation.&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the post please share your comments.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/25546535959227505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/restarting-innovation-big-software.html#comment-form' title='99 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/25546535959227505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/25546535959227505'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/restarting-innovation-big-software.html' title='Restarting Innovation - Big Software Sliced into Small Apps'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>99</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-208672308377894050</id><published>2012-07-18T11:23:00.000-07:00</published><updated>2012-07-18T11:23:00.456-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android OpenGL"/><title type='text'>Sample Code for Open GL in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Sample Code for Open GL in Android&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now your basic Open GL ES concepts are clear as written in the previous post (&lt;/span&gt;&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/basics-of-opengl-in-android.html&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/basics-of-opengl-in-android.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;) you are ready to create something with OpenGL on Android in your creative application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post is explaining a very popular sample for the Open GL for the new&amp;nbsp;developers&amp;nbsp;to quickly understand the implementation of Open GL functions and classes. For a basic Open GL project you need to create a activity class where you host your GLSurfaceView. The render something on the view we need to implement the GLSurfaceView.Renderer interface.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See here the code of my sample class.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Create a Activity Class&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.sampleopengl;

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


public class MainActivity extends Activity {

    &lt;span style=&quot;color: red;&quot;&gt;private MyGLSurfaceView mGLView;&lt;/span&gt;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       &lt;span style=&quot;color: red;&quot;&gt; mGLView = new MyGLSurfaceView(this,null);
        setContentView(mGLView);
       &lt;/span&gt; 
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    
}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the highlighted code which you need to add in your activity class after implementing the following two classes.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now create a class named MyGLSurfaceView which extends the GLSurfaceView to set as the view of activity.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.sampleopengl;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class MyGLSurfaceView extends GLSurfaceView {

    MyGLRenderer mRenderer;
    public MyGLSurfaceView(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
        mRenderer = new MyGLRenderer();
        setRenderer(mRenderer);
    }
    //change the color on touch
    public boolean onTouchEvent(final MotionEvent event) {
        queueEvent(new Runnable(){
            public void run() {
                mRenderer.setColor(event.getX() / getWidth(),
                        event.getY() / getHeight(), 1.0f);
            }});
            return true;
        }

}


&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the implementation of the&amp;nbsp;Renderer&amp;nbsp;which will render the color.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;
package com.example.sampleopengl;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.opengl.GLSurfaceView;

public class MyGLRenderer implements GLSurfaceView.Renderer {
    private float mRed;
    private float mGreen;
    private float mBlue;
    
      public void setColor(float r, float g, float b) {
        mRed = r;
        mGreen = g;
        mBlue = b;
    }

    @Override  //function draw the opengl graphics
    public void onDrawFrame(GL10 gl) {
        // TODO Auto-generated method stub
         gl.glClearColor(mRed, mGreen, mBlue, 1.0f);
         gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
        
    }

    @Override
    public void onSurfaceChanged(GL10 gl, int w, int h) {
        // TODO Auto-generated method stub
        gl.glViewport(0, 0, w, h);
        
    }

    @Override
    public void onSurfaceCreated(GL10 gl, EGLConfig arg1) {
        // TODO Auto-generated method stub
        
        
    }


}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now you can run the sample code and see the following result as your first sample of Open GL on android.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBY29l7HTO1Es5zeJsNCGOpfgHuAII3mQSRp7a3GjZ9wF90muOM58BrLzIh2Fd1-AGtxWTTh083st29O9NFLBKv9KsFkovK9Sd3JXZD5hYxs9CSQd06kSI20zaWtf13dxpTd4SEvUCjyyN/s1600/Opengl.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Open GL Android&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBY29l7HTO1Es5zeJsNCGOpfgHuAII3mQSRp7a3GjZ9wF90muOM58BrLzIh2Fd1-AGtxWTTh083st29O9NFLBKv9KsFkovK9Sd3JXZD5hYxs9CSQd06kSI20zaWtf13dxpTd4SEvUCjyyN/s320/Opengl.png&quot; title=&quot;Open GL&quot; width=&quot;217&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Open GL - Color 1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;On touch you will see a color change on the Open GL surface view created in activity.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdeyQWLv6BnsnXrl5FOUa9WE9_FjNzj-O7c9as90wXilv8nGbEObhZ1AlIMOwUBdOeaZYDW4FmlX1N9bhv2KNCTGJIFNJlk07Bc5XUNdcKKNTPc2fnDgbFrc5x7sdNdaayd9vlK-soHDYB/s1600/opengl1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Open GL Android&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdeyQWLv6BnsnXrl5FOUa9WE9_FjNzj-O7c9as90wXilv8nGbEObhZ1AlIMOwUBdOeaZYDW4FmlX1N9bhv2KNCTGJIFNJlk07Bc5XUNdcKKNTPc2fnDgbFrc5x7sdNdaayd9vlK-soHDYB/s320/opengl1.png&quot; title=&quot;Open GL&quot; width=&quot;217&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Open GL - Color 2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the post please provide your feedback.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/208672308377894050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-for-open-gl-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/208672308377894050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/208672308377894050'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-for-open-gl-in-android.html' title='Sample Code for Open GL in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBY29l7HTO1Es5zeJsNCGOpfgHuAII3mQSRp7a3GjZ9wF90muOM58BrLzIh2Fd1-AGtxWTTh083st29O9NFLBKv9KsFkovK9Sd3JXZD5hYxs9CSQd06kSI20zaWtf13dxpTd4SEvUCjyyN/s72-c/Opengl.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-3476231116574170360</id><published>2012-07-17T22:05:00.000-07:00</published><updated>2012-07-18T11:24:00.780-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenGL"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenGL ES"/><title type='text'>Basics of OpenGL in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;

&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;

&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Basics about OpenGL ES for Android&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OpenGL is an open graphics library to create the high performance 2D and 3D applications.The OpenGL ES is a specification for the embedded devices. The devices comes with GPU (graphics processing unit) accelerate the OpenGL functions and draw the high quality graphics on the screen.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;There is lot of stuff on OpenGL which is not useful to start quickly with OpenGL ES on Android. This post is giving a quick start-up for developers to easily understand the basic about the OpenGL ES concepts around the Android application development.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;OpenGL is a cross platform library and supports on multiple platforms.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android support the OpenGL interface programming using the application development in java as well as the native (NDK) support.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The Android SDK has a &lt;b&gt;android.opengl&lt;/b&gt; package to create the OpenGL graphics in android applications.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The &lt;b&gt;android.opengl &lt;/b&gt;is a static interface and implements the OpenGL ES 1.0/1.1 specifications to create a high performance graphics in 2D and 3D.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The two main classes which need to implement in an OpenGL based application on android platform are as follows.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;GLSurfaceView &lt;/b&gt;- GLSurfaceView provides a View class to implement with OpenGL 2D and 3D APIs just like the normal SurfaceView in Android. You can extend the GLSurfaceView class to create your own class and use that View to create for your activity.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;All the events you want to handle on this view need to implement in the class you extended with GLSurfaceView.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;GLSurfaceView.Renderer&lt;/b&gt; - This is an interface which provides the class to draw the OpenGL objects in GLSurfaceView. You should implement a&amp;nbsp;separate&amp;nbsp;class for Renderer and use that class to associate with GLSurfaceView instance by using the &lt;b&gt;setRenderer &lt;/b&gt;method.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now you can start trying with OpenGL samples for Android.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the first sample here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/sample-code-for-open-gl-in-android.html&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/sample-code-for-open-gl-in-android.html&lt;/span&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like this article then please provide your valuable comments.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/3476231116574170360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-of-opengl-in-android.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/3476231116574170360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/3476231116574170360'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-of-opengl-in-android.html' title='Basics of OpenGL in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-2919609046460482577</id><published>2012-07-16T21:08:00.000-07:00</published><updated>2012-07-16T21:08:21.374-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="googlemap"/><category scheme="http://www.blogger.com/atom/ns#" term="Overlay"/><title type='text'>Sample Code - Add a Image on Google Map</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;


Add a Image on Google Map using Overlay&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Integration of Google Map with location applications provides a better navigation for user. You can add custom images , text and view on the Map View using the Overlay class provided by Google APIs.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the previous post to integrate the location listener with your basic google map view.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/sample-code-update-google-map-using.html&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/sample-code-update-google-map-using.html&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post will focus on adding a image on the map view on the detected location by the location listener.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can use the Overlay class from com.google.android.maps package.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now create a new class &quot;GLocate.java&quot; in your sample application which is extending the com.google.android.maps.Overlay class.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the code as follows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.gmapsample;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.location.Location;
import android.util.Log;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;

public class GLocate extends com.google.android.maps.Overlay{

    GeoPoint location = null;
    Bitmap overlay_img = null;
    public GLocate(GeoPoint location)
    {
        super();
        this.location = location;
    }
    
    public void setImage(Bitmap bmp)
    {
        this.overlay_img = bmp;
    }
    
    @Override
    public void draw(Canvas canvas, MapView mapView, boolean shadow)
     {
         super.draw(canvas, mapView, shadow);
         //translate the screen pixels
         Paint p = new Paint();
         Point screenPoint = new Point();
         mapView.getProjection().toPixels(this.location, screenPoint);
         Log.i(&quot;GLocate&quot;,&quot;draw : x = &quot;+ screenPoint.x + &quot;y= &quot; + screenPoint.y);
         //add the image
         canvas.drawBitmap(overlay_img,screenPoint.x, screenPoint.y , p); //Setting the image  location on the screen (x,y).
         mapView.invalidate(); //redraw the map view
     }

 }

&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now integrate the class in your main activity code as follows (see the highlighted lines of code)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt; @Override
        public void onLocationChanged(Location location) {
        // A new location update is received.  Do something useful with it. 
            Log.i(TAG,&quot;Location Listener start&quot;);
            String coordinates[] = {&quot;&quot;+location.getLatitude(), &quot;&quot;+location.getLongitude()};
            double lat = Double.parseDouble(coordinates[0]);
            double lng = Double.parseDouble(coordinates[1]);
            GeoPoint p = new GeoPoint((int) (lat * 1E6),(int) (lng * 1E6));
            &lt;span style=&quot;color: red;&quot;&gt;Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.caalogo);
            GLocate gl = new GLocate(p);
            gl.setImage(bmp);
            List listOfOverLays = mapView.getOverlays();
            listOfOverLays.clear();
            listOfOverLays.add(gl);
&lt;/span&gt;            mapController.animateTo(p);
            mapController.setZoom(4);
            mapView.invalidate();     

        }

&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now run the application and send the location update using the DDMS tool explained in previous post (&lt;/span&gt;&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/sample-code-update-google-map-using.html&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/sample-code-update-google-map-using.html&lt;/a&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;The output of the application is as follows.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRVFZEg1YIOvXG89IiUOO-lL4whzdxPJG5Mmb6VZEYtHKb8l68Ov3QDd5vwcga5CZ1IPd0nF1cwik4bEfUpdnJE6bjvRNaJRbfyFPHDph1BHre6lWSEYg-VdtygXjcLoAeNtdYuGGCBRrn/s1600/gmapoverlayimage.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Google Map&quot; border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRVFZEg1YIOvXG89IiUOO-lL4whzdxPJG5Mmb6VZEYtHKb8l68Ov3QDd5vwcga5CZ1IPd0nF1cwik4bEfUpdnJE6bjvRNaJRbfyFPHDph1BHre6lWSEYg-VdtygXjcLoAeNtdYuGGCBRrn/s400/gmapoverlayimage.png&quot; title=&quot;Google Map&quot; width=&quot;271&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Google Map - Overlay Image&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Please provide your valuable feedback.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/2919609046460482577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-add-image-on-google-map.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/2919609046460482577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/2919609046460482577'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-add-image-on-google-map.html' title='Sample Code - Add a Image on Google Map'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRVFZEg1YIOvXG89IiUOO-lL4whzdxPJG5Mmb6VZEYtHKb8l68Ov3QDd5vwcga5CZ1IPd0nF1cwik4bEfUpdnJE6bjvRNaJRbfyFPHDph1BHre6lWSEYg-VdtygXjcLoAeNtdYuGGCBRrn/s72-c/gmapoverlayimage.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-4405141832634140923</id><published>2012-07-16T10:24:00.000-07:00</published><updated>2012-07-16T10:24:38.679-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Map"/><category scheme="http://www.blogger.com/atom/ns#" term="Location API"/><title type='text'>Sample Code - Update Google Map using Location listener</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;



&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Sample Code - Update Google Map using Location listener&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Implement the basic example of google map as explained in the following post.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/google-map-in-android-application.html&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/google-map-in-android-application.html&lt;/a&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post will focus on implementing the location listener and update the location in google map.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You need to add the following code for the location listener in the class extending the MapActivity class (see the GMapSample class from the previous sample)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;private final LocationListener listener = new LocationListener() {

        @Override
        public void onLocationChanged(Location location) {
            // A new location update is received.  Do something useful with it.  
             Log.i(TAG,&quot;Location Listener start&quot;);
             String coordinates[] = {&quot;&quot;+location.getLatitude(), &quot;&quot;+location.getLongitude()};
                double lat = Double.parseDouble(coordinates[0]);
                double lng = Double.parseDouble(coordinates[1]);
                GeoPoint p = new GeoPoint(
                (int) (lat * 1E6),
                (int) (lng * 1E6));
                mapController.animateTo(p);
                mapController.setZoom(7);
                mapView.invalidate();     

        }

        @Override
        public void onProviderDisabled(String provider) {
            Log.i(TAG,&quot;Location disable&quot;);
        }

        @Override
        public void onProviderEnabled(String provider) {
            Log.i(TAG,&quot;Location enabldes&quot;);
        }

        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {
        }
    };
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now add a location manager object in class as follows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private LocationManager locMgr;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Add the following lines of highlighted code in the onCreate Method to register the location listener with location manager.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gsample);
        mapView = (MapView) findViewById(R.id.map_view);      
        mapView.setBuiltInZoomControls(true);
       &lt;span style=&quot;color: red;&quot;&gt; locMgr = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
        //register the location listener with location manager       
        locMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, listener);&lt;/span&gt;
        GeoPoint point = new GeoPoint(latitudeE6, longitudeE6);

        mapController = mapView.getController();
        mapController.animateTo(point);
        mapController.setZoom(7);
        mapView.invalidate();     
                          
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The eclipse will not automatically add the import required for location APIs&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now when you run the application you can see the following output.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKEfgRtKsoDfNX7-97oNxbnOhskhSZPPjNZr_joUx_G-aAVMfgGEwjtuuSOdq-lGoLPBuPWcRavLYG7rrajTZTUDVpvlFrUutthRokBAE0RiwuQwuyiKayuE48k9ENLuteVKU5DZEDIPXy/s1600/GMap.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKEfgRtKsoDfNX7-97oNxbnOhskhSZPPjNZr_joUx_G-aAVMfgGEwjtuuSOdq-lGoLPBuPWcRavLYG7rrajTZTUDVpvlFrUutthRokBAE0RiwuQwuyiKayuE48k9ENLuteVKU5DZEDIPXy/s320/GMap.png&quot; width=&quot;223&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To send the location data to the emulator for testing you can use the DDMS tool&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0XEBIEt_h3v2kMsy94Q-UnugrtTUf5iMmohzD7yfwhhtOeaqXxVlopBBySDrxU6T5yqt36iL_yVn09hgy5QrxZbyg1yineKvO2ZVPQtLz9JZz_o2qX3CjLvw93mEaLzruWEueZ9YV7KWp/s1600/DDMS.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;DDMS Tool Android&quot; border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0XEBIEt_h3v2kMsy94Q-UnugrtTUf5iMmohzD7yfwhhtOeaqXxVlopBBySDrxU6T5yqt36iL_yVn09hgy5QrxZbyg1yineKvO2ZVPQtLz9JZz_o2qX3CjLvw93mEaLzruWEueZ9YV7KWp/s400/DDMS.png&quot; title=&quot;Android DDMS&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;DDMS Tool&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;select the emulator device and go to the Emulator Control. See the Location Controls and update the location data and click send to send the location data to the emulator running the application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the post then please provide your feedback.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/4405141832634140923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-update-google-map-using.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/4405141832634140923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/4405141832634140923'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-update-google-map-using.html' title='Sample Code - Update Google Map using Location listener'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKEfgRtKsoDfNX7-97oNxbnOhskhSZPPjNZr_joUx_G-aAVMfgGEwjtuuSOdq-lGoLPBuPWcRavLYG7rrajTZTUDVpvlFrUutthRokBAE0RiwuQwuyiKayuE48k9ENLuteVKU5DZEDIPXy/s72-c/GMap.png" height="72" width="72"/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-2677584829042224688</id><published>2012-07-15T21:56:00.000-07:00</published><updated>2012-07-15T21:56:15.620-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="apiKey"/><category scheme="http://www.blogger.com/atom/ns#" term="googlemap"/><title type='text'>Get Application Key for Google Map</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;


&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Get the apiKey for Google Map&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Google Map integration in your android application requires a key to integrate with your application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post will explain the procedure to get the apiKey for your android application for Google and explain the integration of Google Map with your application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To get the apiKey we need to follow the following steps&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Locate the debug.keystore&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Locate the keytool.exe&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Generate the MD5 fingerprint using keytool and debug.keystore&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Get the API Key from Google by providing the MD5 fingerprint&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can find the debug.keystore file user directory of your operating system&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;For Example &amp;nbsp;: C:\Users\XXXX\.android\debug.keystore&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can find the keytool.exe in your %JAVA_HOME%\bin\keytool.exe&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now run the following command to get the MD5 fingerprint&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;C:\Program Files\Java\jdk1.6.0_01\bin&amp;gt;keytool.exe &amp;nbsp;-list -alias androiddebugkey&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;-keystore C:\Users\t\.android\debug.keystore -storepass android -keypass android&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the output of the command as following screen shot&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIxdyE54-z8R0ju3Y58yU2_461aqjor1dyX3BPQbCf2I8D3F2YlyYeV_mfQYZ6wLGXCGCoN74IUPswg4-CEN_lRCWH6RA4xva4CwE4e7LsO1cyqeUhx1NpgyxfuhnNYmVpLfopRKQMzYp4/s1600/keytool.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;201&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIxdyE54-z8R0ju3Y58yU2_461aqjor1dyX3BPQbCf2I8D3F2YlyYeV_mfQYZ6wLGXCGCoN74IUPswg4-CEN_lRCWH6RA4xva4CwE4e7LsO1cyqeUhx1NpgyxfuhnNYmVpLfopRKQMzYp4/s400/keytool.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;MD5 fingerprint with Key Tool&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now register this MD5 fingerprint to get the Google Map API Key as follows&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Go to the following link&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://developers.google.com/android/maps-api-signup&quot;&gt;https://developers.google.com/android/maps-api-signup&lt;/a&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Copy the MD5 fingerprint and click on Generate Key to get your application key.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Add the application key value to the MapView XML object as follows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt; &amp;lt;com.google.android.maps.MapView
                 android:id=&quot;@+id/map_view&quot;
                 android:layout_width=&quot;fill_parent&quot;
                 android:layout_height=&quot;fill_parent&quot;
                 android:apiKey=&quot;0HvaRYYCBNDap4SKY0HN-XXXXXXXXXXXXXX&quot;
                 /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now you are ready to use the Google Map in your application see here how to integrate the basic google map object in your application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/google-map-in-android-application.html&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/google-map-in-android-application.html&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;If you like the post then please provide your feedback.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/2677584829042224688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/get-application-key-for-google-map.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/2677584829042224688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/2677584829042224688'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/get-application-key-for-google-map.html' title='Get Application Key for Google Map'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIxdyE54-z8R0ju3Y58yU2_461aqjor1dyX3BPQbCf2I8D3F2YlyYeV_mfQYZ6wLGXCGCoN74IUPswg4-CEN_lRCWH6RA4xva4CwE4e7LsO1cyqeUhx1NpgyxfuhnNYmVpLfopRKQMzYp4/s72-c/keytool.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-3595446197116568858</id><published>2012-07-15T21:23:00.000-07:00</published><updated>2012-07-17T09:47:49.631-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Andoird"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Map"/><title type='text'>Google Map in Android Application - Sample Code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;


&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Sample Code - Google Map in Android Application&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Location aware applications on android platform needs an&amp;nbsp;intuitive way to present the location information.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Google provides a set of APIs to integrate the Google Map for&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;development&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;of android applications and bundled as Google APIs.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;This post is focusing on Google Map object integration with android application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Create a Android application project &quot;GMapSample&quot; and open the default class file generated in the src directory as the main activity class. See here the project creation dialog&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW0oht1PNfdfkJmMam1ZMfFQRlOckMNZ10poLJUpIogeDICTr3C223oXO3BOO3j6Tw1Ti3B3HRSUJC4NVnKu0n922wdC0vhakDt7ru67b-CzTgBw6wUDxFhJE5Buur1ZsD8ahQWrnpo4OL/s1600/GMapSample.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Eclipse Android Project&quot; border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW0oht1PNfdfkJmMam1ZMfFQRlOckMNZ10poLJUpIogeDICTr3C223oXO3BOO3j6Tw1Ti3B3HRSUJC4NVnKu0n922wdC0vhakDt7ru67b-CzTgBw6wUDxFhJE5Buur1ZsD8ahQWrnpo4OL/s400/GMapSample.png&quot; title=&quot;Eclipse&quot; width=&quot;396&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Create New Android Application Project Using Eclipse&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;To create the Google Map in the application you need to select the Build SDK as Google APIs (API15). If this is not available then you need to update the SDK and download using Android SDK Manager.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;The following includes need to add in order to integrate the Google Map with your application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: red;&quot;&gt;import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;The MapActivity extends the basic Activity class of Android and provides the Google Map as the user interface.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;In order to access the Google Map in your application you need to get a Application Key and define the Google Map object in your application XML layout.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: &#39;Andale Mono&#39;, &#39;Lucida Console&#39;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt; &amp;lt;com.google.android.maps.MapView
                 android:id=&quot;@+id/map_view&quot;
                 android:layout_width=&quot;fill_parent&quot;
                 android:layout_height=&quot;fill_parent&quot;
                 &lt;span style=&quot;color: #38761d;&quot;&gt;android:apiKey=&quot;0HvaRYYCBNDap4SKY0HN-XXXXXXXXXXXXXXXX&lt;/span&gt;&quot;
                 /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;To get the API key for your application see the following link.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://creativeandroidapps.blogspot.in/2012/07/get-application-key-for-google-map.html&quot;&gt;http://creativeandroidapps.blogspot.in/2012/07/get-application-key-for-google-map.html&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Now replace the code of main activity class by following code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.gmapsample;

import android.os.Bundle;

import android.view.Menu;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;


public class GMapSample extends MapActivity{

    private static final String TAG = &quot;GMapSample&quot;;
    private MapView mapView;
    private MapController mapController;
    private static final int latitudeE6 = 17421306;
    private static final int longitudeE6 = 78457553;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gsample);
        mapView = (MapView) findViewById(R.id.map_view);   //get the map view resource added in XML file   
        mapView.setBuiltInZoomControls(true);
        GeoPoint point = new GeoPoint(latitudeE6, longitudeE6); //defines the geo location
        mapController = mapView.getController(); //get the map controller
        mapController.animateTo(point); // show the location defined by geopoint
        mapController.setZoom(7);  //setting the map zoom level
        mapView.invalidate();  //redraw the map   
                          
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_gsample, menu);
        return true;
    }
    
    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;while compiling the application you will get some error&amp;nbsp;because&amp;nbsp;we have not added the use of google APIs in AndroidManifest.xml file of the application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Add the following line in your application manifest file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #38761d; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;lt;uses-library android:name=&quot;com.google.android.maps&quot; /&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Add the following permissions also to manifest file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot;/&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot;/&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;To run the application you need to define a AVD from the AVD Manager as follows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXk6FJ3TybaAY2JuenO7ZgCD0V85ws6XJx5bnZXeRuZlenqABkSxFvuYxVzm61jafO5EdszckW3VM_qnzffrf8MfA7DBBaQVSvm3gN_0HxfqIwyaO0KhdLVEOeXrWA5Fq-5AXqDi_anE-s/s1600/avdmanager.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;AVD Manager&quot; border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXk6FJ3TybaAY2JuenO7ZgCD0V85ws6XJx5bnZXeRuZlenqABkSxFvuYxVzm61jafO5EdszckW3VM_qnzffrf8MfA7DBBaQVSvm3gN_0HxfqIwyaO0KhdLVEOeXrWA5Fq-5AXqDi_anE-s/s400/avdmanager.png&quot; title=&quot;AVD Manager&quot; width=&quot;338&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;AVD for Google Map&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;Running the application will give the following output.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY2DzfIQIezm4DzWuF08K1QKR32P131XJmMIt92JUQR_ZOQGXNskb4LInTXAoPzzN6ZL13hk9oIN38GXfN5dMWnA4H5JqgZKX9nGKpPlsCcHPFFFRw-DYEMLV-2l1BY326_ug_ypi8yGq4/s1600/GMap.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Google Map Android&quot; border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY2DzfIQIezm4DzWuF08K1QKR32P131XJmMIt92JUQR_ZOQGXNskb4LInTXAoPzzN6ZL13hk9oIN38GXfN5dMWnA4H5JqgZKX9nGKpPlsCcHPFFFRw-DYEMLV-2l1BY326_ug_ypi8yGq4/s400/GMap.png&quot; title=&quot;Google Map&quot; width=&quot;278&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Android Application with Google Map&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Please provide your feedback. The next post for the Google Map is on the way.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Thanks&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/3595446197116568858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/google-map-in-android-application.html#comment-form' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/3595446197116568858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/3595446197116568858'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/google-map-in-android-application.html' title='Google Map in Android Application - Sample Code'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW0oht1PNfdfkJmMam1ZMfFQRlOckMNZ10poLJUpIogeDICTr3C223oXO3BOO3j6Tw1Ti3B3HRSUJC4NVnKu0n922wdC0vhakDt7ru67b-CzTgBw6wUDxFhJE5Buur1ZsD8ahQWrnpo4OL/s72-c/GMapSample.png" height="72" width="72"/><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-9182069336678857117</id><published>2012-07-14T11:13:00.000-07:00</published><updated>2012-07-14T11:13:11.269-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Menu"/><category scheme="http://www.blogger.com/atom/ns#" term="OptionMenu"/><title type='text'>Sample Code - Creating Option Menu in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/h2&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;


Sample Code - Create a Option Menu for Android&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;Application&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The option menu is a core menu of &amp;nbsp;the application which provides the basic navigation for applications.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;I have written this post the explain the use of option menu in android application.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The best way to create an option menu is to define the option menu in a XML file and inflate the menu resource in &lt;b&gt;onCreateOptionMenu&lt;/b&gt; method.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Create a project and define an activity as CreativeMenus (you can use any other name for your activity).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Create the XML file in res-&amp;gt;layout directory as menu.xml&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;
    &amp;lt;item android:id=&quot;@+id/action1&quot;
          android:icon=&quot;@drawable/ic_launcher&quot;
          android:title=&quot;@string/action1&quot;
          /&amp;gt;
    &amp;lt;item android:id=&quot;@+id/action2&quot;
          android:icon=&quot;@drawable/ic_launcher&quot;
          android:title=&quot;@string/action2&quot; /&amp;gt;
    &amp;lt;item android:id=&quot;@+id/action3&quot;
          android:icon=&quot;@drawable/ic_launcher&quot;
          android:title=&quot;@string/action3&quot; /&amp;gt;
    &amp;lt;item android:id=&quot;@+id/action4&quot;
          android:icon=&quot;@drawable/ic_launcher&quot;
          android:title=&quot;@string/action4&quot; /&amp;gt;
&amp;lt;/menu&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now implement the activity class as follows&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;package com.example.creativeapps;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class CreativeMenus extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
      }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.layout.menu, menu);
        return true;
    }
    
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
         switch (item.getItemId()) {
            case R.id.action1: //start another activity
                startActivity(new Intent(this, CreativelayoutsActivity.class));
                return true;
            case R.id.action2:
                //TODO: handle the code for action 2
                return true;
            case R.id.action3:
                //TODO: handle the code for action 3
                return true;
            case R.id.action4:
                //TODO: handle the code for action 4
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To handle the click events on action items you need to implement the &lt;b&gt;onOptionsItemSelected &lt;/b&gt;method of your activity class. Get the unique id defined for each item to handle the proper action for click on menu item.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See in the above example we are starting the another activity on click of action1. you can extend the example by implementing your own actions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Menus are good to implement for version lower then 3.0 for Android version 3.0 or greater implement the action bar.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Please provide your feedback and share this to your creative android friends.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/9182069336678857117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-creating-option-menu-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/9182069336678857117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/9182069336678857117'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/sample-code-creating-option-menu-in.html' title='Sample Code - Creating Option Menu in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-2851351722739184219</id><published>2012-07-14T06:41:00.001-07:00</published><updated>2012-07-14T06:41:59.960-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Menus"/><title type='text'>Basics about Menu in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Menus in Android&amp;nbsp;&lt;/h2&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Menu is the basic navigation method for an application which provides an interactive way to interact with user interface and defines the application actions for its users.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In Android version 2.3.X (API level 10) the Menu is the basic building block of the application invoked by the system when user press the menu button on device. In later versions from Android 3.0&amp;nbsp;on-wards&amp;nbsp;this is replaced by an action bar on the top of device.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Android defines the three type of menus for applications&lt;/span&gt;&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Option Menu&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The option menu is the primary collection of action items for an application. If you are developing an application for android devices running the Android 2.3.X or lower version then option menu will be created by the system when ever user press the menu button on device.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The Android 3.0 converts this into more effective method using the action bar.&lt;/span&gt;&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Contextual Menu&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A contextual menu is a floating menu invoked when user performs a long click on an element of the view.&lt;/span&gt;&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Popup Menu&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A popup menu displays a list of items in a vertical list that&#39;s anchored to the view that invoked the menu.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can define the menus in your android application as XML resources which could be inflate in your activity or fragment.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See here a sample file defining a menu for an application&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-size: 14px; line-height: 1.5; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 1em;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;xml version&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; encoding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;menu&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;item&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;@+id/myaction1&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:icon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;@drawable/ic_myaction1&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:title&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;@string/myaction1&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:showAsAction&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;ifRoom&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;item&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;@+id/help&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:icon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;@drawable/ic_help&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288;&quot;&gt;android:title&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;@string/help&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/menu&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/2851351722739184219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-about-menu-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/2851351722739184219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/2851351722739184219'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/basics-about-menu-in-android.html' title='Basics about Menu in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6896317795307023389.post-5513166125444831398</id><published>2012-07-10T12:00:00.001-07:00</published><updated>2012-07-10T12:00:04.330-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Input Events"/><category scheme="http://www.blogger.com/atom/ns#" term="Event Handlers"/><category scheme="http://www.blogger.com/atom/ns#" term="Event Listeners"/><title type='text'>Handling input events in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Handling Input Events in Android&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The input events are the key elements for the user interface on mobile devices. The mobile devices has many ways to interact with device need to be handle in programming.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In android you can intercept the events passed by the user during interaction with your app and implement the callback to process the events. In android the activity presents the view to the user and each view object will generate the events based on user interaction.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This events could be intercept by each view object using the callback methods or event listeners. In case if you are creating your custom view object you can implement the event handlers for your view object.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Event Listeners&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;An event listener is an interface in the View class that contains a single callback method. These methods will be called by Android framework when the View to which the listener has been registered is triggered by user interaction with the item in the user interface.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the list of event listener callback methods here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;background: #548DD4; border: solid black 1.0pt; mso-background-themecolor: text2; mso-background-themetint: 153; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Event&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #548DD4; border-left: none; border: solid black 1.0pt; mso-background-themecolor: text2; mso-background-themetint: 153; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Listener Callback method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #548DD4; border-left: none; border: solid black 1.0pt; mso-background-themecolor: text2; mso-background-themetint: 153; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onClick()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;View.onClickListener&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is called when the user either touches the item (when in touch
  mode), or focuses upon the item with the navigation-keys or trackball and
  presses the suitable &quot;enter&quot; key or presses down on the trackball.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onLongClick()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;View.onLongClickListener&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is called when the user either touches and holds the item (when
  in touch mode), or focuses upon the item with the navigation-keys or
  trackball and presses and holds the suitable &quot;enter&quot; key or presses
  and holds down on the trackball (for one second).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onFocusChange()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;View.onFocusChangeListener&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is called when the user navigates onto or away from the item,
  using the navigation-keys or trackball.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onKey()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onKeyListener&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is called when the user is focused on the item and presses or
  releases a hardware key on the device.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onTouch()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onTouchListener&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is called when the user performs an action qualified as a touch
  event, including a press, a release, or any movement gesture on the screen
  (within the bounds of the item).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid black 1.0pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onContextMenu()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onContextMenuListener&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid black 1.0pt; border-left: none; border-right: solid black 1.0pt; border-top: none; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt 0in 5.4pt; width: 159.6pt;&quot; valign=&quot;top&quot; width=&quot;213&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is called when a Context Menu is being built (as the result of a
  sustained &quot;long click&quot;).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can use the View.setEventListener() to register the events with view object.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;There are two ways to implement the event listener for a view object.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Register the event listener with view object&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Example Code :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-size: 14px; line-height: 1.5; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 1em; text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// Create an raw implementation of OnClickListener&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;OnClickListener&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; mTestListener &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;OnClickListener&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; onClick&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// do something when the button is clicked&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; savedValues&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// Capture our button from layout&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; button &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;findViewById&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;testbutton&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// Register the onClick listener with the implementation above&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    button&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;setOnClickListener&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;mTestListener&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Implement the event listener on activity class&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Example Code :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-size: 14px; line-height: 1.5; margin-bottom: 1em; margin-top: 1em; overflow: auto; padding: 1em; text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ExampleActivity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Activity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;implements&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;OnClickListener&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; savedValues&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; button &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;findViewById&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;corky&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
        button&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;setOnClickListener&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;

    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// Implement the OnClickListener callback&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; onClick&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// do something when the button is clicked&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;onLongClick(),onKey() and onTouch() events return a boolean value. If return true then the event will not&amp;nbsp;propagate&amp;nbsp;further to event listener.&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Event Handlers&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;An event handler is required to implement when you are extending the view object to create your own view object.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can implement the following basic event handler&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;onKeyDown(int, KeyEvent)&lt;span style=&quot;background-color: white;&quot;&gt; - Called when a new key event occurs.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;onKeyUp(int, KeyEvent)&lt;span style=&quot;background-color: white;&quot;&gt; - Called when a key up event occurs.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;onTrackballEvent(MotionEvent)&lt;span style=&quot;background-color: white;&quot;&gt; - Called when a trackball motion event occurs.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;onTouchEvent(MotionEvent)&lt;span style=&quot;background-color: white;&quot;&gt; - Called when a touch screen motion event occurs.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;onFocusChanged(boolean, int, Rect)&lt;span style=&quot;background-color: white;&quot;&gt; - Called when the view gains or loses focus.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Did you like the post? so this is the time to share.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;Please provide your valuable comments to improve our post.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;Creative Android Apps&lt;/i&gt;&lt;/div&gt;
&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://creativeandroidapps.blogspot.com/feeds/5513166125444831398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/handling-input-events-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/5513166125444831398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6896317795307023389/posts/default/5513166125444831398'/><link rel='alternate' type='text/html' href='http://creativeandroidapps.blogspot.com/2012/07/handling-input-events-in-android.html' title='Handling input events in Android'/><author><name>Creative Software Research</name><uri>http://www.blogger.com/profile/12037721464686499834</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0gfX92tvyDwoW0QIY7fDZd5SV6Zh6H9jCXo0xenFD_ibbSPdUE_WVvKsvUOzkSng_9yt19a8agoiRYgIbSyAVKOOJd0ztHnbaYxKytDMBsr-ukfzfeAJaeFaE7hRvWQ/s220/logocsr.png'/></author><thr:total>0</thr:total></entry></feed>