<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>All About Web &#38; Mobile Application Development &#187; Information Technology</title>
	<atom:link href="http://www.londatiga.net/category/it/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.londatiga.net</link>
	<description>All About Web &#38; Mobile Application Development</description>
	<lastBuildDate>Sat, 14 Jan 2012 16:56:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to Show &#8220;What&#8217;s New&#8221; Dialog in Android App</title>
		<link>http://www.londatiga.net/it/programming/android/how-to-show-whats-new-dialog-in-android-app/</link>
		<comments>http://www.londatiga.net/it/programming/android/how-to-show-whats-new-dialog-in-android-app/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 16:40:13 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[changes dialog]]></category>
		<category><![CDATA[create dialog]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[whats new dialog]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=938</guid>
		<description><![CDATA[As Android application developer  sometimes when we release a new version of our application, we want to provide information to user about what changes have been made or what features have been added into the new version. The best way is to display a &#8216;What&#8217;s New&#8216; dialog that shows information about new changes and features [...]]]></description>
			<content:encoded><![CDATA[<p>As <a title="Android" href="http://android.com" target="_blank"><strong>Android</strong></a> application developer  sometimes when we release a new version of our application, we want to provide information to user about what changes have been made or what features have been added into the new version. The best way is to display a &#8216;<em><strong>What&#8217;s New</strong></em>&#8216; <strong>dialog</strong> that shows information about new changes and features when the application starts after updated. This dialog should only be displayed once  when application starts. If user want to open the dialog manually, we can provide it  via a menu.</p>
<p style="text-align: center;"><img class="alignnone" title="Android Whats New Dialog" src="http://londatiga.net/images/whatsnew.png" alt="" width="200" height="333" /></p>
<p>To display a <em>What&#8217;s New</em> dialog, we can compare  current application version number with the previous version number. If the current version number is greater then previous, that means the application is newer or recently updated then we should display the dialog and save the current version number .</p>
<p>Code implementation in Android:</p>
<pre class="brush: java; title: ;">
public class MainActivity extends Activity {
	private static final String PRIVATE_PREF = &quot;myapp&quot;;
	private static final String VERSION_KEY = &quot;version_number&quot;;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        init();
    }

    private void init() {
    	SharedPreferences sharedPref  	= getSharedPreferences(PRIVATE_PREF, Context.MODE_PRIVATE);
    	int currentVersionNumber		= 0;

		int savedVersionNumber			= sharedPref.getInt(VERSION_KEY, 0);

		try {
   	 		PackageInfo pi 			= getPackageManager().getPackageInfo(getPackageName(), 0);
    	 	currentVersionNumber	= pi.versionCode;
   	 	} catch (Exception e) {}

   	 	if (currentVersionNumber &gt; savedVersionNumber) {
   	 		showWhatsNewDialog();

   	 		Editor editor	= sharedPref.edit();

   	 		editor.putInt(VERSION_KEY, currentVersionNumber);
   	 		editor.commit();
   	 	}
	}

    private void showWhatsNewDialog() {
    	LayoutInflater inflater = LayoutInflater.from(this);

        View view				= inflater.inflate(R.layout.dialog_whatsnew, null);

  	  	Builder builder			= new AlertDialog.Builder(this);

	  	builder.setView(view).setTitle(&quot;Whats New&quot;)
	  	.setPositiveButton(&quot;OK&quot;, new DialogInterface.OnClickListener() {
	  		@Override
	  		public void onClick(DialogInterface dialog, int which) {
	  			dialog.dismiss();
	  		}
	    });

	  	builder.create().show();
    }
}
</pre>
<p>Look at  <em>init()</em> method (<span style="color: #339966;">line 14</span>):</p>
<ul>
<li> <em>currentVersionNumber</em> is the current application version number which is obtained from <em><a title="Android PackageInfo" href="http://developer.android.com/reference/android/content/pm/PackageInfo.html" target="_blank">PackageInfo</a></em> (<span style="color: #008000;">line 21,22</span>). This version number is set in <em><a title="Android Manifest" href="http://developer.android.com/guide/topics/manifest/manifest-intro.html" target="_blank">AndroidManifest.xml</a> </em>on <em><a title="Android version code" href="http://developer.android.com/guide/topics/manifest/manifest-element.html#vcode" target="_blank">android:versionCode</a> </em>attribute.</li>
<pre class="brush: java; title: ;">
try {
   	 		PackageInfo pi 	= getPackageManager().getPackageInfo(getPackageName(), 0);
    	 	currentVersionNumber = pi.versionCode;
   	 	} catch (Exception e) {}
</pre>
<li><em>savedVersionNumber</em> is used to save latest version number and saved in <em><a title="Android SharedPreferences" href="http://developer.android.com/reference/android/content/SharedPreferences.html" target="_blank">SharedPreferences</a> </em>with default value is 0 (<span style="color: #008000;">line 18</span>).</li>
<pre class="brush: java; title: ;">
int savedVersionNumber	= sharedPref.getInt(VERSION_KEY, 0);
</pre>
<li>When application starts for the first time, it compares <em>currentVersionNumber</em> with <em>savedVersionNumber</em>. Because there was no value set for <em>savedVersionNumber</em> before, the value is set to 0 (<span style="color: #008000;">line 18</span>) so <em>currentVersionNumber</em> is greater then savedVersionNumber then the <em>What&#8217;s New</em> dialog displayed (<em><span style="color: #339966;">line 26</span></em>). The value of <em>currentVersionNumber</em> then saved into <em>SharedPreferences</em> for later use (<em><span style="color: #339966;">28-31</span></em>) so the dialog will not be displayed anymore until the application is updated. Next time when the application updated, <em>currentVersionNumber</em> value will be greater than <em>savedVersionNumber</em> so the <em>What&#8217;s New</em> dialog is displayed again.</li>
<pre class="brush: java; title: ;">
if (currentVersionNumber &gt; savedVersionNumber) {
   	 		showWhatsNewDialog();

   	 		Editor editor	= sharedPref.edit();

   	 		editor.putInt(VERSION_KEY, currentVersionNumber);
   	 		editor.commit();
   	 	}
</pre>
</ul>
<p><a href="http://londatiga.net/downloads/WhatsNew.zip" target="_blank">Download source code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/programming/android/how-to-show-whats-new-dialog-in-android-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Import Contacts from Blackberry into Android</title>
		<link>http://www.londatiga.net/it/how-to-import-contacts-from-blackberry-into-android/</link>
		<comments>http://www.londatiga.net/it/how-to-import-contacts-from-blackberry-into-android/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 10:37:04 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[account sync]]></category>
		<category><![CDATA[android blackbery contact]]></category>
		<category><![CDATA[android sync]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[gmail contact]]></category>
		<category><![CDATA[gmail sync]]></category>
		<category><![CDATA[import contact]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=912</guid>
		<description><![CDATA[Nowdays, with the fastest growing of Android and its popularity, many people change their smartphone to Android. One of the most important thing when changing to a new phone is to keep our contacts from older smartphone. The process to backup and restore is easy when the change is from the same platform but it [...]]]></description>
			<content:encoded><![CDATA[<p>Nowdays, with the fastest growing of <a title="Android" href="http://www.londatiga.net/category/it/programming/android/" target="_blank">Android</a> and its popularity, many people change their smartphone to<strong> </strong>Android. One of the most important thing when changing to a new phone is to keep our contacts from older smartphone. The process to backup and restore is easy when the change is from the same platform but it might be difficult if the change is from different platform. I had this problem when my friend asked me to upgrade his phone from <strong>Blackberry </strong>to<strong> Android</strong>.</p>
<p>My solution was simple, since my friend didn&#8217;t use <strong>Gmail</strong> on his <a title="Blackberry" href="http://www.blackberry.com">Blackberry</a> i had to backup the contacts using <strong>Blackberry Desktop Software</strong> into a <a title="CSV" href="http://en.wikipedia.org/wiki/Comma-separated_values" target="_blank">CSV</a> file (comma separated) then import it into<a title="Gmail" href="http://gmail.com" target="_blank"> Gmail</a> contact. Android then will automatically sync the contacts from Gmail into phone&#8217;s contact list using <strong>Android Account Sync</strong> feature. In this tutorial i&#8217;ll try to explain the import steps in a simple way so it can be easily understood by people who are new to Android .</p>
<p>Note that there is another way to import contacts from Blackberry. If you already use Gmail on your Blackberry, you can turn on the <strong>Contact Sync</strong> option on Email settings so your contacts will be synced automatically with Gmail contact. This tutorial is suitable for people who do not use Gmail on their Blackberry.</p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/11/blackberry_gmail_contact_sync.jpg"><img class="alignnone size-full wp-image-922" title="blackberry_gmail_contact_sync" src="http://www.londatiga.net/wp-content/uploads/2011/11/blackberry_gmail_contact_sync.jpg" alt="blackberry_gmail_contact_sync" width="322" height="242" /></a></p>
<p><strong>1. Backup Blackberry contacts to computer.</strong></p>
<p>The first step is to backup your Blackberry contacts to computer using<strong> Blackberry Desktop Software</strong>. If you don&#8217;t have the software installed, go to this <a title="Blackberry Desktop Software" href="http://us.blackberry.com/apps-software/desktop/" target="_blank">link</a> and download the appropriate version for your computer (Windows PC or Mac).</p>
<ul>
<li>Run the Blackberry Desktop Software and connect your Blackberry device to computer using USB cable.</li>
<p><a href="http://londatiga.net/images/blackberrycontact/blackberry_desktop_software.jpg"><img class="alignnone" title="Blackberry Desktop Software" src="http://londatiga.net/images/blackberrycontact/blackberry_desktop_software_s.jpg" alt="" width="450" height="338" /></a></p>
<li>Go to <strong>Organizer</strong> menu then click the<strong> Configure settings</strong> button</li>
<p><a href="http://londatiga.net/images/blackberrycontact/blackberry_desktop_organizer.jpg"><img class="alignnone" title="Blackberry Desktop Software Organizer" src="http://londatiga.net/images/blackberrycontact/blackberry_desktop_organizer_s.jpg" alt="" width="450" height="337" /></a></p>
<li>A new dialog will be opened then click the <strong>Address Book</strong> option</li>
<p><a href="http://londatiga.net/images/blackberrycontact/blackberry_desktop_sync_addressbook.jpg"><img class="alignnone" title="Blackberry Software Sync Address Book" src="http://londatiga.net/images/blackberrycontact/blackberry_desktop_sync_addressbook_s.jpg" alt="" width="450" height="356" /></a></p>
<li>After clicking the Address book option, a new dialog will be opened. Choose the<strong> ASCII Importer/Exporter</strong> option then click <strong>Next</strong></li>
<p><a href="http://londatiga.net/images/blackberrycontact/blackberry_desktop_sync_ascii.jpg"><img class="alignnone" title="Blackberry Software Sync Address Book" src="http://londatiga.net/images/blackberrycontact/blackberry_desktop_sync_ascii_s.jpg" alt="" width="450" height="327" /></a></p>
<li>On <strong>Synchronization options</strong> dialog, choose the <strong>one way sync from Device</strong> option then click <strong>Next</strong></li>
<p><strong><a href="http://londatiga.net/images/blackberrycontact/blackberry_desktop_sync_direction.jpg"><img class="alignnone" title="Blackberry Desktop Sync" src="http://londatiga.net/images/blackberrycontact/blackberry_desktop_sync_direction_s.jpg" alt="" width="450" height="323" /></a><br />
</strong></p>
<li>On <strong>ASCII Importer/Exporter options for Address Book</strong> dialog, click the <strong>Options </strong>button then choose <strong>Comma </strong>on options dialog.</li>
<p><a href="http://londatiga.net/images/blackberrycontact/blackberry_desktop_ascii_option.jpg"><img class="alignnone" title="Blackberry Desktop Sync Option" src="http://londatiga.net/images/blackberrycontact/blackberry_desktop_ascii_option_s.jpg" alt="" width="450" height="327" /></a><br />
<img class="alignnone" src="http://londatiga.net/images/blackberrycontact/ascii_option.jpg" alt="" width="354" height="238" /></p>
<li>Still on the same dialog, click the <strong>Browse</strong> button then point to the directory where you want to put the exported contacts file. Give it any name you want with csv extension (ex: contacts.csv). Note that the csv extension is not mandatory, you can use .txt or any type you want.</li>
<p><img class="alignnone" src="http://londatiga.net/images/blackberrycontact/ascii_save.jpg" alt="" width="450" height="330" /></p>
<li>Click the<strong> Next</strong> button then<strong> Finish</strong>, your final <strong>Organizer</strong> menu display should be like this:</li>
<p><a href="http://londatiga.net/images/blackberrycontact/blackberry_desktop_organizer_final.jpg"><img class="alignnone" title="Blackberry Desktop Organizer" src="http://londatiga.net/images/blackberrycontact/blackberry_desktop_organizer_final_s.jpg" alt="" width="450" height="337" /></a></p>
<li>Click the <strong>Sync</strong> button to start syncing. When the sync completes, click the <strong>Accept </strong>button on the dialog that appears after it. Go to the directory where you save the contact file. If you have Microsoft Excel installed, try to double click on the file then it will be opened on Excel, you can see the list of your contacts there. You can also open the file using notepad or other text editing softwares.</li>
<li>Now you already have the Blackberry contacts on a comma separated format file (csv). It is time to import the file into Gmail contact.</li>
</ul>
<p><strong>2.</strong> <strong>Import contacts into Gmail</strong></p>
<p></p>
<p>The next step is to load the contacts from csv file into Gmail contact list.</p>
<ul>
<li>Go to <a title="Gmail" href="http://gmail.com" target="_blank">gmail.com</a> then log in using your Gmail account.</li>
<li>Open the <strong>Contact</strong> menu</li>
<div id="attachment_915" class="wp-caption alignnone" style="width: 282px"><a href="http://www.londatiga.net/wp-content/uploads/2011/11/gmail_contact_menu_old.jpg"><img class="size-full wp-image-915 " title="gmail contact menu old" src="http://www.londatiga.net/wp-content/uploads/2011/11/gmail_contact_menu_old.jpg" alt="Gmail Contact on Old Layout" width="272" height="157" /></a><p class="wp-caption-text">Gmail Contact on Old Layout</p></div>
<div id="attachment_915" class="wp-caption alignnone" style="width: 282px"><a href="http://www.londatiga.net/wp-content/uploads/2011/11/gmail_contact_menu_new.jpg"><img class="size-full wp-image-915 " title="gmail contact menu old" src="http://www.londatiga.net/wp-content/uploads/2011/11/gmail_contact_menu_new.jpg" alt="Gmail Contact on New Layout" width="272" height="157" /></a><p class="wp-caption-text">Gmail Contact on New Layout</p></div>
<li>Click the<strong> Import Contacts</strong> menu then select the csv file.</li>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/11/gmail_import_contact.jpg"><img class="alignnone size-full wp-image-917" title="gmail import contact" src="http://www.londatiga.net/wp-content/uploads/2011/11/gmail_import_contact.jpg" alt="gmail import contact" width="450" height="250" /></a></p>
<li>Click the <strong>Import </strong>button and wait untill the process completes. If no error occured, you should see your Blackberry contacts now on your Gmail contact list.</li>
</ul>
<p><strong>3. Sync Gmail contact from Android</strong></p>
<p>Ok now you&#8217;ve almost done, it is time to sync Gmail contact into your shiny new Android phone. There are two cases when you want to import Gmail contact:</p>
<p>a. If you already use the Gmail account that contains imported contacts as your Android primary account:</p>
<ul>
<li>Go to <strong>Settings -&gt; Account &amp; sync</strong></li>
<p><strong><a href="http://www.londatiga.net/wp-content/uploads/2011/11/android_account_settings.jpg"><img class="alignnone size-full wp-image-918" title="android account &amp; sync settings" src="http://www.londatiga.net/wp-content/uploads/2011/11/android_account_settings.jpg" alt="android account &amp; sync settings" width="200" height="333" /></a><br />
</strong></p>
<li>Make sure the <strong>Background data</strong> and <strong>Auto-sync</strong> option enabled</li>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/11/android_account_sync.jpg"><img class="alignnone size-full wp-image-919" title="android account sync" src="http://www.londatiga.net/wp-content/uploads/2011/11/android_account_sync.jpg" alt="android account sync" width="200" height="333" /></a></p>
<li>Click on your primary account</li>
<li>Enable the <strong>Sync Contacts</strong> option</li>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/11/android_sync_contacts.jpg"><img class="alignnone size-full wp-image-920" title="android sync contacts" src="http://www.londatiga.net/wp-content/uploads/2011/11/android_sync_contacts.jpg" alt="android sync contacts" width="200" height="333" /></a></ul>
<p>b. If the Gmail account that contains imported contacts differs from your Android primary account, you have to add the account into <strong>Account &amp; Sync</strong> settings:</p>
<ul>
<li>Go to <strong>Settings -&gt; Account &amp; sync </strong>[see case-a,step-1]</li>
<li>Click <strong>Add account </strong>button [see case-1, pic-2]</li>
<li>Choose <strong>Google</strong> and follow the wizard</li>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/11/android_add_account.jpg"><img class="alignnone size-full wp-image-921" title="android add account" src="http://www.londatiga.net/wp-content/uploads/2011/11/android_add_account.jpg" alt="android add account" width="200" height="333" /></a></p>
<li>Enable the contacts sync as described on step-a pic-3.</li>
</ul>
<p>Now just wait for several minutes, your contacts will be loaded automatically into your Android contact list.  Note that the above images taken from <strong>Nexus S </strong>with <strong>Gingebread OS</strong> version. Your menu settings may differ from images above if you use different android version or custom manufacturer UI.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-import-contacts-from-blackberry-into-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Tips: How to Use Custom Transition Animation in Android</title>
		<link>http://www.londatiga.net/it/programming/coding-tips-how-to-use-custom-transition-animation-on-android/</link>
		<comments>http://www.londatiga.net/it/programming/coding-tips-how-to-use-custom-transition-animation-on-android/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 15:21:06 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[custom animation]]></category>
		<category><![CDATA[pending transition]]></category>
		<category><![CDATA[transition animation]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=893</guid>
		<description><![CDATA[Android has a set of Animation API that makes you easily create custom animations in your Android application. You can create animations programmatically via Java code or defined them in xml files inside /res/anim folder. Using your custom animation, you can override the default transition animation between activities to make your app looks more elegant. [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Android" href="http://www.londatiga.net/category/it/programming/android/" target="_blank">Android</a> has a set of <a title="Android Animation " href="http://developer.android.com/reference/android/animation/package-summary.html" target="_blank">Animation API</a> that makes you easily create custom animations in your Android application. You can create animations programmatically via Java code or defined them in xml files inside <em>/res/anim</em> folder. Using your custom animation, you can override the default transition animation between activities to make your app looks more elegant. Overriding the default transition animation is easy, just create two custom animations and call the <em>overridePendingTransition</em> method of <a href="http://developer.android.com/reference/android/app/Activity.html" target="_blank">Activity</a> class to use them.</p>
<p>How to use custom transition animation:</p>
<ul>
<li>Create two animation files (xml), one for incoming activity <em>(/anim/incoming.xml</em>) and one for outgoing activity <em>(/anim/outgoing.xml</em>).<br />
<img class="alignnone size-full wp-image-894" title="Android Transition Animation" src="http://www.londatiga.net/wp-content/uploads/2011/09/Screen-shot-2011-09-29-at-9.37.33-PM.png" alt="Android Transition Animation" width="287" height="275" /></p>
<p><span style="color: #008000;">incoming.xml</span></p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;set xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;

	&lt;translate
		android:interpolator=&quot;@android:anim/accelerate_interpolator&quot;
        android:fromXDelta=&quot;0&quot;
        android:toXDelta=&quot;0&quot;
        android:duration=&quot;300&quot;/&gt;

    &lt;scale
	    android:pivotX=&quot;50%&quot;
	    android:pivotY=&quot;50%&quot;
	    android:fromXScale=&quot;0&quot;
	    android:fromYScale=&quot;0&quot;
	    android:toXScale=&quot;1.0&quot;
	    android:toYScale=&quot;1.0&quot;
	    android:startOffset=&quot;300&quot;
	    android:duration=&quot;300&quot; /&gt;
&lt;/set&gt;
</pre>
<p><span style="color: #008000;">outgoing.xml</span></p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;set xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;

	&lt;translate
        android:fromXDelta=&quot;0&quot;
        android:toXDelta=&quot;-50%p&quot;
        android:duration=&quot;300&quot; /&gt;

    &lt;scale
	    android:pivotX=&quot;50%&quot;
	    android:pivotY=&quot;50%&quot;
	    android:fromXScale=&quot;1.0&quot;
	    android:fromYScale=&quot;1.0&quot;
	    android:toXScale=&quot;.1&quot;
	    android:toYScale=&quot;.1&quot;
	    android:startOffset=&quot;300&quot;
	    android:duration=&quot;400&quot; /&gt;
&lt;/set&gt;
</pre>
</li>
<li>Call method <em>overridePendingTransition (int enterAnim, int exitAnim) </em>right after s<em>tartActivity(intent)</em> to override default transition animation between current activity and next activity.
<pre class="brush: java; title: ;">
Intent intent = new Intent(this, NextActivity.class);

startActivity(intent);
overridePendingTransition (R.anim.incoming, R.anim.outgoing)
</pre>
</li>
<li>To use custom transition animation between current activity and previous activity (when user press the back key to get back to previous activity) override the <span style="text-decoration: underline;"><em>onBackPressed</em></span><em> ()</em> method and call the <em>overridePendingTransition (int enterAnim, int exitAnim) </em>method. 
<pre class="brush: java; title: ;">
@Override
public void onBackPressed() {
  super.onBackPressed();
  overridePendingTransition(R.anim.customanim1, R.anim.customanim2)
}
</pre>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/programming/coding-tips-how-to-use-custom-transition-animation-on-android/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Coding Tips: How to Use Custom Font in Android</title>
		<link>http://www.londatiga.net/it/programming/coding-tips-how-to-use-custom-font-in-android/</link>
		<comments>http://www.londatiga.net/it/programming/coding-tips-how-to-use-custom-font-in-android/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 12:37:57 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[android customfont]]></category>
		<category><![CDATA[android open type]]></category>
		<category><![CDATA[android true type]]></category>
		<category><![CDATA[custom font]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=888</guid>
		<description><![CDATA[If you are new to Android development and wondering how to use custom font, here is a quick tip to use custom font in your Android application. Using custom font in Android is pretty simple, just copy the custom font files  and load them from your application.

Copy your custom font files into assets directory. The [...]]]></description>
			<content:encoded><![CDATA[<p>If you are new to <a href="http://www.londatiga.net/it/how-to-setup-android-application-development-on-eclipse/" target="_blank">Android development</a> and wondering how to use <strong>custom font</strong>, here is a quick tip to use custom font in your Android application. Using custom font in Android is pretty simple, just copy the custom font files  and load them from your application.</p>
<ul>
<li>Copy your custom font files into <em>assets</em> directory. The font files can be a True Type (ttf) font or Open Type font (.otf)<img class="alignnone size-full wp-image-890" title="custom font android" src="http://www.londatiga.net/wp-content/uploads/2011/09/custom_font_android.png" alt="custom font android" width="288" height="141" /></li>
<li>From your application code, load the font using<em> <span>Typeface</span><a title="Android Typeface" href="http://developer.android.com/reference/android/graphics/Typeface.html#createFromAsset%28android.content.res.AssetManager,%20java.lang.String%29" target="_blank"><span>.</span></a></em><em>createFromAsset<span>(</span><span>getAssets</span><span>(), </span><span>&#8220;fontname.otf&#8221;</span></em><span>)<a title="Android Typeface" href="http://developer.android.com/reference/android/graphics/Typeface.html#createFromAsset%28android.content.res.AssetManager,%20java.lang.String%29" target="_blank"> </a>method</span>
<pre class="brush: java; title: ;">
Typeface font = Typeface.createFromAsset(getAssets(), &quot;helvetica.otf&quot;);
</pre>
</li>
<li><span>To use the loaded custom font, use <em>setTypeface</em> method on the widget you want to apply, for example, to use it on TextView, use <em>textViewObj.setTypeface(customfont)</em>.</span>
<pre class="brush: java; title: ;">
TextView myTextView = (TextView) findViewById(R.id.tv_mytext);

myTextView.setTypeface(font);
</pre>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/programming/coding-tips-how-to-use-custom-font-in-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Four Best Chrome Extensions for Reading JSON</title>
		<link>http://www.londatiga.net/it/four-best-chrome-extensions-for-reading-json/</link>
		<comments>http://www.londatiga.net/it/four-best-chrome-extensions-for-reading-json/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 09:49:41 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chrome extension]]></category>
		<category><![CDATA[chrome json extension]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json formatting]]></category>
		<category><![CDATA[json reader]]></category>
		<category><![CDATA[json viewer]]></category>
		<category><![CDATA[restful]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=878</guid>
		<description><![CDATA[As a software developer that deals much with RESTful API, reading raw JSON data on browser can be a pain. It always easier  to read a well formatted JSON in tree view than  in raw data format. Luckily, Chrome has some extensions that could format raw JSON data into tree view format that can be [...]]]></description>
			<content:encoded><![CDATA[<p>As a software developer that deals much with <a title="RESTful" href="http://en.wikipedia.org/wiki/Representational_state_transfer" target="_blank">RESTful </a>API, reading raw <strong>JSON</strong> data on browser can be a pain. It always easier  to read a well formatted JSON in tree view than  in raw data format. Luckily, <a title="Google Chrome" href="http://www.google.com/chrome" target="_blank">Chrome</a> has some extensions that could format raw JSON data into tree view format that can be read easily. Here i&#8217;ll will show  four best <strong>Chrome extensions</strong> for reading JSON on Chrome browser, most of them work perfectly and very easy to use.</p>
<ol>
<li><a title="JSONView, Chrome extension for reading JSON" href="https://chrome.google.com/webstore/detail/chklaanhfefbnpoihckbnefhakgolnmc" target="_blank">JSONView</a><br />
This extension is a porting from original <a title="JSONView Firefox Extension" href="http://jsonview.com/" target="_blank">JSONView Firefox extension</a> and supports <a href="http://en.wikipedia.org/wiki/JSON#JSONP" target="_blank">JSONP</a>. It validates JSON using a client-side javascript implementation of <a title="JSONLint" href="http://github.com/zaach/jsonlint" target="_blank">JSONLint</a> and compliant with <a href="http://www.ietf.org/rfc/rfc4627.txt" target="_blank">rfc 4627</a>.<br />
JSONView  supports syntax highlighting and displays JSON in tree view where the nodes on the tree can be collapsed and expanded by clicking on the plus (+) or minus (-) sign on  the left of each node.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/jsonview_chrome_extension.jpg"><img class="alignnone size-full wp-image-879" title="jsonview chrome extension" src="http://www.londatiga.net/wp-content/uploads/2011/09/jsonview_chrome_extension.jpg" alt="jsonview chrome extension" width="475" height="354" /></a></li>
<li><a title="JSONFormatter, Chrome extension for reading JSON" href="https://chrome.google.com/webstore/detail/bcjindcccaagfpapjjmafapmmgkkhgoa?hc=search&amp;hcp=main" target="_blank">JSONFormatter</a><br />
JSONFormatter supports syntax highlighting and displays JSON in tree view where the nodes on the tree can be collapesed and expanded by clicking on the triangle icon on the left of each node. It also provides a button for switching to original (raw) data.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/jsonformatter_chrome_extension.jpg"><img class="alignnone size-full wp-image-881" title="jsonformatter chrome extension" src="http://www.londatiga.net/wp-content/uploads/2011/09/jsonformatter_chrome_extension.jpg" alt="jsonformatter chrome extension" width="454" height="347" /></a></li>
<li><a title="PrettyJSON Chrome Extension" href="https://chrome.google.com/webstore/detail/ddngkjbldiejbheifcmnfmmfiniimbbg" target="_blank">PrettyJSON</a><br />
PrettyJSON supports syntax highlighting and displays JSON in tree view. Unlike the two previous extensions, the nodes on the tree can not be collapsed and expanded. And because of it doesn&#8217;t check for a valid content type (application/json), it will not format JSON data that comes from a URL without &#8216;json&#8217; appended. For example, it will display correctly the JSON data that comes from http://example.com/data.json but will not work if the JSON data comes from http://example.com/data.php.<br />
<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/prettyjson_chrome_extension.jpg"><img class="alignnone size-full wp-image-882" title="prettyjson chrome extension" src="http://www.londatiga.net/wp-content/uploads/2011/09/prettyjson_chrome_extension.jpg" alt="prettyjson chrome extension" width="463" height="371" /></a></li>
<li><a title="JSON Prettifier, Chrome extension for json reading" href="https://chrome.google.com/webstore/detail/kccpfgilgmgbipamhohknpokhibinhhj?hc=search&amp;hcp=main" target="_blank">JSON Prettifier</a><br />
JSON Prettifier  supports syntax highlighting and displays JSON in tree view where the nodes on the tree can be collapsed and expanded by clicking on the plus (+) or minus (-) sign on  the left of each node. It also has a button for switching to original (raw) data.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/jsonprettifier_chrome_extension.jpg"><img class="alignnone size-full wp-image-883" title="jsonprettifier chrome extension" src="http://www.londatiga.net/wp-content/uploads/2011/09/jsonprettifier_chrome_extension.jpg" alt="jsonprettifier chrome extension" width="459" height="422" /></a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/four-best-chrome-extensions-for-reading-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Delete Preinstalled Android Application</title>
		<link>http://www.londatiga.net/it/how-to-delete-preinstalled-android-application/</link>
		<comments>http://www.londatiga.net/it/how-to-delete-preinstalled-android-application/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 05:22:05 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[android preinstalled application]]></category>
		<category><![CDATA[remove preinstalled application]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[terminal emulator]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=875</guid>
		<description><![CDATA[When buying an Android phone, sometimes it comes with preinstalled applications either from manufacturer or network operator. These preinstalled applications can not be easily removed from application manager unless you have root access. If you already have root access, follow the following steps to remove the preinstalled applications:

Login into Android shell, you can use adb [...]]]></description>
			<content:encoded><![CDATA[<p>When buying an<strong> Android</strong> phone, sometimes it comes with preinstalled applications either from manufacturer or network operator. These preinstalled applications can not be easily removed from application manager unless you have <strong>root</strong> access. If you already have root access, follow the following steps to remove the preinstalled applications:</p>
<ul>
<li>Login into Android shell, you can use <a title="How to use ADB command line" href="http://www.londatiga.net/it/how-to-use-android-adb-command-line-tool/" target="_blank">adb</a> tool or terminal application such as <a href="https://market.android.com/details?id=jackpal.androidterm&amp;feature=search_result" target="_blank">Android Terminal Emulator </a>.</li>
<li>Type <em><span style="color: #008000;">su</span></em> to login as root</li>
<li>Type <em><span style="color: #008000;">mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system</span> </em>to enable read-write mode</li>
<li>Type<em> <span style="color: #008000;">cd /system/app</span>, </em>to enter the applications directory</li>
<li>Tyle <em><span style="color: #008000;">ls </span></em>to view the list of existing applications</li>
<li>Type <em><span style="color: #008000;">rm AppilicationName.apk</span> </em>to delete an application. For example, to delete Facebook app, just type <em><span style="color: #008000;">rm Facebook.apk</span></em></li>
</ul>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-delete-preinstalled-android-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Send Image to Twitpic from Android</title>
		<link>http://www.londatiga.net/it/how-to-send-image-to-twitpic-from-android/</link>
		<comments>http://www.londatiga.net/it/how-to-send-image-to-twitpic-from-android/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 07:14:39 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[android twitpic]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[post image twitpic]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[send image]]></category>
		<category><![CDATA[twitpic]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=855</guid>
		<description><![CDATA[Twitpic is one of the most common used image hosting that allows users to easily post images to Twitter and other social media. Twitpic can be used independently of Twitter, in a way similar to Google Picasa or Flickr. TwitPic usernames and passwords are the same as the ones in Twitter so it doesn&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Twitpic </strong>is one of the most common used image hosting that allows users to easily post images to Twitter and other social media. <a href="http://twitpic.com" target="_blank">Twitpic</a> can be used independently of Twitter, in a way similar to Google Picasa or Flickr. TwitPic usernames and passwords are the same as the ones in Twitter so it doesn&#8217;t have to create new account on Twitpic.</p>
<p>As many other social media, Twitpic also provides <a title="Twitpic API" href="http://dev.twitpic.com/docs/" target="_blank">RESTful API</a> to enable developers to post image to Twitpic. The current version at the time of this writing is version 2 (V2). Using this API, we can build an Android application that features an image upload to Twitpic so we don&#8217;t have to create a new infrastructure for image hosting server.</p>
<p>In this tutorial i&#8217;ll explain how to send image to Twitpic from an Android application using <a title="Twitter4j" href="http://twitter4j.org/en/index.html" target="_blank">Twitter4j</a> library. The source code for this tutorial can be downloaded from my github page (see the download link at the bottom of this post).</p>
<p><strong>I. Register Application</strong></p>
<p>To enable an Android application to send image to Twitpic, first you have to register your application to get an API Key. To get an API Key:</p>
<ul>
<li>Go to <a title="Twitpic Register App" href="http://dev.twitpic.com/" target="_blank">Twitpic developer page</a> and click the <em>Register</em> link. If you&#8217;re not logged in before, you have to sign in to Twitpic using your Twitter account.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register.jpg"><img class="alignnone size-full wp-image-856" title="android twitpic register app" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register.jpg" alt="android twitpic register app" width="484" height="112" /></a></li>
<li>Register your application.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register2.jpg"><img class="alignnone size-full wp-image-857" title="android twitpic register app" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_register2.jpg" alt="android twitpic register app" width="486" height="333" /></a></li>
<li>Save the API Key.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_apikey.jpg"><img class="alignnone size-full wp-image-858" title="android twitpic apikey" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_apikey.jpg" alt="android twitpic apikey" width="484" height="103" /></a></li>
</ul>
<p><strong>II. Android Integration</strong></p>
<p>In my sample project i use <em>Twitter4j</em> library to send image to Twitpic. You can download the latest version from Twitter4j download page or use the library package  i&#8217;ve provided in this tutorial. To enable Android to send image to Twitpic, first you have to connect to Twitter first using a Twitter account. How to connect to Twitter will not be explained here, you can read my previous tutorial on <a title="Twitter status android" href="http://www.londatiga.net/how-to-post-twitter-status-from-android/" target="_blank">how to post Twitter status from Android</a>. So basically to be enable to send image to Twitpic, first you have to sign in to Twitter, get the access token and use the access token along with Twitter consumer key, secret key and Twitpic API key.</p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_eclipse.jpg"><img class="alignnone size-full wp-image-859" title="android twitpic eclipse" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic_eclipse.jpg" alt="android twitpic eclipse" width="230" height="330" /></a></p>
<p>In my sample project, i create two packages. The first is for Twitter library, which can be found also on my previous Twitter tutorial sample project and the second is the main application page.</p>
<p><span style="text-decoration: underline;">Connect to Twitter (ConnectActivity.java)</span></p>
<p>This activity displays the Twitter login page and  authenticates user to get the access token. More comprehensive explanation can be found on my previous tutorial.</p>
<p><img class="alignnone size-full wp-image-860" title="android twitter signin" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitter_signin.jpg" alt="android twitter signin" width="200" height="333" /> <img class="alignnone size-full wp-image-861" title="android twitter signin" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitter_signin2.jpg" alt="android twitter signin" width="200" height="333" /></p>
<p><span style="text-decoration: underline;">Send Image to Twitpic (SendImageActivity.java)</span></p>
<p>In this activity, using an image picker, the image to be sent can be from existing images on sdcard or directly taking a picture from camera. You can read my previous tutorial on <a title="Android Image Picker" href="http://www.londatiga.net/how-to-create-android-image-picker/" target="_blank">how to create image picker on Android </a>to get more deep understanding on how it works. The classes from Twitter4j that are used to send image to Twitpic are:</p>
<pre class="brush: java; title: ;">
import twitter4j.conf.Configuration;
import twitter4j.conf.ConfigurationBuilder;
import twitter4j.http.AccessToken;
import twitter4j.http.OAuthAuthorization;
import twitter4j.util.ImageUpload;
</pre>
<pre class="brush: java; title: ;">
 private class ImageSender extends AsyncTask&lt;URL, Integer, Long&gt; {
    	private String url;

    	protected void onPreExecute() {
			mProgressDialog = ProgressDialog.show(SendImageActivity.this, &quot;&quot;, &quot;Sending image...&quot;, true);

			mProgressDialog.setCancelable(false);
			mProgressDialog.show();
		}

        protected Long doInBackground(URL... urls) {
            long result = 0;

            TwitterSession twitterSession	= new TwitterSession(SendImageActivity.this);
            AccessToken accessToken 		= twitterSession.getAccessToken();

			Configuration conf = new ConfigurationBuilder()
            .setOAuthConsumerKey(twitter_consumer_key)
            .setOAuthConsumerSecret(twitter_secret_key)
            .setOAuthAccessToken(accessToken.getToken())
            .setOAuthAccessTokenSecret(accessToken.getTokenSecret())
            .build();

			OAuthAuthorization auth = new OAuthAuthorization (conf, conf.getOAuthConsumerKey (), conf.getOAuthConsumerSecret (),
	                new AccessToken (conf.getOAuthAccessToken (), conf.getOAuthAccessTokenSecret ()));

	        ImageUpload upload = ImageUpload.getTwitpicUploader (twitpic_api_key, auth);

	        Log.d(TAG, &quot;Start sending image...&quot;);

	        try {
	        	url = upload.upload(new File(mPath));
	        	result = 1;

	        	Log.d(TAG, &quot;Image uploaded, Twitpic url is &quot; + url);
	        } catch (Exception e) {
	        	Log.e(TAG, &quot;Failed to send image&quot;);

	        	e.printStackTrace();
	        }

            return result;
        }

        protected void onProgressUpdate(Integer... progress) {
        }

        protected void onPostExecute(Long result) {
        	mProgressDialog.cancel();

        	String text = (result == 1) ? &quot;Image sent successfully.\n Twitpic url is: &quot; + url : &quot;Failed to send image&quot;;

        	Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();
        }
    }
</pre>
<p>In this example, i use asynchronous task to send image to Twitpic, you can use more convenience way to send the image such as using background service with queue to manage uploading multiple images. The main code for sending image to Twitpic defined in <em>doInBackground()</em> method.</p>
<p>line 14: create an object of<em> TwitterSession</em> class to get the accsess token that was previously saved when user was successfully authenticated.</p>
<p>line 15: get the access token object.</p>
<p>line 16: create the configuration object with <em>Twitter consumer key, secret key, access token </em>and <em>access token secret</em> as parameters.</p>
<p>line 24: create the authorization object.</p>
<p>line 27: create the Twitpic image uploader object.</p>
<p>line 32: upload the image file to Twitpic, the method uses file path to the image that was selected from image picker.</p>
<p>lin3 35: if success, the upload method will return the Twitpic url to the uploaded image, ex: http://twitpic.com/6hqd44</p>
<p><img class="alignnone size-full wp-image-863" title="android twitpic" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_twitpic.jpg" alt="android twitpic" width="200" height="333" /></p>
<p></p>
<p><strong>Download</strong></p>
<ul>
<li>Download source code from <a title="Android Twitpic" href="https://github.com/lorensiuswlt/AndroidTwitpic" target="_blank">my github page</a></li>
<li>Download Twitter external jars <a href="http://londatiga.net/downloads/Twitter_ExtJars.zip" target="_blank">(Twitter4j and signpost)</a></li>
</ul>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-send-image-to-twitpic-from-android/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Create Android Image Picker</title>
		<link>http://www.londatiga.net/it/how-to-create-android-image-picker/</link>
		<comments>http://www.londatiga.net/it/how-to-create-android-image-picker/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 17:54:32 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[file manager]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[image chooser]]></category>
		<category><![CDATA[image picker]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=846</guid>
		<description><![CDATA[In my previous tutorial on how to select  and crop image on Android, i&#8217;ve explained how to create image picker/chooser to select an image from sdcard or camera then crop the selected image. The tutorial is quite advanced and on many cases in our application, we only need to select the image without cropping it. [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous tutorial on <a title="Android Image Crop" href="http://www.londatiga.net/how-to-select-and-crop-image-on-android/" target="_blank">how to select  and crop image on Android</a>, i&#8217;ve explained how to create <strong>image picker/chooser</strong> to select an image from sdcard or camera then crop the selected image. The tutorial is quite advanced and on many cases in our application, we only need to select the image without cropping it. So i made a simplified example to show how to create an image chooser.</p>
<pre class="brush: java; title: ;">
public class MainActivity extends Activity {
	private Uri mImageCaptureUri;
	private ImageView mImageView;

	private static final int PICK_FROM_CAMERA = 1;
	private static final int PICK_FROM_FILE = 2;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        final String [] items			= new String [] {&quot;From Camera&quot;, &quot;From SD Card&quot;};
		ArrayAdapter&lt;String&gt; adapter	= new ArrayAdapter&lt;String&gt; (this, android.R.layout.select_dialog_item,items);
		AlertDialog.Builder builder		= new AlertDialog.Builder(this);

		builder.setTitle(&quot;Select Image&quot;);
		builder.setAdapter( adapter, new DialogInterface.OnClickListener() {
			public void onClick( DialogInterface dialog, int item ) {
				if (item == 0) {
					Intent intent 	 = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
					File file		 = new File(Environment.getExternalStorageDirectory(),
							   			&quot;tmp_avatar_&quot; + String.valueOf(System.currentTimeMillis()) + &quot;.jpg&quot;);
					mImageCaptureUri = Uri.fromFile(file);

					try {
						intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mImageCaptureUri);
						intent.putExtra(&quot;return-data&quot;, true);

						startActivityForResult(intent, PICK_FROM_CAMERA);
					} catch (Exception e) {
						e.printStackTrace();
					}

					dialog.cancel();
				} else {
					Intent intent = new Intent();

	                intent.setType(&quot;image/*&quot;);
	                intent.setAction(Intent.ACTION_GET_CONTENT);

	                startActivityForResult(Intent.createChooser(intent, &quot;Complete action using&quot;), PICK_FROM_FILE);
				}
			}
		} );

		final AlertDialog dialog = builder.create();

		mImageView = (ImageView) findViewById(R.id.iv_pic);

		((Button) findViewById(R.id.btn_choose)).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				dialog.show();
			}
		});
    }

    @Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
	    if (resultCode != RESULT_OK) return;

		Bitmap bitmap 	= null;
		String path		= &quot;&quot;;

		if (requestCode == PICK_FROM_FILE) {
			mImageCaptureUri = data.getData();
			path = getRealPathFromURI(mImageCaptureUri); //from Gallery

			if (path == null)
				path = mImageCaptureUri.getPath(); //from File Manager

			if (path != null)
				bitmap 	= BitmapFactory.decodeFile(path);
		} else {
			path	= mImageCaptureUri.getPath();
			bitmap  = BitmapFactory.decodeFile(path);
		}

		mImageView.setImageBitmap(bitmap);
	}

	public String getRealPathFromURI(Uri contentUri) {
        String [] proj 		= {MediaStore.Images.Media.DATA};
        Cursor cursor 		= managedQuery( contentUri, proj, null, null,null);

        if (cursor == null) return null;

        int column_index 	= cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);

        cursor.moveToFirst();

        return cursor.getString(column_index);
	}
}
</pre>
<p>The code from my sample project above shows how to create a dialog that shows two options to select the image source. The first is from Camera, where the picture is taken directly from camera, and the second is from saved images on sdcard.</p>
<p>line 14: Define two image source options, <em>From Camera</em> and <em>From SD Card.</em></p>
<p>line 16-48: Setup the image picker dialog.</p>
<p>line 22: If user choose to take picture from Camera, create an intent to open Camera app with <em>MediaStore.ACTION_IMAGE_CAPTURE</em> action.</p>
<p>line 23: Create temporary file to hold the image from Camera.</p>
<p>line 24: Get the uri of temporary file</p>
<p>line 39: If user choose to select image from sdcard, start the intent to open image chooser dialog. The image chooser dialog will display list File Manager (if exist) apps and default Gallery app.</p>
<p>line 55: show the image picker dialog.</p>
<p><img class="alignnone size-full wp-image-848" title="android image picker" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_image_picker1.jpg" alt="android image picker" width="200" height="333" /> <img class="alignnone size-full wp-image-849" title="android image picker" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_image_picker2.jpg" alt="android image picker" width="200" height="333" /></p>
<p>line 61:  Override the  <em>onActivityResult</em> method to handle the selected image.</p>
<p>line 67: If user selects image from sdcard, get the uri of selected image (line 68)</p>
<p>line 69: Assume user selects the image from sdcard using Gallery app. The uri from Gallery app does not give the real path to selected image, so it has to be resolved on content provider. Method <em>getRealPathFromURI</em> used to resolve the real path from the uri.</p>
<p>line 71: If the path is null, assume user selects the image using File Manager app. File Manager app returns different information than Gallery app. To get the real path to selected image, use <em>getImagePath</em> method from the uri (line 72).</p>
<p>line 75: Get the bitmap.</p>
<p>line 77: If user choose to take picture from camera, get the real path of temporary file that previously defined on line 24-25.</p>
<p>line 78: Get the bitmap.</p>
<p>line 81: Display the bitmap on image view.</p>
<p><img class="alignnone size-full wp-image-850" title="android image picker" src="http://www.londatiga.net/wp-content/uploads/2011/09/android_image_picker3.jpg" alt="android image picker" width="200" height="333" /></p>
<p></p>
<p>Download source code of this tutorial on <a title="Android Image Picker" href="https://github.com/lorensiuswlt/AndroidImagePicker" target="_blank">my github page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-create-android-image-picker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Use Facebook SDK to Post Status From Android</title>
		<link>http://www.londatiga.net/it/how-to-use-facebook-sdk-to-post-status-from-android/</link>
		<comments>http://www.londatiga.net/it/how-to-use-facebook-sdk-to-post-status-from-android/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 10:35:45 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[facebook sdk]]></category>
		<category><![CDATA[facebook wall status]]></category>
		<category><![CDATA[post status facebook]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=825</guid>
		<description><![CDATA[One of the common features on current mobile application is the ability to share content on social media websites such as Facebook, Twitter and Foursquare. Most of the large social media provide API to enable developers to integrate third party application with their service. Facebook as the largest social media has a very well designed [...]]]></description>
			<content:encoded><![CDATA[<p>One of the common features on current mobile application is the ability to share content on social media websites such as Facebook, Twitter and Foursquare. Most of the large social media provide API to enable developers to integrate third party application with their service. <strong>Facebook </strong>as the largest social media has a very well designed API and available to many programming languages.</p>
<p>Facebook has an official<a title="Facebook Android SDK" href="https://github.com/facebook/facebook-android-sdk" target="_blank"> SDK for Android </a>platform that can be used easily by developers to integrate their application. In this tutorial, i&#8217;ll explain how to use <strong>Facebook SDK for Android </strong>to post status to Facebook wall from an Android application. I have written similar tutorial for Twitter to show <a title="Post Twitter Status from Android" href="http://www.londatiga.net/it/how-to-post-twitter-status-from-android/" target="_blank">how to post status to Twitter from Android</a> and for Foursquare to show <a title="How to use Foursquare API on Android" href="http://www.londatiga.net/featured-articles/how-to-use-foursquare-api-on-android-application/" target="_blank">how to connect and use Foursquare API on Android</a>.</p>
<p><strong>I. Register Facebook Application</strong></p>
<p>To enable user to post status to Facebook, first you have to create a Facebook application:</p>
<ul>
<li>Login to Facebook and go to<a title="Facebook Developer Page " href="https://developers.facebook.com/apps" target="_blank"> Facebook Developer </a>page then register your application by clicking the <em>Create New App</em> button on top right of the page.<br />
<img class="alignnone size-full wp-image-826" title="Create New Facebook App" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_create_app.png" alt="Create New Facebook App" width="292" height="84" /></li>
<li>Fill the <em>App Name</em> with your application name.<br />
<img class="alignnone size-full wp-image-827" title="Facebook Create New App" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_new_app.png" alt="Facebook Create New App" width="419" height="153" /></li>
<li>Note the <em>App ID</em><em>,</em> we will use it later on Android code. Note that you don&#8217;t have to select how app integrate with Facebook option, just click the <strong>Save Changes</strong> button.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_app_setting.jpg"><img class="alignnone size-full wp-image-828" title="Facebook App Setting" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_app_setting.jpg" alt="Facebook App Setting" width="442" height="332" /></a></li>
</ul>
<p><strong>II. Android Integration</strong></p>
<p>To integrate Facebook with Android, you can use official <strong>Facebook SDK for Android </strong>that can be downloaded from <a title="Facebook SDK Android" href="https://github.com/facebook/facebook-android-sdk" target="_blank">github</a> page. For sample project in this tutorial, i use old version of Facebook SDK downloaded from the github page with some small modification. If you want to use the latest version, just download the SDK from the link above.</p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_android_sdk.png"><img class="alignnone size-full wp-image-829" title="Facebook Android SDK" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_android_sdk.png" alt="Facebook Android SDK" width="260" height="378" /></a></p>
<p>In my sample project, i create two packages, one for Facebook SDK and the other for application main package.</p>
<p><span style="text-decoration: underline;">Code implementation</span></p>
<p><span style="text-decoration: underline;">1. Facebook Connection (TestConnect.java)</span></p>
<p>This example shows how to connect to Facebook, display webview dialog to authorize user then save the access token and username on shared preference for later use.</p>
<pre class="brush: java; title: ;">
public class TestConnect extends Activity {
	private Facebook mFacebook;
	private CheckBox mFacebookBtn;
	private ProgressDialog mProgress;

	private static final String[] PERMISSIONS = new String[] {&quot;publish_stream&quot;, &quot;read_stream&quot;, &quot;offline_access&quot;};

	private static final String APP_ID = &quot;*****app id ******&quot;;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        mFacebookBtn	= (CheckBox) findViewById(R.id.cb_facebook);

        mProgress		= new ProgressDialog(this);
        mFacebook		= new Facebook(APP_ID);

        SessionStore.restore(mFacebook, this);

        if (mFacebook.isSessionValid()) {
			mFacebookBtn.setChecked(true);

			String name = SessionStore.getName(this);
			name		= (name.equals(&quot;&quot;)) ? &quot;Unknown&quot; : name;

			mFacebookBtn.setText(&quot;  Facebook (&quot; + name + &quot;)&quot;);
			mFacebookBtn.setTextColor(Color.WHITE);
		}

        mFacebookBtn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				onFacebookClick();
			}
		});

        ((Button) findViewById(R.id.button1)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				startActivity(new Intent(TestConnect.this, TestPost.class));
			}
		});
    }

    private void onFacebookClick() {
		if (mFacebook.isSessionValid()) {
			final AlertDialog.Builder builder = new AlertDialog.Builder(this);

			builder.setMessage(&quot;Delete current Facebook connection?&quot;)
			       .setCancelable(false)
			       .setPositiveButton(&quot;Yes&quot;, new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			        	   fbLogout();
			           }
			       })
			       .setNegativeButton(&quot;No&quot;, new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			                dialog.cancel();

			                mFacebookBtn.setChecked(true);
			           }
			       });

			final AlertDialog alert = builder.create();

			alert.show();
		} else {
			mFacebookBtn.setChecked(false);

			mFacebook.authorize(this, PERMISSIONS, -1, new FbLoginDialogListener());
		}
	}

    private final class FbLoginDialogListener implements DialogListener {
        public void onComplete(Bundle values) {
            SessionStore.save(mFacebook, TestConnect.this);

            mFacebookBtn.setText(&quot;  Facebook (No Name)&quot;);
            mFacebookBtn.setChecked(true);
			mFacebookBtn.setTextColor(Color.WHITE);

            getFbName();
        }

        public void onFacebookError(FacebookError error) {
           Toast.makeText(TestConnect.this, &quot;Facebook connection failed&quot;, Toast.LENGTH_SHORT).show();

           mFacebookBtn.setChecked(false);
        }

        public void onError(DialogError error) {
        	Toast.makeText(TestConnect.this, &quot;Facebook connection failed&quot;, Toast.LENGTH_SHORT).show();

        	mFacebookBtn.setChecked(false);
        }

        public void onCancel() {
        	mFacebookBtn.setChecked(false);
        }
    }

	private void getFbName() {
		mProgress.setMessage(&quot;Finalizing ...&quot;);
		mProgress.show();

		new Thread() {
			@Override
			public void run() {
		        String name = &quot;&quot;;
		        int what = 1;

		        try {
		        	String me = mFacebook.request(&quot;me&quot;);

		        	JSONObject jsonObj = (JSONObject) new JSONTokener(me).nextValue();
		        	name = jsonObj.getString(&quot;name&quot;);
		        	what = 0;
		        } catch (Exception ex) {
		        	ex.printStackTrace();
		        }

		        mFbHandler.sendMessage(mFbHandler.obtainMessage(what, name));
			}
		}.start();
	}

	private void fbLogout() {
		mProgress.setMessage(&quot;Disconnecting from Facebook&quot;);
		mProgress.show();

		new Thread() {
			@Override
			public void run() {
				SessionStore.clear(TestConnect.this);

				int what = 1;

		        try {
		        	mFacebook.logout(TestConnect.this);

		        	what = 0;
		        } catch (Exception ex) {
		        	ex.printStackTrace();
		        }

		        mHandler.sendMessage(mHandler.obtainMessage(what));
			}
		}.start();
	}

	private Handler mFbHandler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			mProgress.dismiss();

			if (msg.what == 0) {
				String username = (String) msg.obj;
		        username = (username.equals(&quot;&quot;)) ? &quot;No Name&quot; : username;

		        SessionStore.saveName(username, TestConnect.this);

		        mFacebookBtn.setText(&quot;  Facebook (&quot; + username + &quot;)&quot;);

		        Toast.makeText(TestConnect.this, &quot;Connected to Facebook as &quot; + username, Toast.LENGTH_SHORT).show();
			} else {
				Toast.makeText(TestConnect.this, &quot;Connected to Facebook&quot;, Toast.LENGTH_SHORT).show();
			}
		}
	};

	private Handler mHandler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			mProgress.dismiss();

			if (msg.what == 1) {
				Toast.makeText(TestConnect.this, &quot;Facebook logout failed&quot;, Toast.LENGTH_SHORT).show();
			} else {
				mFacebookBtn.setChecked(false);
	        	mFacebookBtn.setText(&quot;  Facebook (Not connected)&quot;);
	        	mFacebookBtn.setTextColor(Color.GRAY);

				Toast.makeText(TestConnect.this, &quot;Disconnected from Facebook&quot;, Toast.LENGTH_SHORT).show();
			}
		}
	};
}
</pre>
<p></p>
<p><em> line 6:</em> Define the Facebook permission list, <em>publish_stream</em>, <em>read_stream</em>, and <em>offline_access</em> is enough to enable Android app to write status on Facebook wall. If you want more permissions, just add them into the <em>PERMISSIONS</em> array.</p>
<p><em> line 8</em>:  Set the Facebook application id, use the <em>App ID</em> from Facebook application settings page as described above.</p>
<p>line 19:  Instantiate the <em>Facebook</em> class with <em>APP_ID</em> as the parameter. Facebook class is the main class for interacting with Facebook API endpoint.</p>
<p><em> line 23:</em> Check if user has been authenticated before. Method <em>isSessionValid</em> is used to check if there is already access token saved on preference file. If user has been successfully authenticated, the access token and the name of authenticated user will be saved on preference file. The name of preference file is defined within <em>SessionStore</em> class on KEY variable. You can change the name of preference file as you want.</p>
<p><em> line 33+48: </em> Check if user has been authenticated, if yes, display the confirmation dialog to log out from current session (also delete the access token from preference file). If not, display the authentication dialog (webview dialog).</p>
<p><em> line 77: </em> Define the listener for authentication dialog and override the four methods to handle four different events: <em>onComplete: </em>is<em> </em>called when user successfully authenticated, here we save the access token to preference file (line 79), <em>onFacebookError: </em>is called when there is an error while authenticating user, <em>onError: is</em> called when there is an error on dialog and the last is <em>onCancel:</em> is called when user cancel the dialog.</p>
<p><img class="alignnone size-full wp-image-831" title="facebook sdk android" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_sdk_android.jpg" alt="facebook sdk android" width="200" height="333" /> <img class="alignnone size-full wp-image-832" title="facebook sdk android" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_sdk_android_2.jpg" alt="facebook sdk android" width="200" height="333" /></p>
<p><span style="text-decoration: underline;">2. Post Status (TestPost.java)</span></p>
<p>This example shows how to post status to Facebook wall.</p>
<pre class="brush: java; title: ;">
public class TestPost extends Activity{
	private Facebook mFacebook;
	private CheckBox mFacebookCb;
	private ProgressDialog mProgress;

	private Handler mRunOnUi = new Handler();

	private static final String APP_ID = &quot;*** put app id here&quot;;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.post);

		final EditText reviewEdit = (EditText) findViewById(R.id.revieew);
		mFacebookCb				  = (CheckBox) findViewById(R.id.cb_facebook);

		mProgress	= new ProgressDialog(this);

		mFacebook 	= new Facebook(APP_ID);

		SessionStore.restore(mFacebook, this);

		if (mFacebook.isSessionValid()) {
			mFacebookCb.setChecked(true);

			String name = SessionStore.getName(this);
			name		= (name.equals(&quot;&quot;)) ? &quot;Unknown&quot; : name;

			mFacebookCb.setText(&quot;  Facebook  (&quot; + name + &quot;)&quot;);
		}

		((Button) findViewById(R.id.button1)).setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				String review = reviewEdit.getText().toString();

				if (review.equals(&quot;&quot;)) return;

				if (mFacebookCb.isChecked()) postToFacebook(review);
			}
		});
	}

	private void postToFacebook(String review) {
		mProgress.setMessage(&quot;Posting ...&quot;);
		mProgress.show();

		AsyncFacebookRunner mAsyncFbRunner = new AsyncFacebookRunner(mFacebook);

		Bundle params = new Bundle();

		params.putString(&quot;message&quot;, review);
		params.putString(&quot;name&quot;, &quot;Dexter&quot;);
		params.putString(&quot;caption&quot;, &quot;londatiga.net&quot;);
		params.putString(&quot;link&quot;, &quot;http://www.londatiga.net&quot;);
		params.putString(&quot;description&quot;, &quot;Dexter, seven years old dachshund who loves to catch cats, eat carrot and krupuk&quot;);
		params.putString(&quot;picture&quot;, &quot;http://twitpic.com/show/thumb/6hqd44&quot;);

		mAsyncFbRunner.request(&quot;me/feed&quot;, params, &quot;POST&quot;, new WallPostListener());
	}

	private final class WallPostListener extends BaseRequestListener {
        public void onComplete(final String response) {
        	mRunOnUi.post(new Runnable() {
        		@Override
        		public void run() {
        			mProgress.cancel();

        			Toast.makeText(TestPost.this, &quot;Posted to Facebook&quot;, Toast.LENGTH_SHORT).show();
        		}
        	});
        }
    }
}
</pre>
<p>line 46: Instantiate the Facebook asynchronous thread that will be used to send status to Facebook.<br />
line 52: Use Bundle as data wrapper to send data<br />
line 54: <em>message</em>, is  the Facebook status message<br />
line 55: <em>name</em>, is the link title<br />
line 56: <em>caption</em>, is the caption text below the link<br />
line 57: <em>link</em>, is the link to go when user clicks on the title<br />
line 58: <em>description</em>, is the desciption text below the caption<br />
line 59: <em>picture</em>, is the image link. The image will be displayed on the left of description<br />
line 61: post the status to facebook. <em>me/feed</em> parameter means the status will be posted on current authenticated user&#8217;s wall.  <em>WallPostListener</em> is the listener to be called when the asynchronous thread finished sending the post to Facebook.</p>
<p><img class="alignnone size-full wp-image-834" title="facebook post status android" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_post_status_android.jpg" alt="facebook post status android" width="200" height="333" /></p>
<div id="attachment_835" class="wp-caption alignnone" style="width: 459px"><a href="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_wall_android.jpg"><img class="size-full wp-image-835" title="facebook wall android" src="http://www.londatiga.net/wp-content/uploads/2011/09/facebook_wall_android.jpg" alt="facebook wall android" width="449" height="162" /></a><p class="wp-caption-text">Facebook Wall</p></div>
<p>You can download  the source code on <a title="Facebook Android SDK" href="https://github.com/lorensiuswlt/AndroidFacebook" target="_blank">my github page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-use-facebook-sdk-to-post-status-from-android/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>How to Setup Gmail 2-Step Verification With Android</title>
		<link>http://www.londatiga.net/it/how-to-setup-gmail-2-step-verification-with-android/</link>
		<comments>http://www.londatiga.net/it/how-to-setup-gmail-2-step-verification-with-android/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 23:08:11 +0000</pubDate>
		<dc:creator>lorenz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[2-step verification]]></category>
		<category><![CDATA[android phone]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[verification]]></category>

		<guid isPermaLink="false">http://www.londatiga.net/?p=772</guid>
		<description><![CDATA[Ever wonder how terrible if your Gmail got hacked by someone and stole all your work data, bank account, and other important data? That must be a nightmare and nobody  ever wants it to happen. Gmail currently has an advanced  sign-in method that enable you to pass two steps of verification whenever you want to [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wonder how terrible if your <strong>Gmail</strong> got hacked by someone and stole all your work data, bank account, and other important data? That must be a nightmare and nobody  ever wants it to happen. Gmail currently has an advanced  <strong>sign-in</strong> method that enable you to pass <strong>two steps of verification</strong> whenever you want to login to your Google account.</p>
<p>This  <strong>2-steps verification</strong> requires two independent factors for authentification. This is much like you might see on your e-banking transaction, your website password and a key obtained from your phone or a dedicated key generator device. Once this 2-steps verification enabled on your account, you will see an extra page prompting for a code after you signing in with username and password. You can use your <strong>Android</strong>, Iphone or Blackberry as the code generator device or  use SMS to send the code to your phone. In this tutorial, i&#8217;ll explain how to use <strong>2-step verification with Android </strong>as the code generator device.</p>
<p>How to setup:</p>
<ul>
<li>Log in to your Gmail and go to <em>Account settings</em> page<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/08/account_settings.jpg"><img class="size-full wp-image-773 alignnone" title="2-step verification - account settings" src="http://www.londatiga.net/wp-content/uploads/2011/08/account_settings.jpg" alt="2-step verification - account settings" width="264" height="225" /></a></li>
<li>On<em> Account Settings</em> page, click the <em>Using 2-step verification </em>link.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/08/personal_settings.jpg"><img class="alignnone size-full wp-image-774" title="2-step verification" src="http://www.londatiga.net/wp-content/uploads/2011/08/personal_settings.jpg" alt="2-step verification" width="370" height="201" /></a></li>
<li>Click the <em>Start setup </em>button.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/08/start_up.jpg"><img class="alignnone size-full wp-image-775" title="2-step verification gmail" src="http://www.londatiga.net/wp-content/uploads/2011/08/start_up.jpg" alt="2-step verification gmail" width="324" height="171" /></a></li>
<li>On <em>Set up 2-verification</em> page, choose <strong>Android</strong> as device where you&#8217;ll get the verification code.<a href="http://www.londatiga.net/wp-content/uploads/2011/08/choose_android.jpg"><img class="alignnone size-full wp-image-776" title="2-step verification gmail android" src="http://www.londatiga.net/wp-content/uploads/2011/08/choose_android.jpg" alt="2-step verification gmail android" width="459" height="247" /></a></li>
<li>Install <a title="Google Authenticator Android" href="https://market.android.com/details?id=com.google.android.apps.authenticator&amp;feature=search_result" target="_blank">Google Authenticator </a>app from Android market.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/08/google_auth.jpg"><img class="alignnone size-full wp-image-777" title="Google authenticator android" src="http://www.londatiga.net/wp-content/uploads/2011/08/google_auth.jpg" alt="Google authenticator android" width="318" height="221" /></a></li>
<li>Now it is time to configure your Android device, run the <em>Google Authenticator</em> app.<a href="http://www.londatiga.net/wp-content/uploads/2011/08/android1.jpg"><img class="alignnone size-full wp-image-780" title="Google Authenticator" src="http://www.londatiga.net/wp-content/uploads/2011/08/android1.jpg" alt="Google Authenticator" width="288" height="302" /></a></li>
<li>There are two ways to configure <em>Google Authenticator</em>: by scanning a barcode or manually add account if you have no barcode scanner app installed.</li>
<li>If you choose to scan barcode, click the <em>Scan a barcode</em> button to scan the barcode displayed on setup page.</li>
<li>Enter the code displayed on <em>Google Authenticator</em> app into the <em>Code</em> field then click the<em> Verify</em> button.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/08/barcode2.jpg"><img class="alignnone size-full wp-image-779" title="Google Authenticator" src="http://www.londatiga.net/wp-content/uploads/2011/08/barcode2.jpg" alt="Google Authenticator" width="398" height="316" /></a></li>
<li>If you choose to add account manually, click<em> </em>the<em> Can&#8217;t scan the barcode </em>to expand the hidden instruction page.<img class="alignnone size-full wp-image-782" title="2-step verification" src="http://www.londatiga.net/wp-content/uploads/2011/08/nonbarcode.jpg" alt="2-step verification" width="379" height="160" /></li>
<li>On<em> Google Authenticator </em>app<em>, </em>click the<em> Manually add account </em>button. Enter <em>account name</em> with your Gmail address, <em>key</em> with the key from setup page (step 3 on picture above) and choose <em>time based</em> key type.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/08/android2.jpg"><img class="alignnone size-full wp-image-781" title="Android Authenticator" src="http://www.londatiga.net/wp-content/uploads/2011/08/android2.jpg" alt="Android Authenticator" width="302" height="289" /></a></li>
<li>Enter the code displayed on <em>Google Authenticator</em> app into the <em>Code</em> field then click the<em> Verify</em> button.</li>
<p></p>
<li>Click <em>Next</em> on the next page.</li>
<li>Now you can backup some codes to be used in case the phone isn&#8217;t available. Each code will allow you to sign in one time. Click the  <em>Save to text file </em>to save the codes to local disk<em>. <img class="alignnone size-full wp-image-784" title="2-step verification android gmail" src="http://www.londatiga.net/wp-content/uploads/2011/08/savecode1.jpg" alt="2-step verification android gmail" width="481" height="338" /></em></li>
<li>Click <em>Next</em> to continue.</li>
<li>You can also have the codes sent to your backup phone number if your primary phone is unavailable or lost. Fill in your phone number and choose which way the codes will be sent, you can choose between SMS or Voice Call. Click <em>Next</em> to continue.<br />
<a href="http://www.londatiga.net/wp-content/uploads/2011/08/phone.jpg"><img class="alignnone size-full wp-image-785" title="2-step verificaion android gmail" src="http://www.londatiga.net/wp-content/uploads/2011/08/phone.jpg" alt="2-step verificaion android gmail" width="493" height="206" /></a></li>
<li>On next page, you&#8217;ll get a warning page shows that you need to generate and enter an application specific password. Application specific password will be used when you log in to several Google apps such as Adsense, Adwords, Google Talk or your Android device. Note that if you enable this 2-step verification, you will never be able to use your current password to login to those applications, you have to use separate application specific password. This password need to be entered only once for each application. We will setup it later, click Next to continue.</li>
<li>Now the setup is done, click the <em>Turn on 2-step verification</em> button to turn on the 2-step verification. You will be signed out of your Google Account on all devices including mobile applications. The next time you sign in, Google will ask for your password and your verification code.<a href="http://www.londatiga.net/wp-content/uploads/2011/08/donesetup.jpg"><img class="alignnone size-full wp-image-795" title="Setup 2-step verification" src="http://www.londatiga.net/wp-content/uploads/2011/08/donesetup.jpg" alt="Setup 2-step verification" width="496" height="180" /></a></li>
<li>After logged out, try to log in to your Gmail. After entering your password, you&#8217;ll will be asking for verification code. Use verification code from your <em>Google Authenticator</em> application to verify. <img class="alignnone size-full wp-image-787" title="gmail verification android" src="http://www.londatiga.net/wp-content/uploads/2011/08/verifyandroid.jpg" alt="gmail verification android" width="482" height="172" /></li>
<li>You have done the 2-step verification setup. You will be noticed that you have been logged out automatically from some Google applications such as Google Talk, Gmail and Market on your Android phone. It means you have to sign in again with new application specific password.</li>
<li>Go to <em>Account Settings</em> page then enter the <em>Using 2-step verification</em></li>
<li>Click the  <em>Manage application-specific password</em> link.<br />
<img class="alignnone size-full wp-image-788" title="apppassword" src="http://www.londatiga.net/wp-content/uploads/2011/08/apppassword.jpg" alt="apppassword" width="278" height="207" /></li>
<li>Enter the name that will help you remember what application is for then click<em> Generate password <img class="alignnone size-full wp-image-791" title="newapppass" src="http://www.londatiga.net/wp-content/uploads/2011/08/newapppass2.jpg" alt="newapppass" width="470" height="105" /></em></li>
<li>Use the generated password to sign in to Google application. For example, to login into Gtalk on Android, use your email as username and your generated app-specific password as your password. <img class="alignnone size-full wp-image-796" title="apppassword2" src="http://www.londatiga.net/wp-content/uploads/2011/08/apppassword2.jpg" alt="apppassword2" width="463" height="172" /></li>
<li>Done.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.londatiga.net/it/how-to-setup-gmail-2-step-verification-with-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

