<?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-7255585624608790245</id><updated>2026-10-10T12:51:01.174+05:30</updated><title type='text'>Ranjithkumar Android Mobile Application Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-7747151236138312979</id><published>2015-02-11T21:21:00.004+05:30</published><updated>2015-02-11T21:21:58.907+05:30</updated><title type='text'>Android Material Design Open sources</title><content type='html'>&lt;h4 style=&quot;font-family: -apple-system-font; line-height: 16px;&quot;&gt;
Material Design Reference Projects:&lt;/h4&gt;
&lt;ol style=&quot;font-family: -apple-system-font; line-height: 16px;&quot;&gt;
&lt;li&gt;&lt;strong&gt;MaterialDesignLibrary&lt;/strong&gt;&amp;nbsp;This is a library with components of Android L to you use in android 4.0&lt;br /&gt;&lt;a href=&quot;https://github.com/navasmdc/MaterialDesignLibrary#flat-button&quot;&gt;https://github.com/navasmdc/MaterialDesignLibrary#flat-button&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MaterialEverywhere&lt;/strong&gt;&amp;nbsp;Showcase of the new AppCompat 21, which includes new Material Theme, working in pre-21 devices.&lt;br /&gt;&lt;a href=&quot;https://github.com/antoniolg/MaterialEverywhere&quot;&gt;https://github.com/antoniolg/MaterialEverywhere&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MaterialWidget&lt;/strong&gt;&amp;nbsp;Android L design widget in Android 4.0 ~ 4.4.&lt;br /&gt;&lt;a href=&quot;https://github.com/keithellis/MaterialWidget&quot;&gt;https://github.com/keithellis/MaterialWidget&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MaterialTabs&lt;/strong&gt;&amp;nbsp;Custom Tabs with Material Design effects. It requires 14+ API and android support v7 (Toolbar)&lt;br /&gt;&lt;a href=&quot;https://github.com/neokree/MaterialTabs&quot;&gt;https://github.com/neokree/MaterialTabs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;material-ripple&lt;/strong&gt;&amp;nbsp;Android L Ripple effect wrapper for Views&lt;br /&gt;&lt;a href=&quot;https://github.com/balysv/material-ripple&quot;&gt;https://github.com/balysv/material-ripple&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RippleEffect&lt;/strong&gt;&amp;nbsp;Implementation of Ripple effect from Material Design for Android API 14+&lt;br /&gt;&lt;a href=&quot;https://github.com/traex/RippleEffect&quot;&gt;https://github.com/traex/RippleEffect&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LDrawer&lt;/strong&gt;&amp;nbsp;Android drawer icon with material design animation&lt;br /&gt;&lt;a href=&quot;https://github.com/ikimuhendis/LDrawer&quot;&gt;https://github.com/ikimuhendis/LDrawer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;material-design-icons&lt;/strong&gt;&amp;nbsp;Material Design icons by Google&lt;br /&gt;&lt;a href=&quot;https://github.com/google/material-design-icons&quot;&gt;https://github.com/google/material-design-icons&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AndroidMaterialDesignToolbar&lt;/strong&gt;&amp;nbsp;Android Sample Project with Material Design and Toolbar.&lt;br /&gt;&lt;a href=&quot;https://github.com/tekinarslan/AndroidMaterialDesignToolbar&quot;&gt;https://github.com/tekinarslan/AndroidMaterialDesignToolbar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MaterialEditText&lt;/strong&gt;&amp;nbsp;EditText in Material Design&lt;br /&gt;&lt;a href=&quot;https://github.com/rengwuxian/MaterialEditText&quot;&gt;https://github.com/rengwuxian/MaterialEditText&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;material-menu&lt;/strong&gt;&amp;nbsp;Morphing Android menu, back, dismiss and check buttons&lt;br /&gt;&lt;a href=&quot;https://github.com/balysv/material-menu&quot;&gt;https://github.com/balysv/material-menu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;material-dialogs&lt;/strong&gt;&amp;nbsp;Not even AppCompat uses Material theming for AlertDialogs on pre-Lollipop. This is a beautiful and easy solution.&lt;br /&gt;&lt;a href=&quot;https://github.com/afollestad/material-dialogs&quot;&gt;https://github.com/afollestad/material-dialogs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MaterialNavigationDrawer&lt;/strong&gt;&amp;nbsp;Navigation Drawer Activity with material design style and simplified methods&lt;br /&gt;&lt;a href=&quot;https://github.com/neokree/MaterialNavigationDrawer&quot;&gt;https://github.com/neokree/MaterialNavigationDrawer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MaterialDialog&lt;/strong&gt;&amp;nbsp;An Android library for conveniently building Material Design Dialog in Android version 2.2 ~ L.&lt;br /&gt;&lt;a href=&quot;https://github.com/drakeet/MaterialDialog&quot;&gt;https://github.com/drakeet/MaterialDialog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;materialish-progress&lt;/strong&gt;&amp;nbsp;A material style progress wheel compatible with 2.3&lt;br /&gt;&lt;a href=&quot;https://github.com/pnikosis/materialish-progress&quot;&gt;https://github.com/pnikosis/materialish-progress&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MaterialList&lt;/strong&gt;&amp;nbsp;An Android library aimed to get the beautiful CardViews that Google shows at its official design specifications&lt;br /&gt;&lt;a href=&quot;https://github.com/dexafree/MaterialList&quot;&gt;https://github.com/dexafree/MaterialList&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;android-floating-action-button&lt;/strong&gt;&amp;nbsp;Floating Action Button for Android based on Material Design specification&lt;br /&gt;&lt;a href=&quot;https://github.com/futuresimple/android-floating-action-button&quot;&gt;https://github.com/futuresimple/android-floating-action-button&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Android-Material-circular-button&lt;/strong&gt;&amp;nbsp;Animated Material circular button&lt;br /&gt;&lt;a href=&quot;https://github.com/glomadrian/Android-Material-circular-button&quot;&gt;https://github.com/glomadrian/Android-Material-circular-button&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;material-drawer&lt;/strong&gt;&amp;nbsp;DrawerLayout implementation for Material design apps&lt;br /&gt;&lt;a href=&quot;https://github.com/HeinrichReimer/material-drawer&quot;&gt;https://github.com/HeinrichReimer/material-drawer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;snackbar&lt;/strong&gt;&amp;nbsp;Snackbar Android Library&lt;br /&gt;&lt;a href=&quot;https://github.com/nispok/snackbar&quot;&gt;https://github.com/nispok/snackbar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Android-DialogFragments&lt;/strong&gt;&amp;nbsp;Various DialogFragments for Android.&lt;br /&gt;&lt;a href=&quot;https://github.com/wada811/Android-DialogFragments&quot;&gt;https://github.com/wada811/Android-DialogFragments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;material-range-bar&lt;/strong&gt;&amp;nbsp;Android widget for selecting a range of values.&lt;br /&gt;&lt;a href=&quot;https://github.com/oli107/material-range-bar&quot;&gt;https://github.com/oli107/material-range-bar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CircularProgressView&lt;/strong&gt;&amp;nbsp;A Material style circular progress bar for Android&lt;br /&gt;&lt;a href=&quot;https://github.com/rahatarmanahmed/CircularProgressView&quot;&gt;https://github.com/rahatarmanahmed/CircularProgressView&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RippleDrawable&lt;/strong&gt;&amp;nbsp;A port of Ripple Effect from Android L to non L devices&lt;br /&gt;&lt;a href=&quot;https://github.com/ozodrukh/RippleDrawable&quot;&gt;https://github.com/ozodrukh/RippleDrawable&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/7747151236138312979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2015/02/android-material-design-open-sources.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7747151236138312979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7747151236138312979'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2015/02/android-material-design-open-sources.html' title='Android Material Design Open sources'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-681841388824772036</id><published>2014-07-02T07:38:00.002+05:30</published><updated>2014-07-02T07:38:23.858+05:30</updated><title type='text'>Insertion Sort in Java</title><content type='html'>For theoretical reference:&lt;br /&gt;
http://en.wikipedia.org/wiki/Insertion_sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Java Program:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;public class InsertionSort {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int[] input = { 2, 7, 4, 1, 5, 3};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insertionSort(input);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static void printNumbers(int[] input) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; input.length; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.print(input[i] + &quot;, &quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;\n&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void insertionSort(int array[]) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int n = array.length;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int j = 1; j &amp;lt; n; j++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int key = array[j];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int i = j-1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ( (i &amp;gt; -1) &amp;amp;&amp;amp; ( array [i] &amp;gt; key ) ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array [i+1] = array [i];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i--;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array[i+1] = key;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printNumbers(array);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/681841388824772036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2014/07/insertion-sort-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/681841388824772036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/681841388824772036'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2014/07/insertion-sort-in-java.html' title='Insertion Sort in Java'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-7953098675219812610</id><published>2014-06-30T07:53:00.004+05:30</published><updated>2014-06-30T07:53:52.175+05:30</updated><title type='text'>Bubble sort algorithm using array in Java.</title><content type='html'>For theoretical reference you can see wiki link. &lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/Bubble_sort&lt;br /&gt;
&lt;br /&gt;
For programmatic reference you can check this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;public class BubbleSort {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int arr[] = { 2, 7, 4, 1, 5, 3};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; showAll(bubbleSort(arr));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static int [] bubbleSort(int arr[]){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while(true){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int count = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; arr.length - 1; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(arr[i] &amp;gt; arr[i+1]){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int temp = arr[i];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arr[i] = arr[i + 1];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arr[i + 1] = temp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; count ++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(count == 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return arr;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static void showAll(int[] arr){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i : arr) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;&quot; + i);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/7953098675219812610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2014/06/bubble-sort-algorithm-using-array-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7953098675219812610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7953098675219812610'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2014/06/bubble-sort-algorithm-using-array-in.html' title='Bubble sort algorithm using array in Java.'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-3052767522857308531</id><published>2014-06-30T07:50:00.000+05:30</published><updated>2014-06-30T07:50:15.369+05:30</updated><title type='text'>Selection Sort in Java </title><content type='html'>For theoretical reference you can see wiki link. &lt;br /&gt;
http://en.wikipedia.org/wiki/Selection_sort&lt;br /&gt;
&lt;br /&gt;
For programmatic reference you can check this.&lt;br /&gt;
&lt;br /&gt;
public class SelectionSort {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int [] arr = {3, 4, 2, 1, 5, 10, 99, 12, 1, 7};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; showAll(descSort(arr));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static int [] descSort(int[] arr){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for(int i = 0; i &amp;lt;= arr.length -1; i++){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for(int j = i+1; j &amp;lt; (arr.length); j++){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(arr[i] &amp;gt; arr[j]){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int temp = arr[i];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arr[i] = arr[j];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; arr[j] = temp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return arr;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static void showAll(int[] arr){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i : arr) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;&quot; + i);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/3052767522857308531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2014/06/selection-sort-in-java.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/3052767522857308531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/3052767522857308531'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2014/06/selection-sort-in-java.html' title='Selection Sort in Java '/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-7159252371281291031</id><published>2013-06-05T15:09:00.001+05:30</published><updated>2015-02-24T10:24:07.384+05:30</updated><title type='text'>Android Webview tricks to get alert and console.log() messages.</title><content type='html'>There are many tutorials to write a webview so i am not covering the ways to create a webview instead &amp;nbsp;i wanted to show how we can get the javascript consol.log(&#39;test&#39;), and alert(&#39;message&#39;) from WebChromeClient api &amp;nbsp;which can be used to debug hybrid application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
private class SampleWebChromeClient extends WebChromeClient {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public boolean onConsoleMessage(ConsoleMessage consoleMessage) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;nbsp;&amp;nbsp; Log.d(&quot;SampleActivity&quot;, consoleMessage.message() + &quot; -- From line &quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ consoleMessage.lineNumber() + &quot; of &quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ consoleMessage.sourceId() );&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;nbsp;&amp;nbsp; return true;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public boolean onJsAlert(WebView view, String url, String message,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;JsResult result) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Log.d(&quot;SampleActivity&quot;, message);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//new AlertDialog.Builder(view.getContext()).setMessage(message).setCancelable(true).show();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;result.confirm();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For KitKat &amp;gt; using the below code and you can debug inside the web view. For more details refer &lt;a href=&quot;https://developer.chrome.com/devtools/docs/remote-debugging&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #f7f7f7; box-shadow: rgba(0, 0, 0, 0.14902) 0px 2px 4px, rgba(0, 0, 0, 0.14902) 0px 0px 3px; box-sizing: border-box; color: #008800; font-family: &#39;Source Code Pro&#39;, sans-serif; font-size: 0.95em; line-height: 1.8em; margin-bottom: 2em; margin-top: 2em; overflow-x: auto; padding: 0.99em; position: relative; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #660066; margin: 0px; padding: 0px;&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;VERSION&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;SDK_INT &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #660066; margin: 0px; padding: 0px;&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;VERSION_CODES&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;KITKAT&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #660066; margin: 0px; padding: 0px;&quot;&gt;WebView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;setWebContentsDebuggingEnabled&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black; margin: 0px; padding: 0px;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/7159252371281291031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2013/06/android-webview-tricks-to-get-alert-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7159252371281291031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7159252371281291031'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2013/06/android-webview-tricks-to-get-alert-and.html' title='Android Webview tricks to get alert and console.log() messages.'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-5913031312164215422</id><published>2011-11-07T13:54:00.004+05:30</published><updated>2014-06-30T07:57:43.240+05:30</updated><title type='text'>Data Structure - Queue(JAVA) using array</title><content type='html'>&lt;br /&gt;For theoretical reference you check wiki.&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/Queue_%28data_structure%29&lt;br /&gt;
&lt;br /&gt;
Java you can refer the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 1em; margin-left: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;pre class=&quot;prettyprint&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 1em; margin-left: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000088;&quot;&gt;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class QueueKrk {

 private static final int MAX = 3;
 private static int[] QUEUE = new int[MAX];
 private static int top = -1;
 private static int rear = 0;

 private enum Function {
  PUSH, POP, PRINTALL
 };

 private static void push() {
  if (top &amp;lt; MAX -1) {
   System.out.println(&quot;Enter the value to added to the queue&quot;);
   int value = readValue();
   QUEUE[++top] = value;
  } else {
   System.out.println(&quot;The queue has reached the maximum value&quot;);
  }
 }

 private static void peek() {
  if(top &amp;gt;= rear){
   rear++;
  }else{
   System.out.println(&quot;Nothing to Peek&quot;);
  }

 }

 private static void printAll() {
  if (top &amp;gt;= rear) {
   int i = 0;
   for (i = rear; i &amp;lt;= top; i++) {
    System.out.println(QUEUE[i]);
   }
  } else {
   System.out.println(&quot;The queue is empty&quot;);
  }
 }

 private static int readValue() {
  int input = 0;
  try {
   BufferedReader br = new BufferedReader(new InputStreamReader(
     System.in));
   input = Integer.parseInt(br.readLine());
  } catch (NumberFormatException nfe) {
   System.err.println(&quot;Invalid Format!&quot;);
   System.exit(0);
  } catch (IOException e) {
   e.printStackTrace();
  }
  return input;
 }

 public static void main(String[] args) {
  init();
 }

 private static void init() {
  System.out.println(&quot;For Push enter 0, Peek enter 1 and 2 to print all. For exit enter non number&quot;);
  int selection = readValue();
  optionSelection(selection);
 }

 private static void optionSelection(int selection) {
  Function function = null;
  try {
   function = Function.values()[selection];
  } catch (ArrayIndexOutOfBoundsException ex) {
   System.out.println(&quot;Enter either &#39;0&#39; or &#39;1&#39; or &#39;2&#39; for push, Peek , view all respectively&quot;);
   init();
  }
  switch (function) {
  case PUSH:
   push();
   init();
   break;
  case POP:
   peek();
   init();
   break;
  case PRINTALL:
   printAll();
   init();
   break;
  default:
   break;
  }
 }

}

&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000088;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/5913031312164215422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/data-structure-queue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/5913031312164215422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/5913031312164215422'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/data-structure-queue.html' title='Data Structure - Queue(JAVA) using array'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-7865706118203397803</id><published>2011-11-07T12:22:00.006+05:30</published><updated>2014-06-30T08:00:12.466+05:30</updated><title type='text'>Data Structure - Stack (JAVA) using array</title><content type='html'>For theoretical reference you can see wiki link.&amp;nbsp; &lt;br /&gt;
http://en.wikipedia.org/wiki/Stack_%28data_structure%29&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Java Stack using array .&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 1em; margin-left: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000088;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class StackKrk {

 private static final int MAX = 3;// constant for the size of the stack.
 private static final int[] STACK = new int[MAX]; 
 private static int TOP = 0; // Flag for the stack position.
 private  enum Function{PUSH, POP, PRINTALL};
 
 public static void main(String[] args) {
  init();
 }
 
 private static void init(){
  System.out.println(&quot;For Push enter 0, Pop enter 1 and 2 to print all. For exit enter non number&quot;);
  int selection = readValue();
  
  optionSelection(selection);
 }
 
 private static void optionSelection(int selection){
  Function function = null;
  try{
   function = Function.values()[selection];
  }catch(ArrayIndexOutOfBoundsException ex){
   System.out.println(&quot;Enter either &#39;0&#39; or &#39;1&#39; or &#39;2&#39; for push, pop , view all respectively&quot;);
   init();
  }
  switch (function) {
  case PUSH:
   push();
   init();
   break;
  case POP:
   pop();
   init();
   break;
  case PRINTALL:
   printAll();
   init();
   break;
  default:
   
   break;
  }
 }

 private static int readValue() {
  int input = 0;
  try {
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   input = Integer.parseInt(br.readLine());
  } catch (NumberFormatException nfe) {
   System.err.println(&quot;Invalid Format!&quot;);
   System.exit(0);
  } catch (IOException e) {
   e.printStackTrace();
  }
  return input;
 }

 private static void push() {
  if (TOP == MAX) {
   System.out.println(&quot;Reached the maximum stack value&quot;);
  } else {
   System.out.println(&quot;Enter the value to be pushed ::&amp;gt;&quot;);
   int value = readValue();
   STACK[TOP++] = value;
  }
 }
 
 private static void pop() {
  if (TOP == 0) {
   System.out.println(&quot;The stack is empty&quot;);
  } else {
   System.out.println(&quot;The poped element of the stack ::&amp;gt;&quot; + STACK[--TOP]);
   STACK[TOP] = 0;
  }
 }
 private static void printAll(){
  for(int i=0; i&amp;lt;=TOP-1; i++){
   System.out.println(&quot;Value in the stack position[&quot;+i+&quot;]  &quot;+STACK[i]);
  }
    
 }


}&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000088;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/7865706118203397803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/data-structure-stack-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7865706118203397803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7865706118203397803'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/data-structure-stack-java.html' title='Data Structure - Stack (JAVA) using array'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-4166562024266260423</id><published>2011-11-06T11:06:00.001+05:30</published><updated>2013-06-05T14:25:12.624+05:30</updated><title type='text'>Using GSON Effectively</title><content type='html'>Program of&amp;nbsp;Deserialize/Serialize JSON.I am writing it below. First download the&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/google-gson/downloads/detail?name=google-gson-1.7.1-release.zip&amp;amp;can=2&amp;amp;q=&quot;&gt;Gson&lt;/a&gt;&amp;nbsp;then add it to the eclipse project.&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
Step 1: Create a Dog class with getters and setters as below.&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; line-height: inherit; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000088;&quot;&gt;&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;package&lt;/span&gt; myobject;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; Dog {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String &lt;span style=&quot;color: #2000d1;&quot;&gt;name&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;color: #2000d1;&quot;&gt;age&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #2000d1;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; String getName() {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #a60069; font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #2000d1;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #a60069;&quot;&gt;void&lt;/span&gt; setName(String name) {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #2000d1;&quot;&gt;name&lt;/span&gt; = name;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #a60069;&quot;&gt;int&lt;/span&gt; getAge() {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #a60069; font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #2000d1;&quot;&gt;age&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #a60069;&quot;&gt;void&lt;/span&gt; setAge(&lt;span style=&quot;color: #a60069;&quot;&gt;int&lt;/span&gt; age) {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #2000d1;&quot;&gt;age&lt;/span&gt; = age;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: monospace; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
Step 2: Write a common GsonSerializer as below with generics so any class type can be passed.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; line-height: inherit; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000088;&quot;&gt;&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;package&lt;/span&gt; common;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;import&lt;/span&gt; com.google.gson.Gson;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;import&lt;/span&gt; com.google.gson.GsonBuilder;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
//Generics is used so any class type can be passed
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #a60069;&quot;&gt;class&lt;/span&gt; GsonSerializer&amp;lt;T&amp;gt; {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; T Deserialize(String json, &lt;span style=&quot;text-decoration: underline;&quot;&gt;Class&lt;/span&gt; classOfT) {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Gson gn = &lt;span style=&quot;color: #a60069;&quot;&gt;new&lt;/span&gt; GsonBuilder().create();&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;(T) gn.fromJson(json, classOfT)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; String Serialize(T object) {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Gson gn = &lt;span style=&quot;color: #a60069;&quot;&gt;new&lt;/span&gt; GsonBuilder().create();&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;return&lt;/span&gt; gn.toJson(object);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;3: Write a main method for calling the example&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-family: monospace; line-height: inherit; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #000088;&quot;&gt;&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069; font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069; font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069; font-size: small;&quot;&gt;&lt;/span&gt;

&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069; font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;package&lt;/span&gt; gsoncaller;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;import&lt;/span&gt; myobject.Dog;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;import&lt;/span&gt; common.GsonSerializer;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a60069;&quot;&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #a60069;&quot;&gt;class&lt;/span&gt; MyGsonCaller {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #a60069;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #a60069;&quot;&gt;void&lt;/span&gt; main(String[] args) {&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Dog dog = &lt;span style=&quot;color: #a60069;&quot;&gt;new&lt;/span&gt; Dog();&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;dog.setAge(1);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;dog.setName(&lt;span style=&quot;color: #4e00ff;&quot;&gt;&quot;mela&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;GsonSerializer&amp;lt;Dog&amp;gt; serializer = &lt;span style=&quot;color: #a60069;&quot;&gt;new&lt;/span&gt; GsonSerializer&amp;lt;Dog&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;serializer.Serialize(dog);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.&lt;span style=&quot;color: #2000d1;&quot;&gt;out&lt;/span&gt;.println(&lt;span style=&quot;color: #4e00ff;&quot;&gt;&quot;My json string ::&amp;gt;&quot;&lt;/span&gt; + serializer.Serialize(dog));&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;dog = serializer.Deserialize(serializer.Serialize(dog), Dog.&lt;span style=&quot;color: #a60069;&quot;&gt;class&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String name = dog.getName();&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #a60069;&quot;&gt;int&lt;/span&gt; age = dog.getAge();&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.&lt;span style=&quot;color: #2000d1;&quot;&gt;out&lt;/span&gt;.println(&lt;span style=&quot;color: #4e00ff;&quot;&gt;&quot;Name ::&amp;gt;&quot;&lt;/span&gt; + name);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.&lt;span style=&quot;color: #2000d1;&quot;&gt;out&lt;/span&gt;.println(&lt;span style=&quot;color: #4e00ff;&quot;&gt;&quot;Age ::&amp;gt;&quot;&lt;/span&gt; + age);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
The out put is:&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;My json string ::&amp;gt;{&quot;name&quot;:&quot;mela&quot;,&quot;age&quot;:1}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Name ::&amp;gt;mela&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Age ::&amp;gt;1&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/4166562024266260423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/how-to-serialize-and-desearilize-json.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/4166562024266260423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/4166562024266260423'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/how-to-serialize-and-desearilize-json.html' title='Using GSON Effectively'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-8693344411241071395</id><published>2011-11-04T17:02:00.000+05:30</published><updated>2011-11-04T17:02:09.227+05:30</updated><title type='text'>Eclipse short cut keys</title><content type='html'>&lt;br /&gt;
&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cols=&quot;2&quot; frame=&quot;VOID&quot; rules=&quot;NONE&quot;&gt;
 &lt;colgroup&gt;&lt;col width=&quot;210&quot;&gt;&lt;/col&gt;&lt;col width=&quot;290&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;
 &lt;tbody&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;25&quot; width=&quot;499&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small;&quot;&gt;Highlighted the most useful shortcut keys.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Navigation&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + SHIFT + R&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Open / Search for resources, e.g. files&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + SHIFT + T&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Open / Search for Types&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + E&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Allows to select an editor from the currenlty open editors&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + F8&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut for switching perspectives&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;59&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;ALT + LEFT ARROW KEY or ALT + RIGHT ARROW KEY&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Go to prev/ next editor position in history&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl-PageUp/PageDown&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Previous/next tab&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;F3&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Go to declaration of this variable&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + SHIFT + P&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Go to matching bracket&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + Q&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Go to editor area and position the cursor at the last changed position&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;2. Search&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl + .&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Go to next problem&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl + ,&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Go to previous problem&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;F3&lt;/b&gt; on a variable&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Goto Declaration of this variable&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;F4 on a variable&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Show type hierarchy&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + J , CTRL +k&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Incremental search, find next&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;20&quot;&gt;&lt;b&gt;CTRL+ SHIFT +k&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Decremental search,find previous&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + SHIFT + G&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Search for reference in the workspace&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;25&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small;&quot;&gt;3. Run&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl F11&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Run last launched&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Alt + Shift + X - J&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Run as Java application&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;25&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small;&quot;&gt;4. Editing&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + 1&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Quickfix, dependend on cursor position. See&amp;nbsp;Quickfix&amp;nbsp;for details.&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + Space&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Content assist/ code completion, see&amp;nbsp;Content Assist&amp;nbsp;for details.&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + T&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Show inline inline inheritance tree of the current Java class&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;59&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + O&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Show inline all methods of the current class, press CTRL+O again to show the inherited methods&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;F12&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Focuses the editor (especially helpful if you working with Fast Views&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl + M&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Maximize Java editor&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;CTRL + Shift + F&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Format source code&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;CTRL + Shift + O&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Organize the imports / Will import the missing imports.&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + Q&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Last edited position&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;5. Arrow Keys&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + Left&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Move one element to the left&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + Right&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Move one element to the right&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + ALT + Up/Down&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Copy line&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;ALT + Up / Down&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Move line up / down&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;ALT + SHIFT Up / Down&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Select the previous / next syntactical element&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;ALT + SHIFT Up / Down / Left / Right&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Extending / Reducing the selection of the previous / next syntactical element&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + Up / Down&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Scroll up / down a line in the editor&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;6. Delete&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl + D&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Deletes line&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + SHIFT + DELETE&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Delete until end of line&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + DELETE&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Delete next element&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;CTRL + BACKSPACE&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Delete previous element&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;7. Variable assignment&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl + 2 + L&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Assign statement to new local variable&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl + 2 + F&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Assign statement to new field&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;25&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small;&quot;&gt;8. Programming&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;22&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Coding&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shift + F2&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Call the Javadoc for the selected type / class / method&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;59&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Alt+Shift + N + Letter&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Type shortcut for the command, e.g. njc to create a new Java class or npip to create a new Plugin project.&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Alt + Shift + Z&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Surround block with try and catch&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;22&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;9. Refactoring&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;ALT- SHIFT +R&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Rename&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;40&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;CTRL+2,R&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Rename locally (in file), faster then ALT- SHIFT +R&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;ALT- SHIFT + T&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Opens the quick refactoring menu&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;20&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; colspan=&quot;2&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;10. Debugging&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Shortcut&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;F11&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Debug last run&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Ctrl + Shift + B&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Toggle breakpoint&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;F5&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Single Step (Down)&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;F6&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Single Step (Jump)&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;21&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;F7&lt;/span&gt;&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Up&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/8693344411241071395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/eclipse-short-cut-keys.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/8693344411241071395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/8693344411241071395'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/eclipse-short-cut-keys.html' title='Eclipse short cut keys'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-7957563231149890644</id><published>2011-11-04T16:40:00.000+05:30</published><updated>2011-11-04T16:40:01.728+05:30</updated><title type='text'>Android Interview Questions - Intent and Intent Filters</title><content type='html'>&lt;br /&gt;
1. What is an Intent?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Three of the core components of an application — activities, services, and broadcast receivers — are activated through messages, called intents,passive data structure holding an abstract description of an operation to be performed — or, often in the case of broadcasts, a description of something that has happened and is being announced.&lt;br /&gt;
&lt;br /&gt;
2. How will start an Activity?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;startActivity(),startActivityForResult(),setResult()&lt;br /&gt;
&lt;br /&gt;
3. What are the kinds of Intents?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Implicit Intent and Explicit Intents&lt;br /&gt;
&lt;br /&gt;
4. Explain Explicit and Implicit Intents?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Explicit intent names the component, e.g. the Java class which should be called.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Implicit intents asked the system to perform a service without telling the system which Java class should do this service.&lt;br /&gt;
&lt;br /&gt;
5. What is Intent Filters?&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Intent filters are typically defined via the &quot;AndroidManifest.xml&quot; file.where Android system will determine suitable applications for an implicit intent and if several applications exists offer the user the choice to open one. &amp;nbsp;If a component does not define intent filters it can only be called by explicit intents.&lt;br /&gt;
&lt;br /&gt;
6. What are the object consulted against Intent Filter?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Action, Data, Category&lt;br /&gt;
&lt;br /&gt;
7. &amp;nbsp;What is an Action?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Adds an action to an intent filter. An &amp;lt;intent-filter&amp;gt; element must contain one or more &amp;lt;action&amp;gt; elements. If it doesn&#39;t contain any, no Intent objects will get through the filter.&lt;br /&gt;
&amp;nbsp;&amp;lt;intent-filter . . . &amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;action android:name=&quot;com.example.project.SHOW_CURRENT&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;action android:name=&quot;com.example.project.SHOW_RECENT&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8 What is a Category?&lt;br /&gt;
Adds a category name to an intent filter. The role of category specifications within a filter.&lt;br /&gt;
&amp;lt;intent-filter . . . &amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; . . .&lt;br /&gt;
&amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. What is Data?&lt;br /&gt;
Adds a data specification to an intent filter. The specification can be just a data type (the mimeType attribute), just a URI, or both a data type and a URI. A URI is specified by separate attributes for each of its parts:&lt;br /&gt;
&amp;lt;intent-filter . . . &amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;data android:mimeType=&quot;video/mpeg&quot; android:scheme=&quot;http&quot; . . . /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;data android:mimeType=&quot;audio/mpeg&quot; android:scheme=&quot;http&quot; . . . /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; . . .&lt;br /&gt;
&amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/7957563231149890644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-interview-questions-intent-and.html#comment-form' title='110 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7957563231149890644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7957563231149890644'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-interview-questions-intent-and.html' title='Android Interview Questions - Intent and Intent Filters'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>110</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-1957839481934051626</id><published>2011-11-04T11:01:00.000+05:30</published><updated>2011-11-04T17:08:47.115+05:30</updated><title type='text'>Android Parcelable Vs Serializable</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b&gt;Java Serializable:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;Serializable comes from standard Java and is much easier to implement all&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;you need to do is implement the Serializable interface and add override two methods.&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; font-size: 13px; margin-bottom: 1em; margin-left: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;div style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; white-space: normal;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 13px; line-height: 20px;&quot;&gt;private void writeObject(java.io.ObjectOutputStream out)&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throws IOException&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 13px; line-height: 20px;&quot;&gt;private void readObject(java.io.ObjectInputStream in)&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throws IOException, ClassNotFoundException&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;The problem with Serializable is that it tries to appropriately handle everything under the sun and uses a lot reflection to make determine the types that are being serialized.&amp;nbsp;So it becomes a beefy Object.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b&gt;Androids Parcelable&lt;/b&gt;:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;Android Inter-Process Communication (AIPC) file to tell Android how is should marshal and unmarshal your object.I&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, Calibri, Helvetica, Arial; font-size: 13px; line-height: 20px;&quot;&gt;t is less generic and doesn&#39;t use reflection so it should have much less overhead and be a lot faster.&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; font-size: 13px; margin-bottom: 1em; margin-left: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;implements&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Parcelable&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; describeContents&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; writeToParcel&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Parcel&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; flags&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeInt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Parcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Creator&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; CREATOR
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Parcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Creator&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; createFromParcel&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Parcel&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; newArray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;MyParcelable&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Parcel&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mData &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;readInt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/1957839481934051626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-parcelable-vs-serializable.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/1957839481934051626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/1957839481934051626'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-parcelable-vs-serializable.html' title='Android Parcelable Vs Serializable'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-8812304691073654398</id><published>2011-11-03T22:52:00.000+05:30</published><updated>2011-11-03T22:52:44.605+05:30</updated><title type='text'>Android Application Efficient Development - Trace View</title><content type='html'>Traceview has been integrated into Eclipse plug-in with DDMS. The start/stop profiling button will open traces in Eclipse directly instead of launching the standalone tool.&lt;br /&gt;
&lt;br /&gt;
Inclusive Time:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;The
    time spent in the method plus the time spent in any called functions.&lt;br /&gt;
Exclusive Time:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;The time spent in the method.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A 
timeline panel -- describes when each thread
     and method started and stopped&lt;/li&gt;
&lt;/ul&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/AVvXsEg_sQkESddbV0J5AMksvsyE93KBz6zqGQViaAne-OFw04eErHRkB09vIKaChhuoL9tDWHnhEn_iK3p47BXXt44hStD2aJI77mDXZdacX3p9dDEnK-XmraZQwdZT3Ybcc70TaYer-Mw7NOQ/s1600/traceview_timeline.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;100&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_sQkESddbV0J5AMksvsyE93KBz6zqGQViaAne-OFw04eErHRkB09vIKaChhuoL9tDWHnhEn_iK3p47BXXt44hStD2aJI77mDXZdacX3p9dDEnK-XmraZQwdZT3Ybcc70TaYer-Mw7NOQ/s320/traceview_timeline.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Each thread’s
    execution is shown in its own row, with time increasing to the right. Each method
    is shown in another color (colors are reused in a &lt;a href=&quot;http://en.wikipedia.org/wiki/Round-robin_scheduling&quot;&gt;round-robin fashion&lt;/a&gt; starting
    with the methods that have the most inclusive time). The thin lines underneath
    the first row show the extent (entry to exit) of all the calls to the selected
    method.&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;A 
profile panel -- provides a summary of what happened inside a method.&lt;/li&gt;
&lt;/ul&gt;
The inclusive and exclusive times (as well as the percentage of the total
    time).The calling methods as &quot;parents&quot; and called methods as &quot;children.&quot;
    When a method is selected (by clicking on it), it expands to show the parents
    and children. Parents are shown with a purple background and children
    with a yellow background. The last column in the table shows the number of calls
    to this method plus the number of recursive calls. The last column shows the
    number of calls out of the total number of calls made to that method. In this
    view, we can see that there were 14 calls &amp;nbsp;looking
    at the timeline panel shows that one of those calls took an unusually
    long time. If any doubts please put a comment.&lt;div&gt;
&lt;br /&gt;&lt;div&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/AVvXsEiQkkjMTSyWWlM4RSM-QYEkv26kapCDH6SGl3AHfNzD-42naX05ffHZjPixhw-acxcET_56XKbHI_ui9wwFZxtn89Kl0bsqRKdB12JMt3m58X44DhfgWLlo7K2FxNE7x71HVIHo-DYYIyU/s1600/traceview_profile.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;281&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQkkjMTSyWWlM4RSM-QYEkv26kapCDH6SGl3AHfNzD-42naX05ffHZjPixhw-acxcET_56XKbHI_ui9wwFZxtn89Kl0bsqRKdB12JMt3m58X44DhfgWLlo7K2FxNE7x71HVIHo-DYYIyU/s400/traceview_profile.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/8812304691073654398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-application-efficient.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/8812304691073654398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/8812304691073654398'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-application-efficient.html' title='Android Application Efficient Development - Trace View'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_sQkESddbV0J5AMksvsyE93KBz6zqGQViaAne-OFw04eErHRkB09vIKaChhuoL9tDWHnhEn_iK3p47BXXt44hStD2aJI77mDXZdacX3p9dDEnK-XmraZQwdZT3Ybcc70TaYer-Mw7NOQ/s72-c/traceview_timeline.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-8717452978904967160</id><published>2011-11-03T17:46:00.000+05:30</published><updated>2011-11-03T17:46:19.618+05:30</updated><title type='text'>Android Coding Standards</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;Android rules are not guidelines or recommendations, but &lt;i&gt;&lt;b&gt;strict rules&lt;/b&gt;&lt;/i&gt;. Contributions to Android generally&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;will not be accepted&lt;/em&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&amp;nbsp;if they do not adhere to these rules.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;Not all existing code follows the rules, but all new code is expected to. Rule are available in &lt;a href=&quot;http://source.android.com/source/code-style.html&quot;&gt;ANROID RULES&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/8717452978904967160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-coding-standards.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/8717452978904967160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/8717452978904967160'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-coding-standards.html' title='Android Coding Standards'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total><georss:featurename>Chennai, Tamil Nadu, India</georss:featurename><georss:point>13.060422 80.249583</georss:point><georss:box>12.936679000000002 80.0916545 13.184165 80.4075115</georss:box></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-7394083468656164294</id><published>2011-11-03T17:22:00.000+05:30</published><updated>2011-11-03T17:25:29.896+05:30</updated><title type='text'>Android Interview Questions - Activity</title><content type='html'>&lt;br /&gt;
1. What is an Activity?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; An Activity is an application component that provides a screen with which users can interact in order to do something&lt;br /&gt;
&lt;br /&gt;
2. Activity Life Cycle and explain their states?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onCreate() &amp;nbsp; &amp;nbsp; &amp;nbsp;: Called when the activity is first created.This is where you should do all of your normal static set up — create views, bind data to lists, and so on. &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onStart() &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: Called just before the activity becomes visible to the user.Followed by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onResume() &amp;nbsp; : Called just before the activity starts interacting with the user. At this point the activity is at the top of the activity stack.Always followed by onPause().&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onPause() &amp;nbsp; &amp;nbsp; &amp;nbsp;: Called when the system is about to start resuming another activity. This method is typically used to commit unsaved changes.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onStop() &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp;Called when the activity is no longer visible to the user. This may happen because it is being destroyed, or because another activity has been resumed and is covering it.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onDestroy() &amp;nbsp; : Called before the activity is destroyed. This is the final call that the activity will receive.&lt;br /&gt;
&lt;br /&gt;
3. What happen in onCreate()?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Called when the activity is first created.This is where you should do all of your normal static set up — create views, bind data to lists, and so on. &lt;br /&gt;
&lt;br /&gt;
4. What happen in onCreate() and onStart()?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;onStart() only the activity comes to visible.onCreate() it does the work of setting up &amp;nbsp;— create views, bind data to lists, and so on. &lt;br /&gt;
&lt;br /&gt;
5. What happen in onStop() and onDestroy()?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;onStop() is called before onDestroy() when there is &amp;nbsp;no visibility to the user its exists in the task.When onDestroy() is called it make sure the activity is destroyed.It is called when the BACK() button is clicked the activity pops out of the task.&lt;br /&gt;
&lt;br /&gt;
6. In which stage of the activity life cycle do you want to commit the changes?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;onPause();&lt;br /&gt;
&lt;br /&gt;
7. Which stage of activity is certain to be called?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onPause();&lt;br /&gt;
&lt;br /&gt;
8. How to stop an activity?&lt;br /&gt;
&amp;nbsp; &amp;nbsp;ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; finish();&lt;br /&gt;
&lt;br /&gt;
9. What is Fragments?(Not Important)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; A Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities. You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a &quot;sub activity&quot; that you can reuse in different activities).&lt;br /&gt;
&lt;br /&gt;
10. What is Loaders?(Not Important)&lt;br /&gt;
&amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Introduced in Android 3.0, loaders make it easy to asynchronously load data in an activity or fragment.&lt;br /&gt;
&lt;br /&gt;
11. What is &amp;nbsp;task?&lt;br /&gt;
&amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;A task is a collection of activities that users interact with when performing a certain job.&lt;br /&gt;
&lt;br /&gt;
12. Can task have other application activity inside it ? Give me an example ?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Yes,from any application we can call email client of android this is also falls in the current task.&lt;br /&gt;
&lt;br /&gt;
13. Can u explain how the activity are loaded in Task?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;ans:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;When the current activity starts another, the new activity is pushed on the top of the stack and takes focus. The previous activity remains in the stack, but is stopped. When an activity stops, the system retains the current state of its user interface.Activities in the stack are never rearranged, only pushed and popped from the stack—pushed onto the stack when started by the current activity and popped off when the user leaves it using the BACK key. &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
14. When does the state of the activity is saved?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; onStop();&lt;br /&gt;
&lt;br /&gt;
15. Is all the activity state saved in application stack? If NO what should it does to recover the state?(Important)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;No, the system might destroy that activity completely if it needs to recover system memory. the system still knows that the activity has a place in the back stack, but when the activity is brought to the top of the stack the system must recreate it.&lt;br /&gt;
&lt;br /&gt;
16. What should you do to retain the activity state?(Not Important)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;onSaveInstanceState();&lt;br /&gt;
&lt;br /&gt;
17. How to start a task?&lt;br /&gt;
&amp;lt;activity ...=&quot;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;intent-filter ...=&quot;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;action android:name=&quot;android.intent.action.MAIN&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/category&amp;gt;&amp;lt;/action&amp;gt;&amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ...&lt;br /&gt;
&amp;lt;/activity&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
18. Let there be three activity flow &amp;nbsp;A-&amp;amp;gt;B-&amp;amp;gt;C &amp;nbsp;I want to go to A how will i go?&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Please do a sample program for task. and put the comments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi guys i have summed up few Activity related interview question&#39;s and their answers.If any thing wrong please correct me and add your question&#39;s too?Lets all get benefited.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/7394083468656164294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-application-developer-activity.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7394083468656164294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/7394083468656164294'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/android-application-developer-activity.html' title='Android Interview Questions - Activity'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-250489430043708330</id><published>2011-11-03T15:16:00.001+05:30</published><updated>2011-11-06T00:37:46.636+05:30</updated><title type='text'>What is the difference between Service,Handler,AsyncTask ?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 13px; line-height: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;post-text&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; line-height: 18px; margin-bottom: 5px; margin-left: 0px; margin-right: 5px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; width: 660px;&quot;&gt;
&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1em; margin-left: 30px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;A service is an Android component that lives independently from any other components. Activities may come and go, but services can stick around, if you wish. They serve a number of roles, from managing state that multiple activities rely upon to serving as cron jobs to handling longer app widget updates.&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AsyncTask&lt;/code&gt;&amp;nbsp;is a class that arranges to do some work off the main application thread. From the implementer and user of the&amp;nbsp;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AsyncTask&lt;/code&gt;, how it performs that bit of magic is not generally important. In reality, it uses a thread pool and work queue.&amp;nbsp;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AsyncTask&lt;/code&gt;&amp;nbsp;uses a&amp;nbsp;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Handler&lt;/code&gt;&amp;nbsp;to help arrange for select bits of work to be done on the main application thread (e.g., notifying the user of progress updates).&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Handler&lt;/code&gt;&amp;nbsp;is a class that is tied tightly into the message queue and loop that forms the backbone of the main application thread. The primary purpose of a&amp;nbsp;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Handler&lt;/code&gt;&amp;nbsp;in application code is to arrange for messages to be sent from background threads to the main application thread, mostly to arrange for updates to the UI, which cannot be done from background threads&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/250489430043708330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-difference-between.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/250489430043708330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/250489430043708330'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-difference-between.html' title='What is the difference between Service,Handler,AsyncTask ?'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-5415183438878601154</id><published>2011-11-03T14:29:00.001+05:30</published><updated>2011-11-03T22:59:39.513+05:30</updated><title type='text'>What is a Service?</title><content type='html'>&lt;br /&gt;
A service is an Android component that lives independently from any other components. Activities may come and go, but services can stick around.&lt;br /&gt;
&lt;br /&gt;
A Service is not a separate process, it runs in the same process as the application it is part of.&lt;br /&gt;
A Service is not a thread.&lt;br /&gt;
&lt;br /&gt;
Mostly Service is mistaken to be running in separate process but its always part of the main application process. If you want it to be run separately then use &amp;lt;a href=&quot;http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-async-task.html&quot;&amp;gt;AsynTask&amp;lt;/a&amp;gt; or&amp;lt;a href=&quot;http://developer.android.com/reference/android/app/IntentService.html&quot;&amp;gt; IntentService&amp;lt;/a&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/5415183438878601154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/5415183438878601154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/5415183438878601154'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-service.html' title='What is a Service?'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-1644832548973797818</id><published>2011-11-03T14:03:00.000+05:30</published><updated>2011-11-03T14:03:03.599+05:30</updated><title type='text'>What is Handler?</title><content type='html'>Handler is a class that is tied tightly into the &lt;a href=&quot;http://developer.android.com/reference/android/os/MessageQueue.html&quot;&gt;message queue&lt;/a&gt; and loop that forms the backbone of the&lt;i&gt; main application thread&lt;/i&gt;. The primary purpose of a Handler in application code is to arrange for messages to be sent from background threads to the main application thread, mostly to arrange for updates to the UI, which cannot be done from background threads.&lt;br /&gt;
&lt;br /&gt;
For eg:&lt;br /&gt;
&lt;br /&gt;
Handler handleVal = new Handler();&lt;br /&gt;
&lt;br /&gt;
Runnable runVal = new Runnable() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public void run() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//Your back ground process&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
};&lt;br /&gt;
handleVal.post(runVal);&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/1644832548973797818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-handler.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/1644832548973797818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/1644832548973797818'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-handler.html' title='What is Handler?'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7255585624608790245.post-267870538902846008</id><published>2011-11-03T13:17:00.000+05:30</published><updated>2011-11-06T09:43:43.889+05:30</updated><title type='text'>What is an Async Task?</title><content type='html'>&lt;br /&gt;
AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers. An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread.&lt;br /&gt;
&lt;br /&gt;
An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called onPreExecute, doInBackground, onProgressUpdate and onPostExecute.&lt;br /&gt;
&lt;br /&gt;
1. Params, the type of the parameters sent to the task upon execution.&lt;br /&gt;
2. Progress, the type of the progress units published during the background computation.&lt;br /&gt;
3. Result, the type of the result of the background computation. &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
public class BackgroundTask extends AsyncTask&amp;lt;Void(Parms),Integer(Progress),Bitmap(Result)&amp;gt; {&lt;br /&gt;
@Override&lt;br /&gt;
protected void onPreExecute() {&lt;br /&gt;
//For eg start your progress bar here&lt;br /&gt;
}&lt;br /&gt;
@Override protected Bitmap doInBackground(Void... params) {&lt;br /&gt;
// Web service call&lt;br /&gt;
}&lt;br /&gt;
@Override protected void onCancelled() {&lt;br /&gt;
//for the task to be cancelled&lt;br /&gt;
}&lt;br /&gt;
@Override protected void onProgressUpdate(Integer... values) {&lt;br /&gt;
//show logs in a text field.&lt;br /&gt;
}&lt;br /&gt;
@Override protected void onPostExecute(Bitmap img) {&lt;br /&gt;
//End your progress bar here&lt;br /&gt;
}&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://lifeasanandroiddeveloper.blogspot.com/feeds/267870538902846008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-async-task.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/267870538902846008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7255585624608790245/posts/default/267870538902846008'/><link rel='alternate' type='text/html' href='http://lifeasanandroiddeveloper.blogspot.com/2011/11/what-is-async-task.html' title='What is an Async Task?'/><author><name>Ranjithkumar</name><uri>http://www.blogger.com/profile/18220435353898178591</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ8kFgkJaFcbP6_4cYsPIFI0q6VuaZaQKAGYiZEiwM4PJEUtNIR0FNMXDsBl-uI22oGLVqV7hLjjNU_GLQI2Lyn8ZteVAQhAgFPayiwC-IDXfgm5GFSJEQLVaiZYth3tQ/s220/IMG_20130120_102418.jpg'/></author><thr:total>0</thr:total></entry></feed>