<?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-3529751757867890502</id><updated>2026-09-10T21:04:03.196+05:30</updated><category term="welcome screen code using Thread and Handler Android Application"/><title type='text'>krishnachary</title><subtitle type='html'>Android Apps,Android Querys,Freelancing&#xa;etc</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-5181119988291714289</id><published>2012-06-18T11:55:00.001+05:30</published><updated>2012-08-08T15:04:50.053+05:30</updated><title type='text'>java technical questions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
1.&lt;br /&gt;
public class Example1 {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int i=1000;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Mr. &quot;+args[1]+&quot;get salary &quot;+i);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //compile time error:saying&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //non static variable i can not be referenced from static area&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
2.class Base&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public void m1()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp;class Example2 extends Base{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;protected void m1()//m1() in Example2 can not m1() in Base&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//attempting to assign weaker access privileges;was public&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
3.class B&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; final private void m1()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp;class Example3 extends B{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;void m1()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//no error because private methods are not inherited&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
4.public class Example4 {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;public static int m1(boolean b)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(b)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;finally&lt;br /&gt;
&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;om sai&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m1(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
//output: om sai&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
5.public class Example5 {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Example5() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this(10,10);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//consrtuctor Example5 in class Example can not be applied to given types&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//required: no argument&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//found:int,int&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Example5 e=new Example5();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
6.class Ba&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; void fr(int x)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(x&amp;gt;10)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;super : &quot;+x);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fr(++x);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp;class Example6 extends Ba{&lt;br /&gt;
&amp;nbsp; &amp;nbsp;void fr(int x)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(x&amp;gt;10)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;sub : &quot;+x);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.fr(x);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&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;Example6 ex=new Example6();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ex.fr(10);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
//output: sub 11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.class Bas&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; void m1()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;base class&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp;class Example7 extends Bas {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;void m1()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;derived class&quot;);&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; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Example7 e=new Example7();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bas b= (Bas)e;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b.m1();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //output:derived class&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
upto here perfect questions&lt;br /&gt;
&lt;br /&gt;
last one just guess&lt;br /&gt;
&lt;br /&gt;
8.public class Example9 {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int x;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int x=10;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Example9 e=new Example9();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.m1(x);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;x&quot;+x);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public &amp;nbsp;void m1(int y)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x=y*y;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
//output: 10&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/5181119988291714289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/java-technical-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/5181119988291714289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/5181119988291714289'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/java-technical-questions.html' title='java technical questions'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-6595958813607471263</id><published>2012-06-11T15:26:00.001+05:30</published><updated>2012-06-11T15:26:26.369+05:30</updated><title type='text'>android concepts and code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
http://androidmohan.blogspot.in/2012/06/android-concepts-and-code.html&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/6595958813607471263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/android-concepts-and-code.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6595958813607471263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6595958813607471263'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/android-concepts-and-code.html' title='android concepts and code'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-1489377721581834348</id><published>2012-06-11T14:59:00.002+05:30</published><updated>2012-06-11T14:59:43.685+05:30</updated><title type='text'>Android Tools</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;Android Tools&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Emulator – &lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Virtual Device&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Can develop test and debug apps&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Allows to run simultaneous apps&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ADT – Android Development Tools&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Plugin for eclipse integrated development
environment&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Increases speed and efficiency for developing
android apps.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Allows the apps to access DDMS tool from
eclipse.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Gives the wizard for basic new project creation.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
DDMS – Dalvik Debug Monitor Service&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Works with the emulator or the mobile device&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Gives the information about the virtual devices
and physical devices.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Thread and Heap tab for easy display.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Screen capture&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Exploring the files&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Causes Garbage collection&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Running Log cat&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ADB – Android Debug Bridge&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Three core components&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 1.25in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;o&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Client&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 1.25in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;o&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Server&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 1.25in; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; mso-fareast-font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;o&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Daemon – A computer program that runs in the
background like a thread. Don’t have user control.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Used to manage&amp;nbsp;
the state of an emulator or a device.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Used to install any application directly
from&amp;nbsp; PC to mobile or emulator&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;To manage SQLite DB.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
AAPT – Android Asset Packaging Tool&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Used to package the .apk file&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Developers can use it directly to view , create
and update &amp;nbsp;.zip, .jar and .apk files.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
AIDL – Android Interface Description Language&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Used for Inter process communication.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Interface based. Saves developers time.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Sqlite3&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Allows to access the SQLite data files created
and used by android apps&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
TraceView&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Provides a graphical viewer for execution logs
saved by your app&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
MKSDCARD&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Helps you to create a disk image that you can
use with the emulator&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
DX&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Converts .class files to Android byte code.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ActivityCreator&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Creates basic files that the developer needs,
when the developer not using Eclipse.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Hierarchy Viewer&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;-&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Gives the user interface to the projects and
emulator&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;INSTALLATION&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Required SWs&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: .5in;&quot;&gt;
JDK 1.5 or higher&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Eclipse
3.5 or higher&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; ADT
Plugin for Eclipse&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Android
SDK.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Process&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Install
JDK and set path up to bin in to environment variables.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Extract
Eclipse and open eclipse.exe file.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Then&amp;nbsp; help&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;install
new SW &lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;
give path to ADT plugin&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;then
install ADT plugin.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Install
Android SDK installer file. Then select the files and install.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Then go
to Windows&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;
preferences&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;Android&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt; give path of Android
SDK, up to the root folder of tools folder.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&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; Then go
to Windows&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;
Android SDK and AVD manager&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;
Virtual Devices&lt;span style=&quot;font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;&quot;&gt;à&lt;/span&gt;
Create a new Virtual Device.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now the Set up is completed.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/1489377721581834348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/android-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1489377721581834348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1489377721581834348'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/android-tools.html' title='Android Tools'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-5781360692861149841</id><published>2012-06-11T14:58:00.001+05:30</published><updated>2012-06-11T14:58:16.616+05:30</updated><title type='text'>Generate map key steps in android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://developers.google.com/maps/documentation/android/mapkey&quot;&gt;https://developers.google.com/maps/documentation/android/mapkey&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
c:\&amp;gt;keytool.exe -list -alias androiddebugkey -keystore &quot;C:\android\debug.keystore&quot; -storepass android -keypass android&lt;br /&gt;
&lt;br /&gt;
MD5 Key .............................&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://developers.google.com/android/maps-api-signup?hl=en-US&quot;&gt;https://developers.google.com/android/maps-api-signup?hl=en-US&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/5781360692861149841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/generate-map-key-steps-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/5781360692861149841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/5781360692861149841'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/generate-map-key-steps-in-android.html' title='Generate map key steps in android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-7448178840496945392</id><published>2012-06-11T14:19:00.000+05:30</published><updated>2012-06-11T14:19:00.435+05:30</updated><title type='text'>Basic Android Terminal and ADB Shell Command List</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;While rooting your Android Phone or
installing &lt;/span&gt;&lt;a href=&quot;http://www.gadgetsdna.com/android-terminal-adb-shell-command-list/1168/&quot; target=&quot;undefined&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 6.5pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;custom ROM&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; on your mobile or partitioning your android device to &lt;/span&gt;&lt;a href=&quot;http://www.gadgetsdna.com/android-terminal-adb-shell-command-list/1168/&quot; target=&quot;undefined&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 6.5pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;install applications&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;, requires some &lt;b&gt;android terminal command&lt;/b&gt; and &lt;b&gt;ADB
(Android Debug Bridge) shell command&lt;/b&gt; knowledge. Below is the list of some
basic android commands that are being used on &lt;/span&gt;&lt;a href=&quot;http://www.gadgetsdna.com/android-terminal-adb-shell-command-list/1168/&quot; target=&quot;undefined&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 6.5pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Android platform&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; frequently and that every &lt;a href=&quot;http://www.gadgetsdna.com/android-terminal-adb-shell-command-list/1168/&quot; target=&quot;undefined&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 6.5pt; mso-bidi-font-size: 11.0pt;&quot;&gt;android user&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; display: none; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hide: all; mso-no-proof: yes;&quot;&gt;&lt;a href=&quot;http://www.gadgetsdna.com/android-terminal-adb-shell-command-list/1168/&quot; target=&quot;undefined&quot;&gt;&lt;span style=&quot;color: blue; text-decoration: none; text-underline: none;&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id=&quot;_x0000_t75&quot; coordsize=&quot;21600,21600&quot;
 o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; filled=&quot;f&quot;
 stroked=&quot;f&quot;&gt;
 &lt;v:stroke joinstyle=&quot;miter&quot;/&gt;
 &lt;v:formulas&gt;
  &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;/&gt;
  &lt;v:f eqn=&quot;sum @0 1 0&quot;/&gt;
  &lt;v:f eqn=&quot;sum 0 0 @1&quot;/&gt;
  &lt;v:f eqn=&quot;prod @2 1 2&quot;/&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;/&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;/&gt;
  &lt;v:f eqn=&quot;sum @0 0 1&quot;/&gt;
  &lt;v:f eqn=&quot;prod @6 1 2&quot;/&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;/&gt;
  &lt;v:f eqn=&quot;sum @8 21600 0&quot;/&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;/&gt;
  &lt;v:f eqn=&quot;sum @10 21600 0&quot;/&gt;
 &lt;/v:formulas&gt;
 &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot;/&gt;
 &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot;/&gt;
&lt;/v:shapetype&gt;&lt;v:shape id=&quot;Picture_x0020_1&quot; o:spid=&quot;_x0000_i1026&quot; type=&quot;#_x0000_t75&quot;
 alt=&quot;http://kona.kontera.com/javascript/lib/imgs/grey_loader.gif&quot; style=&#39;width:16.5pt;
 height:16.5pt;visibility:visible;mso-wrap-style:square&#39;&gt;
 &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\KRISHN~1.ZOL\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.gif&quot;
  o:title=&quot;grey_loader&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img alt=&quot;http://kona.kontera.com/javascript/lib/imgs/grey_loader.gif&quot; border=&quot;0&quot; height=&quot;22&quot; src=&quot;file:///C:/DOCUME~1/KRISHN~1.ZOL/LOCALS~1/Temp/msohtmlclip1/01/clip_image001.gif&quot; v:shapes=&quot;Picture_x0020_1&quot; width=&quot;22&quot; /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style=&quot;color: windowtext; mso-no-proof: no; text-decoration: none; text-underline: none;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;must know.&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id=&quot;Picture_x0020_2&quot; o:spid=&quot;_x0000_i1025&quot;
 type=&quot;#_x0000_t75&quot; alt=&quot;android adb shell&quot; style=&#39;width:375pt;height:187.5pt;
 visibility:visible;mso-wrap-style:square&#39;&gt;
 &lt;v:imagedata src=&quot;file:///C:\DOCUME~1\KRISHN~1.ZOL\LOCALS~1\Temp\msohtmlclip1\01\clip_image002.png&quot;
  o:title=&quot;android adb shell&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img alt=&quot;android adb shell&quot; border=&quot;0&quot; height=&quot;250&quot; src=&quot;file:///C:/DOCUME~1/KRISHN~1.ZOL/LOCALS~1/Temp/msohtmlclip1/01/clip_image003.gif&quot; v:shapes=&quot;Picture_x0020_2&quot; width=&quot;500&quot; /&gt;&lt;!--[endif]--&gt;&lt;/b&gt;&lt;br /&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 18.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Basic
Android Terminal and ADB Shell Command List&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1. How to open a cmd in Android
Phone&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Method 1: “Start” – “”Program”-”
“Accessories” – “” Command Prompt ”&lt;br /&gt;
Method 2: “Start” – “” Run “, type cmd ENTER&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2. How to restart Android Phone&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
When the phone and Computer is connected to the data cable, you can enter the
following command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell reboot ===
  ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3. Restart Android into Recovery
Mode&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
With the data cable connected to your phone and computer, enter the following
command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell reboot
  recovery === ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;4. Convert back to ext2 partition&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Restart the phone into Recovery
mode, press “Alt + X” into the console. Open cmd and enter the following
command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell === ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;tune2fs-O ^ has_journal
  / dev/block/mmcblk0p2&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;=== carriage return&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;e2fsck /
  dev/block/mmcblk0p2&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;=== carriage return&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;
  &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;(optional, can be a
  problem area in&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;section 2, when used)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;5. Pulling applications from Android
phone to computer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb pull
  /system/sd/app&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb pull
  /system/sd/app-private&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;app-private&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;6. Pushing applications back to
android phone from the computer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb push app
  /system/sd/app&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb push app-private
  /system/sd/app-private&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;7. Delete existing apps on Android
SD&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell rm&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;-r
  /system/sd/app&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell rm&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;-r
  /system/sd/app-private&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;8. Repair gravity System or switch
to screen&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Sometimes frequent brushing of phone
can cause gravity system or switch to screen failure. Just follow the steps
below-&lt;br /&gt;
Restart the phone into Recovery mode, press “Alt + X” into the console&lt;br /&gt;
Open cmd and enter the following command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;mount&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;/
  data === carriage return&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;rm&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;/
  data / misc / akmd * / data / misc / rild * === ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;9. Ext2/ext3/ext4 formatted
partition&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Enter the following command in the
cmd&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb remount ===
  ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell === ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;rm-r / system / sd /
  * === carriage return&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;10. Remove/ system / app under the
application&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
Under normal circumstances / system / app is not under an application. Use the
following methods to remove these applications.&lt;br /&gt;
Open cmd and enter the following command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb remount ===
  ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb rm&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;/
  system / app / Stocks.apk === Enter&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;11. If the start Time is too Long&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Just enter the following command in
order to view the boot process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb logcat === ENTER&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;12. Through Terminal Partition SD
card&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
It will erase everything on your SD card&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;$&amp;nbsp; su&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;# cd /data&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;# wget &lt;/span&gt;&lt;a href=&quot;http://64.105.21.209/bin/lib/droid/sdsplit&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;http://64.105.21.209/bin/lib/droid/sdsplit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;# chmod 555 sdsplit&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;# /data/sdsplit -fs
  *size* (add -nc to the end for JFv1.5ADP)&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;13. From the Recovery Screen, send
an update file to your SD card.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell mount&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;/sdcard&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb shell rm&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;/sdcard/update.zip&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;adb push *filename*
  /sdcard/update.zip&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;14. Restoring a nandroid backup via
Fastboot&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;
Start command-prompt/terminal cd to the nandroid folder and enter following
commands&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;6&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;7&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;fastboot erase boot&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;fastboot erase
  recovery&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;fastboot flash
  system system.img&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;fastboot flash boot
  boot.img&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;fastboot flash
  userdata data.img&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;fastboot flash
  recovery recovery.img&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;fastboot reboot&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;15. Clear Search History in Android&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Search History is accounted for
Mobile Memory. It can also leak your privacy information as well. Just follow
the steps below to clear android history.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Steps are as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1. Make sure your mobile phone has
Root authority.&lt;br /&gt;
2. Open the super-terminal.&lt;br /&gt;
3. Enter the following command&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: 0in 0in 0in 0in;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;su&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;rm&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;/
  data / data / com.android.vending / databases / suggestions.db&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;4. Exit Hyper Terminal and restart
the phone.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;If you have a good one to add please
post it in comment section&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/7448178840496945392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/basic-android-terminal-and-adb-shell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7448178840496945392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7448178840496945392'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/basic-android-terminal-and-adb-shell.html' title='Basic Android Terminal and ADB Shell Command List'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-2489505799992879826</id><published>2012-06-07T15:18:00.001+05:30</published><updated>2012-06-07T15:18:21.426+05:30</updated><title type='text'>ExampleOnTimePickerDialog</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
public class ExampleontimepickerdialogActivity extends Activity {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/**Private members of the class*/&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private TextView displayTime;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private Button pickTime;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private int pHour;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private int pMinute;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /** This integer will uniquely define the dialog to be used for displaying time picker. */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; static final int TIME_DIALOG_ID = 0;&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;
&amp;nbsp; &amp;nbsp; /** Callback received when the user &quot;picks&quot; a time in the dialog */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private TimePickerDialog.OnTimeSetListener mTimeSetListener =&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new TimePickerDialog.OnTimeSetListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onTimeSet(TimePicker view, int hourOfDay, int minute) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pHour = hourOfDay;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pMinute = minute;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; updateDisplay();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayToast();&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; };&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; /** Updates the time in the TextView */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private void updateDisplay() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayTime.setText(&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new StringBuilder()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .append(pad(pHour)).append(&quot;:&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .append(pad(pMinute)));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; /** Displays a notification when the time is updated */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private void displayToast() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(this, new StringBuilder().append(&quot;Time choosen is &quot;).append(displayTime.getText()), &amp;nbsp; Toast.LENGTH_SHORT).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; /** Add padding to numbers less than ten */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static String pad(int c) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (c &amp;gt;= 10)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return String.valueOf(c);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &quot;0&quot; + String.valueOf(c);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /** Capture our View elements */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayTime = (TextView) findViewById(R.id.timeDisplay);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pickTime = (Button) findViewById(R.id.pickTime);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /** Listener for click event of the button */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pickTime.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onClick(View v) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; showDialog(TIME_DIALOG_ID);&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; });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /** Get the current time */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final Calendar cal = Calendar.getInstance();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pHour = cal.get(Calendar.HOUR_OF_DAY);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pMinute = cal.get(Calendar.MINUTE);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /** Display the current time in the TextView */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; updateDisplay();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; /** Create a new dialog for time picker */&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; protected Dialog onCreateDialog(int id) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (id) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case TIME_DIALOG_ID:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new TimePickerDialog(this,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mTimeSetListener, pHour, pMinute, false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=============== Xml file ===============&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; android:orientation=&quot;vertical&quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;TextView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/timeDisplay&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:text=&quot;Time will appear here after being selected&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textSize=&quot;30sp&quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Button&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/pickTime&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:text=&quot;Change the time&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/2489505799992879826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/exampleontimepickerdialog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2489505799992879826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2489505799992879826'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/exampleontimepickerdialog.html' title='ExampleOnTimePickerDialog'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-6636457879827860510</id><published>2012-06-07T14:07:00.000+05:30</published><updated>2012-06-07T14:28:19.556+05:30</updated><title type='text'>Dialog box examples</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin: 0px 0px 15px; padding: 0px; text-align: left;&quot;&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;An alert box with a single button&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;A dialog box with two buttons&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;A dialog box containing&amp;nbsp;a list&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;A dialog box&amp;nbsp;containing&amp;nbsp;checkboxes&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Android Platform 1.5&quot; src=&quot;http://www.botskool.com/sites/default/files/medium_android-logo.jpg&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;block block-block even&quot; id=&quot;block-block-71&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div class=&quot;content&quot; style=&quot;font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; margin: 10px 0px 0px; padding: 0px;&quot;&gt;
&lt;ins style=&quot;border: none; display: inline-table; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;ins id=&quot;aswift_3_anchor&quot; style=&quot;border: none; display: block; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;15&quot; hspace=&quot;0&quot; id=&quot;aswift_3&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_3&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin: 0px; padding: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Note&lt;/em&gt;:&lt;/div&gt;
&lt;ul style=&quot;margin: 0px 0px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;We will be using Android Platform 1.5 for developing our application.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
To demonstrate&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot; style=&quot;background-attachment: scroll !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;how to create&lt;/span&gt;&amp;nbsp;dialog boxes&amp;nbsp;firstly we will be creating a basic application with four buttons and clicking on each of these buttons will display a different kind of dialog box. We will be using XML based layout for our Application&#39;s User Interface. Create a&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot; style=&quot;background-attachment: scroll !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;new Android&lt;/span&gt;&amp;nbsp;project with the following properties -&lt;/div&gt;
&lt;ul style=&quot;margin: 0px 0px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;Project Name -&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;DialogBox&lt;/strong&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;Name of the Application -&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Dialog Box&lt;/strong&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;Package name -&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;com.botskool.DialogBox&lt;/strong&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;Activity Name -&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Dialog Box&lt;/strong&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
There will be four buttons and a string as listed below -&lt;/div&gt;
&lt;ul style=&quot;margin: 0px 0px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;information&lt;/em&gt;&amp;nbsp;string&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;alert&lt;/em&gt;&amp;nbsp;button (This button will be used to display an alert box)&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;yesno&lt;/em&gt;&amp;nbsp;button&amp;nbsp;(&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot; style=&quot;background-attachment: scroll !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;This will&lt;/span&gt;&amp;nbsp;be used to display a dialog box with Yes/No buttons)&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;selectlist&lt;/em&gt;&amp;nbsp;button&amp;nbsp;(This will&amp;nbsp;be used to display a dialog box which contains a list)&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;selectlistwithcheckbox&lt;/em&gt;&amp;nbsp;(This will&amp;nbsp;be used to display a dialog box which contains a list along with checkbox)&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
Copy the following code in&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;DialogBox.java&lt;/strong&gt;&amp;nbsp;-&lt;/div&gt;
&lt;div class=&quot;block block-block odd&quot; id=&quot;block-block-72&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div class=&quot;content&quot; style=&quot;font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; margin: 10px 0px 0px; padding: 0px;&quot;&gt;
&lt;ins style=&quot;border: none; display: inline-table; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;ins id=&quot;aswift_4_anchor&quot; style=&quot;border: none; display: block; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;15&quot; hspace=&quot;0&quot; id=&quot;aswift_4&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_4&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin: 0px; padding: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.app.Activity;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.app.AlertDialog;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.content.DialogInterface;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.os.Bundle;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.view.View;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.view.View.OnClickListener;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.widget.Button;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;import android.widget.Toast;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;public class DialogBox extends Activity implements OnClickListener{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;/** Called when the activity is first created. */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;@Override&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public void onCreate(Bundle savedInstanceState) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreate(savedInstanceState);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setContentView(R.layout.main);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** We need to set up a click listener on the alert button */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button alert = (Button) findViewById(R.id.alertbutton);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert.setOnClickListener(this);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** We need to set up a click listener on the yesno button */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button yesno = (Button) findViewById(R.id.yesnobutton);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yesno.setOnClickListener(this);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** We need to set up a click listener on the selectlist button */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button selectlist = (Button) findViewById(R.id.selectlist);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;selectlist.setOnClickListener(this);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** We need to set up a click listener on the selectlistwithcheckbox button */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button selectlistwithcheckbox = (Button) findViewById(R.id.selectlistwithcheckbox);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;selectlistwithcheckbox.setOnClickListener(this);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public void onClick(View view) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;/** check whether the alert button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.alertbutton)) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Code here to display alert box&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /** check whether the yesno button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.yesnobutton)) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Code here to display the dialog box with Yes/No button&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** check whether the selectlist button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.selectlist)) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Code here to display the dialog box&amp;nbsp;containing&amp;nbsp;a list. &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** check whether the selectlistwithcheckbox button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.selectlistwithcheckbox)) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Code here to display the dialog box with checkbox&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
Copy the following code in&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;main.xml&lt;/strong&gt;&amp;nbsp;-&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:orientation=&quot;vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;TextView &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:layout_height=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:text=&quot;@string/information&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;Button&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_width=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_height=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:text=&quot;Show Alert&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:id=&quot;@+id/alertbutton&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;Button&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_width=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_height=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:text=&quot;Show Yes/No&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:id=&quot;@+id/yesnobutton&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;Button&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_width=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_height=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:text=&quot;Show List&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:id=&quot;@+id/selectlist&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;Button&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_width=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_height=&quot;wrap_content&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:text=&quot;Show List with Checkbox&quot;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;android:id=&quot;@+id/selectlistwithcheckbox&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
Copy the following code in&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;strings.xml&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;resources&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;string name=&quot;information&quot;&amp;gt;Various kind of&amp;nbsp;dialog boxes&amp;nbsp;- &amp;nbsp;by www.bOtskOOl.com&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;string name=&quot;app_name&quot;&amp;gt;Dialog Box&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/resources&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
Compile and run the Android application and you will get this -&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin: 0px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Dialog Box Application in Android&quot; height=&quot;668&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-1.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;364&quot; /&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin: 0px; padding: 0px; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
Now we need to&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot; style=&quot;background-attachment: scroll !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;write the&lt;/span&gt;&amp;nbsp;code to create and display different&amp;nbsp;dialog boxes. Let&#39;s start with the simple Alert box with single button. Copy the following code inside the if condition which checks whether the alert box has been clicked or not in the&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;OnClick()&lt;/span&gt;&amp;nbsp;function as shown below -&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;/** check whether the alert button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.alertbutton)) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Create the alert box&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AlertDialog.Builder alertbox = new AlertDialog.Builder(this);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Set the message to display&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alertbox.setMessage(&quot;This is an alert box.&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Add a neutral button to the alert box and assign a click listener&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alertbox.setNeutralButton(&quot;Ok&quot;, new DialogInterface.OnClickListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Click listener on the neutral button of alert box&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onClick(DialogInterface arg0, int arg1) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// The neutral button was clicked&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(getApplicationContext(), &quot;&#39;OK&#39; button clicked&quot;, Toast.LENGTH_LONG).show();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // show the alert box&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alertbox.show();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
To create an Alert box we first use the&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;AlertDialog.Builder&lt;/em&gt;&amp;nbsp;subclass. We create an&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;instance&lt;/span&gt;&amp;nbsp;of this class with&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;AlertDialog.Builder(Context)&lt;/em&gt;&amp;nbsp;and then we set the different properties of alert box such as message and button to be displayed by using&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setMessage()&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setNeutralButton()&lt;/span&gt;respectively. After this we display the alert box by using&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;show()&lt;/span&gt;&amp;nbsp;function.&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setMessage()&lt;/span&gt;&amp;nbsp;takes only one argument and that is the string to be displayed to&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;the user&lt;/span&gt;. In&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setNeutralButton()&lt;/span&gt;&amp;nbsp;function the first argument is the name of&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;the button&lt;/span&gt;.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
Also we add a click listener to the (neutral)&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;OK&lt;/strong&gt;&amp;nbsp;button by passing a function as second argument of&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setNeutralButton()&lt;/span&gt;&amp;nbsp;function and we display a toast&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;notification&lt;/span&gt;&amp;nbsp;whenever this button is clicked/activated. Check out the screenshots below.&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;An alert box in android&quot; height=&quot;665&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-5.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;364&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;ok button clicked in android&quot; height=&quot;666&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-6.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;371&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
You must be wondering what a neutral button is? Well in Android we have three types of button -&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px 0px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Positive&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Yes&lt;/strong&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Negative&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;No&lt;/strong&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Neutral&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Cancel&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
You can ONLY add one of each button type to your AlertDialog box. So this limits the number of possible buttons to three: positive, neutral, and negative. As quoted on Android&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;website&lt;/span&gt;&amp;nbsp;-&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;These names are technically irrelevant to the actual functionality of your buttons, but should help you keep track of which one does what&lt;/em&gt;.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
Now if we want to create a dialog box with two buttons you just need to use some other type of button apart from neutral button. Say for Yes/No dialog box we use a positive and a negative button then we can their property by calling&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setPostiveButton()&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setNegativeButton()&lt;/span&gt;&amp;nbsp;as shown below -&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;/** check whether the yesno button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.yesnobutton)) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create the dialog box&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AlertDialog.Builder alertbox = new AlertDialog.Builder(this);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Set the message to display&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alertbox.setMessage(&quot;This is a dialog box with two buttons&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Set a positive/yes button and create a listener&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alertbox.setPositiveButton(&quot;Yes&quot;, new DialogInterface.OnClickListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Click listener&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onClick(DialogInterface arg0, int arg1) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(getApplicationContext(), &quot;&#39;Yes&#39; button clicked&quot;, Toast.LENGTH_SHORT).show();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Set a negative/no button and create a listener&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alertbox.setNegativeButton(&quot;No&quot;, new DialogInterface.OnClickListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Click listener&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onClick(DialogInterface arg0, int arg1) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(getApplicationContext(), &quot;&#39;No&#39; button clicked&quot;, Toast.LENGTH_SHORT).show();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;display box&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alertbox.show();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
The functions&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setPostiveButton()&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setNegativeButton()&lt;/span&gt;&amp;nbsp;are similar to&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setNeutralButton()&lt;/span&gt;. Check out the screenshots below.&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Dialog box with two buttons in android&quot; height=&quot;666&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-2.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;372&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Yes button of dialog box in android&quot; height=&quot;674&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-3.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;367&quot; /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Yes No buttons of dialog box in android&quot; height=&quot;670&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-7.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;369&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;No button clicked in android&quot; height=&quot;674&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-8.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;370&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;background-color: white; color: #666666; font-family: Verdana, &#39;DejaVu Sans&#39;, Sans; font-size: 12px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;br /&gt;
&lt;ul style=&quot;margin: 0px 0px 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;A dialog box&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;containing&lt;/span&gt;&amp;nbsp;a list&lt;/li&gt;
&lt;li style=&quot;line-height: 1.7em; list-style: square; margin: 0px 0px 0px 30px; padding: 0px;&quot;&gt;A dialog box&amp;nbsp;containing&amp;nbsp;checkboxes&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
Lets start with dialog box having a list in it. There is an&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;onClick()&lt;/span&gt;&amp;nbsp;function in the&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;DialogBox.java&lt;/strong&gt;. In this onClick() function we have a if condition to&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;check whether&lt;/span&gt;&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Show List&lt;/em&gt;&amp;nbsp;button has been clicked or not as shown below.&lt;/div&gt;
&lt;div class=&quot;block block-block even&quot; id=&quot;block-block-71&quot; style=&quot;margin: 0px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;div class=&quot;content&quot; style=&quot;margin: 10px 0px 0px; padding: 0px;&quot;&gt;
&lt;ins style=&quot;border: none; display: inline-table; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;ins id=&quot;aswift_3_anchor&quot; style=&quot;border: none; display: block; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;15&quot; hspace=&quot;0&quot; id=&quot;aswift_3&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_3&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin: 0px; padding: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;/**&amp;nbsp;check whether&amp;nbsp;the selectlist button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.selectlist)) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Code here to display the dialog box&amp;nbsp;containing&amp;nbsp;a list. &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;block block-block odd&quot; id=&quot;block-block-72&quot; style=&quot;margin: 0px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;div class=&quot;content&quot; style=&quot;margin: 10px 0px 0px; padding: 0px;&quot;&gt;
&lt;ins style=&quot;border: none; display: inline-table; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;ins id=&quot;aswift_4_anchor&quot; style=&quot;border: none; display: block; height: 15px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;15&quot; hspace=&quot;0&quot; id=&quot;aswift_4&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_4&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; margin: 0px; padding: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
We will write our code inside this if condition to create and display the dialog box&amp;nbsp;containing&amp;nbsp;a list. For this we will use&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Builder&lt;/em&gt;&amp;nbsp;sub-&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;class&lt;/span&gt;&amp;nbsp;of&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;AlertDialog&lt;/em&gt;&amp;nbsp;as we had in the previous two&amp;nbsp;dialog boxes.&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
To create a list we will use&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setItem()&lt;/span&gt;&amp;nbsp;method of this&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Builder&lt;/em&gt;&amp;nbsp;sub&amp;nbsp;class. The first argument of this setItem() function is an array&amp;nbsp;containing&amp;nbsp;the elements of the list that has to be created and the second argument is&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;the click&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;listener&lt;/span&gt;&amp;nbsp;callback function&amp;nbsp;that defines the action to take when&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;the user&lt;/span&gt;&amp;nbsp;selects an item. Check out&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;the code&lt;/span&gt;&amp;nbsp;given below -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;/**&amp;nbsp;check whether&amp;nbsp;the selectlist button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.selectlist)) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//List items&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;final CharSequence[] items = {&quot;Milk&quot;, &quot;Butter&quot;, &quot;Cheese&quot;};&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Prepare the list dialog box&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;AlertDialog.Builder builder = new AlertDialog.Builder(this);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Set its title&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;builder.setTitle(&quot;Pick an item&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Set the list items and assign with&amp;nbsp;the click&amp;nbsp;listener&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;builder.setItems(items, new DialogInterface.OnClickListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt;  &lt;/span&gt;// Click&amp;nbsp;listener&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt;  &lt;/span&gt;public void onClick(DialogInterface dialog, int item) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;AlertDialog alert = builder.create();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//display dialog box&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;alert.show();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 15px; padding: 0px; text-align: -webkit-auto;&quot;&gt;
On selecting a particular item the&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;onClickListener()&lt;/span&gt;&amp;nbsp;function will be called which in turn will display a toast notification&amp;nbsp;containing&amp;nbsp;the name of the selected item as shown in screenshots below.&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Show List button in android&quot; height=&quot;663&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-9.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;373&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Dialog box with a list in android&quot; height=&quot;664&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-10.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;375&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Particular item being selected from the list in Android&quot; height=&quot;671&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-11.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;370&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
Similarly for&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;displaying&lt;/span&gt;&amp;nbsp;a dialog box with checkboxes in it we use&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;setSingleChoiceItems()&lt;/span&gt;&amp;nbsp;method of the&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Builder&lt;/em&gt;&amp;nbsp;sub&amp;nbsp;class&amp;nbsp;of&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;AlertDialog&lt;/em&gt;. The first parameter of this method is again an array of items to be displayed.&amp;nbsp;The second parameter is an&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot; style=&quot;background-attachment: scroll !important; background-color: transparent !important; background-image: none !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: rgb(0, 153, 0) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: #009900; cursor: pointer !important; display: inline !important; float: none !important; margin: 0px; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;integer&lt;/span&gt;&amp;nbsp;value for the checkedItem, which indicates the zero-based list position of the default selected item and we use &quot;-1&quot; if don&#39;t want any item to be selected by default. The third parameter is&amp;nbsp;the click&amp;nbsp;listener&amp;nbsp;function. Check outthe code&amp;nbsp;given below -&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;/**&amp;nbsp;check whether&amp;nbsp;the selectlistwithcheckbox button has been clicked */&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (view == findViewById(R.id.selectlistwithcheckbox)) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//List items&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;final CharSequence[] items = {&quot;Milk&quot;, &quot;Butter&quot;, &quot;Cheese&quot;};&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Prepare the list dialog box&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;AlertDialog.Builder builder = new AlertDialog.Builder(this);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Set its title&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;builder.setTitle(&quot;Pick an item&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//Set the list items along with checkbox and assign with&amp;nbsp;the click&amp;nbsp;listener&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt;  &lt;/span&gt;// Click&amp;nbsp;listener&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt;  &lt;/span&gt;public void onClick(DialogInterface dialog, int item) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//If the Cheese item is chosen close the dialog box&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(items[item]==&quot;Cheese&quot;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;dialog.dismiss();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;AlertDialog alert = builder.create();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;//display dialog box&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;margin: 0px; padding: 0px; white-space: pre;&quot;&gt; &lt;/span&gt;alert.show();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
Check out the screenshots shown below.&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Show List with Checkboxes button in Android&quot; height=&quot;660&quot; src=&quot;http://www.botskool.com/sites/default/files/how-to-create-dialog-box-in-android-12.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;373&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Dialog Box with checkboxes in Android&quot; height=&quot;663&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-13.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;375&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Choosing a particular item from list in Android&quot; height=&quot;659&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-14.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;374&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
In the&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;onClickListener()&lt;/span&gt;&amp;nbsp;function we have introduced an if condition which checks whether the selected item is&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Cheese&lt;/em&gt;&amp;nbsp;and if it is so we have called a function&amp;nbsp;&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;dialog.dimiss()&lt;/span&gt;. This function closes/dismisses the dialog box. Apart from this everything is similar to&amp;nbsp;the code&amp;nbsp;of the previous dialog box i.e. whenever an item is selected the toast notification displays the selected item&#39;s name.&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;An item being selected in a listin dialog box in Android&quot; height=&quot;668&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-15.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;376&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;img alt=&quot;Toast Notification is displayed after selecting a particular option in Android&quot; height=&quot;670&quot; src=&quot;http://www.botskool.com/sites/default/files/image/how-to-create-dialog-box-in-android-16.JPG&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot; width=&quot;372&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;rtecenter&quot; style=&quot;margin-bottom: 15px; padding: 0px; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
So now the complete code of&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;DialogBox.java&lt;/strong&gt;&amp;nbsp;will be -&lt;/div&gt;
&lt;div class=&quot;rteleft&quot; style=&quot;margin-bottom: 15px; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: blue; margin: 0px; padding: 0px;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.app.Activity;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.app.AlertDialog;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.content.DialogInterface;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.os.Bundle;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.view.View;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.view.View.OnClickListener;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.widget.Button;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;import android.widget.Toast;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;public&amp;nbsp;class&amp;nbsp;DialogBox extends Activity implements OnClickListener{&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** We need to set up a click&amp;nbsp;listener&amp;nbsp;on the alert button */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Button alert = (Button) findViewById(R.id.alertbutton);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert.setOnClickListener(this);&amp;nbsp;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** We need to set up a click&amp;nbsp;listener&amp;nbsp;on the yesno button */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Button yesno = (Button) findViewById(R.id.yesnobutton);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yesno.setOnClickListener(this);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** We need to set up a click&amp;nbsp;listener&amp;nbsp;on the selectlist button */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Button selectlist = (Button) findViewById(R.id.selectlist);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectlist.setOnClickListener(this);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** We need to set up a click&amp;nbsp;listener&amp;nbsp;on the selectlistwithcheckbox button */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Button selectlistwithcheckbox = (Button) findViewById(R.id.selectlistwithcheckbox);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectlistwithcheckbox.setOnClickListener(this);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onClick(View view) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;nbsp;check whether&amp;nbsp;the alert button has been clicked */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (view == findViewById(R.id.alertbutton)) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; // Create the alert box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AlertDialog.Builder alertbox = new AlertDialog.Builder(this);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the message to display&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox.setMessage(&quot;This is an alert box.&quot;);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add a neutral button to the alert box and assign a click&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox.setNeutralButton(&quot;Ok&quot;, new DialogInterface.OnClickListener() {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; // Click&amp;nbsp;listener&amp;nbsp;on the neutral button of alert box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; public void onClick(DialogInterface arg0, int arg1) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The neutral button was clicked&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(getApplicationContext(), &quot;&#39;OK&#39; button clicked&quot;, Toast.LENGTH_LONG).show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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 style=&quot;margin: 0px; padding: 0px;&quot; /&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; // show the alert box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox.show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;nbsp;check whether&amp;nbsp;the yesno button has been clicked */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (view == findViewById(R.id.yesnobutton)) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create the dialog box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AlertDialog.Builder alertbox = new AlertDialog.Builder(this);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the message to display&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox.setMessage(&quot;This is a dialog box with two buttons&quot;);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; // Set a positive/yes button and create a&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox.setPositiveButton(&quot;Yes&quot;, new DialogInterface.OnClickListener() {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; // Click&amp;nbsp;listener&amp;nbsp;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; public void onClick(DialogInterface arg0, int arg1) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(getApplicationContext(), &quot;&#39;Yes&#39; button clicked&quot;, Toast.LENGTH_SHORT).show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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 style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set a negative/no button and create a&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox.setNegativeButton(&quot;No&quot;, new DialogInterface.OnClickListener() {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; // Click&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; public void onClick(DialogInterface arg0, int arg1) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(getApplicationContext(), &quot;&#39;No&#39; button clicked&quot;, Toast.LENGTH_SHORT).show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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 style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // display box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alertbox.show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;nbsp;check whether&amp;nbsp;the selectlist button has been clicked */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (view == findViewById(R.id.selectlist)) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //List items&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; final CharSequence[] items = {&quot;Milk&quot;, &quot;Butter&quot;, &quot;Cheese&quot;};&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //Prepare the list dialog box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AlertDialog.Builder builder = new AlertDialog.Builder(this);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //Set its title&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; builder.setTitle(&quot;Pick an item&quot;);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //Set the list items and assign with&amp;nbsp;the click&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; builder.setItems(items, new DialogInterface.OnClickListener() {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; // Click&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; public void onClick(DialogInterface dialog, int item) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp; Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AlertDialog alert = builder.create();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //display dialog box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; alert.show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;nbsp;check whether&amp;nbsp;the selectlistwithcheckbox button has been clicked */&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (view == findViewById(R.id.selectlistwithcheckbox)) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //List items&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; final CharSequence[] items = {&quot;Milk&quot;, &quot;Butter&quot;, &quot;Cheese&quot;};&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //Prepare the list dialog box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AlertDialog.Builder builder = new AlertDialog.Builder(this);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //Set its title&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; builder.setTitle(&quot;Pick an item&quot;);&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //Set the list items along with checkbox and assign with&amp;nbsp;the click&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; // Click&amp;nbsp;listener&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; public void onClick(DialogInterface dialog, int item) {&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp; Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp; //If the Cheese item is chosen close the dialog box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp; if(items[item]==&quot;Cheese&quot;)&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dialog.dismiss();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&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; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AlertDialog alert = builder.create();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //display dialog box&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; alert.show();&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/6636457879827860510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/alert-box-with-single-button-dialog-box.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6636457879827860510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6636457879827860510'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/alert-box-with-single-button-dialog-box.html' title='Dialog box examples'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-6888332307020205662</id><published>2012-06-05T15:27:00.002+05:30</published><updated>2012-06-05T15:27:29.741+05:30</updated><title type='text'>Serialization , Marshalling</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;pre style=&quot;text-align: -webkit-auto; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;                                                                     
                                                                     
                                                                     
                                             
======serialization demo======================
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package zolt.newprograms;

/**
 *
 * @author raju_b
 */
import java.io.*;

public class SerializeDemo
{
   public static void main(String [] args)
   {
      Employee e = new Employee();
      e.name = &quot;RAJREDDY&quot;;
      e.address = &quot;HYDERABAD,AP&quot;;
      e.SSN = 11122333;
      e.number = 101;
      e.ram=&quot;Hello iam not serialized&quot;;
      try
      {
         FileOutputStream fileOut =
         new FileOutputStream(&quot;emprajreddy&quot;);
         ObjectOutputStream out =
                            new ObjectOutputStream(fileOut);
         out.writeObject(e);
         out.close();
          fileOut.close();
      }catch(IOException i)
      {
          i.printStackTrace();
      }
   }
}
======================deserialization demo===========================
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package zolt.newprograms;

/**
 *
 * @author raju_b
 */
import java.io.*;
import java.util.Calendar;
   public class DeserializeDemo
   {
      public static void main(String [] args)
      {
         Employee e = null;
         try
         {
            FileInputStream fileIn =
                          new FileInputStream(&quot;emprajreddy&quot;);
            ObjectInputStream in = new ObjectInputStream(fileIn);
            e = (Employee) in.readObject();
            in.close();
            fileIn.close();
        }catch(IOException i)
        {
            i.printStackTrace();
            return;
        }catch(ClassNotFoundException c)
        {
            System.out.println(&quot;Employee class not found.&quot;);
            c.printStackTrace();
            return;
        }
        System.out.println(&quot;Deserialized Employee...&quot;);
        System.out.println(&quot;Name: &quot; + e.name);
        System.out.println(&quot;Address: &quot; + e.address);
        System.out.println(&quot;SSN: &quot; + e.SSN);
        System.out.println(&quot;Number: &quot; + e.number);
         System.out.println(&quot;Number: &quot; + e.ram);
          System.out.println(&quot;Flattened time: &quot; + e.timenew);
          System.out.println(&quot;stored time is: &quot; + e.time);
         System.out.println();
     // print out the current time
  System.out.println(&quot;Current time: &quot; + Calendar.getInstance().getTime());
    }
}
=================================Employee class====================
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package zolt.newprograms;
import java.io.*;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author raju_b
 */
public class Employee implements java.io.Serializable
{
   public String name;
   public String address;
   public int SSN;
   transient public String  ram;
   public int number;
   public Date time;
   
   
   Date timenew=Calendar.getInstance().getTime();
    public Employee()
   {
      time = Calendar.getInstance().getTime();
       System.out.println(&quot;the time in emp is=&quot;+time);
    }

    public Date getTime()
    {
      return time;
    }
   public void mailCheck()
   {
      System.out.println(&quot;Mailing a check to &quot; + name
                           + &quot; &quot; + address);
   }
}
========================Marshalling demo=====JavaToXML====================
import java.math.BigDecimal;
 
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
 
public class JavaToXML {
    public static void main(String[] args) throws Exception {
        JAXBContext context = JAXBContext.newInstance(Product.class);
 
        Marshaller m = context.createMarshaller();
        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
 
        Product object = new Product();
        object.setCode(&quot;WI1&quot;);
        object.setName(&quot;Widget Number One&quot;);
        object.setPrice(BigDecimal.valueOf(300.00));
 
        m.marshal(object, System.out);
    }
}
================Un-Marshalling xmltojava=====================
import java.io.File;
 
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
 
public class XmlToJava {
 
    public static void main(String[] args) {
        try {
            JAXBContext jc = JAXBContext.newInstance(Product.class);
            Unmarshaller u = jc.createUnmarshaller();
 
            File f = new File(&quot;Product.xml&quot;);
            Product product = (Product) u.unmarshal(f);
 
            System.out.println(product.getCode());
            System.out.println(product.getName());
            System.out.println(product.getPrice());
        } catch (JAXBException e) {
            e.printStackTrace();
        }
    }
}&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/6888332307020205662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/serialization-marshalling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6888332307020205662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6888332307020205662'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/serialization-marshalling.html' title='Serialization , Marshalling'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-7041444231023391922</id><published>2012-06-05T10:57:00.000+05:30</published><updated>2012-06-05T10:57:32.996+05:30</updated><title type='text'>Pojo class or been class example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NotificationGeoFenceData extends Application{&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//int image;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//String sNo, sName, sClass, sPhNo, sEmail;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String Actual, Original, Date, Time,vehicle;&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;public NotificationGeoFenceData(String vehicle1,String Actual1,String Original1,String Date1,String Time1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated constructor stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.v(&quot;Activity Name&quot;, &quot;NotificationGeoFenceData extends Application&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;vehicle=vehicle1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Actual=Actual1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Original=Original1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Date=Date1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Time=Time1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.v(&quot;gggggg&quot;,&quot;values insterteddddddddddddddddddddddd...........&quot;);&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;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public String getVehicle() {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return vehicle;&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;public void setVehicle(String vehicle) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.vehicle = vehicle;&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;public String getActual() {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return Actual;&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;public void setActual(String Actual) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.Actual = Actual;&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;public String getOriginal() {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return Original;&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;public void setOriginal(String Original) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.Original = Original;&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;public String getDate() {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return Date;&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;public void setDate(String Date) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.Date = Date;&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;public String getTime() {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return Time;&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;public void setTime(String Time) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.Time = Time;&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;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/7041444231023391922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/pojo-class-or-been-class-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7041444231023391922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7041444231023391922'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/pojo-class-or-been-class-example.html' title='Pojo class or been class example'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-28213279827274341</id><published>2012-06-05T10:53:00.002+05:30</published><updated>2012-06-05T11:29:01.399+05:30</updated><title type='text'>Total program for custom adapter and parsing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
public class NotificationGeoFenceTab extends Activity&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// String Str = new String(&quot;2011-10-24 10:09:52.0&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String Str, Str2;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static NotificationGeoFenceTab INSTANCE;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ListView GFlist;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// public ArrayList&amp;lt;GeoFenceData&amp;gt; items = new ArrayList&amp;lt;GeoFenceData&amp;gt;();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static int caseNumber;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String xmlData;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String loginId;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public ArrayList&amp;lt;NotificationGeoFenceData&amp;gt; geoitem = new ArrayList&amp;lt;NotificationGeoFenceData&amp;gt;();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// int weAreAt = 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public NotificationGeoFenceData notificationgeofenceData;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/** Called when the activity is first created. */&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 onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super.onCreate(savedInstanceState);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.v(&quot;Activity Name&quot;, &quot;NotificationGeoFenceTab extends Activity&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;setContentView(R.layout.notification_geofence_alert1);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;INSTANCE = this;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;GFlist = (ListView) findViewById(R.id.geofencelist);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;GFlist.setAdapter(new GeoFenceListAdapter(getApplicationContext(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;R.layout.notification_listdata1_geofencedata,geoitem));&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;caseNumber = 6;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;xmlData = &quot;&amp;lt;zoltit.avts.bean.VehicleInputParam&amp;gt;&amp;lt;timeIntervel&amp;gt;&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;+ ApplicationVariables.user_minutes&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;+ &quot;&amp;lt;/timeIntervel&amp;gt;&amp;lt;/zoltit.avts.bean.VehicleInputParam&amp;gt;&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;loginId = ApplicationVariables.loginId;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SoapService service = new SoapService();&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;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String result = service.SoapService(caseNumber, xmlData, loginId);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;parseAlertsData(result);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (Exception e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e.printStackTrace();&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;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void parseAlertsData(String xmlRecord) throws Exception {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;DocumentBuilder db = DocumentBuilderFactory.newInstance()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;.newDocumentBuilder();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;InputSource is = new InputSource();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;is.setCharacterStream(new StringReader(xmlRecord));&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Document doc = db.parse(is);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;NodeList violation_list = doc.getElementsByTagName(&quot;violationlist&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = 0; i &amp;lt; violation_list.getLength(); i++) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Element element = (Element) violation_list.item(i);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;NodeList geofence_info = doc.getElementsByTagName(&quot;geofenceInfo&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (int j = 0; j &amp;lt; geofence_info.getLength(); j++) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;NodeList geofence_list = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;.getElementsByTagName(&quot;geofencelist&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// Toast.makeText(getApplicationContext(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// &quot;geofenceLength&quot; + geofence_list.getLength(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// Toast.LENGTH_LONG).show();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;for (int k = 0; k &amp;lt; geofence_list.getLength(); k++) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList vehicle = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.getElementsByTagName(&quot;registratioNo&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList actual_location = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.getElementsByTagName(&quot;actualLocation&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList original_location = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.getElementsByTagName(&quot;originalLocation&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList date = element.getElementsByTagName(&quot;date&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_vehicle = (Element) vehicle.item(k);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_actualLocation = (Element) actual_location&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.item(k);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_originalLocation = (Element) original_location&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.item(k);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_date = (Element) date.item(k);&lt;br /&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;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Str = new String(getCharacterDataFromElement(el_date));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Str2 = new String(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;getCharacterDataFromElement(el_originalLocation));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String s[] = Str2.split(&quot;,&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String originalLocation = s[0] + &quot;,&quot; + s[1];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String date1 = Str.substring(0, 9);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String time1 = Str.substring(10, 16); // Str.length() - 1);&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;notificationgeofenceData = new NotificationGeoFenceData(getCharacterDataFromElement(el_vehicle),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;getCharacterDataFromElement(el_actualLocation),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;originalLocation, date1, time1);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;geoitem.add(notificationgeofenceData);&lt;br /&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;}&lt;br /&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;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;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private String getCharacterDataFromElement(Element e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Node child = e.getFirstChild();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (child instanceof CharacterData) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;CharacterData cd = (CharacterData) child;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return cd.getData();&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;return &quot;&quot;;&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;private class GeoFenceListAdapter extends ArrayAdapter&amp;lt;NotificationGeoFenceData&amp;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;private ArrayList&amp;lt;NotificationGeoFenceData&amp;gt; GeoFenceDetails;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;private Context mContext;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public GeoFenceListAdapter(Context context, int textViewResourceId,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ArrayList&amp;lt;NotificationGeoFenceData&amp;gt; objects) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;super(context, textViewResourceId, objects);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;GeoFenceDetails = objects;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;mContext = context;&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 int getCount() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return geoitem.size();&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 NotificationGeoFenceData getItem(int position) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return GeoFenceDetails.get(position);&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 long getItemId(int position) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return position;&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 View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;View v = convertView;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (v == null) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;LayoutInflater vl = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;v = vl.inflate(R.layout.notification_listdata1_geofencedata, null);&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;TextView actualtxt = (TextView) v.findViewById(R.id.txtactual_id);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;TextView orinigaltxt = (TextView) v.findViewById(R.id.txtoriginal_id);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;TextView datetxt = (TextView) v.findViewById(R.id.txtdate_id);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;TextView timetxt = (TextView) v.findViewById(R.id.txttime_id);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;TextView vechiletxt= (TextView) v.findViewById(R.id.txtvechile_id);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;NotificationGeoFenceData temp = geoitem.get(position);&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;actualtxt.setText(temp.Actual);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;orinigaltxt.setText(temp.Original);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;datetxt.setText(temp.Date);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;timetxt.setText(temp.Time);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;vechiletxt.setText(temp.vehicle);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return v;&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;}&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/28213279827274341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/total-program-for-custom-adapter-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/28213279827274341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/28213279827274341'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/total-program-for-custom-adapter-and.html' title='Total program for custom adapter and parsing'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-5108353946165037300</id><published>2012-06-05T10:50:00.001+05:30</published><updated>2012-06-05T10:50:36.123+05:30</updated><title type='text'>XML Parsing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void parseAlertsData(String xmlRecord) throws Exception {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;DocumentBuilder db = DocumentBuilderFactory.newInstance()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;.newDocumentBuilder();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;InputSource is = new InputSource();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;is.setCharacterStream(new StringReader(xmlRecord));&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Document doc = db.parse(is);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;NodeList violation_list = doc.getElementsByTagName(&quot;violationlist&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = 0; i &amp;lt; violation_list.getLength(); i++) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Element element = (Element) violation_list.item(i);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;NodeList geofence_info = doc.getElementsByTagName(&quot;geofenceInfo&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (int j = 0; j &amp;lt; geofence_info.getLength(); j++) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;NodeList geofence_list = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;.getElementsByTagName(&quot;geofencelist&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// Toast.makeText(getApplicationContext(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// &quot;geofenceLength&quot; + geofence_list.getLength(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// Toast.LENGTH_LONG).show();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;for (int k = 0; k &amp;lt; geofence_list.getLength(); k++) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList vehicle = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.getElementsByTagName(&quot;registratioNo&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList actual_location = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.getElementsByTagName(&quot;actualLocation&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList original_location = element&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.getElementsByTagName(&quot;originalLocation&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;NodeList date = element.getElementsByTagName(&quot;date&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_vehicle = (Element) vehicle.item(k);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_actualLocation = (Element) actual_location&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.item(k);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_originalLocation = (Element) original_location&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.item(k);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Element el_date = (Element) date.item(k);&lt;br /&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;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Str = new String(getCharacterDataFromElement(el_date));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Str2 = new String(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;getCharacterDataFromElement(el_originalLocation));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String s[] = Str2.split(&quot;,&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String originalLocation = s[0] + &quot;,&quot; + s[1];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String date1 = Str.substring(0, 9);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String time1 = Str.substring(10, 16); // Str.length() - 1);&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;notificationgeofenceData = new NotificationGeoFenceData(getCharacterDataFromElement(el_vehicle),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;getCharacterDataFromElement(el_actualLocation),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;originalLocation, date1, time1);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;geoitem.add(notificationgeofenceData);&lt;br /&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;}&lt;br /&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;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;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private String getCharacterDataFromElement(Element e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Node child = e.getFirstChild();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (child instanceof CharacterData) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;CharacterData cd = (CharacterData) child;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return cd.getData();&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;return &quot;&quot;;&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;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/5108353946165037300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/xml-parsing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/5108353946165037300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/5108353946165037300'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/xml-parsing.html' title='XML Parsing'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-8461065471908395496</id><published>2012-06-04T18:24:00.003+05:30</published><updated>2012-06-04T18:24:41.061+05:30</updated><title type='text'>web services soap request example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;web services soap request example&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.net.UnknownHostException;&lt;br /&gt;
&lt;br /&gt;
import org.ksoap2.SoapEnvelope;&lt;br /&gt;
import org.ksoap2.SoapFault;&lt;br /&gt;
import org.ksoap2.serialization.SoapObject;&lt;br /&gt;
import org.ksoap2.serialization.SoapSerializationEnvelope;&lt;br /&gt;
import org.ksoap2.transport.AndroidHttpTransport;&lt;br /&gt;
import org.xmlpull.v1.XmlPullParserException;&lt;br /&gt;
&lt;br /&gt;
import android.util.Log;&lt;br /&gt;
&lt;br /&gt;
public class SoapService {&lt;br /&gt;
// for local usage use this IP&lt;br /&gt;
//&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; private static final String URL = &quot;http://192.168.55.213:8080/axis2/services/AndroidRemoteService?wsdl&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
// for remote usage&lt;br /&gt;
//&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; private static final String URL = &quot;http://118.102.133.197:8080/axis2/services/AndroidRemoteService?wsdl&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&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;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String URL = &quot;http://182.18.156.227:8080/axis2/services/AndroidRemoteService?wsdl&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&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;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;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String URL = &quot;http://hmrifinance.co.cc/axis2/services/AVTSRemoteService?wsdl&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// private static final String URL&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// =&quot;http://192.168.55.33:8085/axis2/services/AVTSRemoteService?wsdl&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// private static final String URL =&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// &quot;http://192.168.55.217/axis2/services/AVTSRemoteService?wsdl&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String NAMESPACE = &quot;http://remote.avts.zoltit&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String SOAP_ACTION = &quot;urn:androidservice&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String METHOD_NAME = &quot;androidservice&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String result = null;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int caseNumber;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String xmlData;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String loginId;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public String SoapService(int caseNumber, String xmlData, String loginId) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.caseNumber = caseNumber;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.xmlData = xmlData;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.loginId = loginId;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.v(&quot;SOAP SERVICE P1&quot;, &quot;&quot; + this.caseNumber);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.v(&quot;SOAP SERVICE P2&quot;, &quot;&quot; + this.xmlData);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.v(&quot;SOAP SERVICE P3&quot;, &quot;&quot; + this.loginId);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SoapObject soap_object = new SoapObject(NAMESPACE, METHOD_NAME);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;soap_object.addProperty(&quot;caseNumber&quot;, caseNumber);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;soap_object.addProperty(&quot;xmldata&quot;, xmlData);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;soap_object.addProperty(&quot;loginid&quot;, loginId);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SoapSerializationEnvelope soap_envelop = new SoapSerializationEnvelope(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SoapEnvelope.VER11);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;soap_envelop.setOutputSoapObject(soap_object);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;httpTransport.call(SOAP_ACTION, soap_envelop);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (UnknownHostException e1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e1.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ApplicationVariables.error = 100;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} &amp;nbsp;catch (NullPointerException e1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e1.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ApplicationVariables.error = 123;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (IOException e1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ApplicationVariables.error = 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e1.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (XmlPullParserException e1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ApplicationVariables.error = 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e1.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (Exception e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ApplicationVariables.error = 0;&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;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;result = soap_envelop.getResponse().toString();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Result &quot;+result);&lt;br /&gt;
//&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.v(&quot;Result&quot;, &quot;Result........... &quot; + result);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (SoapFault e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (NullPointerException e1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ApplicationVariables.error = 123;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e1.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}catch (Exception e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e.printStackTrace();&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;return result;&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;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/8461065471908395496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/web-services-soap-request-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/8461065471908395496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/8461065471908395496'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/06/web-services-soap-request-example.html' title='web services soap request example'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-508379895473461209</id><published>2012-05-28T18:18:00.001+05:30</published><updated>2012-05-28T18:20:30.250+05:30</updated><title type='text'>Json request and Response</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #e06666;&quot;&gt;&lt;b&gt;&lt;u&gt;Json request without&amp;nbsp;parameters&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
InputStream is = null;&lt;br /&gt;
public String postData(String url)&lt;br /&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;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Create a new HttpClient and Post Header&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;HttpClient httpclient = new DefaultHttpClient();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;HttpPost httppost = new HttpPost(url);&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;try {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// Execute HTTP Post Request&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;HttpResponse response = httpclient.execute(httppost);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;HttpEntity entity = response.getEntity();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;is = entity.getContent();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (ClientProtocolException e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (IOException e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&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;// convert response to string&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;BufferedReader reader = new BufferedReader(new InputStreamReader(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;is, &quot;iso-8859-1&quot;), 8);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;StringBuilder sb = new StringBuilder();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String line = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;while ((line = reader.readLine()) != null) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;sb.append(line + &quot;\n&quot;);&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;is.close();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;result = sb.toString();&lt;br /&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;} catch (Exception e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.e(&quot;log_tag&quot;, &quot;Error converting result &quot; + e.toString());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
// &amp;nbsp;response in &amp;nbsp;string&amp;nbsp;variable in json format&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return result;&lt;br /&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;b&gt;&lt;u&gt;&lt;span style=&quot;color: #e06666;&quot;&gt;Json request with&amp;nbsp;parameters&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public void Uplode(String url1, boolean f, String guid, boolean playnow)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;throws JSONException {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&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;JSONObject json = new JSONObject();&lt;br /&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;json.put(&quot;guid&quot;, guid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;json.put(&quot;description&quot;, &quot;this video file is send by the mobile&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;json.put(&quot;preempt&quot;, playnow);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;json.put(&quot;front&quot;, f);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataOutputStream wr;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String responseHeader;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;HttpURLConnection connection;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;URL url = new URL(&quot;http://flingo.tv/fling/fling&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&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; // Transmit the request document&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;connection = (HttpURLConnection) url.openConnection();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;url conn&quot; + connection);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;connection.setDoOutput(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;connection.setDoInput(true);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;connection.setRequestMethod(&quot;POST&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;connection.setRequestProperty(&quot;Content-Type&quot;, &quot;application/json&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;connection.connect();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;b&gt;// Send request&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;wr = new DataOutputStream(connection.getOutputStream());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;wr.write(json.toString(1).getBytes(&quot;UTF8&quot;));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;wr.flush();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;wr.close();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;b&gt;// Get Response&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;errroo code&quot; + connection + &quot;coonectiom&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;+ connection.getResponseCode());&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;responseHeader = connection.getHeaderField(0);&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;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (responseHeader.contains(&quot;200&quot;)) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;result..........&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;+ responseHeader.toString());&lt;br /&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;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;catch (Exception e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;br /&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;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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #e06666;&quot;&gt;&lt;b&gt;&lt;u&gt;Response in (Json) Parsing&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
private void parse(String jString) throws Exception {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;JSONObject&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jObject = new JSONObject(jString);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String attricount = jObject.getString(&quot;count&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;count=&quot; + attricount);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String attriyourip = jObject.getString(&quot;yourip&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;yourip=&quot; + attriyourip);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String attriinterval = jObject.getString(&quot;interval&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;interval=&quot; + attriinterval);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;JSONArray deviceArray = jObject.getJSONArray(&quot;devices&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = 0; i &amp;lt; deviceArray.length(); i++) {&lt;br /&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;System.out.println(&quot;device_model_id=&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;+ deviceArray.getJSONObject(i).getString(&quot;model_id&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;.toString());&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;device_guid_array_list.add(deviceArray.getJSONObject(i)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;.getString(&quot;guid&quot;).toString());&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;device_guid_no = deviceArray.getJSONObject(i).getString(&quot;guid&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;.toString();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;JSONArray serviceArray = deviceArray.getJSONObject(i).getJSONArray(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&quot;services&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (int j = 0; j &amp;lt; serviceArray.length(); j++) {&lt;br /&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;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;service_version=&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;+ serviceArray.getJSONObject(j).getString(&quot;version&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;.toString());&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;service_private_ip=&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;+ serviceArray.getJSONObject(j).getString(&quot;private_ip&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;.toString());&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;service_name=&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;+ serviceArray.getJSONObject(j).getString(&quot;name&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;.toString());&lt;br /&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;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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/508379895473461209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/05/json-request-and-response.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/508379895473461209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/508379895473461209'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/05/json-request-and-response.html' title='Json request and Response'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-4318368560112318866</id><published>2012-05-28T15:25:00.001+05:30</published><updated>2012-05-28T15:25:00.659+05:30</updated><title type='text'>Your project contains error(s), please fix it before running it</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
That usually comes form errors in the build path&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
if your using eclipse there is a view you can add that list all the errors called &quot;Problems&quot;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
otherwise you can try to clean the project that usually solve a few problems&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
finally if you add or altered resources from outside your IDE you&#39;ll want to reload the resources and clean&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;EDIT&lt;/strong&gt;&amp;nbsp;&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(Comment by anonymous user)&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
This can also be caused by an out of date &quot;Debug Certificate&quot; fixed as follows:&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
Delete your debug certificate under&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 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; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;~/.android/debug.keystore&lt;/code&gt;&amp;nbsp;(on Linux and Mac OS X); the directory is something like&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 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; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;%USERPROFILE%/.android&lt;/code&gt;on Windows.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
This is also another fix for the &quot;setContentView(R.layout.main);&quot; error that says it cannot find R.layout.main when it is actually generated. (R cannot be resolved to a variable).&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
This is also another fix for the error &quot;Your project has errors...&quot; and you cannot find any. Clean and rebuild are still necessary after generating a new debug certificate.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
It&#39;s a pain to have to delete all your development .apk files, because the new certificate doesn&#39;t match so you can&#39;t upgrade them in all your AVDs. You have to get another development MAP-API key as well. There&#39;s another solution.&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
You can create your own debug certificate in debug.keystore with whatever expiration you want. Do this in the .android folder under your HOME directory:&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 14000&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
ADT sets the first and last name on the certificate as &quot;Android Debug&quot;, the organizational unit as &quot;Android&quot; and the two-letter country code as &quot;US&quot;. You can leave the organization, city, and state values as &quot;Unknown&quot;. This example uses a validity of 14000 days. You can use whatever value you like.&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/4318368560112318866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2012/05/your-project-contains-errors-please-fix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/4318368560112318866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/4318368560112318866'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2012/05/your-project-contains-errors-please-fix.html' title='Your project contains error(s), please fix it before running it'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-19597756578621474</id><published>2011-09-29T12:21:00.001+05:30</published><updated>2011-09-29T12:21:49.130+05:30</updated><title type='text'>importent links for android</title><content type='html'>http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/&lt;br /&gt;
&lt;br /&gt;
http://www.careerride.com/android-interview-questions.aspx&lt;br /&gt;
&lt;br /&gt;
http://www.helloandroid.com/content/useful-java-apis-android-applications&lt;br /&gt;
&lt;br /&gt;
http://www.slideshare.net/peterbuck/an-introduction-to-android-4004533?src=related_normal&amp;rel=858298&lt;br /&gt;
&lt;br /&gt;
http://rayfd.wordpress.com/2007/05/20/10-eclipse-navigation-shortcuts-every-java-programmer-should-know/&lt;br /&gt;
&lt;br /&gt;
http://kevindion.com/2011/01/custom-xml-attributes-for-android-widgets/&lt;br /&gt;
&lt;br /&gt;
http://stackoverflow.com/questions/2376250/custom-fonts-and-xml-layouts-android&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://stackoverflow.com/questions/4732634/how-to-set-the-header-and-footer-for-linear-layout-in-android&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://coderzheaven.com/2011/04/expandable-listview-in-android-using-simpleexpandablelistadapter-a-simple-example/&lt;br /&gt;
&lt;br /&gt;
http://arstechnica.com/civis/viewtopic.php?f=20&amp;t=1108192&amp;view=unread&lt;br /&gt;
&lt;br /&gt;
http://www.portalandroid.org/comunidade/search.php?search_id=active_topics&lt;br /&gt;
&lt;br /&gt;
http://thinkandroid.wordpress.com/&lt;br /&gt;
&lt;br /&gt;
http://mylifewithandroid.blogspot.com/search?q=map&amp;updated-max=2008-02-20T22%3A11%3A00%2B01%3A00&amp;max-results=20&lt;br /&gt;
&lt;br /&gt;
http://illuminatus.oczombies.net/?p=78&lt;br /&gt;
&lt;br /&gt;
http://marakana.com/forums/android/examples/</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/19597756578621474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/importent-links-for-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/19597756578621474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/19597756578621474'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/importent-links-for-android.html' title='importent links for android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-2184265422205869436</id><published>2011-09-21T13:15:00.000+05:30</published><updated>2012-05-28T15:28:32.944+05:30</updated><title type='text'>Query and parse Google+ JSON using Google+ API.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
There is a post in The official Google Code blog, discuss about &lt;a href=&quot;http://googlecode.blogspot.com/2011/09/getting-started-on-google-api.html&quot;&gt;Getting started on the Google+ API&lt;/a&gt;. It&#39;s a exercise to query and parse Google+ JSON using Google+ API.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkiY9pwxXqKdCwCTnGQIndACI1kowXhjzSDU-e-hrTzmZlJn0P9Zby6t4DbDX8KHUXFlipO7YpPpDG8BlMkTlJptUm_GYuu5IeAHR9GF78-Km5zQT5aEieFa5HOCjectYJ6G8R7XTgXUIb/s1600/GooglePlus_JSON.png&quot;&gt;&lt;img alt=&quot;Query and Parse Google+ JSON&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5653034443253257538&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkiY9pwxXqKdCwCTnGQIndACI1kowXhjzSDU-e-hrTzmZlJn0P9Zby6t4DbDX8KHUXFlipO7YpPpDG8BlMkTlJptUm_GYuu5IeAHR9GF78-Km5zQT5aEieFa5HOCjectYJ6G8R7XTgXUIb/s400/GooglePlus_JSON.png&quot; style=&quot;cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 240px;&quot; title=&quot;Query and Parse Google+ JSON&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use Google+ API, you have to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.exercise.AndroidGooglePlus;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;
import android.widget.Toast;

public class AndroidGooglePlusActivity extends Activity {
 
   TextView item_kind;
   TextView item_id;
   TextView item_displayName;
   TextView item_tagline;
   TextView item_gender;
   TextView item_aboutMe;
   TextView item_url;
  
   final static String GooglePlus_url
   = &quot;https://www.googleapis.com/plus/v1/people/108189587050871927619?key=&amp;lt;your own Google+ API key&amp;gt;&quot;;
 
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
       item_kind = (TextView)findViewById(R.id.item_kind);
       item_id = (TextView)findViewById(R.id.item_id);
       item_displayName = (TextView)findViewById(R.id.item_displayName);
       item_tagline = (TextView)findViewById(R.id.item_tagline);
       item_gender = (TextView)findViewById(R.id.item_gender);
       item_aboutMe = (TextView)findViewById(R.id.item_aboutMe);
       item_url = (TextView)findViewById(R.id.item_url);
      
       String googlePlusResult = QueryGooglePlus();
       ParseGooglePlusJSON(googlePlusResult);
      
   }
  
   String QueryGooglePlus(){
    String qResult = null;
    
    HttpClient httpClient = new DefaultHttpClient();
       HttpGet httpGet = new HttpGet(GooglePlus_url);
      
       try {
        HttpEntity httpEntity = httpClient.execute(httpGet).getEntity();
        
        if (httpEntity != null){
         InputStream inputStream = httpEntity.getContent();
         Reader in = new InputStreamReader(inputStream);
         BufferedReader bufferedreader = new BufferedReader(in);
         StringBuilder stringBuilder = new StringBuilder();
         
         String stringReadLine = null;
 
         while ((stringReadLine = bufferedreader.readLine()) != null) {
          stringBuilder.append(stringReadLine + &quot;\n&quot;); 
         }
         
         qResult = stringBuilder.toString(); 
        } 
       } catch (ClientProtocolException e) {
        e.printStackTrace(); 
        Toast.makeText(AndroidGooglePlusActivity.this,
          e.toString(),
          Toast.LENGTH_LONG).show();
       } catch (IOException e) {
        e.printStackTrace();
        Toast.makeText(AndroidGooglePlusActivity.this,
          e.toString(),
          Toast.LENGTH_LONG).show();
       }
    
    return qResult;
   }
  
   void ParseGooglePlusJSON(String json){
    if(json != null){
     try {
      JSONObject JsonObject = new JSONObject(json);
      item_kind.setText(&quot;kind: &quot; + JsonObject.getString(&quot;kind&quot;));
      item_id.setText(&quot;id: &quot; + JsonObject.getString(&quot;id&quot;));
            item_displayName.setText(&quot;displayName: &quot; + JsonObject.getString(&quot;displayName&quot;));
            item_tagline.setText(&quot;tagline: &quot; + JsonObject.getString(&quot;tagline&quot;));
            item_gender.setText(&quot;gender: &quot; + JsonObject.getString(&quot;gender&quot;));
            item_aboutMe.setText(&quot;aboutMe: &quot; + Html.fromHtml(JsonObject.getString(&quot;aboutMe&quot;)));
            item_url.setText(&quot;url: &quot; + JsonObject.getString(&quot;url&quot;));
      
      Toast.makeText(AndroidGooglePlusActivity.this,
              &quot;finished&quot;,
              Toast.LENGTH_LONG).show();
      
     } catch (JSONException e) {
      e.printStackTrace();
      Toast.makeText(AndroidGooglePlusActivity.this,
              e.toString(),
              Toast.LENGTH_LONG).show();
     }
    }
    
   }
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
   android:orientation=&quot;vertical&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;fill_parent&quot;
   &amp;gt;
&amp;lt;TextView 
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   android:text=&quot;@string/hello&quot;
   /&amp;gt;
&amp;lt;TextView 
   android:id=&quot;@+id/item_kind&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   /&amp;gt;
&amp;lt;TextView 
   android:id=&quot;@+id/item_id&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   /&amp;gt;
&amp;lt;TextView 
   android:id=&quot;@+id/item_displayName&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   /&amp;gt;
&amp;lt;TextView 
   android:id=&quot;@+id/item_tagline&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   /&amp;gt;
&amp;lt;TextView 
   android:id=&quot;@+id/item_gender&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   /&amp;gt;
&amp;lt;TextView 
   android:id=&quot;@+id/item_aboutMe&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   /&amp;gt;
&amp;lt;TextView 
   android:id=&quot;@+id/item_url&quot;
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
note: have to modify AndroidManifest.xml to grant permission of &quot;android.permission.INTERNET&quot;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/2184265422205869436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/query-and-parse-google-json-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2184265422205869436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2184265422205869436'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/query-and-parse-google-json-using.html' title='Query and parse Google+ JSON using Google+ API.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkiY9pwxXqKdCwCTnGQIndACI1kowXhjzSDU-e-hrTzmZlJn0P9Zby6t4DbDX8KHUXFlipO7YpPpDG8BlMkTlJptUm_GYuu5IeAHR9GF78-Km5zQT5aEieFa5HOCjectYJ6G8R7XTgXUIb/s72-c/GooglePlus_JSON.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-2995988742223378984</id><published>2011-09-21T13:12:00.001+05:30</published><updated>2011-09-21T13:16:50.506+05:30</updated><title type='text'>Apply your own Google+ API key</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt;&lt;/h3&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt;Apply your own Google+ API key &amp;nbsp; &lt;/h3&gt;&lt;div class=&quot;post-header&quot;&gt;&lt;/div&gt;The official Google Code blog have a new post about &lt;a href=&quot;http://googlecode.blogspot.com/2011/09/getting-started-on-google-api.html&quot;&gt;Getting started on the Google+ API&lt;/a&gt;. Google+ gives users full control over their information, supporting everything from intimate conversations with family to public showcases and debates. This initial API release is focused on public data only — it lets you read information that people have shared publicly on Google+.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to read information from Google+, you have &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;to apply&lt;/span&gt; your API Key. Visit &lt;a href=&quot;https://code.google.com/apis/console#access&quot;&gt;APIs Console&lt;/a&gt;, you have to login your &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;Google account&lt;/span&gt; to create your API key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Click on the API project on the left and select Create...&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo2T64eahB5ZjudvfU7CqLKzG-zmsEUhK_bKdrbBT-K9FQxiq0aVsGTPsYaHxZ6gu0CEtJPNihd9Jl9LsCZcmYVQf9wptsiXtg1ljuyS15Erpy7Nf11Wg9e8ZZL6e3JbuPuxQKiBqdBLdW/s1600/API_01.png&quot;&gt;&lt;img alt=&quot;Apply your own Google+ API key&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5652876180406829874&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo2T64eahB5ZjudvfU7CqLKzG-zmsEUhK_bKdrbBT-K9FQxiq0aVsGTPsYaHxZ6gu0CEtJPNihd9Jl9LsCZcmYVQf9wptsiXtg1ljuyS15Erpy7Nf11Wg9e8ZZL6e3JbuPuxQKiBqdBLdW/s400/API_01.png&quot; style=&quot;cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; title=&quot;Apply your own Google+ API key&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Enter the name of your project and click Create project.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE2leD1Qgp_8tHnoHG9MyZ3U3bwd8uwwn1DT6TjEICDU5fNpX6-fK8fJ6VvYH6HR2bV1i6-2TAm-wcOfidj4arAgi4AYKk5fVZbMruEE4M_liHLZXfdVID8NLtBkZEfFeZKwZOAJUOKQ1s/s1600/API_02.png&quot;&gt;&lt;img alt=&quot;Apply your own Google+ API key&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5652876116327750114&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE2leD1Qgp_8tHnoHG9MyZ3U3bwd8uwwn1DT6TjEICDU5fNpX6-fK8fJ6VvYH6HR2bV1i6-2TAm-wcOfidj4arAgi4AYKk5fVZbMruEE4M_liHLZXfdVID8NLtBkZEfFeZKwZOAJUOKQ1s/s400/API_02.png&quot; style=&quot;cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; title=&quot;Apply your own Google+ API key&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Click to enable Google+ API, you will be asked to review and accept the terms of service.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcLfVC6LfFjuDldY_upP7rDyTZRMaF5SAJ2cjh1nfoa43CxGQ5PzgbaOZ9FOCTV1_cd8wLDODVU6loZ-gCsRTfe-OEjpq_kONUEdBJjy58CbVsInzDgLOhpGb-afA0jc5FmPwauVHAh7kP/s1600/API_03.png&quot;&gt;&lt;img alt=&quot;Apply your own Google+ API key&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5652875812959319570&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcLfVC6LfFjuDldY_upP7rDyTZRMaF5SAJ2cjh1nfoa43CxGQ5PzgbaOZ9FOCTV1_cd8wLDODVU6loZ-gCsRTfe-OEjpq_kONUEdBJjy58CbVsInzDgLOhpGb-afA0jc5FmPwauVHAh7kP/s400/API_03.png&quot; style=&quot;cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; title=&quot;Apply your own Google+ API key&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Click API Access, your API Key will be found.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhMSQtpxLeBGNKqUWZ8CuJhzDS2iHaOh7XSMxxV8TclTz7zt6ZlBwggqPSMNLzvJA0FSYw7uDC4ESTlLf2dvSPYb95sbUSl3sTN9lexmegeH0vDKifE0qJB887VLhPBR33lQFAafmXYiSS/s1600/API_04.png&quot;&gt;&lt;img alt=&quot;Apply your own Google+ API key&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5652875749783786914&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhMSQtpxLeBGNKqUWZ8CuJhzDS2iHaOh7XSMxxV8TclTz7zt6ZlBwggqPSMNLzvJA0FSYw7uDC4ESTlLf2dvSPYb95sbUSl3sTN9lexmegeH0vDKifE0qJB887VLhPBR33lQFAafmXYiSS/s400/API_04.png&quot; style=&quot;cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; title=&quot;Apply your own Google+ API key&quot; /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can copy the link with your own API key at browser to read the JSON returned from Google+.&lt;br /&gt;
&lt;br /&gt;
https://www.googleapis.com/plus/v1/people/108189587050871927619?key=&amp;lt;your API key&amp;gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0-mc4qJ7bR4sd320IJp1t3zhNpAjK5Ng5P0JhYNeRhrOOZl33Ssih3-pSrcMcmJMOpseCYaruSnZV6L-PYtuOYLG26J8_0oVtKhqNp86HKdGnq_A1Qi0vk5dqFYbagnm8PpSVlTUnEMKT/s1600/API_05.png&quot;&gt;&lt;img alt=&quot;Google+ API key&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5652875343481661746&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0-mc4qJ7bR4sd320IJp1t3zhNpAjK5Ng5P0JhYNeRhrOOZl33Ssih3-pSrcMcmJMOpseCYaruSnZV6L-PYtuOYLG26J8_0oVtKhqNp86HKdGnq_A1Qi0vk5dqFYbagnm8PpSVlTUnEMKT/s400/API_05.png&quot; style=&quot;cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; title=&quot;Google+ API key&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/2995988742223378984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/apply-your-own-google-api-key.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2995988742223378984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2995988742223378984'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/apply-your-own-google-api-key.html' title='Apply your own Google+ API key'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo2T64eahB5ZjudvfU7CqLKzG-zmsEUhK_bKdrbBT-K9FQxiq0aVsGTPsYaHxZ6gu0CEtJPNihd9Jl9LsCZcmYVQf9wptsiXtg1ljuyS15Erpy7Nf11Wg9e8ZZL6e3JbuPuxQKiBqdBLdW/s72-c/API_01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-1151971300847936608</id><published>2011-09-21T12:40:00.000+05:30</published><updated>2012-06-04T18:25:47.669+05:30</updated><title type='text'>XML PARSING SAMPLE IN ANDROID</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;XML PARSING SAMPLE IN ANDROID&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In this exercise, we read our own XML Resource (in /res/xml folder) using XmlResourceParser, and display the contents on screen.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6cGVUKL5WQ95ZYn5zc3afhP7mDGt6ohY_HRSi_KtUWPz-HIQt84WHxOj9yveswmW3RJYDeltrSODYqxTqTXzUZzz-6UWOWLD-_JAXtBn717dOLGkVtXGBCPaIdca3Blu1GMxGhM49yaWm/s1600/AndroidXmlResource_01.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5462256153051182210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6cGVUKL5WQ95ZYn5zc3afhP7mDGt6ohY_HRSi_KtUWPz-HIQt84WHxOj9yveswmW3RJYDeltrSODYqxTqTXzUZzz-6UWOWLD-_JAXtBn717dOLGkVtXGBCPaIdca3Blu1GMxGhM49yaWm/s400/AndroidXmlResource_01.png&quot; style=&quot;cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 281px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
First of all, create a folder /res/xml, and our own XML file myxml.xml&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot;&gt;xml version&lt;/span&gt;=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;rootelement1&amp;gt;
&amp;lt;subelement&amp;gt;
 Hello XML Sub-Element 1
&amp;lt;/subelement&amp;gt;
&amp;lt;subelement&amp;gt;
 Hello XML Sub-Element 2
 &amp;lt;subsubelement&amp;gt;Sub Sub Element&amp;lt;/subsubelement&amp;gt;
&amp;lt;/subelement&amp;gt;
&amp;lt;/rootelement1&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Modify main.xml&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:orientation=&quot;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;vertical&lt;/span&gt;&quot;
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;fill_parent&quot;
  &amp;gt;
&amp;lt;TextView
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;wrap_content&quot;
  android:text=&quot;@string/hello&quot;
  /&amp;gt;
&amp;lt;TextView
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;wrap_content&quot;
  android:id=&quot;@+id/my_xml&quot;
  /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, modify java code&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.exercise.AndroidXmlResource;

import java.io.IOException;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import android.app.Activity;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import android.widget.TextView;

public class AndroidXmlResource extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
    
      TextView myXmlContent = (TextView)findViewById(R.id.my_xml);
      String stringXmlContent;
 try {
  stringXmlContent = getEventsFromAnXML(this);
  myXmlContent.setText(stringXmlContent);
 } catch (XmlPullParserException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 } catch (IOException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }
  }

  &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;private&lt;/span&gt; String getEventsFromAnXML(Activity activity)
  throws XmlPullParserException, IOException
  {
   StringBuffer stringBuffer = new StringBuffer();
   Resources res = activity.getResources();
   XmlResourceParser xpp = res.getXml(R.xml.myxml);
   xpp.next();
   int eventType = xpp.getEventType();
   while (eventType != XmlPullParser.END_DOCUMENT)
   {
    if(eventType == XmlPullParser.START_DOCUMENT)
    {
     stringBuffer.append(&quot;--- Start XML ---&quot;);
    }
    else if(eventType == XmlPullParser.START_TAG)
    {
     stringBuffer.append(&quot;\nSTART_TAG: &quot;+xpp.getName());
    }
    else if(eventType == XmlPullParser.END_TAG)
    {
     stringBuffer.append(&quot;\nEND_TAG: &quot;+xpp.getName());
    }
    else if(eventType == XmlPullParser.TEXT)
    {
     stringBuffer.append(&quot;\nTEXT: &quot;+xpp.getText());
    }
    eventType = xpp.next();
   }
   stringBuffer.append(&quot;\n--- End XML ---&quot;);
   return stringBuffer.toString();
  }
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/1151971300847936608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/xml-parsing-sample-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1151971300847936608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1151971300847936608'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/xml-parsing-sample-in-android.html' title='XML PARSING SAMPLE IN ANDROID'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6cGVUKL5WQ95ZYn5zc3afhP7mDGt6ohY_HRSi_KtUWPz-HIQt84WHxOj9yveswmW3RJYDeltrSODYqxTqTXzUZzz-6UWOWLD-_JAXtBn717dOLGkVtXGBCPaIdca3Blu1GMxGhM49yaWm/s72-c/AndroidXmlResource_01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-7308890196583143041</id><published>2011-09-21T12:06:00.002+05:30</published><updated>2011-09-21T12:36:21.737+05:30</updated><title type='text'>A simple RSS reader, using Android&#39;s org.xml.sax package.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt;A simple RSS reader, using Android&#39;s org.xml.sax package. &lt;/h3&gt;&lt;div class=&quot;post-header&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
In order to make it simple, only the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;contents&lt;/span&gt; under &quot;title&quot; tag will be retrieved and appended as a string.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_o4NtDI38MLSKlRUHobAEOlYRT5lN9ikcZHWPQpYgGxyb7m5juMc2g11F6r-0MFms-DARwRfuTf2JfUkvpi0oJLUFtDztRcLjcfRjPzVoRnhbGZhF9_U5oxldki_bbm6AtULRUOYZ8Yt6/s1600/AndroidRssReader_01.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5463018892651318898&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_o4NtDI38MLSKlRUHobAEOlYRT5lN9ikcZHWPQpYgGxyb7m5juMc2g11F6r-0MFms-DARwRfuTf2JfUkvpi0oJLUFtDztRcLjcfRjPzVoRnhbGZhF9_U5oxldki_bbm6AtULRUOYZ8Yt6/s400/AndroidRssReader_01.png&quot; style=&quot;cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 280px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To allow the Android application, &quot;android.permission.INTERNET&quot; have to be granted to &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;the application&lt;/span&gt;. Modify AndroidManifest.xml&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;xml version&lt;/span&gt;=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    package=&quot;com.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;exercise&lt;/span&gt;.AndroidRssReader&quot;
    android:versionCode=&quot;1&quot;
    android:versionName=&quot;1.0&quot;&amp;gt;
  &amp;lt;application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;&amp;gt;
      &amp;lt;activity android:name=&quot;.AndroidRssReader&quot;
                android:label=&quot;@string/app_name&quot;&amp;gt;
          &amp;lt;intent-filter&amp;gt;
              &amp;lt;action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;
              &amp;lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;
          &amp;lt;/intent-filter&amp;gt;
      &amp;lt;/activity&amp;gt;

  &amp;lt;/application&amp;gt;
  &amp;lt;uses-sdk android:minSdkVersion=&quot;4&quot; /&amp;gt;
&amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&amp;gt;
&amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Modify main.xml to add a TextView to display the result.&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:orientation=&quot;vertical&quot;
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;fill_parent&quot;
  &amp;gt;
&amp;lt;TextView
  android:layout_width=&quot;fill_parent&quot;
  android:layout_height=&quot;wrap_content&quot;
  android:text=&quot;@string/hello&quot; /&amp;gt;
&amp;lt;ScrollView
android:layout_width=&quot;fill_parent&quot;
android:layout_height=&quot;wrap_content&quot;&amp;gt;
&amp;lt;TextView
   android:layout_width=&quot;fill_parent&quot;
   android:layout_height=&quot;wrap_content&quot;
   android:id=&quot;@+id/result&quot; /&amp;gt;
&amp;lt;/ScrollView&amp;gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Java &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot;&gt;source code&lt;/span&gt;.&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.exercise.AndroidRssReader;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;

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

public class AndroidRssReader extends Activity {

String streamTitle = &quot;&quot;;

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
    
      TextView result = (TextView)findViewById(R.id.result);
    
      try {
  URL rssUrl = new URL(&quot;http://example.com/example.xml.........&quot;);
  SAXParserFactory mySAXParserFactory = SAXParserFactory.newInstance();
  SAXParser mySAXParser = mySAXParserFactory.newSAXParser();
  XMLReader myXMLReader = mySAXParser.getXMLReader();
  RSSHandler myRSSHandler = new RSSHandler();
  myXMLReader.setContentHandler(myRSSHandler);
  InputSource myInputSource = new InputSource(rssUrl.openStream());
  myXMLReader.parse(myInputSource);
 
  result.setText(streamTitle);
 
 } catch (MalformedURLException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  result.setText(&quot;Cannot connect RSS!&quot;);
 } catch (ParserConfigurationException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  result.setText(&quot;Cannot connect RSS!&quot;);
 } catch (SAXException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  result.setText(&quot;Cannot connect RSS!&quot;);
 } catch (IOException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  result.setText(&quot;Cannot connect RSS!&quot;);
 }
    
    
  }

  &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;private&lt;/span&gt; class RSSHandler extends DefaultHandler
  {
   final int stateUnknown = 0;
   final int stateTitle = 1;
   int state = stateUnknown;
  
   int numberOfTitle = 0;
   String strTitle = &quot;&quot;;
   String strElement = &quot;&quot;;
  
 @Override
 public void startDocument() throws SAXException {
  // TODO Auto-generated method stub
  strTitle = &quot;--- Start Document ---\n&quot;;
 }

 @Override
 public void endDocument() throws SAXException {
  // TODO Auto-generated method stub
  strTitle += &quot;--- End Document ---&quot;;
  streamTitle = &quot;Number Of Title: &quot; + String.valueOf(numberOfTitle) + &quot;\n&quot;
     + strTitle;
 }

 @Override
 public void startElement(String uri, String localName, String qName,
   Attributes attributes) throws SAXException {
  // TODO Auto-generated method stub
  if (localName.equalsIgnoreCase(&quot;title&quot;))
  {
   state = stateTitle;
   strElement = &quot;Title: &quot;;
   numberOfTitle++;
  }
  else
  {
   state = stateUnknown;
  }
 }

 @Override
 public void endElement(String uri, String localName, String qName)
   throws SAXException {
  // TODO Auto-generated method stub
  if (localName.equalsIgnoreCase(&quot;title&quot;))
  {
   strTitle += strElement + &quot;\n&quot;;
  }
  state = stateUnknown;
 }

 @Override
 public void characters(char[] ch, int start, int length)
   throws SAXException {
  // TODO Auto-generated method stub
  String strCharacters = new String(ch, start, length);
  if (state == stateTitle)
  {
   strElement += strCharacters;
  }
 }
  
  }
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/7308890196583143041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/simple-rss-reader-using-androids.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7308890196583143041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7308890196583143041'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/simple-rss-reader-using-androids.html' title='A simple RSS reader, using Android&#39;s org.xml.sax package.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_o4NtDI38MLSKlRUHobAEOlYRT5lN9ikcZHWPQpYgGxyb7m5juMc2g11F6r-0MFms-DARwRfuTf2JfUkvpi0oJLUFtDztRcLjcfRjPzVoRnhbGZhF9_U5oxldki_bbm6AtULRUOYZ8Yt6/s72-c/AndroidRssReader_01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-6991568338272943123</id><published>2011-09-20T14:07:00.000+05:30</published><updated>2011-09-20T14:07:04.595+05:30</updated><title type='text'>Lifecycle of an Android Application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt; Lifecycle of an Android Application &lt;/h3&gt;&lt;div class=&quot;post-header&quot;&gt;  &lt;/div&gt;&lt;br /&gt;
In most cases, every &lt;b&gt;Android application runs in its own Linux process.&lt;/b&gt; This process is created for the application when some of its code needs to be run, and will remain running until it is no longer needed and the system needs to reclaim its memory for use by other applications.&lt;br /&gt;
&lt;br /&gt;
An important and unusual feature of Android is that an application process&#39;s lifetime is not directly controlled by the application itself. Instead, it is determined by the system through a combination of the parts of the application that the system knows are running, how important these things are to the user, and how much overall memory is available in the system.&lt;br /&gt;
&lt;br /&gt;
It is important that application developers understand how different application components (in particular Activity, Service, and IntentReceiver) impact the lifetime of the application&#39;s process. Not using these components correctly can result in the system killing the application&#39;s process while it is doing important work.&lt;br /&gt;
&lt;br /&gt;
A common example of a process lifecycle bug is an IntentReceiver that starts a thread when it receives an Intent in its onReceiveIntent() method, and then returns from the function. Once it returns, the system considers that IntentReceiver to be no longer active, and thus its hosting process no longer needed (unless other application components are active in it). Thus, it may kill the process at any time to reclaim memory, terminating the spawned thread that is running in it. The solution to this problem is to start a Service from the IntentReceiver, so the system knows that there is still active work being done in the process.&lt;br /&gt;
&lt;br /&gt;
To determine which processes should be killed when low on memory, Android places them into an &quot;importance hierarchy&quot; based on the components running in them and the state of those components. These are, in order of importance:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 1. A &lt;b&gt;foreground process&lt;/b&gt; is one holding an Activity at the top of the screen that the user is interacting with (its onResume() method has been called) or an IntentReceiver that is currently running (its onReceiveIntent() method is executing). There will only ever be a few such processes in the system, and these will only be killed as a last resort if memory is so low that not even these processes can continue to run. Generally at this point the device has reached a memory paging state, so this action is required in order to keep the user interface responsive.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 2. A &lt;b&gt;visible process&lt;/b&gt; is one holding an Activity that is visible to the user on-screen but not in the foreground (its onPause() method has been called). This may occur, for example, if the foreground activity has been displayed with a dialog appearance that allows the previous activity to be seen behind it. Such a process is considered extremely important and will not be killed unless doing so is required to keep all foreground processes running.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 3. A &lt;b&gt;service process&lt;/b&gt; is one holding a Service that has been started with the startService() method. Though these processes are not directly visible to the user, they are generally doing things that the user cares about (such as background mp3 playback or background network data upload or download), so the system will always keep such processes running unless there is not enough memory to retain all foreground and visible process.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 4. A&lt;b&gt; background process&lt;/b&gt; is one holding an Activity that is not currently visible to the user (its onStop() method has been called). These processes have no direct impact on the user experience. Provided they implement their activity lifecycle correctly (see Activity for more details), the system can kill such processes at any time to reclaim memory for one of the three previous processes types. Usually there are many of these processes running, so they are kept in an LRU list to ensure the process that was most recently seen by the user is the last to be killed when running low on memory.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 5.An &lt;b&gt;empty process&lt;/b&gt; is one that doesn&#39;t hold any active application components. The only reason to keep such a process around is as a cache to improve startup time the next time a component of its application needs to run. As such, the system will often kill these processes in order to balance overall system resources between these empty cached processes and the underlying kernel caches. &lt;br /&gt;
&lt;br /&gt;
When deciding how to classify a process, the system picks the most important level of all the components currently active in the process. See the Activity, Service, and IntentReceiver documentation for more detail on how each of these components contribute to the overall lifecycle of a process. The documentation for each of these classes describes in more detail how they impact the overall lifecycle of their application.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/6991568338272943123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/lifecycle-of-android-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6991568338272943123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/6991568338272943123'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/lifecycle-of-android-application.html' title='Lifecycle of an Android Application'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-2804045116714310738</id><published>2011-09-20T12:29:00.002+05:30</published><updated>2011-09-20T12:29:57.407+05:30</updated><title type='text'>Sample Android Activity,Service ( 1 )</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;An activity is the equivalent of a Frame/Window in GUI toolkits. It takes up the entire drawable area of the screen. An activity is what gets bound to the AndroidManifest.xml as the main entry point into an application. For long running tasks, it’s best to use a service that talks to this activity.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Service :&lt;/b&gt; Activities are meant to display the UI and get input from the user. Services on the other hand keep running for the duration of the user’s ‘session’ on the device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Activity Navigation:&lt;/b&gt;&lt;br /&gt;
This has done by the following two ways. &lt;br /&gt;
1. Fire and forget – create an event (Intent) and fire it&lt;br /&gt;
2. Async callback – create an event (Intent), fire it, and wait for it’s response in a callback method (of the calling-Activity).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Activity history stack&lt;/b&gt;&lt;br /&gt;
Please note that Android maintains a history stack of all the Activities that have been spawned in an application’s Linux process. In the sample code above, the calling-Activity simply provides the class name of the sub-Activity. When the sub-Activity finishes, it puts it’s result code and any data back on the stack and finishes itself. Since Android maintains the stack, it knows which calling Activity to pass the result back to. The calling-Activity has an onActivityResult method that handles all the callbacks from the sub-Activities. This is pretty confusing at first, since to keep it all straight we have to use CorrelationIds (more on that below).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example :&lt;/b&gt; User wants to navigate Talk application to Browser Application. Using the Browser application wants to serach some photos and saved his local memory. After that he shares the photo with his friend via email application and finally he will come back to the talk application. &lt;br /&gt;
&lt;br /&gt;
Firstly, as the user is talking to his friend, a specific Talk application is opened, which contains the activity manager. System Creates two processes, the main system process and Talk application process. Moreover, before going to Web Browser application, the system saves a Talk state T in order to remember that process. At this point, as a user holds a talk and opens a web browser, the system creates a new process and new web browser activity is launched in it. Again, the state of the last activity is saved.After that, the user browses the internet, finds his picture in Picasa album and saves it to particular folder. He does not close a web browser, instead he opens a folder to find saved picture. The folder activity is launched in particular process.&amp;nbsp; At this point, the user finds his saved picture in the folder and he creates a request to open an Email application. The last state F is saved. Now assume that the mobile phone is out of the memory and there is no room to create a new process for Email application. Therefore, Android looks to kill a process. It can not destroy Folder process, as it was used previously and could be reused again, so it kills Web Browser process as it is not useful anymore and locates a new Email process instead. The user opens Email application and sends a picture to his friend via email. Now he wants to go back to the Talk application and to resume a talk to his friend. Because of the previously saved states, this work is done fast and easily. In this example, Email application is popped out and the user sees a previous Folder application.Next, the user goes back to Web Browser application. Unfortunately, web browser&lt;br /&gt;
process was killed previously so the system has to kill another process (in our case it is Email application process, which is not used anymore) in order to locate Web Browser process and manage the stack memory. Now the user comes back to the Talk application and resumes his talk with his friend. Because of the saved states, going back procedure is fast and useful, because it remembers previous activities and its views.&lt;br /&gt;
This example shows, that it does not matter how many applications and processes are active or how much available memory is left, Android it manages fast and without a user interaction.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Fire and forget&lt;/b&gt;&lt;br /&gt;
For this method we just calls the child activity and flow the process. we are not getting any return value from the child activity. Here intent is just an event. It can have a target of an activity calss along with some date that&#39;s passed in via a Bundle. &lt;br /&gt;
refer : http://about-android.blogspot.com/2009/12/passing-data-or-parameter-to-another_02.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Create a two Activity [MainActivity &amp;amp; ChildActivity]&lt;br /&gt;
&lt;br /&gt;
Activity : 1 -&amp;nbsp; MainActivity&lt;br /&gt;
&amp;nbsp;public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Activity : 2 - ChildActivity&lt;br /&gt;
&amp;nbsp;public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Put your code here&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.&amp;nbsp; Define Your Shared collection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Bundle bundle = new Bundle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; bundle.putString(&quot;sample&quot;, &quot;this is the test commands&quot;);&lt;br /&gt;
&lt;br /&gt;
3. Call the child Activity from mainactivity with the bundle &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; startActivity(new Intent(this, ChildActivity.class).putExtras(bundle));&lt;br /&gt;
&lt;br /&gt;
4. Get the Value from MainActivity in ChildActivity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.getIntent().getExtras().getString(&quot;sample&quot;)&lt;br /&gt;
&lt;br /&gt;
5. Toast the Message&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, this.getIntent().getExtras().getString(&quot;sample&quot;),&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; Toast.LENGTH_LONG).show();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Full Source :MainActivity.java&lt;br /&gt;
&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.content.SharedPreferences;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
&lt;br /&gt;
public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bundle bundle = new Bundle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bundle.putString(&quot;sample&quot;, &quot;this is the test commands&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bundle.putString(&quot;sample1&quot;, &quot;this is the test commands1&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; startActivity(new Intent(this, ChildActivity.class).putExtras(bundle));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-------ChildActivity.java----------&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.content.SharedPreferences;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, this.getIntent().getExtras().getString(&quot;sample&quot;),&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; Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, this.getIntent().getExtras().getString(&quot;sample1&quot;),&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; Toast.LENGTH_LONG).show();&lt;br /&gt;
&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;b&gt;Async callback, and correlationId&lt;/b&gt;&lt;br /&gt;
The calling-Activity has to provide a correlationId/request code to the Intent/event, before firing/raising it. This is then used by the sub-Activity to report it’s results back to the calling-Activity when it’s ready. The calling-Activity does not stop when it spawns the sub-Activity. &lt;br /&gt;
&lt;br /&gt;
Please note that this sub-Activity is not &quot;modal&quot;, that is, the calling Activity does not block, when startSubActivity() is called. So if you’re thinking that this is like a modal dialog box, where the calling-Activity will wait for the sub-Activity to produce a result, then you have to think of it differently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Create a two Activity [MainActivity &amp;amp; ChildActivity]&lt;br /&gt;
&lt;br /&gt;
Activity : 1 -&amp;nbsp; MainActivity&lt;br /&gt;
&amp;nbsp;public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Activity : 2 - ChildActivity&lt;br /&gt;
&amp;nbsp;public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Put your code here&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Call the child Activity from mainactivity with the bundle &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Intent i = new Intent(this, ChildActivity.class);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; startActivityForResult(i, 1);&lt;br /&gt;
&lt;br /&gt;
4. Set the Value from ChildActivity To&amp;nbsp; MainActivity &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; setResult(RESULT_OK, new Intent().putExtra(&quot;result&quot;, &quot;value from Child Activity&quot;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; finish();&lt;br /&gt;
&lt;br /&gt;
5. Receive the value from ChildActiivity and Print the Message in onActivityResult Method&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (resultCode == RESULT_OK) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String name = data.getStringExtra(&quot;result&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, &quot;You have chosen the City: &quot; + &quot; &quot; + name,&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; Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
Source Code&lt;/b&gt;&lt;br /&gt;
&lt;u&gt;MainActivity.java&lt;/u&gt;&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Intent i = new Intent(this, ChildActivity.class);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; startActivityForResult(i, 1);&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; protected void start(Intent intent) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.startActivityForResult(intent, 1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onActivityResult(int requestCode, int resultCode, Intent data) {&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; &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; if (resultCode == RESULT_OK) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String name = data.getStringExtra(&quot;result&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, &quot;You have chosen the Value: &quot; + &quot; &quot; + name,&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; Toast.LENGTH_LONG).show();&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; super.onActivityResult(requestCode, resultCode, data);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;ChildActivity.java&lt;/u&gt;&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, &quot;Child Activity&quot;, Toast.LENGTH_LONG).show();&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; setResult(RESULT_OK, new Intent().putExtra(&quot;result&quot;, &quot;value from Child Activity&quot;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; finish();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/2804045116714310738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/sample-android-activityservice-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2804045116714310738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/2804045116714310738'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/sample-android-activityservice-1.html' title='Sample Android Activity,Service ( 1 )'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-7424225629764889097</id><published>2011-09-20T12:22:00.003+05:30</published><updated>2011-09-20T12:22:48.730+05:30</updated><title type='text'>Passing data or parameter to another Activity Android -2 ( Bundle Collection )</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Passing data or parameter to another Activity Android - using Bundle&lt;/b&gt;&lt;br /&gt;
This following step helps to share the content using bundle.&lt;br /&gt;
&amp;nbsp;1. Create a two Activity [MainActivity &amp;amp; ChildActivity]&lt;br /&gt;
&lt;br /&gt;
Activity : 1 -&amp;nbsp; MainActivity&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Activity : 2 - ChildActivity&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Put your code here&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.&amp;nbsp; Define Your Shared collection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt; Bundle bundle = new Bundle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; bundle.putString(&quot;sample&quot;, &quot;this is the test commands&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; bundle.putString(&quot;sample1&quot;, &quot;this is the test commands1&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Call the child Activity from mainactivity with the bundle &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt;&amp;nbsp; startActivity(new Intent(this, ChildActivity.class).putExtras(bundle));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4. Get the Value from MainActivity in ChildActivity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt; this.getIntent().getExtras().getString(&quot;sample&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
5. Toast the Message&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #660000;&quot;&gt; Toast.makeText(this, this.getIntent().getExtras().getString(&quot;sample&quot;),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, this.getIntent().getExtras().getString(&quot;sample1&quot;),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&amp;nbsp;Full Source :MainActivity.java&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.content.SharedPreferences;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
&lt;br /&gt;
public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Bundle bundle = new Bundle();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; bundle.putString(&quot;sample&quot;, &quot;this is the test commands&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; bundle.putString(&quot;sample1&quot;, &quot;this is the test commands1&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; startActivity(new Intent(this, ChildActivity.class).putExtras(bundle));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-------ChildActivity.java----------&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.content.SharedPreferences;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, this.getIntent().getExtras().getString(&quot;sample&quot;),&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; Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, this.getIntent().getExtras().getString(&quot;sample1&quot;),&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; Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/7424225629764889097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/passing-data-or-parameter-to-another_20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7424225629764889097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7424225629764889097'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/passing-data-or-parameter-to-another_20.html' title='Passing data or parameter to another Activity Android -2 ( Bundle Collection )'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-7228031506241748492</id><published>2011-09-20T12:22:00.000+05:30</published><updated>2012-06-12T15:54:34.702+05:30</updated><title type='text'>Passing data from activity to activity using (Shared Preference ) in android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;In this blog we have discussed shared preference and bundle collection. We can pass the value from parent activity to child activity using the bundled collection and shared preference. &lt;br /&gt;
1. Shared Preference &lt;br /&gt;
2. Bundle Collection&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Shared Preference &lt;/b&gt;&lt;br /&gt;
Preferences are typically name value pairs. They can be stored as “Shared Preferences” across various activities in an application (note currently it cannot be shared across processes). First we need to put our value in to the context. And the context object lets you retrieve SharedPreferences through the method Context.getSharedPreferences(). &lt;br /&gt;
&lt;br /&gt;
1. Make a Shared Preference Collection&lt;br /&gt;
2. Retrieve Shared Preference Collection&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;i&gt;Make a Shared Preference Collection&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences myPrefs = this.getSharedPreferences(&quot;contact&quot;, MODE_WORLD_READABLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences.Editor prefsEditor = myPrefs.edit();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; prefsEditor.putString(&quot;sample&quot;, &quot;this is test commands&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; prefsEditor.commit();&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;u&gt;Retrieve Shared Preference Collection&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences myPrefs = this.getSharedPreferences(&quot;contact&quot;, MODE_WORLD_READABLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; prefsEditor.getString(&quot;sample&quot;, &quot;DEFAULT VALUE&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;1. Create a two Activity [MainActivity &amp;amp; ChildActivity]&lt;br /&gt;
&lt;br /&gt;
Activity : 1 -&amp;nbsp; MainActivity&lt;/span&gt;&lt;span style=&quot;color: #660000; font-family: verdana;&quot;&gt;&amp;nbsp;public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/span&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Activity : 2 - ChildActivity&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #660000; font-family: verdana;&quot;&gt;public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO Put your code here&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.&amp;nbsp; Define Your Shared collection&lt;/span&gt;&lt;span style=&quot;color: #660000; font-family: verdana;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences myPrefs = this.getSharedPreferences(&quot;contact&quot;, MODE_WORLD_READABLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences.Editor prefsEditor = myPrefs.edit();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; prefsEditor.putString(&quot;sample&quot;, &quot;this is test commands&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; prefsEditor.commit();&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
3. Call the child Activity from mainactivity&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #660000; font-family: verdana;&quot;&gt; startActivity(new Intent(this,ChildActivity.class));&lt;/span&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
4. Get the Value from MainActivity in ChildActivity&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #660000; font-family: verdana;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences myPrefs = this.getSharedPreferences(&quot;contact&quot;, MODE_WORLD_READABLE);&lt;/span&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
5. Toast the Message&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #660000; font-family: verdana;&quot;&gt;&amp;nbsp; Toast.makeText(this, myPrefs.getString(&quot;sample&quot;, &quot;DEFAULT VALUE&quot;), Toast.LENGTH_LONG).show();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;Full Source :MainActivity.java&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;import android.app.Activity;&lt;br /&gt;
&amp;nbsp;import android.content.Intent;&lt;br /&gt;
&amp;nbsp;import android.content.SharedPreferences;&lt;br /&gt;
&amp;nbsp;import android.os.Bundle;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;public class MainActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences myPrefs = this.getSharedPreferences(&quot;contact&quot;, MODE_WORLD_READABLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences.Editor prefsEditor = myPrefs.edit();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; prefsEditor.putString(&quot;sample&quot;, &quot;this is test commands&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; prefsEditor.commit();&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; startActivity(new Intent(this,ChildActivity.class));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;-------ChildActivity.java----------&lt;/b&gt;&lt;br /&gt;
import android.app.Activity;&lt;br /&gt;
import android.content.SharedPreferences;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
public class ChildActivity extends Activity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @see android.app.Activity#onCreate(Bundle)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SharedPreferences myPrefs = this.getSharedPreferences(&quot;contact&quot;, MODE_WORLD_READABLE);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toast.makeText(this, myPrefs.getString(&quot;sample&quot;, &quot;DEFAULT VALUE&quot;), Toast.LENGTH_LONG).show();&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;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/7228031506241748492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/passing-data-or-parameter-to-another.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7228031506241748492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/7228031506241748492'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/passing-data-or-parameter-to-another.html' title='Passing data from activity to activity using (Shared Preference ) in android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-1600383141557062750</id><published>2011-09-20T12:17:00.000+05:30</published><updated>2011-09-20T12:17:42.719+05:30</updated><title type='text'>Android Hello World Activity Sample</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt; Android Hello World Activity Sample &lt;/h3&gt;&lt;div class=&quot;post-header&quot;&gt;  &lt;/div&gt;Here we are looking how to create a sample hello android program using eclipse IDE&lt;br /&gt;
1.Setup your Environment&lt;br /&gt;
2. Create an application&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Setup Android Environment&lt;/b&gt;&lt;br /&gt;
a. Download latest Eclipse from http://eclipse.org/ &lt;br /&gt;
b. update android Plug-in - Refer : http://about-android.blogspot.com/2009/11/about-android-first-of-all-android_09.html&lt;br /&gt;
&lt;img height=&quot;502&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKz1Q6o6mFDM-S0gHBA9qXS9KYvFVhbDbHiKz7cXtJrx8aSURtOgNE_xaNZBAcYYHh_ZMUExNA5crA7j9MQ855LbvHXTq4Oq0yBprGI_NnQY4UBTbq-hk5MPCrdhOWkiHi-lSF1Dpk_o8/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; width=&quot;711&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
c. Install Android SDK &lt;br /&gt;
Install new android SDK from the android site. Refer:http://about-android.blogspot.com/2009/11/about-android-first-of-all-android_09.html&lt;br /&gt;
&lt;img height=&quot;406&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhclOM91PFvZu20iOv_YZ-i0NqmC9a2iNd0RbXxrNkbCJv-ArItpcDnPmhky3TXUZJX5Lfumk9F8ivw7W8RPonLrf5XdTU5jsvLlmxSa8NHgU1aw-cojP6upSNPnN5ixoYWDGhJy03wNhM/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; width=&quot;679&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
D. Configure SDK with your Eclipse&lt;br /&gt;
Go to Window&amp;gt;Preference&amp;gt;Select Android &amp;gt; Browse &quot;SDK PATH&quot; &amp;gt; Apply &lt;br /&gt;
&lt;img height=&quot;437&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOjQUe8QZuhHP__efm8PfmhXjc8_7Wk8tkX0OKKEFEANBZVdrUSjd0Yu5LVR36hRQjJluRQYBcKmimberFGzGjX8ZM8MjNbdyVw8WokfJa3hXOlw_i82Nq5op4UbsbFZFUGHZkwOTTKPo/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; width=&quot;699&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
E. Create a Device / Emulator &lt;br /&gt;
Create emulator using the AVD manager&lt;br /&gt;
Open AVD Manager &amp;gt; New &amp;gt; Give Name/Target &amp;gt; Create AVD.&lt;br /&gt;
&lt;img height=&quot;421&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTIQSeaiaTZ0TJgK3ezh_FSBvXmixYFcDKB0mLcBeVG7welOw0P0rfYBYmwIs77dxR8DgBRiQ-IIl60m5HADZGhRZ9ok5NKfA2YLo3knIhnLw7cfpFWri5faij59RR6dmtDqwQINnemFE/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; width=&quot;674&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Android Environment has setted. Now we can create an android Application. &lt;br /&gt;
&lt;br /&gt;
2. Create a &quot; Hello World Apps &quot;&lt;br /&gt;
a. Open Eclipse &amp;gt; File &amp;gt; Android Project.&lt;br /&gt;
&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhh74Gc8fpZG3oJGMwtYzXDQHIoWVQIe-6q4mz0Z0U-zk3VoYFstDyQfSJyX_oTIJ1TyW08jnTWRUI0wEBMgE1_YpEs_v2eJDo1dTFx2r99oErbyy75sy-3Vk91mdMX7ffKCQa8WA7e5CM/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
b. Check the Android Folder Structure.&lt;br /&gt;
Go to Window &amp;gt; Show View &amp;gt; package Explorer&lt;br /&gt;
&lt;img height=&quot;331&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhey4_itYDWb-Qp2WIXRpTVCorYC8I0fKg1SLj0HXCXPpEno6w6MdTl2hjmzQW0hXVTuYJ0jH6pQl-ofWN47PXaPYYzI17UhQLiDCM1Qw4G0f92p5U9nQ5mOVlO0c1QCRZHpnM_UYzzOkk/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; width=&quot;584&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
AndroidManifest.xml - It contains the overall application configuration.&lt;br /&gt;
src - Contains the java code like activites,service,broadcast receiver , etc,.&lt;br /&gt;
res - Contains the application resource&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. drawable - Icon,Image&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. raw - Sounds&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3. menu - menu properties&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4. values - application properites like title,color value, dropdown values. &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5. layout - screen design &lt;br /&gt;
gen - Contains the R.java File which is used to map the resource and java src. &lt;br /&gt;
&lt;br /&gt;
c. Run the application &lt;br /&gt;
Run &amp;gt; Run Android Application&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;img height=&quot;341&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV-oNyjQvAFlZPRbwCmGBlY3x10L1CZ7DwQyv-g-rz7uyCCFsz5zY7yLlAfrSXHnb7YgMewfA9TCR9qtHpF6EjdUaArfWzDAJ-spRXrgrEbDhfadxqw4NR6SUY0boPjx4eMytg6y7vN3A/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; width=&quot;546&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;D. Check the Emulator &lt;br /&gt;
&lt;img height=&quot;394&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy4lxaaRiZLVnf_EW_cmB5_4P2qDjFucFBXJH3sU9KI3Yo0YbLUuSVMrMinCkXtq6KJVjP6d_I7RuTzP92SgLdnGT9js-_JsqNVgYzwky2bY-4rOxsQ9qFDAg6-qnc4FT7pxgmZw6EaB0/?imgmax=800&quot; style=&quot;max-width: 800px;&quot; width=&quot;486&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Hope this is useful for create a hello world program. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/1600383141557062750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/android-hello-world-activity-sample.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1600383141557062750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1600383141557062750'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/android-hello-world-activity-sample.html' title='Android Hello World Activity Sample'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKz1Q6o6mFDM-S0gHBA9qXS9KYvFVhbDbHiKz7cXtJrx8aSURtOgNE_xaNZBAcYYHh_ZMUExNA5crA7j9MQ855LbvHXTq4Oq0yBprGI_NnQY4UBTbq-hk5MPCrdhOWkiHi-lSF1Dpk_o8/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3529751757867890502.post-1719244452383276066</id><published>2011-09-20T12:15:00.000+05:30</published><updated>2011-09-20T12:15:47.259+05:30</updated><title type='text'>Application Fundamentals</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt;Application Fundamentals &lt;/h3&gt;&lt;h3 class=&quot;post-title entry-title&quot;&gt; Application Fundamentals &lt;/h3&gt;&lt;div class=&quot;post-header&quot;&gt;  &lt;/div&gt;Android applications are written in the Java programming language.&lt;br /&gt;
Android application archieve format is .apx&lt;br /&gt;
Each process has its own Java virtual machine (VM), so application code runs in isolation from the code of all other application&lt;br /&gt;
Android Application Components are Activites,Service,Broadcast receivers and Content providers&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Activities&lt;/span&gt;&lt;br /&gt;
An application that has a visible UI is implemented with an activity. When a user selects an application from the home screen or application launcher, an activity is started.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Services&lt;/span&gt;&lt;br /&gt;
A service should be used for any application that needs to persist for a long time, such as a network monitor or update-checking application.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Content providers&lt;/span&gt;&lt;br /&gt;
You can think of content providers as a database server. A content provider&#39;s job is to manage access to persisted data, such as a SQLite database. If your application is very simple, you might not necessarily create a content provider. If you&#39;re building a larger application, or one that makes data available to multiple activities or applications, a content provider is the means of accessing your data.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Broadcast receivers&lt;/span&gt;&lt;br /&gt;
An Android application may be launched to process a element of data or respond to an event, such as the receipt of a text message.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;AndroidManifest.xml - Configuration &lt;/span&gt;&lt;br /&gt;
An Android application, along with a file called AndroidManifest.xml, is deployed to a device.&lt;br /&gt;
AndroidManifest.xml contains the necessary configuration information to properly install it to the device. It includes the required class names and types of events the application is able to process, and the required permissions the application needs to run.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Project Folder Structure ;&lt;/b&gt;&lt;br /&gt;
1. src - It contain the java code &lt;br /&gt;
2. Resource - It contain the all resource with different floder&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; drawable - Icon&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; raw - Sounds&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; menu - Menu&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; values - Project Properties &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; layout - User interface Screens&lt;br /&gt;
3. gen - It contains the R.java file. You could not edit R.java manually. This have been generated automatically by understanding resource files etc. &lt;br /&gt;
4. AndroidManifest -It contains the Project properties &lt;br /&gt;
5. Android lib. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidkrishna.blogspot.com/feeds/1719244452383276066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/application-fundamentals.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1719244452383276066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3529751757867890502/posts/default/1719244452383276066'/><link rel='alternate' type='text/html' href='http://androidkrishna.blogspot.com/2011/09/application-fundamentals.html' title='Application Fundamentals'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/11194530274701794494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>