tag:blogger.com,1999:blog-81400447940766684432024-03-19T05:23:54.804-07:00RKK AndroidAnonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.comBlogger80125tag:blogger.com,1999:blog-8140044794076668443.post-50191955163701987492018-06-21T02:14:00.000-07:002018-06-21T02:14:56.602-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 class="post-title entry-title" itemprop="name" style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 30px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: normal; line-height: normal; margin: 0px; position: relative; text-align: center;">
<span style="text-decoration-line: none;">Google I/O '18</span></h3>
<h3 class="post-title entry-title" itemprop="name" style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 30px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: normal; line-height: normal; margin: 0px; position: relative; text-align: center;">
<br /></h3>
<div>
<div>
<span style="color: #222222; font-family: sans-serif;"><span style="background-color: white; font-size: 14px;">Google I/O (simply I/O) is an annual developer conference held by Google in Mountain View, California. I/O showcases technical in-depth sessions focused on building web, mobile, and enterprise applications with Google and open sources such as Android, Chromeand Chrome OS, APIs, Google Web Toolkit, App Engine, and more.</span></span></div>
<div>
<span style="color: #222222; font-family: sans-serif;"><span style="background-color: white; font-size: 14px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: sans-serif;"><span style="background-color: white; font-size: 14px;">Android Things is Google's platform to support the development of Internet of Things devices. This talk will provide an update on the program and the future roadmap. Learn more about the breadth of hardware reference designs, the operating system, building apps, device management, and support from chip vendors. It will also discuss use-cases where edge computing can be used, and examples of prototype-to-production that demonstrate how Android Things is ready for commercial products.</span></span></div>
</div>
<div>
<span style="color: #222222; font-family: sans-serif;"><span style="background-color: white; font-size: 14px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: sans-serif;"><span style="background-color: white; font-size: 14px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dw8BAnOFLMo_dQmZUK6vm3jfRme1QyAgY2HWuSU7uxMRWoxih77k_TVKvLIczHhtRg32LEXyKPgzXvq9-_LJw' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<div>
<span style="color: #222222; font-family: sans-serif;"><span style="background-color: white; font-size: 14px;"><br /></span></span></div>
<div>
<span style="color: #222222; font-family: sans-serif;"><span style="background-color: white; font-size: 14px;"><br /></span></span></div>
<div>
<span style="background-color: white; font-size: 14px;"><span style="color: #222222; font-family: sans-serif;">know more, check the playlist IoT at Google I/O 2018. know more, check the playlist IoT at <a href="https://www.youtube.com/playlist?list=PLOU2XLYxmsIJQgQfgYDuH8V31HZTtWUBp">Google I/O 2018. </a></span></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-72165905681504004632017-05-24T05:53:00.001-07:002017-05-24T05:53:59.885-07:00<div dir="ltr" style="text-align: left;" trbidi="on"><iframe style="width:120px;height:240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-in.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=IN&source=ac&ref=qf_sp_asin_til&ad_type=product_link&tracking_id=amazon01ce-21&marketplace=amazon®ion=IN&placement=B01LXASAI9&asins=B01LXASAI9&linkId=f82f08df78dacf74db45c2d03215c564&show_border=false&link_opens_in_new_window=false&price_color=333333&title_color=0066c0&bg_color=ffffff"><br />
</iframe><br />
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-8318913912052138622017-04-15T05:07:00.000-07:002017-04-15T05:07:28.203-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: 12.0pt; mso-outline-level: 2;">
<b><span style="font-family: Arial, sans-serif; font-size: 22.5pt;"> Android ConstraintLayout<o:p></o:p></span></b></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: 19.5pt;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">To use android
ConstraintLayout, make sure you’re using the latest Android Studio version.
Ideally, Android Studio 2.2 and above. We need to download the necessary SDK
Tools for ConstraintLayout from the SDK Manager.<o:p></o:p></span></div>
<div style="background: white; margin-bottom: 19.5pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;">
<span style="color: #666666; font-family: "Arial","sans-serif";">Create
a new empty activity project and add the following dependency inside the<span class="apple-converted-space"> </span><strong style="box-sizing: border-box;">build.gradle</strong><span class="apple-converted-space"> </span>file.<o:p></o:p></span></div>
<div style="background: white; box-sizing: border-box; margin: 0in 0in 19.5pt;">
<code style="box-sizing: border-box;"><span style="background: aqua; font-size: 10.0pt; mso-highlight: aqua; mso-shading: #EFE8E5;">compile
'com.android.support.constraint:constraint-layout:1.0.0-beta4'</span></code></div>
<div class="MsoNormal">
<span style="background: white; color: #666666; font-family: "Arial","sans-serif";">To convert an old layout into a ConstraintLayout. Open the
design pane of the respective layout, right click the root component and choose
the relevant option<span class="apple-converted-space"> </span>as Convert
RelativeLayout to ConstraintLayout<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<h3 style="background: white; margin-bottom: 12.0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;">
<span style="font-family: Arial, sans-serif; font-size: 18pt; line-height: 107%;"><u>Android Constraint Layout
Overview</u><o:p></o:p></span></h3>
<div style="background: white; box-sizing: border-box; margin: 0in 0in 19.5pt;">
<span style="color: #666666; font-family: "Arial","sans-serif";">Android
ConstraintLayout is used to define a layout by assigning constraints for every
child view/widget relative to other views present.<o:p></o:p></span></div>
<div style="background: white; box-sizing: border-box; margin: 0in 0in 19.5pt;">
<span style="color: #666666; font-family: "Arial","sans-serif";">A
ConstraintLayout is similar to a RelativeLayout, but with more power. The aim
of ConstraintLayout is to improve the performance of the applications by
removing the nested views with a flat and flexible design.<o:p></o:p></span></div>
<div style="background: white; box-sizing: border-box; margin: 0in 0in 19.5pt;">
<span style="color: #666666; font-family: "Arial","sans-serif";">A view inside
the ConstraintLayout has handles(or anchor points) on each side which are used
to assign the constraints. Let’s drag and drop a TextView on the layout and
assign the constraints to it.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: 19.5pt;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">The TextView above has
three types of handles:<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: 19.5pt; margin-left: 30.0pt; margin-right: 0in; margin-top: 0in;">
<b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><u>Resize handle</u></span></b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><u> </u>– It’s present on the four corners and is
used to resize the view, but keeping its constraints intact.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: 19.5pt; margin-left: 30.0pt; margin-right: 0in; margin-top: 0in;">
<b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><u>Side handle</u></span></b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> – It’s the circular handle present on the centre of each
side. It’s used to set the top, left, bottom and right constraints of the view.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: 19.5pt; margin-left: 30.0pt; margin-right: 0in; margin-top: 0in;">
<b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><u>Baseline handle</u></span></b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> – It’s used to align the baseline with
another textview in the layout.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #666666; font-family: Arial, sans-serif;">Notice the Properties inspector pane at the right-hand side:</span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #666666; font-family: Arial, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioBL4nj9_7uqJ4PiEYBJ1mSK4poMpOE7X2Chp53zkSSQ1uKe3kHj-Z2WOfyLFeUZPB6Tyxp8VaD4prBVpBbxT3B7OAvGez_blG6sNO4A-7ixPDXdk8hSPTutqAJ6sD_xMMUOnNhkVvyyg/s1600/android.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioBL4nj9_7uqJ4PiEYBJ1mSK4poMpOE7X2Chp53zkSSQ1uKe3kHj-Z2WOfyLFeUZPB6Tyxp8VaD4prBVpBbxT3B7OAvGez_blG6sNO4A-7ixPDXdk8hSPTutqAJ6sD_xMMUOnNhkVvyyg/s1600/android.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span style="color: #666666; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Wrap
Content</span></b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> – This wraps the
view to fill it’s content.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> </span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqiTyQQ6eiaotN3BijOmkoL-NGfQnhPJXvhchKkpEZVLIMmFo0U8paNmCZ6km9GWlz7YS6_WhHwDyYAdHjTkNKw3vMi2jvBaV_mndHUINkCBMG5q6Rh5dv7UmJGvdjHdhfkirbd1EjGts/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqiTyQQ6eiaotN3BijOmkoL-NGfQnhPJXvhchKkpEZVLIMmFo0U8paNmCZ6km9GWlz7YS6_WhHwDyYAdHjTkNKw3vMi2jvBaV_mndHUINkCBMG5q6Rh5dv7UmJGvdjHdhfkirbd1EjGts/s1600/1.png" /></a></div>
<br />
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span style="color: #666666; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Any
Size</span></b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> – This is
similar to match parent<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> </span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBlou5DZbdAy2gUofJVhkmj9AUYiHa0TGwOg7goxMXnfXXhYQ3-LwGJjldMdv6NaP4POuS7QO-4SHtfkxsKc0TXRKHGi9cQbY5O4F5sHiBeiQ6Idnpjc58AWp74LUkTGoHzeh6XjZY0XI/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBlou5DZbdAy2gUofJVhkmj9AUYiHa0TGwOg7goxMXnfXXhYQ3-LwGJjldMdv6NaP4POuS7QO-4SHtfkxsKc0TXRKHGi9cQbY5O4F5sHiBeiQ6Idnpjc58AWp74LUkTGoHzeh6XjZY0XI/s1600/2.png" /></a></div>
<br />
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<br /></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<!--[if !supportLists]--><span style="color: #666666; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">Fixed
Size</span></b><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> – This allows us
to set constant width and height<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in; text-indent: -.25in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL7uitCrN0Wf4QrtN1B9CaLsTlIgqg3N65no5kX3_3MiBJ_oQdPWX8cWO1s68B9V05vydW_ZR8lABIXuS1K97YdZ662mJkttNJ9hFBzLcTiYW1U9DpombsKi8HEfUwLTyOemupcN7r6qw/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL7uitCrN0Wf4QrtN1B9CaLsTlIgqg3N65no5kX3_3MiBJ_oQdPWX8cWO1s68B9V05vydW_ZR8lABIXuS1K97YdZ662mJkttNJ9hFBzLcTiYW1U9DpombsKi8HEfUwLTyOemupcN7r6qw/s1600/3.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-left: 30.0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">.</span></div>
<div class="MsoNormal">
<span style="background-color: white; color: #666666; font-family: Arial, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal" style="background: white; line-height: normal; margin-bottom: 12.0pt; mso-outline-level: 2;">
<b><span style="font-family: Arial, sans-serif; font-size: 22.5pt;"><br /></span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-25170560602418984462016-04-01T20:47:00.000-07:002016-04-01T20:47:10.069-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: center;">
Mockito</h2>
<div>
<br /></div>
<div>
<div>
<b> 1 : verify </b></div>
<div>
</div>
<div>
//Let's import Mockito statically so that the code looks clearer</div>
<div>
import static org.mockito.Mockito.*;</div>
<div>
</div>
<div>
//mock creation</div>
<div>
List mockedList = mock(List.class);</div>
<div>
</div>
<div>
//using mock object</div>
<div>
mockedList.add("one");</div>
<div>
mockedList.clear();</div>
<div>
</div>
<div>
//verification</div>
<div>
verify(mockedList).add("one");</div>
<div>
verify(mockedList).clear();</div>
<div>
</div>
<div>
</div>
<div>
<b> 2 : Argument matchers</b></div>
<div>
</div>
<div>
//stubbing using built-in anyInt() argument matcher</div>
<div>
when(mockedList.get(anyInt())).thenReturn("element");</div>
<div>
</div>
<div>
//stubbing using hamcrest (let's say isValid() returns your own hamcrest matcher):</div>
<div>
when(mockedList.contains(argThat(isValid()))).thenReturn("element");</div>
<div>
</div>
<div>
//following prints "element"</div>
<div>
System.out.println(mockedList.get(999));</div>
<div>
</div>
<div>
//you can also verify using an argument matcher</div>
<div>
verify(mockedList).get(anyInt());</div>
<div>
</div>
<div>
Argument matchers allow flexible verification or stubbing.</div>
<div>
</div>
<div>
<b> 3 : Verifying exact number of invocations / at least x / never</b></div>
<div>
</div>
<div>
//using mock </div>
<div>
mockedList.add("once");</div>
<div>
</div>
<div>
mockedList.add("twice");</div>
<div>
mockedList.add("twice");</div>
<div>
</div>
<div>
mockedList.add("three times");</div>
<div>
mockedList.add("three times");</div>
<div>
mockedList.add("three times");</div>
<div>
</div>
<div>
//following two verifications work exactly the same - times(1) is used by default</div>
<div>
verify(mockedList).add("once");</div>
<div>
verify(mockedList, times(1)).add("once");</div>
<div>
</div>
<div>
//exact number of invocations verification</div>
<div>
verify(mockedList, times(2)).add("twice");</div>
<div>
verify(mockedList, times(3)).add("three times");</div>
<div>
</div>
<div>
//verification using never(). never() is an alias to times(0)</div>
<div>
verify(mockedList, never()).add("never happened");</div>
<div>
</div>
<div>
//verification using atLeast()/atMost()</div>
<div>
verify(mockedList, atLeastOnce()).add("three times");</div>
<div>
verify(mockedList, atLeast(2)).add("five times");</div>
<div>
verify(mockedList, atMost(5)).add("three times");</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-9177390184578811632016-03-03T23:10:00.002-08:002016-03-03T23:10:59.366-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<b> Test Case From Sample Json in Android </b><br />
<b><br /></b>
<b><br /></b>
Save the sample Json in text and save in Assert folder.<br />
<b>Exp :</b> sample.txt<br />
<br />
{<br />
"success": true,<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
"data": {<br />
"message": "Document describes test cases that need to be executed to verify that the specification has been implemented",<br />
"isConnectDevice": "Android",<br />
"requiresSerialNumber": true,<br />
"requiresDateOfPurchase": true<br />
}<br />
<br />
}<br />
<br />
<br />
sample test class as ResponseTest :<br />
<br />
public class ResponseTest extends InstrumentationTestCase {<br />
<br />
public void testSummaryResponseObject() {<br />
try {<br />
StringBuilder sb = new StringBuilder();<br />
try {<br />
BufferedReader reader = new BufferedReader(new InputStreamReader(getInstrumentation().getContext().getResources().getAssets().open("sample.txt")));<br />
String mLine = reader.readLine();<br />
while (mLine != null) {<br />
sb.append(mLine);<br />
mLine = reader.readLine();<br />
}<br />
<br />
reader.close();<br />
} catch (IOException e) {<br />
e.printStackTrace();<br />
}<br />
Log.d(TAG, "Parsed Data : " + sb.toString());<br />
<br />
Data response = (ProductMetaData) mProductAsset.getResponseData(new JSONObject(sb.toString()));<br />
PojoData mResponseData = response.getData();<br />
assertNotNull(mResponseData);<br />
<br />
PojoData pojoData = sedataObject(mResponseData);<br />
TestAssertionOnResponse(mResponseData, pojoData);<br />
} catch (Exception e) {<br />
Log.d(TAG, "IO " + e);<br />
}<br />
}<br />
<br />
private void TestAssertionOnResponse(final PojoData mResponseData, final PojoData pojoData) {<br />
assertEquals(mResponseData.getMessage(), pojoData.getMessage());<br />
assertEquals(mResponseData.getisConnectDevice(), pojoData.getisConnectDevice();<br />
assertEquals(mResponseData.getrequiresSerialNumber(), pojoData.getrequiresSerialNumber());<br />
assertEquals(mResponseData.getrequiresDateOfPurchase(), pojoData.getrequiresDateOfPurchase());<br />
<br />
}<br />
<br />
private PojoData set]dataObject(final PojoData mResponseData) {<br />
PojoData pojoData = new PojoData();<br />
pojoData.setMessage(mResponseData.getMessage());<br />
pojoData.setIsConnectedDevice(mResponseData.getisConnectDevice());<br />
pojoData.setRequiresDateOfPurchase(mResponseData.getrequiresSerialNumber());<br />
pojoData.setExtendedWarrantyMonths(mResponseData.getrequiresDateOfPurchase()); <br />
return pojoData;<br />
}<br />
}</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-43574911967128886682014-09-27T06:56:00.000-07:002016-08-12T00:29:32.495-07:00Android Interview Questions For Fresher and Experience<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="background: white; line-height: 11.25pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;">
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">1. What are the key
components of Android Architecture?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Android Architecture
consists of 4 key components:<br />
- Linux Kernel<br />
- Libraries<br />
- Android Framework<br />
- Android Applications<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">2. What are the
advantages of having an emulator within the Android environment?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- The emulator allows
the developers to work around an interface which acts as if it were an actual
mobile device.<br />
- They can write, test and debug the code.<br />
- They are safe for testing the code in early design phase<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">3. Tell us something
about activityCreator?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- An activityCreator is
the initial step for creation of a new Android project.<br />
- It consists of a shell script that is used to create new file system
structure required for writing codes in Android IDE.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">4. What do you know
about Intents?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- Notification messages
to the user from an Android enabled device can be displayed using Intents. The
users can respond to intents.<br />
- There are two types of Intents - Explicit Intent, Implicit Intent.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">5. What is an Explicit
Intent?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- Explicit intent
specifies the particular activity that should respond to the intent.<br />
- They are used for application internal messages.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">6. What is an Implicit
Intent?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- In case of Implicit Intent,
an intent is just declared.<br />
- It is for the platform to find an activity that can respond to it.<br />
- Since the target component is not declared, it is used for activating
components of other applications.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">7. What do intent
filters do?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- There can be more than
one intents, depending on the services and activities that are going to use
them.<br />
- Each component needs to tell which intents they want to respond to.<br />
- Intent filters filter out the intents that these components are willing to respond
to.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">8. Where are lay out
details placed? Why?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- Layout details are
placed in XML files<br />
- XML-based layouts provide a consistent and standard means of setting GUI
definition format.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">9. What do containers
hold?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- Containers hold
objects and widgets in a specified arrangement.<br />
- They can also hold labels, fields, buttons, or child containers. .<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">10. What is Orientation?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- Orientation decides if
the LinearLayout should be presented in row wise or column wise fashion.<br />
- The values are set using setOrientation()<br />
- The values can be HORIZONTAL or VERTICAL<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">11. What is it important
to set permissions in app development?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- Certain restrictions
to protect data and code can be set using permissions.<br />
- In absence of these permissions, codes could get compromised causing defects
in functionality.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">12. What is AIDL?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- AIDL is the
abbreviation for Android Interface Definition Language.<br />
- It handles the interface requirements between a client and a service to
communicate at the same level through interprocess communication.<br />
- The process involves breaking down objects into primitives that are Android
understandable.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">13. What data types are
supported by AIDL?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">AIDL supports following
data types:<br />
-string<br />
-List<br />
-Map<br />
-charSequence<br />
and<br />
-all native Java data types like int,long, char and Boolean<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">14. Tell us something
about nine-patch image.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- The Nine-patch in the
image name refers to the way the image can be resized: 4 corners that are
unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be
scaled into both axes.<br />
- A Nine-patch image allows resizing that can be used as background or other
image size requirements for the target device.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">15. Which dialog boxes
are supported by android?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Android supports 4
dialog boxes:<br />
<br />
a.) AlertDialog: Alert dialog box supports 0 to 3 buttons and a list of
selectable elements which includes check boxes and radio buttons.<br />
<br />
b.) ProgressDialog: This dialog box is an extension of AlertDialog and supports
adding buttons. It displays a progress wheel or bar.<br />
<br />
c.) DatePickerDialog: The user can select the date using this dialog box.<br />
<br />
d.) TimePickerDialog: The user can select the time using this dialog box.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">16. What is Dalvik
Virtual Machine?<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">- It is Android's
virtual machine.<br />
- It is an interpreter-only virtual machine which executes files in Dalvik
Executable (.dex) format. This format is optimized for efficient storage and
memory-mappable execution.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">17. Explain in
brief about the important file and folder when you create new android
application.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">When you create android
application the following folders are created in the package explorer in eclipse
which are as follows:</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">src: </span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Contains the .java source files for your
project. You write the code for your application in this file. This file is
available under the package name for your project.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">gen —</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">This folder contains the R.java file. It is
compiler-generated file that references all the resources found in your
project. You should not modify this file.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Android 4.0 library:
This folder contains android.jar file, which contains all the class libraries
needed for an Android application.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">assets:</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> This folder contains all the information
about HTML file, text files, databases, etc.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">bin:</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> It contains the .apk file (Android
Package) that is generated by the ADT during the build process. An .apk file is
the application binary file. It contains everything needed to run an Android
application.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">res:</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> This folder contains all the resource file
that is used byandroid application. It contains subfolders as: drawable, menu,
layout, and values etc.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">18. Explain
AndroidManifest.xmlfile in detail.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><?xml
version="1.0" encoding="utf-8"?><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.careerride" android:versionCode="1"
android:versionName="1.0"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><uses-sdk
android:minSdkVersion="8" android:targetSdkVersion="18"
/><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><application android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><activity
android:name="com.example.careerride.MainActivity"
android:label="@string/app_name"><br />
<intent-filter><br />
<action android:name="android.intent.action.MAIN" /><br />
<category android:name="android.intent.category.LAUNCHER" /><br />
</intent-filter><br />
</activity><br />
</application><br />
<br />
</manifest><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">The AndroidManifest.xml
file contains the following information about the application:<o:p></o:p></span></div>
<ul type="disc">
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">It
contains the package name of the application.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">The
version code of the application is 1.This value is used to identify the
version number of your application.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">The
version name of the application is 1.0</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">The
android:minSdkVersion attribute of the element defines the minimum
version of the OS on which the application will
run.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ic_launcher.png
is the default image that located in the drawable folders.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">app_name
defines the name of applicationand available in the strings.xml file.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">It
also contains the information about the activity. Its name is same as the
application name.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
</ul>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">19. Describe android
Activities in brief.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Activity provides the
user interface. When you create an android application in eclipse through the
wizard it asks you the name of the activity. Default name is MainActivity. You
can provide any name according to the need. Basically it is a class
(MainActivity) that is inherited automatically from Activity class. Mostly,
applications have oneor more activities; and the main purpose of an activity is
to interact with the user. Activity goes through a numberof stages, known as an
activity’s life cycle.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Example:<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">packagecom.example.careerride;
//Application name careerride<br />
<br />
importandroid.os.Bundle; // Default packages<br />
importandroid.app.Activity; // Default packages<br />
importandroid.view.Menu;<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">public class
MainActivity extends Activity {<br />
@Override<br />
protected void onCreate(Bundle savedInstanceState) {<br />
super.onCreate(savedInstanceState);<br />
setContentView(R.layout.activity_main);<br />
}<br />
@Override<br />
publicbooleanonCreateOptionsMenu(Menu menu) {<br />
// Inflate the menu; this adds items to the action bar if it is present.<br />
getMenuInflater().inflate(R.menu.main, menu);<br />
return true;<br />
}<br />
}<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">When you run the
application onCreate method is called automatically.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">20. Describe Intents in
detail.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">An Android application
can contain zero or more activities. If you want to navigate fromone activity
to another then android provides you Intent class. This class is available
inandroid.content.Intent package.One of the most common uses for Intents is to
start new activities.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">There are two types of
Intents.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Explicit Intents</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><br />
<b>Implicit Intents</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Intents works in pairs:
actionand data. The action defines what you want to do, such as editing an
item, viewingthe content of an item etc. The dataspecifies what is
affected,such as a person in the Contacts database. The data is specified as
anUri object.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Explicitly starting an
Activity</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Intent intent = newIntent
(this, SecondActivity.class);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">startActivity(intent);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Here SecondActivity is
the name of the target activity that you want to start.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Implicitly starting an
Activity</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">If you want to view a
web page with the specified URL then you can use this procedure.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Intent i =
newIntent(android.content.Intent.ACTION_VIEW,Uri.parse(“http://www.amazon.com”));<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">startActivity(i);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">if you want to dial a
telephone number then you can use this method by passing the telephone number
in the data portion</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Intent i = newIntent
(android.content.Intent.ACTION_DIAL,Uri.parse(“tel:+9923.....”));<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">startActivity(i);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">In the above method the
user must press the dial button to dial the number. If you want to directly
call the number without user intervention, change the action as follows:<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Intent i = newIntent
(android.content.Intent.ACTION_CALL,Uri.parse(“tel:+9923.....”));<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">startActivity(i);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">If you want to dial tel
no or use internet then write these line in AndroidManifest.xml<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><uses-permissionandroid:name=”android.permission.CALL_PHONE”/><br />
<uses-permissionandroid:name=”android.permission.INTERNET”/><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">21. How to send SMS in
android? Explain with example.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">SMS messaging is one of
the basic and important applications on a mobile phone. Now days every mobile
phone has SMS messaging capabilities, and nearly all users of any age know how
to send and receive suchmessages. Mobile phones come with a built-in SMS
application that enables you to send and receiveSMS messages. If you want to
send the SMS programmatically then follow the following steps.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Sending SMS Messages
Programmatically</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Take a button on
activity_main.xml file as follows.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><Button
android:id="@+id/btnSendSMS"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" android:onClick=”sendmySMS”
android:text="sendSMS" /><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">According to above code
when user clicks the button sendmySMS method will be called. sendmySMS is user
defined method.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">In the
AndroidManifest.xml file, add the following statements<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><uses-permissionandroid:name=”android.permission.SEND_SMS”/></span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Now we write the final
step. Write the given below method in MainActivity,java file<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">publicvoidsendmySMS(View
v)<br />
{<br />
SmsManagersms = SmsManager.getDefault();<br />
sms.sendTextMessage("5556", null, "Hello from careerRide",
null, null);<br />
}<br />
In this example I have used two emulator. On the first Android emulator (5554),
click the Send SMSbutton to send an SMS message to the second emulator(5556).<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">22. Describe the
SmsManager class in android.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">SmsManager class is
responsible for sending SMS from one emulator to another or device.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">You cannot directly
instantiate this class; instead, you call the getDefault() static method to
obtain an SmsManager object. You then send the SMS message using the
sendTextMessage() method:<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">SmsManagersms =
SmsManager.getDefault();<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">sms.sendTextMessage("5556",
null, "Hello from careerRide", null, null);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">sendTextMessage() method
takes five argument.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<ul type="disc">
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">destinationAddress
— Phone number of the recipient.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">scAddress
— Service center address; you can use null also.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">text
— Content of the SMS message that you want to send.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">sentIntent
— Pending intent to invoke when the message is sent.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">deliveryIntent
— Pending intent to invoke when the message has been delivered.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
</ul>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">23. How you can use
built-in Messaging within your application?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">You can use an Intent
object to activate the built-in Messaging service. You have to pass MIME type
“vnd.android-dir/mms-sms”, in setType method of Intent as shown in the
following given below code.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Intent intent = new
Intent (android.content.Intent.ACTION_VIEW);<br />
intent.putExtra("address", "5556; 5558;");// Send the
message to multiple recipient.<br />
itent.putExtra("sms_body", "Hello my friends!");<br />
intent.setType("vnd.android-dir/mms-sms");<br />
startActivity(intent);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">What are different data
storage options are available in Android?<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Different data storage options
are available in Android are:<o:p></o:p></span></div>
<ul type="disc">
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">SharedPreferences</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">SQlite</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">ContentProvider</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">File
Storage</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Cloud
Storage</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
</ul>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">24. Describe
SharedPreference storage option with example.</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">SharedPreference is the
simplest mechanism to store the data in android. You do not worry about
creating the file or using files API.It stores the data in XML files.
SharedPreference stores the data in key value pair.The SharedPreferences class
allows you to save and retrieve key-value pairs of primitive data types. You
can use SharedPreferences to save any primitive data: boolean, floats, int,
longs, and strings.The data is stored in XML file in the directory
data/data//shared-prefs folder.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Application of
SharedPreference</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<ul type="disc">
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Storing
the information about number of visitors (counter).</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Storing
the date and time (when your Application is updated).</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Storing
the username and password.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
<li class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: ""serif"",serif; font-size: 13.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Storing
the user settings.</span><span style="font-family: "Times New Roman",serif; font-size: 13.5pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></li>
</ul>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Example:</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">For storing the data we
will write the following code in main activity on save button:</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">SharedPreferences
sf=getSharedPreferences("MyData", MODE_PRIVATE);<br />
SharedPreferences.Editored= sf.edit();<br />
ed.putString("name", txtusername.getText().toString());<br />
ed.putString("pass", txtpassword.getText().toString());<br />
ed.commit();<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">In this example I have
taken two activities. The first is MainActivity and the second one is
SecondActivity.When user click on save button the user name and password that
you have entered in textboxes, will be stored in MyData.xml file.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Here MyData is the name
of XML file .It will be created automatically for you.<br />
<br />
MODE_PRIVATE means this file is used by your application only.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">txtusernameand
txtpassword are two EditText control in MainActivity.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">For retrieving the data
we will write the following code in SecondActiviy when user click on Load
button:</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Public static final
String DEFAULT=”N? A”;<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">DEFAULT is a String type
user defined global variable.If the data is not saved in XML file and user
click on load button then your application will not give the error. It will
show message “No Data is found”. Here name and pass are same variable that I
have used in MainActivity.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">SharedPreferences
sf=getSharedPreferences("MyData", Context.MODE_PRIVATE);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">String Uname=sf.getString("name",
DEFAULT);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">String
UPass=sf.getString("pass", DEFAULT);<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">if(name.equals(DEFAULT)||Pass.equals(DEFAULT))<br />
{<br />
Toast.makeText(this, "No data is found", Toast.LENGTH_LONG).show();<br />
}<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">else<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Txtusername.setText(Uname);<br />
Txtpassword.setText(UPass) ;<br />
}<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: "Times New Roman", serif; font-size: 13.5pt;">25.
What is</span></b><b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">Android?</span></span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">-- It is an open-sourced operating system
that is used primarily on mobile devices, such as cell phones and tablets. It
is a Linux kernel-based system that’s been equipped with rich components that
allows developers to create and run apps that can perform both basic and
advanced functions.</span><br />
<br />
<br />
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">26. What Is the</span> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">Google Android SDK?</span></b><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">-- The Google Android SDK is a toolset that
developers need in order to write apps on Android enabled devices. It contains
a graphical interface that emulates an Android driven handheld environment,
allowing them to test and debug their codes.</span><br />
<br />
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">27. What is the</span> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">Android Architecture?</span></b><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">-- Android Architecture is made up of 4
key components:</span><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">- Linux Kernel</span><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">- Libraries</span><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">- Android Framework</span><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">- Android Applications</span><br />
<br />
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">28. Describe the</span> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">Android Framework.</span></b><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">-- The Android Framework is an important
aspect of the Android Architecture. Here you can find all the classes and
methods that developers would need in order to write applications on the
Android environment.</span><br />
<br />
<b><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">29. What is</span> <span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">AAPT?</span></b><br />
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;">-- AAPT is short for Android Asset
Packaging Tool. This tool provides developers with the ability to deal with
zip-compatible archives, which includes creating, extracting as well as viewing
its contents.</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">30. What is the
importance of having an emulator within the Android environment?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">--The emulator lets
developers “play” around an interface that acts as if it were an actual mobile
device. They can write and test codes, and even debug. Emulators are a safe
place for testing codes especially if it is in the early design phase.<br />
<br />
<b>31. What is the use of an activityCreator?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">-- An
activityCreator is the first step towards the creation of a new Android
project. It is made up of a shell script that will be used to create new file
system structure necessary for writing codes within the Android IDE.<br />
<br />
<b>32. Describe Activities.</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">-- Activities are
what you refer to as the window to a user interface. Just as you create windows
in order to display output or to ask for an input in the form of dialog boxes,
activities play the same role, though it may not always be in the form of a
user interface.<br />
<br />
<b>33. What are Intents?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">-- Intents displays
notification messages to the user from within the Android enabled device. It
can be used to alert the user of a particular state that occurred. Users can be
made to respond to intents.<br />
<br />
<b>34. Differentiate Activities from Services.</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">-Activities can be closed, or terminated anytime
the user wishes. On the other hand, services are designed to run behind the scenes,
and can act independently. Most services run continuously, regardless of
whether there are certain or no activities being executed.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">35. What items are
important in every Android project?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">--These are the essential items that are present
each time an Android project is created:<br />
- AndroidManifest.xml<br />
- build.xml<br />
- bin/<br />
- src/<br />
- res/<br />
- assets/<br />
<br />
<b>36. What is the importance of XML-based layouts?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> The
use of XML-based layouts provides a consistent and somewhat standard means of
setting GUI definition format. In common practice, layout details are placed in
XML files while other items are placed in source files.<br />
<br />
<b>37. What are containers?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Containers, as the name itself implies,
holds objects and widgets together, depending on which specific items are needed
and in what particular arrangement that is wanted. Containers may hold labels,
fields, buttons, or even child containers, as examples.<br />
<br />
<b>38. What is Orientation?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Orientation, which can be set using
setOrientation(), dictates if the LinearLayout is represented as a row or as a
column. Values are set as either HORIZONTAL or VERTICAL.<br />
<br />
<b>39. What is the importance of Android in the mobile market?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Developers can write and register apps
that will specifically run under the Android environment. This means that every
mobile device that is Android enabled will be able to support and run these
apps. With the growing popularity of Android mobile devices, developers can
take advantage of this trend by creating and uploading their apps on the
Android Market for distribution to anyone who wants to download it.<br />
<br />
<b>40. What do you think are some disadvantages of Android?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Given that Android is an open-source
platform, and the fact that different Android operating systems have been
released on different mobile devices, there’s no clear cut policy to how
applications can adapt with various OS versions and upgrades.<br />
--> One app that runs on this particular version of Android OS may or
may not run on another version.<br />
--> Another disadvantage is that since mobile devices such as phones
and tabs come in different sizes and forms, it poses a challenge for developers
to create apps that can adjust correctly to the right screen size and other
varying features and specs.<br />
<br />
<b>41. What is adb?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Adb is short for Android Debug Bridge. It
allows developers the power to execute remote shell commands. Its basic
function is to allow and control communication towards and from the emulator
port.<br />
<br />
<b>42. What are the four essential states of an activity?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Active –
if the activity is at the foreground<br />
- Paused – if the activity is at the background and still visible<br />
- Stopped – if the activity is not visible and therefore is hidden or obscured
by another activity<br />
- Destroyed – when the activity process is killed or completed terminated<br />
<br />
<b>43. What is ANR?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> ANR
is short for Application Not Responding. This is actually a dialog that appears
to the user whenever an application have been unresponsive for a long period of
time.<br />
<br />
<b>44. Which elements can occur only once and must be present?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Among the
different elements, the and elements must be present and can occur only once.
The rest are optional, and can occur as many times as needed.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">45. How are escape
characters used as attribute?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Escape characters
are preceded by double backslashes. For example, a newline character is created
using ‘\\n’<br />
<br />
<b>47. What is the importance of settings permissions in app development?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Permissions allow
certain restrictions to be imposed primarily to protect data and code. Without
these, codes could be compromised, resulting to defects in functionality.<br />
<br />
<b>48. What is the function of an intent filter?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Because every
component needs to indicate which intents they can respond to, intent filters
are used to filter out intents that these components are willing to receive.
One or more intent filters are possible, depending on the services and
activities that is going to make use of it.<br />
<br />
<b>49. Enumerate the three key loops when monitoring an activity?</b>- <o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Entire lifetime –
activity happens between onCreate and onDestroy<br />
- Visible lifetime – activity happens between onStart and onStop<br />
- Foreground lifetime – activity happens between onResume and onPause<br />
<br />
<b>50.When is the onStop() method invoked?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> A call to onStop method happens when an
activity is no longer visible to the user, either because another activity has
taken over or if in front of that activity.<br />
<br />
<b>51. Is there a case wherein other qualifiers in multiple resources
take precedence over locale?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Yes, there are
actually instances wherein some qualifiers can take precedence over locale.
There are two known exceptions, which are the MCC (mobile country code) and MNC
(mobile network code) qualifiers.<br />
<br />
<b>52. What are the different states wherein a process is based?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">There are 4 possible
states:<br />
- foreground activity<br />
- visible activity<br />
- background activity<br />
- empty process<br />
<br />
<b>53. How can the ANR be prevented?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> One technique that
prevents the Android system from concluding a code that has been responsive for
a long period of time is to create a child thread. Within the child thread,
most of the actual workings of the codes can be placed, so that the main thread
runs with minimal periods of unresponsive times.<br />
<br />
<b>54. What role does Dalvik play in Android development?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Dalvik serves as a virtual machine, and
it is where every Android application runs. Through Dalvik, a device is able to
execute multiple virtual machines efficiently through better memory management.<br />
<br />
<b>55. What is the AndroidManifest.xml?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> This file is essential in every
application. It is declared in the root directory and contains information
about the application that the Android system must know before the codes can be
executed.<br />
<br />
<b>57. What is the proper way of setting up an Android-powered device for app
development?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> The following are steps to be followed
prior to actual application development in an Android-powered device:<br />
<br />
-Declare your application as “debuggable” in your Android Manifest.<br />
-Turn on “USB Debugging” on your device.<br />
-Set up your system to detect your device.<br />
<br />
<b>58. Enumerate the steps in creating a bounded service through AIDL.<o:p></o:p></b></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">1. create the .aidl
file, which defines the programming interface<br />
2. implement the interface, which involves extending the inner abstract Stub
class as well as implanting its methods.<br />
3. expose the interface, which involves implementing the service to the
clients.<br />
<br />
<b>59. What is the importance of Default Resources?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">When default resources,
which contain default strings and files, are not present, an error will occur
and the app will not run. Resources are placed in specially named
subdirectories under the project res/ directory.<br />
<br />
<b>60. When dealing with multiple resources, which one takes precedence?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Assuming that all of these multiple
resources are able to match the configuration of a device, the ‘locale’
qualifier almost always takes the highest precedence over the others.<br />
<br />
<b>61. When does ANR occur?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> The ANR dialog is displayed to the user
based on two possible conditions. One is when there is no response to an input
event within 5 seconds, and the other is when a broadcast receiver is not done
executing within 10 seconds.<br />
<br />
<b>62. What is AIDL?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> AIDL, or Android Interface Definition
Language, handles the interface requirements between a client and a service so
both can communicate at the same level through interprocess communication or
IPC. This process involves breaking down objects into primitives that Android
can understand. This part is required simply because a process cannot access
the memory of the other process.<br />
<br />
<b>63. What data types are supported by AIDL?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">AIDL has support for the
following data types:<br />
-string<br />
-charSequence<br />
-List<br />
-Map<br />
-all native Java data types like int,long, char and Boolean<br />
<br />
<b>64. What is a Fragment?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> A fragment is a part or portion of an
activity. It is modular in a sense that you can move around or combine with
other fragments in a single activity. Fragments are also reusable.<br />
<br />
<b>65. What is a visible activity?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> A visible activity is one that sits
behind a foreground dialog. It is actually visible to the user, but not
necessarily being in the foreground itself.<br />
<br />
<b>66. When is the best time to kill a foreground activity?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">The foreground activity,
being the most important among the other states, is only killed or terminated
as a last resort, especially if it is already consuming too much memory. When a
memory paging state has been reach by a foreground activity, then it is killed
so that the user interface can retain its responsiveness to the user.<br />
<br />
<b>67. Is it possible to use or add a fragment without using a user interface?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Yes, it is
possible to do that, such as when you want to create a background behavior for
a particular activity. You can do this by using add(Fragment,string) method to
add a fragment from the activity.<br />
<br />
<b>68. How do you remove icons and widgets from the main screen of the Android
device?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> To remove an icon
or shortcut, press and hold that icon. You then drag it downwards to the lower
part of the screen where a remove button appears.<br />
<br />
<b>69 What are the core components under the Android
application architecture?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> There are 5 key
components under the Android application architecture:<br />
- services<br />
- intent<br />
- resource externalization<br />
- notifications<br />
- content providers<br />
<br />
<b>70. What composes a typical Android application project?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> A project under
Android development, upon compilation, becomes an .apk file. This apk file
format is actually made up of the AndroidManifest.xml file, application code,
resource files, and other related files.<br />
<br />
<b>71. What is a Sticky Intent?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">A Sticky Intent is a
broadcast from sendStickyBroadcast() method such that the intent floats around
even after the broadcast, allowing others to collect data from it.<br />
<br />
<b>72. Do all mobile phones support the latest Android operating system?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> Some
Android-powered phone allows you to upgrade to the higher Android operating
system version. However, not all upgrades would allow you to get the latest
version. It depends largely on the capability and specs of the phone, whether
it can support the newer features available under the latest Android version.<br />
<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--><b><o:p></o:p></b></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">73.What is portable
wi-fi hotspot?</span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">Portable Wi-Fi Hotspot
allows you to share your mobile internet connection to other wireless device.
For example, using your Android-powered phone as a Wi-Fi Hotspot, you can use
your laptop to connect to the Internet using that access point.<br />
<br />
<b>74. What is an action?</b><o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> In Android development, an action is
what the intent sender wants to do or expected to get as a response. Most
application functionality is based on the intended action.<br />
<br />
<b>75. What is the difference between a regular bitmap and a nine-patch image?<o:p></o:p></b></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> In general, a Nine-patch image allows
resizing that can be used as background or other image size requirements for
the target device. The Nine-patch refers to the way you can resize the image: 4
corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle
one that can be scaled into both axes.<br />
<br />
<b>76. What language is supported by Android for application
development?<o:p></o:p></b></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> <o:p></o:p></span></b></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 14.4pt; margin-bottom: 0.0001pt;">
<b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;"> </span></b><span style="font-family: "Times New Roman", serif; font-size: 13.5pt;">The main language supported is Java programming language. Java is
the most popular language for app development, which makes it ideal even for
new Android developers to quickly learn to create and deploy applications in
the Android environment.<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<br />
<div class="MsoNormal">
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-25260616580121755452014-01-09T23:18:00.003-08:002014-01-09T23:18:54.465-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
</h2>
<div class="MsoNormal">
<b><span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%;"><span style="color: blue;">Difference
Between SQLite and MySQLite ?</span><o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">SQLite
:</span></b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br />
<br />
1. Easy to set up and in many cases no configuration or
installation is necessary.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 2. G<span style="background: white;">reat for rapid development.</span></span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><span style="background: white;"><br /></span></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">
3. Suitable for using in embedded applications and installations and
embedding into applications themselves. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 4. Not
good for large scale databases as SQLite stores the database in a single file and
this can fall under the restrictions of the operating system where SQLite
is not capable of splitting the data across volumes. </span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 5. Not suitable for use in any situation where a Client/Server
Architecture is needed.</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /> 6. Great for rapid development</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br />
</span><b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">MySQLite :<o:p></o:p></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br />
1. More difficult to set up and
configuration of users is a must.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 2.<span style="background: white;"> Good for creating temporary databases as well as
for test purposes. This would only be practical if you have the MySQL
database server and client already set up.</span></span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><span style="background: white;"><br /></span></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 3. G</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">reat for rapid development in some situations. </span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 4. Perfect for
concurrency transactions on the data and is well suited for multi-user
environment.</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 5. Great for large
scale production applications which scale even over clustered database
configurations.</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 6. Perfect for using
in a Client/Server Architecture set up.</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgrSapIz_inOtwEL0cWG62jJi7h0WjsXwOjqyE0KGnrWWDWoKLcI1sP5dOJnQnHzWTqwbz7MoyWnVU6JjoyCpW-j7LT7BzJKetvm6zBHDF2g0p_zJGGf55zCGUAZBhckQvBK9oTKne97M/s1600/line.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgrSapIz_inOtwEL0cWG62jJi7h0WjsXwOjqyE0KGnrWWDWoKLcI1sP5dOJnQnHzWTqwbz7MoyWnVU6JjoyCpW-j7LT7BzJKetvm6zBHDF2g0p_zJGGf55zCGUAZBhckQvBK9oTKne97M/s1600/line.png" height="1" width="320" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br />
</span><b><span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%;"><span style="color: blue;">Difference Between
Content-Provider and SQLite ? </span><o:p></o:p></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br />
SQLite database created on Android by
one application is usable only by that application, not by other applications.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> Content Provider Share
data beteen applications, you need to use it as recommended in Android</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2lSGKgvrJnQbKHPbRYBjrmTOAssYS2A9wpKRa9WBwXw0qSjhkYAsTd5oX5okIT4kCibMC9nDNcF3NqbbZo-PP0xDw_YSwoiMMRL2U4OD0l9Yy5FrkTq2MLhMVpZk-ZbsDweEYpWw4L5A/s1600/line.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2lSGKgvrJnQbKHPbRYBjrmTOAssYS2A9wpKRa9WBwXw0qSjhkYAsTd5oX5okIT4kCibMC9nDNcF3NqbbZo-PP0xDw_YSwoiMMRL2U4OD0l9Yy5FrkTq2MLhMVpZk-ZbsDweEYpWw4L5A/s1600/line.png" height="1" width="320" /></a></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<b><span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%;"><br />
</span></b><b><span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%;"><span style="color: blue;">Difference Between
Shared Preferences and SQLite ?</span><o:p></o:p></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 14.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br />
</span><b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">Shared Preferences:<o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 1 . Shared Preference is Lightweight, Quick and easy to use
and Easy to debug .</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 2 . Slow when dealing with lots of data</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 3. Not helpful when the data is more than a simple key/value
affair.</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"> 4. Entire file needs to be read and parsed to access
data</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br />
</span><b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;">SQLite :<o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">
1. Scales nicely , Changes don't require rewriting the entire data
file from scratch and
Powerful queries</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;">
2. More code to write.</span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 115%; mso-bidi-font-weight: bold;"><br /></span></div>
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-weight: bold; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-fareast;">
3. More heavyweight (code and memory), overkill when
dealing with a little bit of data.</span><br />
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-weight: bold; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-fareast;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2lSGKgvrJnQbKHPbRYBjrmTOAssYS2A9wpKRa9WBwXw0qSjhkYAsTd5oX5okIT4kCibMC9nDNcF3NqbbZo-PP0xDw_YSwoiMMRL2U4OD0l9Yy5FrkTq2MLhMVpZk-ZbsDweEYpWw4L5A/s1600/line.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2lSGKgvrJnQbKHPbRYBjrmTOAssYS2A9wpKRa9WBwXw0qSjhkYAsTd5oX5okIT4kCibMC9nDNcF3NqbbZo-PP0xDw_YSwoiMMRL2U4OD0l9Yy5FrkTq2MLhMVpZk-ZbsDweEYpWw4L5A/s1600/line.png" height="1" width="320" /></a></div>
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-bidi-font-weight: bold; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-fareast;"><br /></span>
<div class="MsoNormal" style="text-align: left;">
<span style="font-family: "inherit","serif"; font-size: 10.5pt; line-height: 115%; mso-bidi-font-family: Arial; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-58714431110417869562013-10-29T08:25:00.003-07:002013-10-29T08:25:49.916-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 class="post-title entry-title" itemprop="name" style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 26px; margin: 0px; position: relative;">
<span style="background-color: white;">Screenshot Using DDMS on Windows(Android Device)</span></h1>
<div>
<span style="background-color: white;"><br /></span></div>
<div>
<h4 style="text-align: left;">
<strong style="background-color: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">What is DDMS?</strong></h4>
<div style="background-color: white; border: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; vertical-align: baseline;">
Android provides a debugging tool called the Dalvik Debug Monitor Server (DDMS). </div>
<h4 style="text-align: left;">
<strong style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Advantages of DDMS:</strong></h4>
<div style="border: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; vertical-align: baseline;">
<span style="background-color: white;"><strong style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> 1 . </strong>DDMS provides port-forwarding services.<br /> <b>2 </b>. Screen capture on the device.<br /><strong style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> 3 . </strong>Thread and heap information on the device.<br /> 4 . Logcat.<br /> <b>5</b> . Process.<br /><strong style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> 6 . </strong>Radio state information.<br /> <b>7</b> . Incoming call and SMS spoofing, location data spoofing, and more.</span></div>
<h4 style="text-align: left;">
<span style="background-color: white;">Screen Shot</span></h4>
<div style="border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; vertical-align: baseline;">
<span style="background-color: white;"><span style="color: #333333;">1. </span>First Create AVD, open </span><span style="background-color: white; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 16.363636016845703px; line-height: 20px;">Emulator</span><span style="background-color: white; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 16.363636016845703px; line-height: 20px;"> .</span></div>
<div style="border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; text-align: left; vertical-align: baseline;">
<span style="background-color: white; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 16.363636016845703px; line-height: 20px;"><span style="color: #333333;">2</span>. </span><span style="background-color: white;">open DDMS Prospective ,DDMS Windows With the List of Devices Connected to it.</span></div>
<div style="border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; text-align: left; vertical-align: baseline;">
<span style="background-color: white;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeeZFptdU8Q30tUA4lefsfGD7u5du_SrmD4JJbzBoB5DduO7heJP8MpISBo62Kdk9ArRn55XNyEdtMCPz7zpzqH_OlMDWzyT9NHiWXv5H0Zeb7hp-KSApfblIECn5vYCzMZVxQyaqEiNM/s1600/a.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeeZFptdU8Q30tUA4lefsfGD7u5du_SrmD4JJbzBoB5DduO7heJP8MpISBo62Kdk9ArRn55XNyEdtMCPz7zpzqH_OlMDWzyT9NHiWXv5H0Zeb7hp-KSApfblIECn5vYCzMZVxQyaqEiNM/s320/a.jpg" width="212" /></a></div>
<div style="border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; text-align: left; vertical-align: baseline;">
<span style="background-color: white;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; text-align: left; vertical-align: baseline;">
<span style="background-color: white;">3 Finally Click on Save Button.</span></div>
<div style="border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; text-align: left; vertical-align: baseline;">
<span style="background-color: white;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_6YXRdW42xWzVrSRZ64ITEfMKXV4uGnWxrzpFLk-Fyq99RGjzhNZE_EvoQD4UH9OQrFE7IBMsbAbFBDTSAJZexGEtTBhDuOxag-x3CPHwUxs3Et0DvRbzrxesO1rQ8L9-IinAFu2G-e8/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_6YXRdW42xWzVrSRZ64ITEfMKXV4uGnWxrzpFLk-Fyq99RGjzhNZE_EvoQD4UH9OQrFE7IBMsbAbFBDTSAJZexGEtTBhDuOxag-x3CPHwUxs3Et0DvRbzrxesO1rQ8L9-IinAFu2G-e8/s320/4.jpg" width="262" /></a></div>
<div style="border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; text-align: left; vertical-align: baseline;">
<span style="background-color: white;"><br /></span></div>
<div style="border: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; outline: 0px; padding: 0px 0px 10px; vertical-align: baseline;">
<span style="background-color: white; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 16.363636016845703px; line-height: 20px;"><br /></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-41617060762037303022013-10-26T03:19:00.000-07:002013-10-26T03:19:04.103-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 class="post-title" style="color: #333333; font-family: 'Source Sans Pro', Arial, Tahoma, sans-serif; font-size: 30px; line-height: 1.5em; margin: 0px 0px 10px; text-align: center;">
<span style="background-color: white;">Handler and AsyncTask in Android</span></h1>
<div>
<span style="background-color: white;"><br /></span></div>
<div>
<h2 style="font-family: 'Source Sans Pro', Arial, Tahoma, sans-serif; font-size: 20px; line-height: 26px; margin: 12px 0px;">
<span style="background-color: white;"><span style="color: blue;">Android Handler</span></span></h2>
<ol style="color: #0a000a; font-family: 'Source Sans Pro', Arial, Tahoma, sans-serif; font-size: 14px; line-height: 23px; list-style-position: inside; margin: 0px 0px 1em 1em; padding: 0px;">
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">Handler allows to add messages to the thread which creates it and It also enables you to schedule some runnable to execute at some time in future.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">The Handler is associated with the application’s main thread. It handles and schedules messages and runnables sent from background threads to the app main thread.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">If you are doing multiple repeated tasks, for example downloading multiple images which are to be displayed in ImageViews (like downloading thumbnails) upon download, use a task queue with Handler.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">There are two main uses for a Handler. First is to schedule messages and runnables to be executed as some point in the future; and second Is to enqueue an action to be performed on a different thread than your own.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">Scheduling messages is accomplished with the the methods like post(Runnable), postAtTime(Runnable, long), postDelayed(Runnable, long), sendEmptyMessage(int), sendMessage(Message), sendMessageAtTime(Message, long), and sendMessageDelayed(Message, long) methods.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">When a process is created for your application, its main thread is dedicated to running a message queue that takes care of managing the top-level application objects (activities, broadcast receivers, etc) and any windows they create.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">You can create your own threads, and communicate back with the main application thread through a Handler.</span></li>
</ol>
<h2 justify="" style="font-family: 'Source Sans Pro', Arial, Tahoma, sans-serif; font-size: 20px; line-height: 26px; margin: 12px 0px;">
<span style="background-color: white;"><span style="color: blue;">Android AsynkTask</span></span></h2>
<ol style="color: #0a000a; font-family: 'Source Sans Pro', Arial, Tahoma, sans-serif; font-size: 14px; line-height: 23px; list-style-position: inside; margin: 0px 0px 1em 1em; padding: 0px;">
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">Async task enables you to implement MultiThreading without get Hands dirty into threads. AsyncTask enables proper and easy use of the UI thread. It allows performing background operations and passing the results on the UI thread.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">If you are doing something isolated related to UI, for example downloading data to present in a list, go ahead and use AsyncTask.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">AsyncTasks should ideally be used for short operations (a few seconds at the most.)</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called onPreExecute, doInBackground, onProgressUpdate and onPostExecute.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">In <b>onPreExecute</b> you can define code, which need to be executed before background processing starts.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;"><b>doInBackground</b> have code which needs to be executed in background, here in doInBackground we can send results to multiple times to event thread by publishProgress() method, to notify background processing has been completed we can return results simply.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;"><b>onProgressUpdate()</b> method receives progress updates from doInBackground method, which is published via publishProgress method, and this method can use this progress update to update event thread</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;"><b>onPostExecute()</b> method handles results returned by doInBackground method.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">The generic types used are</span><ul style="list-style-position: inside; margin: 0px 0px 0px 1em; padding: 0px;">
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px;"><span style="background-color: white;">Params, the type of the parameters sent to the task upon execution</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px;"><span style="background-color: white;">Progress, the type of the progress units published during the background computation.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px;"><span style="background-color: white;">Result, the type of the result of the background computation.</span></li>
</ul>
</li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">If an async task not using any types, then it can be marked as Void type.</span></li>
<li style="list-style-position: outside; list-style-type: decimal; margin-left: 20px; text-align: justify;"><span style="background-color: white;">An running async task can be cancelled by calling cancel(boolean) method.</span></li>
</ol>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-84342032128392675102013-10-25T04:27:00.002-07:002013-10-25T04:27:31.858-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="background-color: white; border: 0px; font-family: Arial, Helvetica, sans-serif; margin: 0px; outline: 0px; padding: 5px; text-align: center; vertical-align: top;">
<b style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: top;">AsyncroTask Example To Get Server Data</b></h2>
<div>
<b style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: top;"><br /></b></div>
<div>
<b style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: top;">AsyncroTask Basics:</b></div>
<div>
<b style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: top;"><br /></b></div>
<div>
<span style="border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: top;"> </span> 1. AsyncTask provide easy way to use of the UI thread.</div>
<div>
</div>
<div>
2. Perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.</div>
<div>
<br /></div>
<div>
3. AsyncTask is designed to be a helper class around Thread and Handler and does not use a generic threading framework.</div>
<div>
<br /></div>
<div>
4. AsyncTasks should ideally be used for short operations (a few seconds at the most.)</div>
<div>
<br /></div>
<div>
5. The AsyncTask class must be loaded on the UI thread.</div>
<div>
<br /></div>
<div>
6. The task instance must be created on the UI thread.</div>
<div>
<br /></div>
<div>
7. execute(Params...) must be invoked on the UI thread.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b> Usage:</b></div>
<div>
<b><br /></b></div>
<div>
<b> </b>Taking same example as we have done in previous example Thread With Handlers - Android Example In this example we are creating a thread and call http GET method to get server response and after got the response,then do other functionality ( Save Data in database or show alert ,Redirect to another activity).</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>Program Code :</b></div>
<div>
<b><br /></b></div>
<div>
<b><span style="color: blue;"> Asyncronoustask.class</span></b></div>
<div>
<b><span style="color: blue;"><br /></span></b></div>
<div>
<div>
public class Asyncronoustask extends Activity {</div>
<div>
/** Called when the activity is first created. */</div>
<div>
@Override</div>
<div>
public void onCreate(Bundle savedInstanceState) {</div>
<div>
super.onCreate(savedInstanceState);</div>
<div>
setContentView(R.layout.example);</div>
<div>
</div>
<div>
</div>
<div>
final Button GetServerData = (Button) findViewById(R.id.btuserver);</div>
<div>
</div>
<div>
GetServerData.setOnClickListener(new OnClickListener() {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onClick(View v) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>String serverURL = "http://www.mobile-tech.in/"; </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>new LongOperation().execute(serverURL);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
});<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
</div>
<div>
}</div>
<div>
</div>
<div>
private class LongOperation extends AsyncTask<String, Void, Void> {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
private final HttpClient Client = new DefaultHttpClient();</div>
<div>
private String Content;</div>
<div>
private String Error = null;</div>
<div>
private ProgressDialog Dialog = new ProgressDialog(Asyncronoustask.this);</div>
<div>
TextView uiUpdate = (TextView) findViewById(R.id.output);</div>
<div>
protected void onPreExecute() {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>uiUpdate.setText("Output : ");</div>
<div>
Dialog.setMessage("Downloading source..");</div>
<div>
Dialog.show();</div>
<div>
}</div>
<div>
<br /></div>
<div>
protected Void doInBackground(String... urls) {</div>
<div>
try {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<div style="display: inline !important;">
HttpGet httpget = new HttpGet(urls[0]);</div>
</div>
<div>
ResponseHandler<String> responseHandler = new BasicResponseHandler();</div>
<div>
Content = Client.execute(httpget, responseHandler);</div>
<div>
</div>
<div>
} catch (ClientProtocolException e) {</div>
<div>
Error = e.getMessage();</div>
<div>
cancel(true);</div>
<div>
} catch (IOException e) {</div>
<div>
Error = e.getMessage();</div>
<div>
cancel(true);</div>
<div>
}</div>
<div>
</div>
<div>
return null;</div>
<div>
}</div>
<div>
</div>
<div>
protected void onPostExecute(Void unused) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
Dialog.dismiss();</div>
<div>
</div>
<div>
if (Error != null) {</div>
<div>
</div>
<div>
uiUpdate.setText("Output : "+Error);</div>
<div>
</div>
<div>
} else {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>uiUpdate.setText("Output : "+Content);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
}</div>
<div>
}</div>
<div>
</div>
<div>
}</div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
<b><br /></b></div>
<div>
<b>Main.xml :</b></div>
<div>
<br /></div>
<div>
<Button </div>
<div>
android:paddingTop="10px"</div>
<div>
android:id="@+id/btuserver" </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>android:text="Get Data Server " </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>android:cursorVisible="true"</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>android:clickable="true"</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>android:layout_width="wrap_content"</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>android:layout_height="wrap_content" </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>android:layout_gravity="center_horizontal"</div>
<div>
/> </div>
<div>
</div>
<div>
<TextView</div>
<div>
android:paddingTop="20px"</div>
<div>
android:id="@+id/output"</div>
<div>
android:layout_width="fill_parent"</div>
<div>
android:layout_height="wrap_content"</div>
<div>
android:text="Data Will Display here" /></div>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
<div>
<b>Out Put :</b></div>
<div>
<b><br /></b></div>
<div>
<b>1. <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_nuC9dP22oFnM8bFkmoIA5QYDrEPKnWnSiFyi8JtHcez3ilJtjmyelqmcJCk7q6hxdD8x5Xx8uvi_tFBUjNA10RxgRzJtxSIFemoieKWYKUw4T3xGPQ9WWhLC_x4Z86lh7RsV5xEFik/s1600/Screenshot_2013-10-25-16-48-05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_nuC9dP22oFnM8bFkmoIA5QYDrEPKnWnSiFyi8JtHcez3ilJtjmyelqmcJCk7q6hxdD8x5Xx8uvi_tFBUjNA10RxgRzJtxSIFemoieKWYKUw4T3xGPQ9WWhLC_x4Z86lh7RsV5xEFik/s320/Screenshot_2013-10-25-16-48-05.png" width="180" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</b></div>
<div>
<b>2 . <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis64DW4jQ7yLT7nFnAphWHgJYhCZUUyJvUOh0CflYPE534DS6T8KWNiLAqY1Osqz6l0X7ARrYWz_4hglk-jC3pLrXRSMNr6_iOURS0gpYq8nCI1a579hML8jybcz5oyhmg0S39vLJ40i0/s1600/Screenshot_2013-10-25-16-48-11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis64DW4jQ7yLT7nFnAphWHgJYhCZUUyJvUOh0CflYPE534DS6T8KWNiLAqY1Osqz6l0X7ARrYWz_4hglk-jC3pLrXRSMNr6_iOURS0gpYq8nCI1a579hML8jybcz5oyhmg0S39vLJ40i0/s320/Screenshot_2013-10-25-16-48-11.png" width="180" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</b></div>
<div>
<b>3 . <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6d-LYZ1qEKtaRbpnxfHrfci1UZ8MHkzPhKBUZIdvWlFVepSg0Q8FwjUOsqePAyUz1NQhsEQohdxE1xS1vSzlNyRY1-FjfxQNoBh1-fNctYFg1sKrpLrFPk-TVeU-bjYvI9Ju-LO78Iak/s1600/Screenshot_2013-10-25-16-49-03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6d-LYZ1qEKtaRbpnxfHrfci1UZ8MHkzPhKBUZIdvWlFVepSg0Q8FwjUOsqePAyUz1NQhsEQohdxE1xS1vSzlNyRY1-FjfxQNoBh1-fNctYFg1sKrpLrFPk-TVeU-bjYvI9Ju-LO78Iak/s320/Screenshot_2013-10-25-16-49-03.png" width="180" /></a></div>
</b></div>
<div>
<b><br /></b></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-42431503091534530052013-10-06T06:36:00.000-07:002013-10-06T06:36:21.994-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 id="#IntentFlagsForTasks" style="font-family: Roboto, sans-serif; font-size: 16px; line-height: 20px; margin: 10px 0px; text-align: center;">
<span style="background-color: white;"><br /></span></h4>
<h2 style="text-align: center;">
<span style="background-color: white;">Using Intent Flags</span></h2>
<div>
<span style="background-color: white;"><br /></span></div>
<div>
<span style="background-color: white;"><span style="font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px;">When starting an activity, you can modify the default association of an activity to its task by including flags in the intent that you deliver to </span><code style="font-size: 13px; line-height: 14px;"><a href="http://developer.android.com/reference/android/app/Activity.html#startActivity(android.content.Intent)" style="text-decoration: none;">startActivity()</a></code><span style="font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px;">. The flags you can use to modify the default behavior are:</span></span></div>
<div>
<span style="background-color: white;"><span style="font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px;"><br /></span></span></div>
<div>
<a href="http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK" style="background-color: white; color: #258aaf; font-family: monospace; font-size: 13px; line-height: 14px; text-decoration: none;">FLAG_ACTIVITY_NEW_TASK</a></div>
<div>
<span style="background-color: white;"><br /></span></div>
<div>
<a href="http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_SINGLE_TOP" style="background-color: white; color: #258aaf; font-family: monospace; font-size: 13px; line-height: 14px; text-decoration: none;">FLAG_ACTIVITY_SINGLE_TOP</a></div>
<div>
<span style="background-color: white;"><br /></span></div>
<div>
<a href="http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP" style="background-color: white; color: #258aaf; font-family: monospace; font-size: 13px; line-height: 14px; text-decoration: none;">FLAG_ACTIVITY_CLEAR_TOP</a></div>
<div>
<span style="background-color: white; color: orange;"><br /></span></div>
<div>
<div>
<br /></div>
<div>
<b>FLAG_ACTIVITY_NEW_TASK</b></div>
<div>
<br /></div>
<div>
Start the activity in a new task. If a task is already running for the activity you are now starting, that task is brought to the foreground with its last state restored and the activity receives the new intent in <span style="color: blue;">onNewIntent().</span></div>
<div>
This produces the same behavior as the <span style="color: #38761d;">"singleTask"</span> launchMode value, discussed in the previous section.</div>
<div>
<br /></div>
<div>
<b><br /></b></div>
<div>
<b>FLAG_ACTIVITY_SINGLE_TOP</b></div>
<div>
<b><br /></b></div>
<div>
If the activity being started is the current activity (at the top of the back stack), then the existing instance receives a call to <span style="color: blue;">onNewIntent()</span>, instead of creating a new instance of the activity.</div>
<div>
This produces the same behavior as the<span style="color: #38761d;"> "singleTop"</span> launchMode value, discussed in the previous section.</div>
<div>
<b><br /></b></div>
<div>
<b><br /></b></div>
<div>
<b>FLAG_ACTIVITY_CLEAR_TOP</b></div>
<div>
<br /></div>
<div>
If the activity being started is already running in the current task, then instead of launching a new instance of that activity, all of the other activities on top of it are destroyed and this intent is delivered to the resumed instance of the activity (now on top), through <span style="color: blue;">onNewIntent()</span>).</div>
<div>
There is no value for the launchMode attribute that produces this behavior.</div>
<div>
<br /></div>
<div>
<span style="color: #274e13;">FLAG_ACTIVITY_CLEAR_TOP</span> is most often used in conjunction with <span style="color: #38761d;">FLAG_ACTIVITY_NEW_TASK</span>. When used together, these flags are a way of locating an existing activity in another task and putting it in a position where it can respond to the intent.</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-87931233933026173912013-08-23T05:26:00.002-07:002013-08-23T05:26:37.923-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<b><span style="color: #b45f06;">READ THE FILE AND IMAGE FROM ASSERT FOLDER :</span></b></h2>
<b>In This code you read the file and Image from Assert folder </b><br />
<br />
<h3 style="text-align: left;">
<b><u>Main.Class File:</u></b></h3>
<b><br /></b>
<b>public void onCreate(Bundle savedInstanceState) {</b><br />
<b><br /></b>
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>setContentView(R.layout.main);</b><br />
<b><br /></b>
<span class="Apple-tab-span" style="white-space: pre;"><b> </b></span><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>TextView readtext = (TextView) findViewById(R.id.readtext);</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView image = (ImageView) findViewById(R.id.image);</b><br />
<span class="Apple-tab-span" style="white-space: pre;"><b> </b></span><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>AssetManager assetManager = getAssets();</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>InputStream input;</b><br />
<b> </b><br />
<b> // To read the text file from assert</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>try {</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>input = assetManager.open("helloworld.txt");</b><br />
<span class="Apple-tab-span" style="white-space: pre;"><b> </b></span><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> int size = input.available();</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> byte[] buffer = new byte[size];</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> input.read(buffer);</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> input.close();</b><br />
<b><br /></b>
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> String text = new String(buffer);</b><br />
<span class="Apple-tab-span" style="white-space: pre;"><b> </b></span><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> readtext.setText(text);</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>} catch (IOException e) {</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>// TODO Auto-generated catch block</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>e.printStackTrace();</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>}</b><br />
<span class="Apple-tab-span" style="white-space: pre;"><b> </b></span><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>// To get the image from assert</b><br />
<b> <span class="Apple-tab-span" style="white-space: pre;"> </span>try {</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>InputStream ims = assetManager.open("android.jpg");</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>Drawable d = Drawable.createFromStream(ims, null);</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>image.setImageDrawable(d);</b><br />
<b> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</b><br />
<b> <span class="Apple-tab-span" style="white-space: pre;"> </span>catch(IOException ex) {</b><br />
<b> <span class="Apple-tab-span" style="white-space: pre;"> </span>return;</b><br />
<b> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</b><br />
<b><span class="Apple-tab-span" style="white-space: pre;"> </span>}</b><br />
<b></b><br />
<b>}</b><br />
<b><br /></b>
<br />
<h3 style="text-align: left;">
<b><u>Main.xml:</u></b></h3>
<b> <LinearLayout</b><br />
<b> android:layout_width="fill_parent"</b><br />
<b> android:layout_height="fill_parent"</b><br />
<b> android:orientation="vertical" ></b><br />
<b><br /></b>
<b> <ImageView</b><br />
<b> android:id="@+id/image"</b><br />
<b> android:layout_width="fill_parent"</b><br />
<b> android:layout_height="wrap_content" /></b><br />
<b><br /></b>
<b> <TextView</b><br />
<b> android:id="@+id/readtext"</b><br />
<b> android:layout_width="fill_parent"</b><br />
<b> android:layout_height="wrap_content" /></b><br />
<b> </LinearLayout></b><br />
<b><br /></b>
<h3 style="text-align: left;">
<u><b><br /></b><b>Screen Short :</b></u></h3>
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiJwhm7YwNUXO5RICRkI5iK85d4MQkAK38TWDqYHTDkIC1nlbdAuGVjWPrvPajEg7M8qRGnAMBPWhS8SrceUY5nPnhEFspPT4LhQS62L8nFLMmxdz2wx9ZEIHMU39FUyWbSuICgdvzVjs/s1600/android.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiJwhm7YwNUXO5RICRkI5iK85d4MQkAK38TWDqYHTDkIC1nlbdAuGVjWPrvPajEg7M8qRGnAMBPWhS8SrceUY5nPnhEFspPT4LhQS62L8nFLMmxdz2wx9ZEIHMU39FUyWbSuICgdvzVjs/s320/android.jpg" width="194" /></a></div>
<br />
<b><span style="color: #b45f06;"><br /></span></b></div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com1tag:blogger.com,1999:blog-8140044794076668443.post-56369484823892974202013-04-25T03:42:00.001-07:002013-04-25T03:42:29.413-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
<span style="color: #3d85c6;">Create Our Own App Lancher</span></h2>
<div>
<span style="color: #3d85c6;"><br />
</span></div>
<div>
Main.xml</div>
<div>
</div>
<div>
<div>
<?xml version="1.0" encoding="utf-8"?></div>
<div>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"</div>
<div>
android:orientation="vertical"</div>
<div>
android:layout_width="fill_parent"</div>
<div>
android:layout_height="fill_parent"</div>
<div>
android:background="@drawable/bg"></div>
<div>
<br /></div>
<div>
<TextView</div>
<div>
android:id="@+id/textView1"</div>
<div>
android:layout_width="wrap_content"</div>
<div>
android:layout_height="wrap_content"</div>
<div>
android:text="Purple App Lancher"</div>
<div>
android:layout_gravity="center"</div>
<div>
android:layout_marginTop="15dp"</div>
<div>
android:textStyle="bold"</div>
<div>
android:textSize="30sp"</div>
<div>
android:textColor="#2E0854" /></div>
<div>
</div>
<div>
<ListView </div>
<div>
android:layout_width="fill_parent"</div>
<div>
android:layout_height="wrap_content"</div>
<div>
android:id="@android:id/list"</div>
<div>
android:layout_marginLeft="200dp"</div>
<div>
android:layout_marginRight="200dp"</div>
<div>
android:layout_marginTop="10dp"</div>
<div>
android:layout_marginBottom="10dp"</div>
<div>
android:background="@drawable/purple"/></div>
<div>
</div>
<div>
</LinearLayout></div>
</div>
<div>
<br />
<br />
row.xml<br />
<br />
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<LinearLayout<br />
xmlns:android="http://schemas.android.com/apk/res/android"<br />
android:layout_width="fill_parent"<br />
android:layout_height="wrap_content"><br />
<br />
<ImageView<br />
android:id="@+id/app_icon"<br />
android:layout_width="48px"<br />
android:layout_height="48px"<br />
android:padding="3px"<br />
android:scaleType="fitXY"/><br />
<br />
<LinearLayout<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"><br />
<br />
<TextView<br />
android:id="@+id/app_name"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:gravity="center_vertical"<br />
android:textColor="#fff"/><br />
<br />
</LinearLayout><br />
</LinearLayout><br />
<br />
<br />
MainActivity:<br />
<br />
<br />
package com.example.applauncher;<br />
<br />
import java.util.ArrayList;<br />
import java.util.List;<br />
<br />
import android.app.AlertDialog;<br />
import android.app.ListActivity;<br />
import android.app.ProgressDialog;<br />
import android.content.ActivityNotFoundException;<br />
import android.content.Context;<br />
import android.content.Intent;<br />
import android.content.pm.ApplicationInfo;<br />
import android.content.pm.PackageManager;<br />
import android.os.AsyncTask;<br />
import android.os.Bundle;<br />
import android.view.LayoutInflater;<br />
import android.view.Menu;<br />
import android.view.MenuInflater;<br />
import android.view.MenuItem;<br />
import android.view.View;<br />
import android.view.ViewGroup;<br />
import android.widget.ArrayAdapter;<br />
import android.widget.ImageView;<br />
import android.widget.ListView;<br />
import android.widget.TextView;<br />
import android.widget.Toast;<br />
<br />
public class AppLauncher extends ListActivity {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PackageManager packageManager = null;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>List<ApplicationInfo> applist = null;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ApplicationAdaptor listadaptor = null;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onCreate(Bundle savedInstanceState) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>setContentView(R.layout.main);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>packageManager = getPackageManager();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>new LoadApplicationTask().execute();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>protected void onListItemClick(ListView l, View v, int position, long id) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onListItemClick(l, v, position, id);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ApplicationInfo app = applist.get(position);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>try {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Intent intent = packageManager<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.getLaunchIntentForPackage(app.packageName);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (null != intent) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>startActivity(intent);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>} catch (ActivityNotFoundException e) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Toast.makeText(AppLauncher.this, e.getMessage(), Toast.LENGTH_LONG)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.show();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>} catch (Exception e) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Toast.makeText(AppLauncher.this, e.getMessage(), Toast.LENGTH_LONG)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.show();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>private List<ApplicationInfo> checkForLaunchIntent(<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>List<ApplicationInfo> list) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ArrayList<ApplicationInfo> applist = new ArrayList<ApplicationInfo>();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>for (ApplicationInfo info : list) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (info.packageName.startsWith("<span style="background-color: yellow;">com.test</span>")) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>try {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (null != packageManager.getLaunchIntentForPackage(info.packageName)) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>applist.add(info);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>} catch (Exception e) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>e.printStackTrace();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return applist;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>private class LoadApplicationTask extends AsyncTask<Void, Void, Void> {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>private ProgressDialog progress = null;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>protected Void doInBackground(Void... params) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>applist = checkForLaunchIntent(packageManager<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.getInstalledApplications(PackageManager.GET_META_DATA));<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>listadaptor = new ApplicationAdaptor(AppLauncher.this,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>R.layout.row, applist);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return null;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>protected void onCancelled() {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCancelled();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>protected void onPostExecute(Void result) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>setListAdapter(listadaptor);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>progress.dismiss();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onPostExecute(result);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>protected void onPreExecute() {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>progress = ProgressDialog.show(AppLauncher.this, null,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>"Loading application info...");<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onPreExecute();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>protected void onProgressUpdate(Void... values) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onProgressUpdate(values);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>private class ApplicationAdaptor extends ArrayAdapter<ApplicationInfo> {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>private List<ApplicationInfo> objects = null;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public ApplicationAdaptor(Context context, int textViewResourceId,<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>List<ApplicationInfo> objects) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super(context, textViewResourceId, objects);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>this.objects = objects;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public int getCount() {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return ((null != objects) ? objects.size() : 0);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public ApplicationInfo getItem(int position) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return ((null != objects) ? objects.get(position) : null);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public long getItemId(int position) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return position;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public View getView(int position, View convertView, ViewGroup parent) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>View view = convertView;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (null == view) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>LayoutInflater vi = (LayoutInflater) AppLauncher.this<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.getSystemService(Context.LAYOUT_INFLATER_SERVICE);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>view = vi.inflate(R.layout.applauncherrow, null);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ApplicationInfo data = objects.get(position);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (null != data) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TextView textName = (TextView) view.findViewById(R.id.app_name);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView iconview = (ImageView) view<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.findViewById(R.id.app_icon);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>textName.setText(data.loadLabel(packageManager) + " ("<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>+ data.packageName + ")");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>iconview.setImageDrawable(data.loadIcon(packageManager));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return view;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>};<br />
}<br />
<br />
<br />
<br />
<span style="color: #cc0000;">in the above text color ,there you can give you own package name</span><br />
<br />
</div>
<div>
<span style="color: #3d85c6;"><br />
</span></div>
<div>
<span style="color: #3d85c6;"><br />
</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-68233744968735882972013-02-10T02:27:00.000-08:002013-02-10T02:27:10.858-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: red; font-size: large;">Android Blink Text :</span><br />
<br />
<br />
<span style="background-color: #f4cccc; color: #4c1130;">Main Activity :</span><br />
<br />
import android.app.Activity;<br />
<br />
import android.os.Bundle;<br />
import android.os.Handler;<br />
import android.view.Menu;<br />
import android.view.View;<br />
import android.view.animation.AlphaAnimation;<br />
import android.view.animation.Animation;<br />
import android.widget.TextView;<br />
<br />
public class MainActivity extends Activity {<br />
<br />
@Override<br />
public void onCreate(Bundle savedInstanceState) {<br />
super.onCreate(savedInstanceState);<br />
setContentView(R.layout.activity_main);<br />
blinkText();<br />
<br />
}<br />
<br />
private void blinkText(){<br />
final Handler handler = new Handler();<br />
new Thread(new Runnable() {<br />
public void run() {<br />
int timeToBlink = 1000; <br />
try{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Thread.sleep(timeToBlink);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}catch (Exception e) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
handler.post(new Runnable() {<br />
public void run() {<br />
TextView txt = (TextView) findViewById(R.id.tv);<br />
if(txt.getVisibility() == View.VISIBLE){<br />
txt.setVisibility(View.INVISIBLE);<br />
}else{<br />
txt.setVisibility(View.VISIBLE);<br />
}<br />
blinkText();<br />
}<br />
});<br />
}}).start();<br />
}<br />
<br />
public void blinkText2(){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TextView myText = (TextView) findViewById(R.id.tv );<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Animation anim = new AlphaAnimation(0.0f, 1.0f);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>anim.setDuration(50);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>anim.setStartOffset(20);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>anim.setRepeatMode(Animation.REVERSE);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>anim.setRepeatCount(Animation.INFINITE);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>myText.startAnimation(anim);<br />
}<br />
<br />
<br />
@Override<br />
public boolean onCreateOptionsMenu(Menu menu) {<br />
getMenuInflater().inflate(R.menu.activity_main, menu);<br />
return true;<br />
}<br />
<br />
<br />
}<br />
<div>
<br /></div>
<div>
<span style="background-color: #f4cccc; color: #4c1130;">main.xlm :</span></div>
<div>
<br /></div>
<div>
<div>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"</div>
<div>
xmlns:tools="http://schemas.android.com/tools"</div>
<div>
android:layout_width="fill_parent"</div>
<div>
android:layout_height="fill_parent" ></div>
<div>
<br /></div>
<div>
<TextView</div>
<div>
android:layout_width="wrap_content"</div>
<div>
android:layout_height="wrap_content"</div>
<div>
android:layout_centerHorizontal="true"</div>
<div>
android:layout_centerVertical="true"</div>
<div>
android:text="@string/hello_world"</div>
<div>
tools:context=".MainActivity"</div>
<div>
android:id="@+id/tv" /></div>
<div>
</div>
<div>
</RelativeLayout></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-54462052169969765892013-02-10T02:08:00.000-08:002013-02-10T02:08:21.819-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="color: red; font-size: large;"><b>Android Blink Animation as LED Bulb :</b></span><br />
<span style="font-size: large;"><br /></span>
<br />
<span style="color: #3d85c6;"> Create a new folder in res as anim--></span><br />
<br />
<span style="background-color: #76a5af; color: #660000;"> tween.xml</span><br />
<br />
<set ><br />
<alpha<br />
xmlns:android="http://schemas.android.com/apk/res/android"<br />
android:fromAlpha="0.0"<br />
android:toAlpha="1.0"<br />
android:duration="100"<br />
android:repeatMode="reverse"<br />
android:repeatCount="infinite" /><br />
</set><br />
<br />
<span style="background-color: #76a5af; color: #660000;">main.xml</span><br />
<br />
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:orientation="vertical"<br />
android:background="#ffffff" ><br />
<br />
<TableRow<br />
android:id="@+id/tableRow1"<br />
android:layout_width="wrap_content"<br />
android:layout_height="wrap_content"<br />
android:paddingLeft="80dp" ><br />
<br />
<FrameLayout<br />
android:id="@+id/rightIcon"<br />
android:layout_width="30.0dip"<br />
android:layout_height="30.0dip" ><br />
<br />
<ImageView<br />
android:id="@+id/bsecond"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_red"<br />
android:visibility="visible" /><br />
<br />
<ImageView<br />
android:id="@+id/afirst"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_yellow"<br />
android:visibility="visible" /><br />
</FrameLayout><br />
<br />
<FrameLayout<br />
android:id="@+id/rightIcon"<br />
android:layout_width="30.0dip"<br />
android:layout_height="30.0dip" ><br />
<br />
<ImageView<br />
android:id="@+id/bfourth"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_green"<br />
android:visibility="visible" /><br />
<br />
<ImageView<br />
android:id="@+id/athird"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_red"<br />
android:visibility="visible" /><br />
</FrameLayout><br />
<br />
<FrameLayout<br />
android:id="@+id/rightIcon"<br />
android:layout_width="30.0dip"<br />
android:layout_height="30.0dip" ><br />
<br />
<ImageView<br />
android:id="@+id/bsix"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_red"<br />
android:visibility="visible" /><br />
<br />
<ImageView<br />
android:id="@+id/afifth"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_green"<br />
android:visibility="visible" /><br />
</FrameLayout><br />
<br />
<FrameLayout<br />
android:id="@+id/rightIcon"<br />
android:layout_width="30.0dip"<br />
android:layout_height="30.0dip" ><br />
<br />
<ImageView<br />
android:id="@+id/bsecond"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_red"<br />
android:visibility="visible" /><br />
<br />
<ImageView<br />
android:id="@+id/cfirst"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_yellow"<br />
android:visibility="visible" /><br />
</FrameLayout><br />
<br />
<FrameLayout<br />
android:id="@+id/rightIcon"<br />
android:layout_width="30.0dip"<br />
android:layout_height="30.0dip"><br />
<br />
<ImageView<br />
android:id="@+id/bsix"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_red"<br />
android:visibility="visible" /><br />
<br />
<ImageView<br />
android:id="@+id/cfifth"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:scaleType="fitXY"<br />
android:src="@drawable/img_green"<br />
android:visibility="visible" /><br />
</FrameLayout><br />
<br />
</TableRow><br />
<br />
</RelativeLayout><br />
<br />
<br />
<span style="background-color: #a2c4c9; color: #660000;">MainActivity</span><br />
<br />
<br />
import android.app.Activity;<br />
import android.os.Bundle;<br />
import android.view.animation.Animation;<br />
import android.view.animation.AnimationUtils;<br />
import android.widget.ImageView;<br />
<br />
public class MainActivity extends Activity {<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onCreate(Bundle savedInstanceState) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>setContentView(R.layout.activity_main);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>animate();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>private void animate() {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView myImageView4 = (ImageView) findViewById(R.id.afirst);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView myImageView5 = (ImageView) findViewById(R.id.athird);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView myImageView6 = (ImageView) findViewById(R.id.afifth);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView myImageView7 = (ImageView) findViewById(R.id.cfirst);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView myImageView9 = (ImageView) findViewById(R.id.cfifth);<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Animation myFadeInAnimation = AnimationUtils.loadAnimation(<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>MainActivity.this, R.anim.tween);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>myImageView4.startAnimation(myFadeInAnimation);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>myImageView5.startAnimation(myFadeInAnimation);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>myImageView6.startAnimation(myFadeInAnimation);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>myImageView7.startAnimation(myFadeInAnimation);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>myImageView9.startAnimation(myFadeInAnimation);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
}<br />
<br />
<span style="color: #660000;">OutPut :</span><br />
<span style="color: #660000;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgqjrxQKmJM_nLmP79I73FQxenMyoXl3HweiwRB8kiRj3J0cjva5j_PUe8z9s47zzmCCAoX3bqGif5tCxUa_SGAO0KboyOPEmSQotI9jQAX7N81XMXbpQS7MpWP_wxxKQfzpnKXpdG3Mc/s1600/red.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgqjrxQKmJM_nLmP79I73FQxenMyoXl3HweiwRB8kiRj3J0cjva5j_PUe8z9s47zzmCCAoX3bqGif5tCxUa_SGAO0KboyOPEmSQotI9jQAX7N81XMXbpQS7MpWP_wxxKQfzpnKXpdG3Mc/s320/red.png" width="192" /></a> <br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiat6wh0hN1UesUVPemEEnhyjst3s1LIiArtPhsv21TOXNGleCPfNH9B6CBz5HDTs3pQkhgLd15zwmH_Th0MUTpMymeV1V9M7h5QdMRi_V_huvBSOyrrhsWEGJ6zVTeOEigUrkjDWOf3NI/s1600/device1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiat6wh0hN1UesUVPemEEnhyjst3s1LIiArtPhsv21TOXNGleCPfNH9B6CBz5HDTs3pQkhgLd15zwmH_Th0MUTpMymeV1V9M7h5QdMRi_V_huvBSOyrrhsWEGJ6zVTeOEigUrkjDWOf3NI/s320/device1.png" width="192" /></a><br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-60502903412353616802013-01-21T09:48:00.000-08:002013-01-21T09:48:21.682-08:00<div dir="ltr" style="text-align: left;" trbidi="on"><b style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;"><span style="font-size: large;"><span style="color: #cc0000;">Android Simple ToggleButton Saving the </span><span style="color: #274e13;">ON/OFF</span><span style="color: #cc0000;"> Example</span></span></span></b><br />
<b style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;"><span style="font-size: large;"><span style="color: #cc0000;"><br />
</span></span></span></b> <b style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;"><span style="font-size: large;"><span style="color: #cc0000;"><br />
</span></span></span></b> <b style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;">I use two Activity ,in first used button in second activity </span></b><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><b>ToggleButton.</b></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><b><br />
</b></span></span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><b>........................Main.Xml..............</b></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><br />
</span></span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"></span><br />
<div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> xmlns:tools="http://schemas.android.com/tools"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_width="match_parent"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_height="match_parent" ></span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><br />
</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> <Button</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:id="@+id/button1"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> style="?android:attr/buttonStyleSmall"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_width="wrap_content"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_height="wrap_content"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_alignParentTop="true"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_alignRight="@+id/textView1"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_marginRight="75dp"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_marginTop="120dp"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:text="Button" /></span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><br />
</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"></RelativeLayout></span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><br />
</span></div><div style="line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><b>...........................Second.xml............</b></span></div><div style="line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><b><br />
</b></span></div><br />
<div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><?xml version="1.0" encoding="utf-8"?></span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_width="match_parent"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_height="match_parent"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:orientation="vertical" ></span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><br />
</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> <ToggleButton</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:id="@+id/toggleButton1"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_width="wrap_content"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:layout_height="wrap_content"</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"> android:text="ToggleButton" /></span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><br />
</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"></LinearLayout></span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><br />
</span></div><div style="font-size: small; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><br />
</span></div><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><b><span style="line-height: 21px;">..............................MainActivity.java.....................</span></b></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><b><span style="line-height: 21px;"><br />
</span></b></span> <br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">import android.app.Activity;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">import android.content.Intent;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">import android.os.Bundle;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">import android.view.Menu;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">import android.view.View;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">import android.view.View.OnClickListener;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">import android.widget.Button;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><br />
</span></span></span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;">public class MainActivity extends Activity {</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Button button;</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><br />
</span></span></span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void onCreate(Bundle savedInstanceState) {</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>setContentView(R.layout.activity_main);</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button = (Button) findViewById(R.id.button1);</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button.setOnClickListener(new OnClickListener() {</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><br />
</span></span></span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void onClick(View v) {</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// TODO Auto-generated method stub</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>startActivity(new Intent(getApplicationContext(), second.class));</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="line-height: 21px;"><span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></span></span><br />
<div style="line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="font-size: x-small;">}</span></span></div><div style="line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><span style="font-size: x-small;"><br />
</span></span></div><div style="line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><b><br />
</b></span></div><div><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif;"><b><span style="line-height: 21px;">.............................</span><span style="line-height: 21px;">second.java........................................</span></b></span></div><br />
<br />
<br />
<b style="font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; line-height: 21px;"><span style="background-color: white;"><span style="color: #cc0000; font-size: x-small;"><br />
</span></span></b> <span style="font-size: x-small;"><br />
</span> <span style="background-color: white; line-height: 21px;"><span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"></span></span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.app.Activity;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.content.SharedPreferences;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.os.Bundle;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.preference.PreferenceManager;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.view.View;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.view.View.OnClickListener;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.widget.Toast;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">import android.widget.ToggleButton;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">public class second extends Activity {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>ToggleButton button;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>SharedPreferences app_preferences;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>SharedPreferences.Editor editor;</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>private static final String TOGGLE = "abc";</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>/** Called when the activity is first created. */</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void onCreate(Bundle savedInstanceState) {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>setContentView(R.layout.second);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button = (ToggleButton) findViewById(R.id.toggleButton1);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>app_preferences = PreferenceManager</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>.getDefaultSharedPreferences(getApplicationContext());</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>editor = app_preferences.edit();</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (app_preferences.getBoolean(TOGGLE, true)) {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button.setChecked(true);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} else {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button.setChecked(false);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// TODO Auto-generated method stub</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button.setOnClickListener(new OnClickListener() {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>public void onClick(View v) {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>// TODO Auto-generated method stub</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if (button.isChecked()) {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button.setChecked(true);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>editor.putBoolean(TOGGLE, true);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>} else {</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>button.setChecked(false);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>editor.putBoolean(TOGGLE, false);</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>editor.commit();</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>});</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span><br />
<span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;"><br />
</span> <span style="font-family: Georgia, Utopia, Palatino Linotype, Palatino, serif; font-size: x-small;">}</span><br />
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-36536133034040406242013-01-21T09:12:00.000-08:002013-01-21T09:12:53.378-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="color: #a64d79; font-size: large;">Android Simple ToggleButton Example</span></b><br />
<b><span style="font-size: large;"><br /></span></b>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;">SOURCE CODE</span><span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"> [main.xml]</span><br />
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><br /></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><?xml version="1.0" encoding="utf-8"?><o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"<o:p style="margin: 0px; padding: 0px;"></o:p></span></span><br />
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:orientation="vertical"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:layout_width="fill_parent"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:layout_height="fill_parent" ><o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<br style="margin: 0px; padding: 0px;" /></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;"><TextView android:layout_width="fill_parent"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:layout_height="wrap_content"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:text="@string/hello" /><o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px;"> </span><o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;"><ToggleButton android:id="@+id/togglebutton"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:layout_width="150px"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:layout_height="50px"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:textOn="ON"<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">android:textOff="OFF" /><o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<br style="margin: 0px; padding: 0px;" /></div>
<span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"></LinearLayout></span><br />
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;">SOURCE CODE</span><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"> [ToggleButtonExample.java] is</span></span></span><br />
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><br /></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">import android.app.Activity;<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">import android.os.Bundle;<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">import android.view.View;<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">import android.view.View.OnClickListener;<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">import android.widget.Toast;<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">import android.widget.ToggleButton;<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">public class ToggleButtonExample extends Activity<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">{<o:p style="margin: 0px; padding: 0px;"></o:p></span></span></span></span><br />
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">ToggleButton tb;<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<br style="margin: 0px; padding: 0px;" /></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">public void onCreate(Bundle savedInstanceState)<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">{<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">super.onCreate(savedInstanceState);<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px;"> </span>setContentView(R.layout.main);<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px;"> </span>tb = (ToggleButton) findViewById(R.id.togglebutton);<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px;"> </span>tb.setOnClickListener(new OnClickListener()<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 0.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">{<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 1in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">public void onClick(View v)<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 1in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">{<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 1.5in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">Toast.makeText(getBaseContext(),<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 2in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">"Button is "+tb.getText().toString(),<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<div style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px 0px 0px 2in; padding: 0px; text-indent: 0.5in;">
<span style="font-family: Calibri, sans-serif; font-size: 11pt; margin: 0px; padding: 0px;">Toast.LENGTH_LONG).show();<o:p style="margin: 0px; padding: 0px;"></o:p></span></div>
<span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px;"> </span>}<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px;"> </span>});<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px;"> </span>}<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;">}<o:p style="margin: 0px; padding: 0px;"></o:p></span><br style="color: #555555; font-family: Georgia, Arial, Tahoma, 'Century gothic', sans-serif; font-size: 12px; margin: 0px; padding: 0px;" /><br />
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 19px;">The </span><span style="color: blue; font-size: 19px; margin: 0px; padding: 0px;">OUTPUT</span></span></span></span></span><br />
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 19px; margin: 0px; padding: 0px;"><br /></span></span></span></span></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHv87vwezv4WBCGG6IrscCL4g8mNar1fAR3MhyrYIs5FU8Kbhqp3Fk8B8eWnmJ73JYSTZuD8llETzEHFZxNe6aiZKUAbMHljOoDcxdfQbLbLYEnM397IupBHG8deE7xzaW1E0moj8VLFE/s1600/togglebutton1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHv87vwezv4WBCGG6IrscCL4g8mNar1fAR3MhyrYIs5FU8Kbhqp3Fk8B8eWnmJ73JYSTZuD8llETzEHFZxNe6aiZKUAbMHljOoDcxdfQbLbLYEnM397IupBHG8deE7xzaW1E0moj8VLFE/s320/togglebutton1.png" width="213" /></a></div>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 19px; margin: 0px; padding: 0px;"><br /></span></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV_ZvxXGmJwWn-R09p-nhlF5XIqaq0-R_Kt0iv8Iuyfzw9QvjOwGjN1yKDc6z3Fj7JY9ZT3IhH1AupOesoJM1JopCuF8mHME-j2-jyy11noqJIzsnaDAz_3RTJJwizT3xxpjiVi9hQs0w/s1600/togglebutton2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV_ZvxXGmJwWn-R09p-nhlF5XIqaq0-R_Kt0iv8Iuyfzw9QvjOwGjN1yKDc6z3Fj7JY9ZT3IhH1AupOesoJM1JopCuF8mHME-j2-jyy11noqJIzsnaDAz_3RTJJwizT3xxpjiVi9hQs0w/s320/togglebutton2.png" width="213" /></a></div>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span>
<span style="color: blue; font-family: Calibri, sans-serif; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><span style="color: blue; font-size: 14pt; margin: 0px; padding: 0px;"><span style="color: #555555; font-size: 11pt; margin: 0px; padding: 0px;"><br /></span></span></span></span></div>
Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-11460822339668181912012-04-21T00:04:00.000-07:002012-04-21T00:04:05.228-07:00Custom Spinners<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span><br />
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span><br />
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span><br />
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">Refer to the exercise "</span><a href="http://android-er.blogspot.com/2009/08/helloandroid-with-spinner.html" style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">HelloAndroid with Spinner</a><span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">", it's a basic spinner with default format to display simple text in the spinner. Current exercise is modified to have custom display with icon in the spinner, actually it is Spinner version of another exercise "</span><a href="http://android-er.blogspot.com/2010/06/listview-with-icon.html" style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">ListView, with icon</a><span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">".</span>
<br />
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span><br />
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span><br />
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span><br />
<span style="background-color: ; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;">-------------------------------------------------------------Code------------------------------------------------------------------------</span><br />
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-align: -webkit-auto;"><br /></span><br />
<span style="background-color: white; text-align: -webkit-auto;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"></span></span><br />
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">package com.kiran;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.app.Activity;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.content.Context;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.os.Bundle;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.view.LayoutInflater;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.view.View;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.view.ViewGroup;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.widget.ArrayAdapter;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.widget.ImageView;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.widget.Spinner;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">import android.widget.TextView;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">public class CustomSpinnerDemoActivity extends Activity {</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>String[] strings = {"CoderzHeaven","Google",</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>"Microsoft", "Apple", "Yahoo","Samsung"};</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>String[] subs = {"Heaven of all working codes ","Google sub",</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>"Microsoft sub", "Apple sub", "Yahoo sub","Samsung sub"};</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>int arr_images[] = { R.drawable.coderzheaven,</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> R.drawable.google, R.drawable.microsoft,</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> R.drawable.apple, R.drawable.yahoo, R.drawable.samsung};</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> @Override</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> public void onCreate(Bundle savedInstanceState) {</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> super.onCreate(savedInstanceState);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> setContentView(R.layout.main);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> Spinner mySpinner = (Spinner)findViewById(R.id.spinner1);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> mySpinner.setAdapter(new MyAdapter(CustomSpinnerDemoActivity.this, R.layout.row, strings));</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> }</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> public class MyAdapter extends ArrayAdapter<String>{</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>public MyAdapter(Context context, int textViewResourceId,<span class="Apple-tab-span" style="white-space: pre;"> </span>String[] objects) {</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>super(context, textViewResourceId, objects);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>public View getDropDownView(int position, View convertView,ViewGroup parent) {</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>return getCustomView(position, convertView, parent);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>public View getView(int position, View convertView, ViewGroup parent) {</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>return getCustomView(position, convertView, parent);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>public View getCustomView(int position, View convertView, ViewGroup parent) {</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>LayoutInflater inflater=getLayoutInflater();</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>View row=inflater.inflate(R.layout.row, parent, false);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>TextView label=(TextView)row.findViewById(R.id.company);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>label.setText(strings[position]);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>TextView sub=(TextView)row.findViewById(R.id.sub);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>sub.setText(subs[position]);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>ImageView icon=(ImageView)row.findViewById(R.id.image);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>icon.setImageResource(arr_images[position]);</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>return row;</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"> }</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;">---------------------------------------------------Main XML-----------------------------------------------------------------------</span></div>
<div style="line-height: 18px;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><br /></span></div>
<br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><?xml version="1.0" encoding="utf-8"?></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_width="fill_parent"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_height="fill_parent"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:orientation="vertical" ></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> <TextView</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_width="fill_parent"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_height="wrap_content"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:text="@string/hello" /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> <Spinner</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:id="@+id/spinner1"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_width="match_parent"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_height="wrap_content" /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"></LinearLayout></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;">-------------------------------------------------------------Row Xml----------------------------------------------------------------</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><?xml version="1.0" encoding="utf-8"?></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_width="fill_parent"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_height="wrap_content"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:orientation="vertical"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:padding="3dip" ></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> <ImageView</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:id="@+id/image"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_width="wrap_content"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_height="wrap_content" /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> <TextView</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:id="@+id/company"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_width="wrap_content"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_height="wrap_content"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_marginLeft="5dip"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_marginTop="2dip"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_toRightOf="@+id/image"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:padding="3dip"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:text="CoderzHeaven"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:textStyle="bold" /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> <TextView</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:id="@+id/sub"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_width="wrap_content"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_height="wrap_content"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_below="@+id/company"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_marginLeft="5dip"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:layout_toRightOf="@+id/image"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:padding="2dip"</span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"> android:text="Heaven of all working codes" /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"></RelativeLayout></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Lp2236n6kCA8KSK8R8Jv9HL5nlNLEKKpxI4vf_f1DHSA9Ttzyhvzr1-EQqkq6vedtIKG8rSNXwaIxKp3j9hW3KrRulV0-LUZxYrng7m11SV5dnb7qdz6P7CgBmU5n6W55mhysQY_fmQ/s1600/device-2012-04-21-122814.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Lp2236n6kCA8KSK8R8Jv9HL5nlNLEKKpxI4vf_f1DHSA9Ttzyhvzr1-EQqkq6vedtIKG8rSNXwaIxKp3j9hW3KrRulV0-LUZxYrng7m11SV5dnb7qdz6P7CgBmU5n6W55mhysQY_fmQ/s320/device-2012-04-21-122814.png" width="192" /></a></span></div>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span><br />
<br />
<br />
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-59426284301100496752012-04-20T23:53:00.000-07:002012-04-20T23:53:19.596-07:00Shared Preferences<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: -webkit-auto;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 14px;">how data can be stored in SQLDB. However, many applications may provide a way to capture user preferences on the settings of a specific application or an activity. For supporting this, Android provides a simple set of APIs. <o:p></o:p></span></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: -webkit-auto;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: x-small;"><span style="font-size: 13px; line-height: 14px;"><br /></span></span></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: -webkit-auto;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 14px;">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). Or it can be something that needs to be stored specific to an activity (which is not discussed here). <o:p></o:p></span></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: -webkit-auto;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: x-small;"><span style="font-size: 13px; line-height: 14px;"><br /></span></span></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: -webkit-auto;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 14px;">The context object lets you retrieve </span><span style="font-family: 'Courier New'; font-size: 10pt; line-height: 14px;">SharedPreferences</span><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 14px;"> through the method</span><span style="font-family: 'Courier New'; font-size: 10pt; line-height: 14px;">Context.getSharedPreferences().</span><span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 14px;"> </span></div>
</div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: -webkit-auto;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 14px;"><br /></span></div>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px; text-align: -webkit-auto;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 10pt; line-height: 14px;"><br /></span></div>
<div>
------------------------------------------CODE------------------------------------------------------</div>
<br />
package com.kiran;<br />
<br />
import android.app.Activity;<br />
import android.content.SharedPreferences;<br />
import android.os.Bundle;<br />
import android.preference.PreferenceManager;<br />
import android.view.View;<br />
import android.view.View.OnClickListener;<br />
import android.widget.Button;<br />
import android.widget.EditText;<br />
import android.widget.TextView;<br />
<br />
public class SharedpreActivity extends Activity {<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Button save, show;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>EditText enter;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>/** Called when the activity is first created. */<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onCreate(Bundle savedInstanceState) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super.onCreate(savedInstanceState);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>setContentView(R.layout.main);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Button save = (Button) findViewById(R.id.button1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Button show = (Button) findViewById(R.id.button2);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
final EditText enter = (EditText) findViewById(R.id.editText1);<br />
<br />
//-----------------------------SAVE---------------------------------------------------------// <br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>save.setOnClickListener(new OnClickListener() {<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onClick(View v) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(SharedpreActivity.this);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SharedPreferences.Editor editor = app_preferences.edit();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>String text = enter.getText().toString();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>editor.putString("key", text);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>editor.commit();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
//----------------------------------SHOW-------------------------------------------------//<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>show.setOnClickListener(new OnClickListener() {<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onClick(View arg0) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TextView textView = (TextView) findViewById(R.id.textView1);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>SharedPreferences app_Preferences = PreferenceManager<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>.getDefaultSharedPreferences(SharedpreActivity.this);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>String text = app_Preferences.getString("key", "null");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>textView.setText(text);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
}<br />
---------------------------------------------XML------------------------------------------------------<br />
<br />
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
android:background="@drawable/back"<br />
android:orientation="vertical" ><br />
<br />
<TextView<br />
android:id="@+id/textView1"<br />
android:layout_width="wrap_content"<br />
android:layout_height="wrap_content"<br />
android:layout_alignParentLeft="true"<br />
android:layout_centerVertical="true"<br />
android:text="TextView" android:textColor="@color/black"/><br />
<br />
<br />
<br />
<Button<br />
android:id="@+id/button2"<br />
android:layout_width="wrap_content"<br />
android:layout_height="wrap_content"<br />
android:layout_alignParentLeft="true"<br />
android:layout_below="@+id/textView1"<br />
android:layout_marginTop="14dp"<br />
android:text="SHOW" /><br />
<br />
<EditText<br />
android:id="@+id/editText1"<br />
android:layout_width="250dp"<br />
android:layout_height="wrap_content"<br />
android:layout_above="@+id/textView1"<br />
android:layout_alignParentLeft="true"<br />
android:layout_marginBottom="43dp" ><br />
<br />
<requestFocus /><br />
</EditText><br />
<br />
<Button<br />
android:id="@+id/button1"<br />
android:layout_width="wrap_content"<br />
android:layout_height="wrap_content"<br />
android:layout_alignParentRight="true"<br />
android:layout_alignTop="@+id/editText1"<br />
android:text="SAVE" /><br />
<br />
<br />
<br />
<LinearLayout<br />
android:id="@+id/linearLayout1"<br />
android:layout_width="wrap_content"<br />
android:layout_height="wrap_content"<br />
android:layout_above="@+id/editText1"<br />
android:layout_alignParentLeft="true"<br />
android:layout_alignParentRight="true"<br />
android:layout_alignParentTop="true"<br />
android:background="@drawable/fish"<br />
android:orientation="vertical" ><br />
<br />
</LinearLayout><br />
<br />
</RelativeLayout><br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-1698132192832569892012-02-18T03:49:00.000-08:002012-02-18T03:49:04.677-08:00ANDROID INTERVIEW QUESTIONS AND ANSWERS<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<b><span style="font-family: Arimo, serif; font-size: 11.5pt;">How do you declare 4 components of android in
mainfestfile?</span></b><span style="font-family: Arimo, serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><activity><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><service><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><receiver><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><provider><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<b><span style="font-family: Arimo, serif; font-size: 11.5pt;">What are intent filters?</span></b><span style="font-family: Arimo, serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Intents filter are used to register activity, services,
broadcast receiver as being capable of performing an action on a particular
kind of action.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<b><span style="font-family: Arimo, serif; font-size: 11.5pt;">How many ways data stored in android?</span></b><span style="font-family: Arimo, serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Shared preferences<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Internal storage<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">External storage<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Sqlite database<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Network connetion<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<b><span style="font-family: Arimo, serif; font-size: 11.5pt;">User interface types?</span></b><span style="font-family: Arimo, serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Views<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Notifications<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<b><span style="font-family: Arimo, serif; font-size: 11.5pt;">Types of notification in android?</span></b><span style="font-family: Arimo, serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Tost notification<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Status bar notification<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Dialog notification<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<b><span style="font-family: Arimo, serif; font-size: 11.5pt;">How do you find any view element into your
program?</span></b><span style="font-family: Arimo, serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Findviewbyid<o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<b><span style="font-family: Arimo, serif; font-size: 11.5pt;">What is handler class do in android?</span></b><span style="font-family: Arimo, serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: ; line-height: 15.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;">
<span style="color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Handler allows yo to send and process message and runnable
objects associated with a thread’s message queue.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<b><span style="background: ; color: #212426; font-family: "Arimo","serif"; font-size: 11.5pt;"><br />
</span><span style="background-attachment: initial; background-clip: initial; background-color: ; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial;">Describe
the APK format.</span><span style="color: #38761d;"> </span></b><span style="background: ; color: #212426;"><br />
The APK file is compressed the AndroidManifest.xml file, application code (.dex
files), resource files, and other files. A project is compiled into a single
.apk file.</span><span style="color: #212426;"> <span style="background: ;"><br />
<br />
</span></span><b><span style="background-attachment: initial; background-clip: initial; background-color: ; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial;">What
is an action?</span></b><span style="color: #38761d;"> </span><span style="background: ; color: #212426;"><br />
The Intent Sender desires something or doing some task</span><span style="color: #212426;"> <span style="background: ;"><br />
<br />
<b>What is activity?</b></span> <span style="background: ;"><br />
A single screen in an application, with supporting Java code.</span> <span style="background: ;"><br />
<br />
<b>What is intent in Android?</b></span> <span style="background: ;"><br />
A class (Intent) will describes what a caller desires to do. The caller will
send this intent to Android's intent resolver, which finds the most suitable
activity for the intent. E.g. opening a PDF document is an intent, and the
Adobe Reader apps will be the perfect activity for that intent(class).</span> <span style="background: ;"><br />
<br />
<b>What is a Sticky Intent?</b></span> <span style="background: ;"><br />
sendStickyBroadcast() performs a sendBroadcast (Intent) known as sticky, i.e.
the Intent you are sending stays around after the broadcast is complete, so
that others can quickly retrieve that data through the return value of
registerReceiver (BroadcastReceiver, IntentFilter). In all other ways, this
behaves the same as sendBroadcast(Intent).</span> <span style="background: ;"><br />
<br />
<b>Example for sticky broadcast</b></span> <span style="background: ;"><br />
When you call registerReceiver() for that action -- even with a null
BroadcastReceiver -- you get the Intent that was last broadcast for that
action. Hence, you can use this to find the state of the battery without
necessarily registering for all future state changes in the battery.</span> <span style="background: ;"><br />
<br />
<b>How the nine-patch Image different from a regular bitmap? or Different
between nine-patch Image vs regular Bitmap Image</b></span> <span style="background: ;"><br />
It is one of a resizable bitmap resource which is being used as backgrounds or
other images on the device. The NinePatch class allows drawing a bitmap in nine
sections. The four corners are unscaled; the middle of the image is scaled in
both axes, the four edges are scaled into one axis.</span> <span style="background: ;"><br />
<br />
<b>What Programming languages does Android support for application development?</b></span> <span style="background: ;"><br />
Android applications supports using Java Programming Language. which is coded
in Java and complied using Android SDK.</span> <span style="background: ;"><br />
<br />
<b>What is a resource?</b></span> <span style="background: ;"><br />
A user defined JSON, XML, bitmap, or other file, injected into the application
build process, which can later be loaded from code.</span> <span style="background: ;"><br />
<br />
<b>How will you record a phone call in Android? or How to handle on Audio
Stream for a call in Android?</b></span> <span style="background: ;"><br />
Permissions.PROCESS_OUTGOING_CALLS: Will Allows an application to monitor,
modify, or abort outgoing calls. So through that we can monitor the Phone
calls.</span> <span style="background: ;"><br />
<br />
<b>What's the difference between class, file and activity in android?</b></span> <span style="background: ;"><br />
Class - The Class file is complied from .java file. Android will use this
.class file to produce the executable apk.</span> <span style="background: ;"><br />
File - It is a block of resources, srbitrary information. It can be any file
type.</span> <span style="background: ;"><br />
Activity - An activity is the equivalent of a Frame/Window in GUI toolkits. It
is not a file or a file type it is just a class that can be extended in Android
for loading UI elements on view.</span> <span style="background: ;"><br />
<br />
<b>Does Android support the Bluetooth serial port profile?</b></span> <span style="background: ;"><br />
A. Yes.</span> <span style="background: ;"><br />
<br />
<br />
<br />
<b>Can an application be started on powerup?</b></span> <span style="background: ;"><br />
A. Yes.</span> <span style="background: ;"><br />
<br />
<b>What is APK format.</b></span> <span style="background: ;"><br />
The APK file is compressed AndroidManifest.xml file with extension .apk, Which
have application code (.dex files), resource files, and other files which is
compressed into single .apk file.</span> <span style="background: ;"><br />
<br />
<b>How to Translate in android</b></span> <span style="background: ;"><br />
The Google translator translates the data of one language into another language
by using XMPP to transmit data. You can type the message in English and select
the language which is understood by the citizens of the country in order to
reach the message to the citizens.</span> <span style="background: ;"><br />
<br />
<b>What is an action?</b></span> <span style="background: ;"><br />
A description of something that an Intent sender desires.</span> <span style="background: ;"><br />
<br />
<b>What are the advantages of Android?</b></span> <span style="background: ;"><br />
The following are the advantages of Android:</span> <span style="background: ;"><br />
<br />
* The customer will be benefited from wide range of mobile applications to
choose, since the monopoly of wireless carriers like Orange and AT&T will
be broken by Google Android.</span> <span style="background: ;"><br />
* Features like weather details, live RSS feeds, opening screen, icon on the
opening screen can be customized</span> <span style="background: ;"><br />
* Innovative products like the location-aware services, location of a nearby
convenience store etc., are some of the additive facilities in Android.</span></span><strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"><o:p></o:p></span></strong></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<br /></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Introduction Android:</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Android is
an operating system for mobile devices that includes middleware and key
applications, and uses a modified version of the Linux kernel. It was initially
developed by Android Inc..It allows developers to write managed code in the
Java language, controlling the device via Google-developed Java libraries…..<br />
The Android SDK includes a comprehensive set of development tools . These
include a debugger, libraries, a handset emulator (based on QEMU),
documentation, sample code, and tutorials. Currently supported development
platforms include x86-architecture computers running Linux (any modern desktop
Linux distribution), Mac OS X 10.4.8 or later, Windows XP or Vista.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Android
does not use established Java standards, i.e. Java SE and ME. This prevents
compatibility among Java applications written for those platforms and those for
the Android platform. Android only reuses the Java language syntax, but does
not provide the full-class libraries and APIs bundled with Java SE or ME<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is android?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android is a stack of software for mobile devices which has Operating System,
middleware and some key applications. The application executes within its own
process and its own instance of Dalvik Virtual Machine. Many Virtual Machines
run efficiently by a DVM device. DVM executes Java language?s byte code which
later transforms into .dex format files.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What are the advantages of Android?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The following are the advantages of Android:<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">* The
customer will be benefited from wide range of mobile applications to choose,
since the monopoly of wireless carriers like AT&T and Orange will be broken
by Google Android.<br />
* Features like weather details, live RSS feeds, opening screen, icon on the
opening screen can be customized<br />
* Innovative products like the location-aware services, location of a nearby
convenience store etc., are some of the additive facilities in Android.<br />
Components can be reused and replaced by the application framework.<br />
*Optimized DVM for mobile devices<br />
*SQLite enables to store the data in a structured manner.<br />
*Supports GSM telephone and Bluetooth, WiFi, 3G and EDGE technologies<br />
*The development is a combination of a device emulator, debugging tools, memory
profiling and plug-in for Eclipse IDE.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Features of Android</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Application framework enabling reuse and
replacement of components</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Dalvik virtual machine optimized for
mobile devices</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Integrated browser based on the open
source WebKit engine</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Optimized graphics powered by a custom
2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification
(hardware acceleration optional)</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
SQLite for structured data storage</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Media support for common audio, video,
and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
GSM Telephony (hardware dependent)</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Bluetooth, EDGE, 3G, and WiFi (hardware
dependent)</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Camera, GPS, compass, and accelerometer
(hardware dependent)</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Rich development environment including a
device emulator, tools for debugging, memory and performance profiling, and a
plugin for the Eclipse IDE.</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Explain about the exceptions of Android?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">The
following are the exceptions that are supported by Android<br />
* InflateException : When an error conditions are occurred, this exception is
thrown<br />
* Surface.OutOfResourceException: When a surface is not created or resized,
this exception is thrown<br />
* SurfaceHolder.BadSurfaceTypeException: This exception is thrown from the
lockCanvas() method, when invoked on a Surface whose is
SURFACE_TYPE_PUSH_BUFFERS<br />
* WindowManager.BadTokenException: This exception is thrown at the time of
trying to add view an invalid WindowManager.LayoutParamstoken.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Describe the APK format.</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The APK file is compressed the AndroidManifest.xml file, application code (.dex
files), resource files, and other files. A project is compiled into a single
.apk file.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is .apk extension?</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The extension for an Android package file, which typically contains all of the
files related to a single Android application. The file itself is a compressed
collection of an AndroidManifest.xml file, application code (.dex files),
resource files, and other files. A project is compiled into a single .apk file.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is .dex extension</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android programs are compiled into .dex (Dalvik Executable) files, which are in
turn zipped into a single .apk file on the device. .dex files can be created by
automatically translating compiled applications written in the Java programming
language<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an adb ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android Debug Bridge, a command-line debugging application shipped with the
SDK. It provides tools to browse the device, copy tools on the device, and forward
ports for debugging.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an Application ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A collection of one or more activities, services, listeners, and intent
receivers. An application has a single manifest, and is compiled into a single
.apk file on the device.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Content Provider ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A class built on ContentProvider that handles content query strings of a
specific format to return data in a specific format. See Reading and writing
data to a content provider for information on using content providers.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Dalvik ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The name of Android’s virtual machine. The Dalvik VM is an interpreter-only
virtual machine that executes files in the Dalvik Executable (.dex) format, a
format that is optimized for efficient storage and memory-mappable execution.
The virtual machine is register-based, and it can run classes compiled by a
Java language compiler that have been transformed into its native format using
the included “dx” tool. The VM runs on top of Posix-compliant operating
systems, which it relies on for underlying functionality (such as threading and
low level memory management). The Dalvik core class library is intended to
provide a familiar development base for those used to programming with Java
Standard Edition, but it is geared specifically to the needs of a small mobile
device.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an DDMS</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Dalvik Debug Monitor Service, a GUI debugging application shipped with the SDK.
It provides screen capture, log dump, and process examination capabilities.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is Drawable?</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A compiled visual resource that can be used as a background, title, or other
part of the screen. It is compiled into an android.graphics.drawable subclass.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an Intent?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A class (Intent) that contains several fields describing what a caller would
like to do. The caller sends this intent to Android’s intent resolver, which
looks through the intent filters of all applications to find the activity most
suited to handle this intent. Intent fields include the desired action, a
category, a data string, the MIME type of the data, a handling class, and other
restrictions.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an Intent Filter ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Activities and intent receivers include one or more filters in their manifest
to describe what kinds of intents or messages they can handle or want to
receive. An intent filter lists a set of requirements, such as data type,
action requested, and URI format, that the Intent or message must fulfill. For
Activities, Android searches for the Activity with the most closely matching
valid match between the Intent and the activity filter. For messages, Android
will forward a message to all receivers with matching intent filters.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an Intent Receiver?</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
An application class that listens for messages broadcast by calling
Context.broadcastIntent<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Layout resource?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
An XML file that describes the layout of an Activity screen.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Manifest ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
An XML file associated with each Application that describes the various
activies, intent filters, services, and other items that it exposes.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Resource</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A user-supplied XML, bitmap, or other file, entered into an application build
process, which can later be loaded from code. Android can accept resources of
many types; see Resources for a full description. Application-defined resources
should be stored in the res/ subfolders.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Service ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A class that runs in the background to perform various persistent actions, such
as playing music or monitoring network activity.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Theme ?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A set of properties (text size, background color, and so on) bundled together
to define various default display settings. Android provides a few standard
themes, listed in R.style (starting with “Theme_”).<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an URIs?</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android uses URI strings both for requesting data (e.g., a list of contacts)
and for requesting actions (e.g., opening a Web page in a browser). Both are
valid URI strings, but have different values. All requests for data must start
with the string “content://”. Action strings are valid URIs that can be handled
appropriately by applications on the device; for example, a URI starting with
“http://” will be handled by the browser.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Can I write code for Android using C/C++?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Yes, but need to use NDK<br />
Android applications are written using the Java programming language. Android
includes a set of core libraries that provides most of the functionality
available in the core libraries of the Java programming language.<br />
Every Android application runs in its own process, with its own instance of the
Dalvik virtual machine. Dalvik has been written so that a device can run
multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable
(.dex) format which is optimized for minimal memory footprint. The VM is
register-based, and runs classes compiled by a Java language compiler that have
been transformed into the .dex format by the included “dx” tool.<br />
Android only supports applications written using the Java programming language
at this time.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is an action?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A description of something that an Intent sender desires.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is activity?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A single screen in an application, with supporting Java code.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is intent?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A class (Intent) describes what a caller desires to do. The caller sends this
intent to Android’s intent resolver, which finds the most suitable activity for
the intent. E.g. opening a PDF file is an intent, and the Adobe Reader is the
suitable activity for this intent.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How is nine-patch image different from a
regular bitmap?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
It is a resizable bitmap resource that can be used for backgrounds or other
images on the device. The NinePatch class permits drawing a bitmap in nine
sections. The four corners are unscaled; the four edges are scaled in one axis,
and the middle is scaled in both axes.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What languages does Android support for
application development?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android applications are written using the Java programming language.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a resource?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A user-supplied XML, bitmap, or other file, injected into the application build
process, which can later be loaded from code.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How will you record a phone call in Android?
How to get a handle on Audio Stream for a call in Android?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Permissions.PROCESS_OUTGOING_CALLS: Allows an application to monitor, modify,
or abort outgoing calls.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What’s the difference between file, class and
activity in android?</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
File – It is a block of arbitrary information, or resource for storing
information. It can be of any type.<br />
Class – Its a compiled form of .Java file . Android finally used this .class
files to produce an executable apk<br />
Activity – An activity is the equivalent of a Frame/Window in GUI toolkits. It
is not a file or a file type it is just a class that can be extended in Android
for loading UI elements on view.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is a Sticky Intent?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
sendStickyBroadcast() performs a sendBroadcast (Intent) that is “sticky,” i.e.
the Intent you are sending stays around after the broadcast is complete, so
that others can quickly retrieve that data through the return value of registerReceiver
(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as
sendBroadcast(Intent).<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">One
example of a sticky broadcast sent via the operating system is
ACTION_BATTERY_CHANGED. When you call registerReceiver() for that action — even
with a null BroadcastReceiver — you get the Intent that was last broadcast for
that action. Hence, you can use this to find the state of the battery without
necessarily registering for all future state changes in the battery.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Does Android support the Bluetooth serial port
profile?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Yes.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Can an application be started on powerup?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Yes.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How to Remove Desktop icons and Widgets</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
A. Press and Hold the icon or widget. The phone will vibrate and on the bottom
of the phone you will see anoption to remove. While still holding the icon or
widget drag it to the remove button. Once remove turns red drop the item and it
is gone<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Describe a real time scenario where android
can be used?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Imagine a situation that you are in a country where no one understands the
language you speak and you can not read or write. However, you have mobile
phone with you.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">With a
mobile phone with android, the Google translator translates the data of one
language into another language by using XMPP to transmit data. You can type the
message in English and select the language which is understood by the citizens
of the country in order to reach the message to the citizens.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How to select more than one option from list
in android xml file?</span></strong><span class="apple-converted-space"><b><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;"> </span></b></span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Give an example.<br />
Specify android id, layout height and width as depicted in the following
example.<o:p></o:p></span></div>
<div style="background: white; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What languages does Android support for
application development?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android applications are written using the Java programming language.<o:p></o:p></span></div>
<div style="background: white; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Describe Android Application Architecture.</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android Application Architecture has the following components:<br />
• Services – like Network Operation<br />
• Intent – To perform inter-communication between activities or services<br />
• Resource Externalization – such as strings and graphics<br />
• Notification signaling users – light, sound, icon, notification, dialog etc.<br />
• Content Providers – They share data between applications<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Common Tricky questions</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Remember that the GUI layer doesn’t
request data directly from the web; data is always loaded from a local
database.</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The service layer periodically updates
the local database.</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
What is the risk in blocking the Main
thread when performing a lengthy operation such as web access or heavy
computation? Application_Not_Responding exception will be thrown which will
crash and restart the application.</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Why is List View not recommended to have
active components? Clicking on the active text box will pop up the software
keyboard but this will resize the list, removing focus from the clicked
element.</span><span style="color: #333333; font-family: Symbol; font-size: 10.5pt; mso-ascii-font-family: Georgia; mso-char-type: symbol; mso-hansi-font-family: Georgia; mso-symbol-font-family: Symbol;">§</span><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Open Source</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
</span><strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is the Android Open Source Project?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
We use the phrase “Android Open Source Project” or “AOSP” to refer to the
people, the processes, and the source code that make up Android.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">The people
oversee the project and develop the actual source code. The processes refer to
the tools and procedures we use to manage the development of the software. The
net result is the source code that you can use to build cell phone and other
devices.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Why did we open the Android source code?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Google started the Android project in response to our own experiences launching
mobile apps. We wanted to make sure that there would always be an open platform
available for carriers, OEMs, and developers to use to make their innovative
ideas a reality. We also wanted to make sure that there was no central point of
failure, so that no single industry player could restrict or control the
innovations of any other. The single most important goal of the Android
Open-Source Project (AOSP) is to make sure that the open-source Android
software is implemented as widely and compatibly as possible, to everyone’s
benefit.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">You can
find more information on this topic at our Project Philosophy page.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What kind of open-source project is Android?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Google oversees the development of the core Android open-source platform, and
works to create robust developer and user communities. For the most part the
Android source code is licensed under the permissive Apache Software License
2.0, rather than a “copyleft” license. The main reason for this is because our
most important goal is widespread adoption of the software, and we believe that
the ASL2.0 license best achieves that goal.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">You can
find more information on this topic at our Project Philosophy and Licensing
pages.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Why is Google in charge of Android?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Launching a software platform is complex. Openness is vital to the long-term
success of a platform, since openness is required to attract investment from
developers and ensure a level playing field. However, the platform itself must
also be a compelling product to end users.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">That’s why
Google has committed the professional engineering resources necessary to ensure
that Android is a fully competitive software platform. Google treats the
Android project as a full-scale product development operation, and strikes the
business deals necessary to make sure that great devices running Android
actually make it to market.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">By making
sure that Android is a success with end users, we help ensure the vitality of
Android as a platform, and as an open-source project. After all, who wants the
source code to an unsuccessful product?<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Google’s goal
is to ensure a successful ecosystem around Android, but no one is required to
participate, of course. We opened the Android source code so anyone can modify
and distribute the software to meet their own needs.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is Google’s overall strategy for Android
product development?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
We focus on releasing great devices into a competitive marketplace, and then
incorporate the innovations and enhancements we made into the core platform, as
the next version.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">In
practice, this means that the Android engineering team typically focuses on a
small number of “flagship” devices, and develops the next version of the
Android software to support those product launches. These flagship devices
absorb much of the product risk and blaze a trail for the broad OEM community,
who follow up with many more devices that take advantage of the new features.
In this way, we make sure that the Android platform evolves according to the
actual needs of real-world devices.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How is the Android software developed?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Each platform version of Android (such as 1.5, 1.6, and so on) has a
corresponding branch in the open-source tree. At any given moment, the most
recent such branch will be considered the “current stable” branch version. This
current stable branch is the one that manufacturers port to their devices. This
branch is kept suitable for release at all times.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Simultaneously,
there is also a “current experimental” branch, which is where speculative
contributions, such as large next-generation features, are developed. Bug fixes
and other contributions can be included in the current stable branch from the
experimental branch as appropriate.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Finally,
Google works on the next version of the Android platform in tandem with
developing a flagship device. This branch pulls in changes from the experimental
and stable branches as appropriate.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">You can
find more information on this topic at our Branches and Releases.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Why are parts of Android developed in private?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
It typically takes over a year to bring a device to market, but of course
device manufacturers want to ship the latest software they can. Developers,
meanwhile, don’t want to have to constantly track new versions of the platform
when writing apps. Both groups experience a tension between shipping products,
and not wanting to fall behind.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">To address
this, some parts of the next version of Android including the core platform
APIs are developed in a private branch. These APIs constitute the next version
of Android. Our aim is to focus attention on the current stable version of the
Android source code, while we create the next version of the platform as driven
by flagship Android devices. This allows developers and OEMs to focus on a
single version without having to track unfinished future work just to keep up.
Other parts of the Android system that aren’t related to application
compatibility are developed in the open, however. It’s our intention to move
more of these parts to open development over time.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">When are source code releases made?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
When they are ready. Some parts of Android are developed in the open, so that
source code is always available. Other parts are developed first in a private
tree, and that source code is released when the next platform version is ready.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">In some
releases, core platform APIs will be ready far enough in advance that we can push
the source code out for an early look in advance of the device’s release;
however in others, this isn’t possible. In all cases, we release the platform
source when we feel the version has stabilized enough, and when the development
process permits. Releasing the source code is a fairly complex process.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is involved in releasing the source code
for a new Android version?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Releasing the source code for a new version of the Android platform is a
significant process. First, the software gets built into a system image for a
device, and put through various forms of certification, including government
regulatory certification for the regions the phones will be deployed. It also
goes through operator testing. This is an important phase of the process, since
it helps shake out a lot of software bugs.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Once the
release is approved by the regulators and operators, the manufacturer begins
mass producing devices, and we turn to releasing the source code.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Simultaneous
to mass production the Google team kicks off several efforts to prepare the
open source release. These efforts include final API changes and documentation
(to reflect any changes that were made during qualification testing, for
example), preparing an SDK for the new version, and launching the platform compatibility
information.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Also
included is a final legal sign-off to release the code into open source. Just
as open source contributors are required to sign a Contributors License
Agreement attesting to their IP ownership of their contribution, Google too must
verify that it is clear to make contributions.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Starting
at the time mass production begins, the software release process usually takes
around a month, which often roughly places source code releases around the same
time that the devices reach users.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How does the AOSP relate to the Android
Compatibility Program?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The Android Open-Source Project maintains the Android software, and develops
new versions. Since it’s open-source, this software can be used for any
purpose, including to ship devices that are not compatible with other devices
based on the same source.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">The
function of the Android Compatibility Program is to define a baseline
implementation of Android that is compatible with third-party apps written by
developers. Devices that are “Android compatible” may participate in the
Android ecosystem, including Android Market; devices that don’t meet the
compatibility requirements exist outside that ecosystem.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">In other
words, the Android Compatibility Program is how we separate “Android compatible
devices” from devices that merely run derivatives of the source code. We
welcome all uses of the Android source code, but only Android compatible
devices — as defined and tested by the Android Compatibility Program — may
participate in the Android ecosystem.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How can I contribute to Android?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
There are a number of ways you can contribute to Android. You can report bugs,
write apps for Android, or contribute source code to the Android Open-Source
Project.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">There are
some limits on the kinds of code contributions we are willing or able to
accept. For instance, someone might want to contribute an alternative
application API, such as a full C++-based environment. We would decline that
contribution, since Android is focused on applications that run in the Dalvik
VM. Alternatively, we won’t accept contributions such as GPL or LGPL libraries
that are incompatible with our licensing goals.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">We
encourage those interested in contributing source code to contact us via the
AOSP Community page prior to beginning any work. You can find more information
on this topic at the Getting Involved page.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How do I become an Android committer?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The Android Open Source Project doesn’t really have a notion of a “committer”.
All contributions — including those authored by Google employees — go through a
web-based system known as “gerrit” that’s part of the Android engineering
process. This system works in tandem with the git source code management system
to cleanly manage source code contributions.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Once
submitted, changes need to be accepted by a designated Approver. Approvers are
typically Google employees, but the same approvers are responsible for all
submissions, regardless of origin.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">You can
find more information on this topic at the Submitting Patches page.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Compatibility</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
</span><strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What does “compatibility” mean?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
We define an “Android compatible” device as one that can run any application
written by third-party developers using the Android SDK and NDK. We use this as
a filter to separate devices that can participate in the Android app ecosystem,
and those that cannot. Devices that are properly compatible can seek approval
to use the Android trademark. Devices that are not compatible are merely
derived from the Android source code and may not use the Android trademark.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">In other
words, compatibility is a prerequisite to participate in the Android apps
ecosystem. Anyone is welcome to use the Android source code, but if the device
isn’t compatible, it’s not considered part of the Android ecosystem.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is the role of Android Market in
compatibility?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Devices that are Android compatible may seek to license the Android Market
client software. This allows them to become part of the Android app ecosystem,
by allowing users to download developers’ apps from a catalog shared by all
compatible devices. This option isn’t available to devices that aren’t
compatible.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">What kinds
of devices can be Android compatible?<br />
The Android software can be ported to a lot of different kinds of devices,
including some on which third-party apps won’t run properly. The Android
Compatibility Definition Document (CDD) spells out the specific device
configurations that will be considered compatible.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">For
example, though the Android source code could be ported to run on a phone that
doesn’t have a camera, the CDD requires that in order to be compatible, all
phones must have a camera. This allows developers to rely on a consistent set
of capabilities when writing their apps.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">The CDD
will evolve over time to reflect market realities. For instance, the 1.6 CDD
only allows cell phones, but the 2.1 CDD allows devices to omit telephony
hardware, allowing for non-phone devices such as tablet-style music players to
be compatible. As we make these changes, we will also augment Android Market to
allow developers to retain control over where their apps are available. To
continue the telephony example, an app that manages SMS text messages would not
be useful on a media player, so Android Market allows the developer to restrict
that app exclusively to phone devices.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">If my
device is compatible, does it automatically have access to Android Market and
branding?<br />
Android Market is a service operated by Google. Achieving compatibility is a
prerequisite for obtaining access to the Android Market software and branding.
Device manufacturers should contact Google to obtain access to Android Market.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">If I am not a manufacturer, how can I get
Android Market?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Android Market is only licensed to handset manufacturers shipping devices. For
questions about specific cases, contact android-partnerships@google.com.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How can I get access to the Google apps for
Android, such as Maps?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The Google apps for Android, such as YouTube, Google Maps and Navigation,
Gmail, and so on are Google properties that are not part of Android, and are
licensed separately. Contact android-partnerships@google.com for inquiries
related to those apps.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Is compatibility mandatory?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
No. The Android Compatibility Program is optional. Since the Android source
code is open, anyone can use it to build any kind of device. However, if a
manufacturer wishes to use the Android name with their product, or wants access
to Android Market, they must first demonstrate that the device is compatible.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How much does compatibility certification
cost?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
There is no cost to obtain Android compatibility for a device. The
Compatibility Test Suite is open-source and available to anyone to use to test
a device.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How long does compatibility take?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The process is automated. The Compatibility Test Suite generates a report that
can be provided to Google to verify compatibility. Eventually we intend to provide
self-service tools to upload these reports to a public database.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Who determines what will be part of the
compatibility definition?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Since Google is responsible for the overall direction of Android as a platform
and product, Google maintains the Compatibility Definition Document for each
release. We draft the CDD for a new Android version in consultation with a
number of OEMs, who provide input on its contents.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How long will each Android version be
supported for new devices?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Since Android’s code is open-source, we can’t prevent someone from using an old
version to launch a device. Instead, Google chooses not to license the Android
Market client software for use on versions that are considered obsolete. This
allows anyone to continue to ship old versions of Android, but those devices
won’t use the Android name and will exist outside the Android apps ecosystem,
just as if they were non-compatible.<o:p></o:p></span></div>
<div style="background: white; line-height: 17.25pt; margin-bottom: 20.4pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm; vertical-align: baseline;">
<span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;">Can a
device have a different user interface and still be compatible?<br />
The Android Compatibility Program focuses on whether a device can run
third-party applications. The user interface components shipped with a device
(such as home screen, dialer, color scheme, and so on) does not generally have
much effect on third-party apps. As such, device builders are free to customize
the user interface as much as they like. The Compatibility Definition Document
does restrict the degree to which OEMs may alter the system user interface for
areas that do impact third-party apps.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">When are compatibility definitions released
for new Android versions?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Our goal is to release new versions of Android Compatibility Definition
Documents (CDDs) once the corresponding Android platform version has converged
enough to permit it. While we can’t release a final draft of a CDD for an
Android software version before the first flagship device ships with that
software, final CDDs will always be released after the first device. However,
wherever practical we will make draft versions of CDDs available.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How are device manufacturers’ compatibility
claims validated?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
There is no validation process for Android device compatibility. However, if
the device is to include Android Market, Google will typically validate the
device for compatibility before agreeing to license the Market client software.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What happens if a device that claims
compatibility is later found to have compatibility problems?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Typically, Google’s relationships with Android Market licensees allow us to ask
them to release updated system images that fix the problems.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Compatibility Test Suite</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
</span><strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What is the purpose of the CTS?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The Compatibility Test Suite is a tool used by device manufacturers to help
ensure their devices are compatible, and to report test results for
validations. The CTS is intended to be run frequently by OEMs throughout the
engineering process to catch compatibility issues early.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">What kinds of things does the CTS test?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The CTS currently tests that all of the supported Android strong-typed APIs are
present and behave correctly. It also tests other non-API system behaviors such
as application lifecycle and performance. We plan to add support in future CTS
versions to test “soft” APIs such as Intents as well.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Will the CTS reports be made public?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Yes. While not currently implemented, Google intends to provide web-based
self-service tools for OEMs to publish CTS reports so that they can be viewed
by anyone. CTS reports can be shared as widely as manufacturers prefer.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">How is the CTS licensed?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The CTS is licensed under the same Apache Software License 2.0 that the bulk of
Android uses.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Does the CTS accept contributions?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
Yes please! The Android Open-Source Project accepts contributions to improve
the CTS in the same way as for any other component. In fact, improving the
coverage and quality of the CTS test cases is one of the best ways to help out
Android.<o:p></o:p></span></div>
<div style="background: ; line-height: 17.25pt; margin-bottom: .0001pt; margin: 0cm; vertical-align: baseline;">
<strong><span style="border: none windowtext 1.0pt; color: #333333; font-family: "inherit","serif"; font-size: 10.5pt; mso-border-alt: none windowtext 0cm; padding: 0cm;">Can anyone use the CTS on existing devices?</span></strong><span style="color: #333333; font-family: "Georgia","serif"; font-size: 10.5pt;"><br />
The Compatibility Definition Document requires that compatible devices
implement the ‘adb’ debugging utility. This means that any compatible device —
including ones available at retail — must be able to run the CTS tests.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, sans-serif;"><span style="font-size: 12px; line-height: 13px;"><br /></span></span></div>
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com1tag:blogger.com,1999:blog-8140044794076668443.post-6762261247332301392012-02-18T03:37:00.000-08:002012-02-18T03:37:29.174-08:00Android Tracking Memory Allocations<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h1 itemprop="name" style="background-color: ; color: #212426; font-family: Arimo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; position: relative;">
<br /></h1>
<span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">Writing efficient mobile applications is not always straightforward. In particular, Android applications rely on automatic memory management handled by Dalvik's garbage collector, which can sometimes cause performance issues if you are not careful with memory allocations.</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">In a performance-sensitive code path, such as the layout or drawing method of a view or the logic code of a game, any allocation comes at a price. After too many allocations, the garbage collector will kick in and stop your application to let it free some memory. Most of the time, garbage collections happen fast enough for you not to notice. However, if a collection happens while you are scrolling through a list of items or while you are trying to defeat a foe in a game, you may suddenly see a drop in performance/responsiveness of the application. It's not unusual for a garbage collection to take 100 to 200 ms. For comparison, a smooth animation needs to draw each frame in 16 to 33 ms. If the animation is suddenly interrupted for 10 frames, you can be certain that your users will notice.</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">Most of the time, garbage collection occurs because of tons of small, short-lived objects and some garbage collectors, like generational garbage collectors, can optimize the collection of these objects so that the application does not get interrupted too often. The Android garbage collector is unfortunately not able to perform such optimizations and the creation of short-lived objects in performance critical code paths is thus very costly for your application.</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">To help you avoid frequent garbage collections, the Android SDK ships with a very useful tool called</span><em style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">allocation tracker</em><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">. This tool is part of DDMS, which you must have already used for debugging purposes. To start using the allocation tracker, you must first launch the standalone version of DDMS, which can be found in the </span><code style="background-color: ; color: #212426; font-size: 15px; line-height: 21px;">tools/</code><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> directory of the SDK. The version of DDMS included in the Eclipse plugin does not offer you ability to use the allocation tracker yet.</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">Once DDMS is running, simply select your application process and then click the </span><em style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">Allocation Tracker</em><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> tab. In the new view, click </span><em style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">Start Tracking</em><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> and then use your application to make it execute the code paths you want to analyze. When you are ready, click </span><em style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">Get Allocations</em><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">. A list of allocated objects will be shown in the first table. By clicking on a line you can see, in the second table, the stack trace that led to the allocation. Not only you will know what type of object was allocated, but also in which thread, in which class, in which file and at which line. The following screenshot shows the allocations performed by </span><a href="http://code.google.com/p/shelves" style="background-color: ; color: #075a90; font-family: Arimo; font-size: 15px; line-height: 21px; text-decoration: none;">Shelves</a><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> while scrolling a ListView.</span>
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-9449074219360716702012-02-18T03:35:00.000-08:002012-02-18T03:35:48.580-08:00Set Validation error for edittext in android<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">suppose user not fill the edittext filed at the time we can show alert\error msg .</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><b style="background-color: ; color: #3d85c6; font-family: Arimo; font-size: 15px; line-height: 21px;">Solution: </b><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">we can solve this issue using </span><b style="background-color: ; color: #3d85c6; font-family: Arimo; font-size: 15px; line-height: 21px;">setError()</b><span style="background-color:; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">.</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><b style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"><span style="color: #3d85c6;">ex code</span></b><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;">:</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> @Override</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> public void onCreate(Bundle savedInstanceState) {</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> super.onCreate(savedInstanceState);</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> setContentView(R.layout.main);</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> Button btn =(Button)findViewById(R.id.button1);</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> btn.setOnClickListener(new OnClickListener() {</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> </span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> @Override</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> public void onClick(View v) {</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> EditText edittext =(EditText)findViewById(R.id.editText1);</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> </span><span style="background-color: ; color: #3d85c6; font-family: Arimo; font-size: 15px; line-height: 21px;"> <b> if(edittext.getText().length()==0){</b></span><b style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"><br style="color: #3d85c6;" /><span style="color: #3d85c6;"> edittext.setError("please enter the value");</span><br style="color: #3d85c6;" /><span style="color: #3d85c6;"> }</span></b><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> }</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> });</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><span style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;"> }</span><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><b style="background-color: ; color: #3d85c6; font-family: Arimo; font-size: 15px; line-height: 21px;">screen shot:</b><br style="background-color: ; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px;" /><br />
<div class="separator" style="background-color: ; clear: both; color: #212426; font-family: Arimo; font-size: 15px; line-height: 21px; text-align: center;">
<a href="http://1.bp.blogspot.com/-jFJpCs_h0iU/TvmewXWo3pI/AAAAAAAAAWY/CduRPNa0zfo/s1600/device-2011-12-27-160208.png" imageanchor="1" style="color: #075a90; margin-left: 1em; margin-right: 1em; text-decoration: none;"><img border="0" height="227" src="http://1.bp.blogspot.com/-jFJpCs_h0iU/TvmewXWo3pI/AAAAAAAAAWY/CduRPNa0zfo/s320/device-2011-12-27-160208.png" style="-webkit-box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px; background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; border-bottom-color: rgb(204, 204, 204); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-left-radius: 0px; border-top-right-radius: 0px; border-top-style: solid; border-top-width: 1px; border-width: initial; box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px; position: relative;" width="320" /></a></div>
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com1tag:blogger.com,1999:blog-8140044794076668443.post-45149279022333642472012-01-18T22:44:00.000-08:002012-01-18T22:44:28.699-08:00FRAME ANIMATION<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal">
FRAME ANIMATION</div>
<div class="MsoNoSpacing">
/*</div>
<div class="MsoNoSpacing">
A series of frames
is drawn one after the other at regular intervals.</div>
<div class="MsoNoSpacing">
For this create a
xml which contains ImageView for showing the animation</div>
<div class="MsoNoSpacing">
*/</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
package com.animation;</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
import android.app.Activity;</div>
<div class="MsoNoSpacing">
import android.graphics.drawable.AnimationDrawable;</div>
<div class="MsoNoSpacing">
import android.os.Bundle;</div>
<div class="MsoNoSpacing">
import android.widget.ImageView;</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
public class FrameAnimationActivity extends Activity {</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
AnimationDrawable
frameAnimation;</div>
<div class="MsoNoSpacing">
AnimationDrawable
frameAnimation2;</div>
<div class="MsoNoSpacing">
/**
Called when the activity is first created. */</div>
<div class="MsoNoSpacing">
@Override</div>
<div class="MsoNoSpacing">
public
void onCreate(Bundle savedInstanceState) {</div>
<div class="MsoNoSpacing">
super.onCreate(savedInstanceState);</div>
<div class="MsoNoSpacing">
setContentView(R.layout.main);</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
ImageView
imgView = (ImageView) findViewById(R.id.Image);</div>
<div class="MsoNoSpacing">
ImageView
imgView2 = (ImageView) findViewById(R.id.imageView1);</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
imgView.setVisibility(ImageView.VISIBLE);</div>
<div class="MsoNoSpacing">
imgView2.setVisibility(ImageView.VISIBLE);</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
imgView.setBackgroundResource(R.drawable.ani);</div>
<div class="MsoNoSpacing">
imgView2.setBackgroundResource(R.drawable.ani);</div>
<div class="MsoNoSpacing">
</div>
<div class="MsoNoSpacing">
frameAnimation
= (AnimationDrawable) imgView.getBackground();</div>
<div class="MsoNoSpacing">
frameAnimation2
= (AnimationDrawable) imgView2.getBackground();</div>
<div class="MsoNoSpacing">
imgView.post(new
Starter());</div>
<div class="MsoNoSpacing">
imgView2.post(new
Starter());</div>
<div class="MsoNoSpacing">
}</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
public
class Starter implements Runnable {</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
public
void run() {</div>
<div class="MsoNoSpacing">
//
TODO Auto-generated method stub</div>
<div class="MsoNoSpacing">
frameAnimation.start();</div>
<div class="MsoNoSpacing">
frameAnimation2.start();</div>
<div class="MsoNoSpacing">
</div>
<div class="MsoNoSpacing">
}</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
}</div>
<div class="MsoNoSpacing">
}</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
.XML</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: Consolas; font-size: 10pt;"><?</span><span style="color: #3f7f7f; font-family: Consolas; font-size: 10pt;">xml</span><span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">version</span>=<i><span style="color: #2a00ff;">"1.0"</span></i>
<span style="color: #7f007f;">encoding</span>=<i><span style="color: #2a00ff;">"utf-8"</span></i><span style="color: teal;">?></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: teal; font-family: Consolas; font-size: 10pt;"><</span><span style="color: #3f7f7f; font-family: Consolas; font-size: 10pt;">LinearLayout</span><span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">xmlns:android</span>=<i><span style="color: #2a00ff;">"http://schemas.android.com/apk/res/android"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_width</span>=<i><span style="color: #2a00ff;">"fill_parent"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_height</span>=<i><span style="color: #2a00ff;">"fill_parent"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:orientation</span>=<i><span style="color: #2a00ff;">"vertical"</span></i> <span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;">
</span><span style="color: teal; font-family: Consolas; font-size: 10pt;"><</span><span style="color: #3f7f7f; font-family: Consolas; font-size: 10pt;">TextView</span><span style="font-family: Consolas; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_width</span>=<i><span style="color: #2a00ff;">"fill_parent"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_height</span>=<i><span style="color: #2a00ff;">"wrap_content"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:text</span>=<i><span style="color: #2a00ff;">"@string/hello"</span></i> <span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;">
</span><span style="color: teal; font-family: Consolas; font-size: 10pt;"><</span><span style="color: #3f7f7f; font-family: Consolas; font-size: 10pt;">ImageView</span><span style="font-family: Consolas; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:id</span>=<i><span style="color: #2a00ff;">"@+id/Image"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_width</span>=<i><span style="color: #2a00ff;">"100px"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_height</span>=<i><span style="color: #2a00ff;">"100px"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_gravity</span>=<i><span style="color: #2a00ff;">"center_horizontal"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:background</span>=<i><span style="color: #2a00ff;">"@drawable/an2"</span></i> <span style="color: teal;">/></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;">
</span><span style="color: teal; font-family: Consolas; font-size: 10pt;"><</span><span style="color: #3f7f7f; font-family: Consolas; font-size: 10pt;">ImageView</span><span style="font-family: Consolas; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:id</span>=<i><span style="color: #2a00ff;">"@+id/imageView1"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_width</span>=<i><span style="color: #2a00ff;">"100px"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_height</span>=<i><span style="color: #2a00ff;">"100px"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:layout_gravity</span>=<i><span style="color: #2a00ff;">"center_horizontal"</span></i><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;"> <span style="color: #7f007f;">android:background</span>=<i><span style="color: #2a00ff;">"@drawable/an1"</span></i> <span style="color: teal;">></span><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: Consolas; font-size: 10pt;">
</span><span style="color: teal; font-family: Consolas; font-size: 10pt;"></</span><span style="color: #3f7f7f; font-family: Consolas; font-size: 10pt;">ImageView</span><span style="color: teal; font-family: Consolas; font-size: 10pt;">></span><span style="font-family: Consolas; font-size: 10pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNoSpacing">
<span style="color: teal; font-family: Consolas; font-size: 10pt;"></</span><span style="color: #3f7f7f; font-family: Consolas; font-size: 10pt;">LinearLayout</span><span style="color: teal; font-family: Consolas; font-size: 10pt;">><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<img height="233" src="file:///C:/Users/dell/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg" v:shapes="Picture_x0020_37" width="354" /></div>
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-5054545486665438612012-01-18T21:27:00.000-08:002012-01-18T21:27:41.658-08:00Beginning Android Tablet Games Programming<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 9pt;">
<span style="font-family: 'Trebuchet MS', sans-serif; font-size: 16.5pt;">Beginning Android Tablet Games Programming<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;"><br />
<br />
<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">Android games programmers now have the power to write games
for Android tablets.<i>Beginning Android Tablet Games Programming</i> explains
how to enhance your Android games using the new tablet interface and the
additional screen estate. You'll learn how to bring your programming
skills up to date and into a world where touch screens, games physics, and
artificial intelligence come together in new and surprising ways.<br />
<br />
<i>Beginning Android Tablet Games Programming</i> shows how
to quickly and easily set up an Android development environment—in
no time at all, you'll be programming away. You'll begin with some simple games
using sprites and choreographed movement. Next, you'll learn how to
handle user input in the modern age of touch screens and motion.<br />
<br />
Along the way, you'll discover how to use that extra screen space on a tablet
to provide more relaxed and more interesting user interactions in your games.
You'll learn how to use sound and music, for instance, to make your application menus
more user-friendly.<br />
<br />
The Android operating system has recently acquired multicore
functionality to meet the demands of multicore devices now entering the tablet
market. With <i>BeginningAndroid Tablet Games Programming</i>, you'll
discover how to harness that new power with your games programming
through more process-demanding and fun techniques, including physics modeling,
rich game world representation, artificial intelligence, and multiplayer
interactions.<br />
<br />
Throughout each chapter of <i>Beginning Android Tablet Games Programming, </i>you'll
find code that you can add or adapt to your own games to create the components
you want. You can also work up to wrapping everything together into a complete
Mario-type example game.<br />
<br />
Finally, when you have your first games ready, learn how developers
have released their games and made a profit. You'll find tips on how to present
your games in the Android and other application markets, and a solid
approach to games marketing and monetization.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt;">
<b><span style="font-family: Verdana, sans-serif; font-size: 10pt;">What you’ll learn<o:p></o:p></span></b></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">How to set up an Android tablet programming environment<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">How to program for touchscreens and other input
devices<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Techniques to take advantage of the extra screen size of a
tablet<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">How to take advantage of multicore processing power in your
games<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">How to program a multiplayer game<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">How to add artificial intelligence to in-game opponents<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">How to program game modes, game states, and game worlds<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">How to program a complete game<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 6pt; margin-left: 15pt; margin-right: 15pt; margin-top: 6pt; text-indent: 0cm;">
<span style="font-family: Symbol; font-size: 10pt;">·<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">About in-app marketing and games monetization<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt;">
<b><span style="font-family: Verdana, sans-serif; font-size: 10pt;">Who this book is for<o:p></o:p></span></b></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">This is a book for Java programmers new to Honeycomb,
tablets and games programming. An experienced games programmer can also use
this book to migrate their existing expertise to the Android and the tablet
environment.<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt;">
<b><span style="font-family: Verdana, sans-serif; font-size: 10pt;">Table of Contents<o:p></o:p></span></b></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">1.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Setting Up for Android 3.0 Java Development<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">2.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Creating Simple Games with Sprites and Movement<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">3.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Creating Gathering User Input<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">4.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Adding Sounds Effects, Music, and Video<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">5.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">One-Player Game with Obstacles<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">6.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">A Ball and Paddle Game<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">7.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Building a Two-Player Game<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">8.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">A One-Player Strategy Game Part I<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">9.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">A One-Player Strategy Game Part II<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 3pt; margin-left: 36pt; margin-right: 0cm; margin-top: 0cm; text-indent: 0cm;">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">10.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Publishing the Game<o:p></o:p></span></div>
<blockquote class="tr_bq">
<span style="font-family: Verdana, sans-serif; font-size: 12pt;">11.<span style="font: normal normal normal 7pt/normal 'Times New Roman';">
</span></span><span style="font-family: Verdana, sans-serif; font-size: 12pt;">Testing Android Games on a Real Device<span style="color: #666666;"><o:p></o:p></span></span></blockquote>
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0tag:blogger.com,1999:blog-8140044794076668443.post-50734353293902997402012-01-18T21:24:00.002-08:002012-01-18T21:24:48.427-08:00Google release Android Design Site<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color:; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 9pt;">
<span style="color: #666666; font-family: "Trebuchet MS","sans-serif"; font-size: 16.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">Google release Android Design Site<o:p></o:p></span></div>
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: ; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman"; mso-no-proof: yes;"><!--[if gte vml 1]><v:shapetype
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="BLOGGER_PHOTO_ID_5697009011092313906" o:spid="_x0000_i1025"
type="#_x0000_t75" alt="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCr_3UHxHTz0ow-Ys1behC1EsvBH0aJ8vB3oxOsXMTt6elJQULEkAOoLD_b_GAGU2SjZXWs5McBr95DNPVTavCzTs6TOSatnZM7RMWxj-XikbM3PV55-hqgbKPPZ9QhUpSjo6vfzP6R-tf/s200/Android+Design.png"
style='width:150pt;height:136.5pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///C:\Users\dell\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"
o:title="Android%2BDesign"/>
</v:shape><![endif]--><!--[if !vml]--><img alt="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCr_3UHxHTz0ow-Ys1behC1EsvBH0aJ8vB3oxOsXMTt6elJQULEkAOoLD_b_GAGU2SjZXWs5McBr95DNPVTavCzTs6TOSatnZM7RMWxj-XikbM3PV55-hqgbKPPZ9QhUpSjo6vfzP6R-tf/s200/Android+Design.png" height="182" src="file:///C:/Users/dell/AppData/Local/Temp/msohtmlclip1/01/clip_image002.gif" v:shapes="BLOGGER_PHOTO_ID_5697009011092313906" width="200" /><!--[endif]--></span><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><br />
Google are introducing</span><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><a href="http://developer.android.com/design/"><span style="color: #5421bb; mso-bidi-font-size: 11.0pt; text-decoration: none; text-underline: none;">Android Design</span></a></span><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">for developers to learn about principles,
building blocks, and patterns for creating world-class Android user interfaces.
Whether you’re a UI professional or a developer playing that role, these docs
show you how to make good design decisions, big and small. In the coming
months, it will be expanded with more in-depth content.<br />
<br />
-</span><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: #666666; font-family: "Arial","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><a href="http://developer.android.com/design/"><span style="color: #5421bb; mso-bidi-font-size: 11.0pt; text-decoration: none; text-underline: none;">Android Design</span></a><o:p></o:p></span></div>
</div>Anonymoushttp://www.blogger.com/profile/08700398954963761207noreply@blogger.com0