<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5515158391435587981</id><updated>2024-09-10T09:08:48.727-07:00</updated><category term="android"/><category term="java"/><category term="examples"/><category term="eclipse"/><category term="xml"/><category term="android market"/><category term="Search Dialog"/><category term="plugin"/><category term="ADT"/><category term="SDK"/><category term="User interface"/><category term="ads"/><category term="dalvik"/><category term="development"/><category term="list adapter"/><category term="methods"/><category term="API"/><category term="Android SDK"/><category term="AsyncTask"/><category term="BlackBerry"/><category term="Density"/><category term="Drag and Drop"/><category term="DroidDoc"/><category term="HTTP"/><category term="JDK"/><category term="JRE"/><category term="Java Style"/><category term="MediaPlayer"/><category term="MotionEvent"/><category term="Multitouch"/><category term="NumberPicker"/><category term="OAuth"/><category term="PlayBook"/><category term="Renderscript"/><category term="Screen size"/><category term="URI"/><category term="Verizon"/><category term="calendar"/><category term="classes"/><category term="customization"/><category term="devices"/><category term="dialogue"/><category term="events"/><category term="exceptions"/><category term="geometric factor"/><category term="google+"/><category term="layout"/><category term="list"/><category term="listview"/><category term="manifest"/><category term="money"/><category term="notification bar"/><category term="patterns"/><category term="settings"/><category term="sms"/><category term="succes story"/><category term="toast"/><category term="touchscreen"/><category term="twitter"/><category term="wallpaper"/><category term="widget"/><title type='text'>Developing mobile applications</title><subtitle type='html'>A little of everything about Android, iPhone, WinPhone &amp;amp; Bada&#xa;(poor English)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://devmobapps.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-8922804216172958002</id><published>2011-10-03T18:39:00.000-07:00</published><updated>2011-10-03T18:39:05.210-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Renderscript"/><title type='text'>Introduction to Renderscript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Renderscript - an important feature of Honeycomb, which was not discussed previously.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;There will be two articles, this - a simple overview Renderscript, following the same will contain more technical detail and a simple example.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Renderscript - this is a new API, aimed at high performance in 3D rendering and complex computing operations.&lt;/span&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Renderscript will be of interest to developers who are trying to maximize their overall experience and feel comfortable when working at low levels.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;For developers, there are three tools: a simple API for 3D rendering that supports hardware acceleration, API to model complex algorithms (similar to&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://ru.wikipedia.org/wiki/CUDA&amp;amp;usg=ALkJrhjPXdzQTc_1Uds6q9OlA_YkRL-ivw&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;CUDA&lt;/a&gt;&amp;nbsp;), and standard language is close to&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://ru.wikipedia.org/wiki/C99&amp;amp;usg=ALkJrhhHhmK-kkfQT_e4qT4AzehvbqWJEw&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;C99&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Renderscript has been used previously to create a new, more beautiful visually, applications Books and YouTube.&lt;/span&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;He has also been used to write living wallpaper that shipped with Honeycomb.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Improved performance is achieved through the implementation of native code on the device.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;However, in contrast to the NDK, this solution is cross-platform.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Language development for Renderscript - this C99 with some extensions during the development process, it is compiled into a hardware-independent intermediate format and placed in the application package.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;When the application starts, the script is compiled into native code and optimized.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;This avoids the problems associated with the need to choose any particular machine architecture.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Renderscript not intended to replace existing high-level API, it should be used in cases where the current need for performance is not provided with the API.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;It may seem interesting that nothing was said earlier about where the code runs - on the GPU or CPU.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The reason is that it is defined on the device at run time.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;When there is a corresponding hardware support, simple scripts can be executed on the GPU in a small computational load.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;More complex scripts run on the CPU (or multiple CPU).&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The role of the CPU in this case also is to provide a reserve if there is no additional hardware support in the form of suitable GPU.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In fact, this should be transparent to the developer.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Generally, in the future will be able to run simple scripts in many places, but so far all that is needed in practice - to distribute the load across multiple CPU, supported on the device.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;355&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; width=&quot;425&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/uQ5NumRfHN4&amp;amp;hl=en&amp;amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; font: inherit; vertical-align: baseline; outline-width: 0px; outline-style: initial; outline-color: initial; &quot;&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;This is a video obtained by image capture from HDMI output on the tablet Honeycomb.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;It shows Renderscript work.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Here we present a &quot;brutforsnuyu&quot; implementation of physics for 900 particles.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Computing the script runs each frame a picture and automatically takes advantage of two cores.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As soon as the physics simulation is completed, the second graphic script renders an image.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In the video we push one of the larger particles, in order to show their interaction.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;After that, cannot tablet to the work for us has made gravity.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The whole process demonstrates good computing power of the new processor A9.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;On we went with Honeycomb GL ES 1.1 to 2.0 as to render Renderscript.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;With version 2.0 we were able to add software support for shaders, download 3D models and more efficient memory management.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;However, the most important change - that&#39;s what Renderscript and related tools are now available to all.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-TzY5babwzVk/TVMhgJtshWI/AAAAAAAAARM/d5R06K39MRM/s1600/SceneGraph.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;img align=&quot;center&quot; alt=&quot;image&quot; src=&quot;http://2.bp.blogspot.com/-TzY5babwzVk/TVMhgJtshWI/AAAAAAAAARM/d5R06K39MRM/s400/SceneGraph.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 100%; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Screenshot shows one of our test applications.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Application implements a three-dimensional scene, which shows a recursive call scripts.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Androids, shown in the screenshot downloaded from A3D file created in&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://usa.autodesk.com/adsk/servlet/pc/index%3Fid%3D13577897%26siteID%3D123112&amp;amp;usg=ALkJrhhCDlOK03gOj_n90EXh7n_otiP7Iw&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Maya&lt;/a&gt;&amp;nbsp;and broadcast from a file&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://ru.wikipedia.org/wiki/COLLADA&amp;amp;usg=ALkJrhg4306G2yZJB4y__D5wMORrxqGwag&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Collada&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;A3D - a format for storing objects Renderscript on the device.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Later, the article will be provided with more technical information and sample code.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/8922804216172958002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/8922804216172958002'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/10/introduction-to-renderscript.html' title='Introduction to Renderscript'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-TzY5babwzVk/TVMhgJtshWI/AAAAAAAAARM/d5R06K39MRM/s72-c/SceneGraph.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-1998704697826099479</id><published>2011-10-03T18:35:00.000-07:00</published><updated>2011-10-03T18:35:55.261-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ads"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="android market"/><title type='text'>How to promote Android apps</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px; line-height: 20px;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Recently my friend asked me to answer a few questions to promote applications for Android.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;We dogovorlis that I would write a post.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Over the last year I got the definite impression on the market Android Market.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I am pleased to share my opinion.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I hope my experience will be useful to developers.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I would be happy if the post will generate a constructive discussion.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h5 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 14px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;On Android Market:&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;1.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;How often do updates for whether these updates in some real bug fixes, or users&#39; trust and silently update &quot;?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As a user I am a &quot;trust and silently update the&quot; application or not at all if I update the application is not interested.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Everyone is different and there are users who are always watching the ongoing changes in apdeyte, my IMHO - is dominated by people who install updates, rarely going into the details.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;There is also a category of applications, in which each update brings new features.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As a rule, the loyal users of such applications are always waiting for the upgrade of new functionality or content.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As a developer, I consider that the application needs to update regularly once a week or two.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;This is for at least two reasons: first regular updates with new features done and content have a positive effect on the formation of a loyal audience of the project, and secondly when you upgrade an application fall into the category of &#39;Just in&#39;, which positively affects the number of downloads.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;If your application has positive comments and high ratings in the amount of downloads apdeyte much more.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;It is worth noting that if the update more frequently than once a week, then jump on the downloads will not be because the application does not fall into the &#39;Just in&#39;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Empty updates without changes should be avoided.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Almost always, (we all without sin!) To update strive to make some new feature or fix bugs.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Without bugs is just hello word, so there is always something to improve / fix, especially when it comes to programs for mobile devices.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Most likely, frequent updates can empty a negative impact on the audience loyalty and the reputation of the developer.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In addition, full update, as a rule, is very effective.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;IMHO the ideal option - pre-release updates before developit application, even if the first version will be slightly curtailed.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As practice shows, regular updates - it is very important and effective tool in promoting the application, but to achieve some decent results updates are not enough.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;2.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;What is the dynamics of downloads needed and for what period, to reach the top?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Unambiguously answer this question is difficult because the market is changing rapidly.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Today in the TOP Free to enter more complicated than in the TOP Paid.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;My experience is that if there is a 10.5 download within one to two months, you can enter in TOP Paid-100 in its category.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;TOP Free From a little harder.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;At various times, I reached up to 30 seats in the TOP Free in its category.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;My most successful application has 700,000 downloads since April last year, with the first 50,000 downloads were given hard, then went easier.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Now this program is contained in the TOP Free 50 in its category with the dynamics of 1000-5000 downloads a day.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Over the weekend, more uploads by 20-30%.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;3.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;If the application is free, but there are domestic payments - they are sure to carry through Google Checkout or turning a blind eye to it?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Local payments - a very profitable model, however, on its Android I have not tried it.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Considering the vast majority of free applications, I feared that this model would be accepted &#39;in arms&#39; users.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Heard that&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;PayPal&lt;/b&gt;&amp;nbsp;has its own In-App Purchase library for Android, but experience with it does not.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;For domestic payments has some interesting branches on StackOverflow.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;4.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;What statistics are collected - download, many users of versions of what they do in the application, etc.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As I try to make the application as &#39;light&#39;, I do not use a special library to gather statistics.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Statistics in my applications library is going to advertise on Mobclix.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In the admin I have the opportunity to see &#39;App Opens&#39; and &#39;New Users&#39; on the clock, except for direct advertising rates (impressions, eCPM, eCPC, etc.).&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I agree that the collection of statistics - it is very important, but I do settle for a limited set of parameters.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 14px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Promotion:&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;5.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Ever worked with review sites and directories?&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;There is a clear leader, which gives the most downloads?&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In the event that review and catalog provides a link to the application in the Android Market, is there a way to track exactly which gave life to these downloads Market?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;From site surveys worked.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I do not think that there is a clear leader, like&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;TouchArcade&lt;/b&gt;&amp;nbsp;for iOS.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I think that good would result from a review on&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Pocket Gamer.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Ideal - in Google to find as many review sites, sort of Alexei and send all request to Review.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The more reviews - the better!&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Track the number of downloads from a specific review to me it is not possible at this time.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;You can also order the banners on niche sites.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;There is a resource&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;BuySellAds.com,&lt;/b&gt;&amp;nbsp;where you can filter and sort advertisements on the android website by visitors and price.&lt;/span&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;You can also apply directly to advertisers on popular websites.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Certainly, popular sites are owned media holding, to help you if you wish to learn of the advertising budget.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;With regard to third-party alternatives to the directory for Android software, I was not able to achieve the number of downloads, comparable to the Android Market.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The main reason for my failure - my laziness.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Because a lot of directories and I do updates almost every week, I was very uncomfortable to submit your site updates regularly.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;So I scored while on the directories.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Maybe I just do not see a viable alternative to Android Market.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I admit the thought that I would return to the topic later catalogs.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;6.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Did you work with someone from the advertising networks such as Tapjoy.com, Mdotm.com, Smaato.com?&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I mean, as an advertiser.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;By visitors?&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Most Popular?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As an advertiser mainly worked with&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AdMob&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Mobclix.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Budgets content was not very big, so hard to objectively compare.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I feel that as a free application to have 10 clicks a instal.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Again, much depends on the content of advertisements, descriptions of applications, and screenshots.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;7.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Placed ads in a contextual advertising Google?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Often advertise the application with&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AdMob,&lt;/b&gt;&amp;nbsp;$ 200 dollars apart for 6-7 hours.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;According to my statistics, 237 hits have a click (not the best indicator), for $ 200 you can get some clicks and 5000-10000, according to my feelings, 500-1000 downloads.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I may be wrong in the calculations.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;8.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;A similar question on the same scale - with whom to work harder to show someone else&#39;s advertising in itself why.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;As a seller of advertising closely worked with&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AdMob, Quattro Wirelless&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Mobclix.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Now I use mostly&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Mobclix.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;To date, for my most popular program generated an average of 600-700 thousand hits a day.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;It should be noted that if the program is popular, it does not always have enough advertising network advertising in order to cater for all application requests.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;If this happens, you can lose up to 90% of their income.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;For such cases, there are solutions that provide maximum filling of advertising applications through the automatic replacement of ad networks based on the presence of ads.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Today I know two solutions to do it automatically -&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AdMob + AdWirl&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Mobclix.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I like the&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Mobclix,&lt;/b&gt;&amp;nbsp;since&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Mobclix&lt;/b&gt;&amp;nbsp;collects all ad networks money, accumulating them at home and make one payment to the developer to all networks.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In the case of&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AdWirl&lt;/b&gt;&amp;nbsp;each ad network to get paid separately.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;On the plus&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Mobclix&lt;/b&gt;&amp;nbsp;also include the ability to use&amp;nbsp;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;AdMob&lt;/b&gt;&amp;nbsp;as an alternative.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Outro&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In 2010 I became convinced that developing for Android is not only interesting but also beneficial.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;On the advertising model and you can earn quite well.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In the Android Market today, there are many free niches that can and should take.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I am sure that there are many ways to promote your software for Android.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The main thing - do not be afraid to experiment!&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In no event do not get upset if something does not work and never stop.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Thank you.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I would really welcome your comments.&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/1998704697826099479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/1998704697826099479'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/10/how-to-promote-android-apps.html' title='How to promote Android apps'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-6489950534362983958</id><published>2011-10-03T18:26:00.000-07:00</published><updated>2011-10-03T18:32:19.615-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Search Dialog"/><title type='text'>Using Android Search Dialog. Part 3 - Custom Suggestions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px; line-height: 20px;&quot;&gt;&lt;img alt=&quot;image&quot; src=&quot;http://developer.android.com/images/search/search-suggest-custom.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 100%; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;This is the final article on the use of Android Search Dialog (previous are&amp;nbsp;&lt;a href=&quot;http://devmobapps.blogspot.com/2011/09/using-android-search-dialog-simple.html&quot;&gt;here&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href=&quot;http://devmobapps.blogspot.com/2011/09/using-android-search-dialog-recent.html&quot;&gt;here&lt;/a&gt;&amp;nbsp;).&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In it, I&#39;ll show you how to add dynamic dialogue in the search for clues, as well as how to integrate search into your application system Quick Search Box (QSB).&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;QSB advantage that it can be used to obtain information from virtually anywhere in the OS.&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=5515158391435587981&amp;amp;postID=6489950534362983958&amp;amp;from=pencil&quot; name=&quot;habracut&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Theory&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Tips for searching the data generated by your application that are subject to search.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;When the user selects one of them, the Search Manager sends Intent to Activity, which is responsible for the search.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Normally, when a user clicks an icon in the search dialog box, then sent Intent type Search, however, the choice of tips in this case we can define another type of Intent, so that we can intercept it and take appropriate action, such as creating a new dialogue, or call Activity to display information, etc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The data are transferred via a search query Intent as before, but now we will use the URI, to determine the type of request by the content provider.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Again, we need not perform any action on the rendering of dialogue, is engaged in Search Manager, all that is required of us - to provide a configuration xml file.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;So, when the Search Manager determines our Activity as responsible for finding and providing clues to the search, the following sequence of actions occurs:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;When the Search Manager receives the search request, it sends a request to the content provider, provides tips.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Content provider returns a cursor that points to clues that coincide with the text search.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Search Manager displays a prompt, using the cursor&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Once a list of tips has been mapped, it may be the following:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;If the user changes the text of the query, then all of the above steps are repeated.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;If the user starts the search, the hints are ignored, and sent to Activity Intent type Search.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;If the user selects a clue what to Activity Intent delivered another type (the type is defined in the configuration file) that transfers data as a URI.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;URI will be used to search for records in the table corresponding to the selected tip.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;So, we modify our application (that which was seen in&amp;nbsp;&lt;a href=&quot;http://devmobapps.blogspot.com/2011/09/using-android-search-dialog-simple.html&quot;&gt;part 1&lt;/a&gt;&amp;nbsp;) so as to add dynamic prompts, and to develop a mechanism, the choice tips will cause a new Activity, which will display information on request.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;For the implementation will require:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Edit the configuration file dialog by adding information about the content provider and the type of Intent, used for clues&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Create a table in the database SQLite, which will provide the columns needed for Manager&#39;om Search Tips&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Create a new content provider that has access to a table hint, and define it in the manifesto&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Add Activity, which will display the information in the choice tips&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Change the configuration file&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I remind you that the configuration file (res / xml / searchable.xml) is required to display the dialog and change it, for example, to use voice search.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;To use dynamic prompts, you must add a file parameter: android: searchSuggestAuthority.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;It will coincide with a string of authorization content provider.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Besides adding a android: searchMode = «queryRewriteFromText», its value indicates that the search string in the dialog will be overwritten when navigating through the prompts, for example using the trackball.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Also add the parameters that define the operator selection, the type of Intent sent to the selection tips, and the minimum number of characters printed in the dialogue necessary to query the content provider.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;File res / xml / searchable.xml&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;code class=&quot;xml&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;searchable xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:label=&quot;@string/app_name&quot;
    android:hint=&quot;@string/search_hint&quot; 
    android:searchSettingsDescription=&quot;@string/settings_description&quot;
    android:searchMode=&quot;queryRewriteFromText&quot;
    android:includeInGlobalSearch=&quot;true&quot;
    android:searchSuggestAuthority=&quot;com.example.search.SuggestionProvider&quot; 
    android:searchSuggestIntentAction=&quot;android.intent.action.VIEW&quot;
    android:searchSuggestIntentData=&quot;content://com.example.search.SuggestionProvider/records&quot;
    android:searchSuggestThreshold=&quot;1&quot;
    android:searchSuggestSelection=&quot; ?&quot;&amp;gt;
&amp;lt;/searchable&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Create a content provider&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;In fact, our content provider is no different from others.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;But to do so for each row of the table prompts to select the correct columns, those that require Search Manager.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;We will request data on the prompts using the content provider&#39;s query ().&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;And he will be called whenever the user types a new character in the dialogue.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Thus, query () method must return a pointer to the table entries that match the query, and then Search Manager will display a prompt.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;See the description of the method in the code comments.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The text itself will be appended to the request URI, so that it will not give problems, you just use the standard method getLastPathSegment ().&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Create a table hints&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;When the cursor gets Search Manager, pointing to the record, it expects a certain set of columns for each record.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Binding are two: _ID - unique identifier for each clue and SUGGEST_COLUMN_TEXT_1 - help text.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;There are many optional columns, such as using SUGGEST_COLUMN_ICON_1, you can define for each record, the icon shown on the left side tips (very useful, for example, to search for contacts).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Data type definition for Intent&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Since we are passing the data on demand through the URI, then we need a mechanism to determine which clue was chosen.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;There are two ways.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The first is to define a column SUGGEST_COLUMN_INTENT_DATA, which will be unique information for each record, then you can retrieve data from across Intent getData () or getDataString ().&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The second option - the data type for all of Intent in the configuration file (res / xml / searchable.xml) and then append to the URI unique data for each of Intent, using the column SUGGEST_COLUMN_INTENT_DATA_ID.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;We will use the second option, with separate columns in the table, I did not create, because you can simply create a map of SUGGEST_COLUMN_INTENT_DATA_ID rowId in the table.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;I will add that for fun in SQLite to search for used&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.sqlite.org/fts3.html&amp;amp;usg=ALkJrhjVAJVLiqsSdf9S2K9tFQ0m2Y0FWA&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;FTS3&lt;/a&gt;&amp;nbsp;, that is, had to create a virtual table that you can not impose restrictions on the columns (constraints), such as a PRIMARY KEY or NULL / NOT NULL.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;But at the virtual table has a unique ID string, and set it on the map.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;That is, data for Intent will be as follows: the URI will be appended to &quot;/&quot; and rowId row in the table.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Create Activity to display information&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;The interface is in res / layout / record_activity.xml.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;All what the Activity - getting data from Intent, a query cursor over a content provider and display records in text box.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;File res / layout / record_activity.xml&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;xml&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
        android:orientation=&quot;vertical&quot;
        android:layout_width=&quot;fill_parent&quot;
        android:layout_height=&quot;fill_parent&quot;
        android:padding=&quot;10dp&quot;&amp;gt;
    &amp;lt;TextView
            android:id=&quot;@+id/record_header&quot;
            android:textSize=&quot;25dp&quot;
            android:textColor=&quot;?android:textColorPrimary&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Now fill out the information on the content provider and a new Activity to the manifest, too, since we now have two Activity, then point out that, by default, is responsible for the search.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;File AndroidManifest.xml&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;xml&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      package=&quot;com.example.search&quot;
      android:versionCode=&quot;1&quot;
      android:versionName=&quot;1.0&quot;&amp;gt;
    &amp;lt;application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;&amp;gt;
        &amp;lt;activity android:name=&quot;.Main&quot;
                  android:label=&quot;@string/app_name&quot;&amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;
                &amp;lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name=&quot;android.intent.action.SEARCH&quot; /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
            &amp;lt;meta-data 
                android:name=&quot;android.app.searchable&quot;
                android:resource=&quot;@xml/searchable&quot;
            /&amp;gt;
        &amp;lt;/activity&amp;gt;

        &amp;lt;activity android:name=&quot;.RecordActivity&quot;
                  android:theme=&quot;@android:style/Theme.NoTitleBar&quot; /&amp;gt;

        &amp;lt;provider android:name=&quot;.SuggestionProvider&quot;
                  android:authorities=&quot;com.example.search.SuggestionProvider&quot; /&amp;gt;

        &amp;lt;meta-data android:name=&quot;android.app.default_searchable&quot;
                   android:value=&quot;.Main&quot; /&amp;gt;
    
    &amp;lt;/application&amp;gt;
    &amp;lt;uses-sdk android:minSdkVersion=&quot;5&quot; /&amp;gt;
&amp;lt;/manifest&amp;gt; &lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Intent to Intercept Activity, responsible for search&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;After all these steps need to be processed in the main Intent Activity, which is responsible for the search.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Since we have determined the type of Intent for clues as View, then you just need to add a check on him.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;If the condition is satisfied, then starts RecordActivity, using the Intent, in which data is recorded URI + &quot;/&quot; + id tips in the table.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Integration with the Quick Search Box&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Once you have modified your application to use custom suggestions, you can add it to the system search.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;To do this, file searchable.xml need to add two parameters:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;android: includeInGlobalSearch = «true» - indicates that QSB can search for your application.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; list-style-image: initial; list-style-position: outside; list-style-type: decimal; margin-bottom: 0px; margin-left: 10px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;android: searchSettingsDescription = &quot;@ string / settings_description&quot; - points to a description of your application to be displayed when configuring the Quick Search Box.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;These settings are in settings-&amp;gt; search.&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;These options are available with version Android 1.6, that is for versions below you can not configure your application to QSB.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 16px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Source&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Presenting the complete source code for all required classes.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Main.java - main Activity, responsible for search and for sending requests to the content provider, RecordActivity.java - Intent receives data on a particular record, gets a reference to record and display information.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;SuggestionProvider.java - the content provider will handle the requests from the Search Manager&#39;a to the table hints.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;RecordsDbHelper.java - responsible for creating the table, filling it, the establishment of the necessary maps, and for myself «matching» records.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;File Main.java&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;package com.example.search;

import android.app.ListActivity;
import android.app.SearchManager;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.SimpleCursorAdapter;
import android.widget.Toast;

public class Main extends ListActivity {
 
    private EditText text;
    private Button add;
    private RecordsDbHelper mDbHelper;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 mDbHelper = new RecordsDbHelper(this);
  
 Intent intent = getIntent();
  
 if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
     //Берем строку запроса из экстры
     String query = intent.getStringExtra(SearchManager.QUERY);
     //Выполняем поиск
     showResults(query);
 } else if (Intent.ACTION_VIEW.equals(intent.getAction())){
         //Создаем Intent для открытия RecordActivity
                Intent recordIntent = new Intent(this, RecordActivity.class);
                recordIntent.setData(intent.getData());
                startActivity(recordIntent);
                finish();
 }
  
 add = (Button) findViewById(R.id.add);
 text = (EditText) findViewById(R.id.text);
 add.setOnClickListener(new View.OnClickListener() {
     public void onClick(View view) {
         String data = text.getText().toString();
  if (!data.equals(&quot;&quot;)) {
      saveTask(data);
      text.setText(&quot;&quot;);
  }
     }
 });
  
    }

    private void saveTask(String data) {
        mDbHelper.createRecord(data);
    }
 
    private void showResults(String query) {

     //Запрашиваем у контент-провайдера курсор на записи 
        Cursor cursor = managedQuery(SuggestionProvider.CONTENT_URI, null, null,
                                new String[] {query}, null);
        if (cursor == null) {
            Toast.makeText(this, &quot;There are no results&quot;, Toast.LENGTH_SHORT).show();
        } else {
         //Обновляем адаптер
            String[] from = new String[] { RecordsDbHelper.KEY_DATA };
            int[] to = new int[] { R.id.text1 };
            SimpleCursorAdapter records = new SimpleCursorAdapter(this, R.layout.record, cursor, from, to);
            getListView().setAdapter(records);            
        }        
    }
 

    //Создаем меню для вызова поиска (интерфейс в res/menu/main_menu.xml)
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true; 
    }

    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.search_record:
          onSearchRequested();
         return true;
            default:
            return super.onOptionsItemSelected(item);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Файл RecordActivity.java&lt;/b&gt;&lt;br /&gt;
&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;package com.example.search;

import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TextView;

public class RecordActivity extends Activity {

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

     //Получаем URI с данными из Intent и запрашиваем данные через контент-провайдер
     Uri uri = getIntent().getData();
            Cursor cursor = managedQuery(uri, null, null, null, null);

        if (cursor == null) {
            finish();
        } else {
            //Устанавливаем данные в текстовое поле
            cursor.moveToFirst();

            TextView record = (TextView) findViewById(R.id.record_header);
            int rIndex = cursor.getColumnIndexOrThrow(RecordsDbHelper.KEY_DATA);

            record.setText(cursor.getString(rIndex));
        }
    }
 
 //Создаем меню для вызова диалога поиска из этого активити
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.search_record:
                onSearchRequested();
                return true;
            default:
                return false;
        }
    }

}
&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;package com.example.search;

import android.app.SearchManager;
import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.net.Uri;
import android.provider.BaseColumns;

public class SuggestionProvider extends ContentProvider{

    private RecordsDbHelper mDbHelper;
    
    public static String AUTHORITY = &quot;com.example.search.SuggestionProvider&quot;;
    public static final Uri CONTENT_URI = Uri.parse(&quot;content://&quot; + AUTHORITY + &quot;/records&quot;);
    
    //MIME типы для getType()
    public static final String RECORDS_MIME_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
                                                  &quot;/vnd.example.search&quot;;
    public static final String RECORD_MIME_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE +
                                                  &quot;/vnd.example.search&quot;;

    //Для матчера разных URI
    private static final int SEARCH_RECORDS = 0;
    private static final int GET_RECORD = 1;
    private static final int SEARCH_SUGGEST = 2;
    private static final UriMatcher sURIMatcher = makeUriMatcher();
               
    @Override
    public boolean onCreate() {
        mDbHelper = new RecordsDbHelper(getContext());
        return true;
    }

    /**
     * Обрабатывает запросы от Search Manager&#39;a.
     * Когда запрашивается конкретный элемент, то требуется только URI.
     * Когда запрашивается поиск по всей таблице, то первый элемент параметра selectionArgs содержит строку запроса.
     * Остальные параметры не нужны.
     */
    @Override
    public Cursor query(Uri uri, String[] projection, String selection,
       String[] selectionArgs, String sortOrder) {
        //Используем UriMatcher, чтобы узнать какой тип запроса получен. Далее формируем соответствующий запрос к БД
        switch (sURIMatcher.match(uri)) {
            case SEARCH_SUGGEST:
                if (selectionArgs == null) {
                    throw new IllegalArgumentException(
                        &quot;selectionArgs must be provided for the Uri: &quot; + uri);
                }
                return getSuggestions(selectionArgs[0]);
            case SEARCH_RECORDS:
                if (selectionArgs == null) {
                    throw new IllegalArgumentException(
                        &quot;selectionArgs must be provided for the Uri: &quot; + uri);
                }
                return search(selectionArgs[0]);
            case GET_RECORD:
                return getRecord(uri);
            default:
                throw new IllegalArgumentException(&quot;Unknown Uri: &quot; + uri);
        }
 }
 
    private Cursor getSuggestions(String query) {
        query = query.toLowerCase();
        String[] columns = new String[] {
             BaseColumns._ID,
             RecordsDbHelper.KEY_DATA,
             SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID};
        return mDbHelper.getRecordMatches(query, columns);
    }
    
    private Cursor search(String query) {
        query = query.toLowerCase();
        String[] columns = new String[] {
            BaseColumns._ID,
            RecordsDbHelper.KEY_DATA};

        return mDbHelper.getRecordMatches(query, columns);
    }
    
    private Cursor getRecord(Uri uri) {
        String rowId = uri.getLastPathSegment();
        String[] columns = new String[] {
            RecordsDbHelper.KEY_DATA};

        return mDbHelper.getRecord(rowId, columns);
    }
    
    /**
     * Вспомогательный метод
     * нужен для сопоставления разным URI конкретных значений 
     */
    private static UriMatcher makeUriMatcher() {
        UriMatcher matcher =  new UriMatcher(UriMatcher.NO_MATCH);
        // Для записей
        matcher.addURI(AUTHORITY, &quot;records&quot;, SEARCH_RECORDS);
        matcher.addURI(AUTHORITY, &quot;records/#&quot;, GET_RECORD);
        // Для подсказок
        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, SEARCH_SUGGEST);
        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY + &quot;/*&quot;, SEARCH_SUGGEST);
        return matcher;
    }
 
    //Требуемые методы (наследуются от класса ContentProvider)
    @Override
    public String getType(Uri uri) {
        switch (sURIMatcher.match(uri)) {
            case SEARCH_RECORDS:
                return RECORDS_MIME_TYPE;
            case SEARCH_SUGGEST:
             return SearchManager.SUGGEST_MIME_TYPE;
            case GET_RECORD:
                return RECORD_MIME_TYPE;
            default:
                throw new IllegalArgumentException(&quot;Unknown URL &quot; + uri);
        } 
    }
 
    @Override
    public int update(Uri uri, ContentValues values, String selection,
                   String[] selectionArgs) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        throw new UnsupportedOperationException();
    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        throw new UnsupportedOperationException();
    }
 
&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;package com.example.search;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TextView;

public class RecordActivity extends Activity {

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

     //Получаем URI с данными из Intent и запрашиваем данные через контент-провайдер
     Uri uri = getIntent().getData();
            Cursor cursor = managedQuery(uri, null, null, null, null);

        if (cursor == null) {
            finish();
        } else {
            //Устанавливаем данные в текстовое поле
            cursor.moveToFirst();

            TextView record = (TextView) findViewById(R.id.record_header);
            int rIndex = cursor.getColumnIndexOrThrow(RecordsDbHelper.KEY_DATA);

            record.setText(cursor.getString(rIndex));
        }
    }
 
 //Создаем меню для вызова диалога поиска из этого активити
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.search_record:
                onSearchRequested();
                return true;
            default:
                return false;
        }
    }

}&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;File RecordActivity.java&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;package com.example.search;

import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TextView;

public class RecordActivity extends Activity {

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

     //Получаем URI с данными из Intent и запрашиваем данные через контент-провайдер
     Uri uri = getIntent().getData();
            Cursor cursor = managedQuery(uri, null, null, null, null);

        if (cursor == null) {
            finish();
        } else {
            //Устанавливаем данные в текстовое поле
            cursor.moveToFirst();

            TextView record = (TextView) findViewById(R.id.record_header);
            int rIndex = cursor.getColumnIndexOrThrow(RecordsDbHelper.KEY_DATA);

            record.setText(cursor.getString(rIndex));
        }
    }
 
 //Создаем меню для вызова диалога поиска из этого активити
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.search_record:
                onSearchRequested();
                return true;
            default:
                return false;
        }
    }

}&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;File SuggestionProvider.java&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;package com.example.search;

import android.app.SearchManager;
import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.net.Uri;
import android.provider.BaseColumns;

public class SuggestionProvider extends ContentProvider{

    private RecordsDbHelper mDbHelper;
    
    public static String AUTHORITY = &quot;com.example.search.SuggestionProvider&quot;;
    public static final Uri CONTENT_URI = Uri.parse(&quot;content://&quot; + AUTHORITY + &quot;/records&quot;);
    
    //MIME типы для getType()
    public static final String RECORDS_MIME_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
                                                  &quot;/vnd.example.search&quot;;
    public static final String RECORD_MIME_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE +
                                                  &quot;/vnd.example.search&quot;;

    //Для матчера разных URI
    private static final int SEARCH_RECORDS = 0;
    private static final int GET_RECORD = 1;
    private static final int SEARCH_SUGGEST = 2;
    private static final UriMatcher sURIMatcher = makeUriMatcher();
               
    @Override
    public boolean onCreate() {
        mDbHelper = new RecordsDbHelper(getContext());
        return true;
    }

    /**
     * Обрабатывает запросы от Search Manager&#39;a.
     * Когда запрашивается конкретный элемент, то требуется только URI.
     * Когда запрашивается поиск по всей таблице, то первый элемент параметра selectionArgs содержит строку запроса.
     * Остальные параметры не нужны.
     */
    @Override
    public Cursor query(Uri uri, String[] projection, String selection,
       String[] selectionArgs, String sortOrder) {
        //Используем UriMatcher, чтобы узнать какой тип запроса получен. Далее формируем соответствующий запрос к БД
        switch (sURIMatcher.match(uri)) {
            case SEARCH_SUGGEST:
                if (selectionArgs == null) {
                    throw new IllegalArgumentException(
                        &quot;selectionArgs must be provided for the Uri: &quot; + uri);
                }
                return getSuggestions(selectionArgs[0]);
            case SEARCH_RECORDS:
                if (selectionArgs == null) {
                    throw new IllegalArgumentException(
                        &quot;selectionArgs must be provided for the Uri: &quot; + uri);
                }
                return search(selectionArgs[0]);
            case GET_RECORD:
                return getRecord(uri);
            default:
                throw new IllegalArgumentException(&quot;Unknown Uri: &quot; + uri);
        }
 }
 
    private Cursor getSuggestions(String query) {
        query = query.toLowerCase();
        String[] columns = new String[] {
             BaseColumns._ID,
             RecordsDbHelper.KEY_DATA,
             SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID};
        return mDbHelper.getRecordMatches(query, columns);
    }
    
    private Cursor search(String query) {
        query = query.toLowerCase();
        String[] columns = new String[] {
            BaseColumns._ID,
            RecordsDbHelper.KEY_DATA};

        return mDbHelper.getRecordMatches(query, columns);
    }
    
    private Cursor getRecord(Uri uri) {
        String rowId = uri.getLastPathSegment();
        String[] columns = new String[] {
            RecordsDbHelper.KEY_DATA};

        return mDbHelper.getRecord(rowId, columns);
    }
    
    /**
     * Вспомогательный метод
     * нужен для сопоставления разным URI конкретных значений 
     */
    private static UriMatcher makeUriMatcher() {
        UriMatcher matcher =  new UriMatcher(UriMatcher.NO_MATCH);
        // Для записей
        matcher.addURI(AUTHORITY, &quot;records&quot;, SEARCH_RECORDS);
        matcher.addURI(AUTHORITY, &quot;records/#&quot;, GET_RECORD);
        // Для подсказок
        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, SEARCH_SUGGEST);
        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY + &quot;/*&quot;, SEARCH_SUGGEST);
        return matcher;
    }
 
    //Требуемые методы (наследуются от класса ContentProvider)
    @Override
    public String getType(Uri uri) {
        switch (sURIMatcher.match(uri)) {
            case SEARCH_RECORDS:
                return RECORDS_MIME_TYPE;
            case SEARCH_SUGGEST:
             return SearchManager.SUGGEST_MIME_TYPE;
            case GET_RECORD:
                return RECORD_MIME_TYPE;
            default:
                throw new IllegalArgumentException(&quot;Unknown URL &quot; + uri);
        } 
    }
 
    @Override
    public int update(Uri uri, ContentValues values, String selection,
                   String[] selectionArgs) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        throw new UnsupportedOperationException();
    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        throw new UnsupportedOperationException();
    }
 
}&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;___&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: normal;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;RecordsDbHelper.java&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: normal;&quot;&gt;&lt;b style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font-weight: bold; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt;package com.example.search;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
import java.util.HashMap;

import android.app.SearchManager;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
import android.provider.BaseColumns;
import android.util.Log;

public class RecordsDbHelper {

    //Единственный столбец в таблице - данные
    public static final String KEY_DATA = SearchManager.SUGGEST_COLUMN_TEXT_1;

    private static final String TAG = &quot;RecordsDbHelper&quot;;
    private DatabaseHelper mDbHelper;
    private SQLiteDatabase mDb;

    private static final String DATABASE_NAME = &quot;datas&quot;;
    private static final String DATABASE_TABLE = &quot;records&quot;;
    private static final int DATABASE_VERSION = 2;
 
    //Сценарий создания БД
    private static final String DATABASE_CREATE =
  &quot;CREATE VIRTUAL TABLE &quot; + DATABASE_TABLE +
                &quot; USING fts3 (&quot; + KEY_DATA + &quot;);&quot;; 

    private static final HashMap&amp;lt;String,String&amp;gt; mColumnMap = buildColumnMap();
 
    /**
     * Возвращает курсор, указывающий на запись с rowId
     * @param rowId id возвращаемой записи
     * @param columns возвращаемые столбцы записи; если null, то все 
     * @return курсор, указывающий на определенную запись, null - если не запись не найдена
     */
    public Cursor getRecord(String rowId, String[] columns) {
        String selection = &quot;rowid = ?&quot;;
        String[] selectionArgs = new String[] {rowId};

        return query(selection, selectionArgs, columns);
    }
    
    /**
     * Возвращает курсор, указывающий на все записи, совпадающие с запросом
     * @param query текст поискового запроса
     * @param columns возвращаемые столбцы записи; если null, то все 
     * @return курсор, указывающий на записи, совпадающие с запросом, null - если не записи не найдена
     */
    public Cursor getRecordMatches(String query, String[] columns) {
        String selection = KEY_DATA + &quot; MATCH ?&quot;;
        String[] selectionArgs = new String[] {query+&quot;*&quot;};

        return query(selection, selectionArgs, columns);
    }
    
    /**
     * Создает отображение всевозможных запрашиваемых столбцов.
     * Будет установлено как проекция в SQLiteQueryBuilder.
     * Нужно для того, чтобы назначить для каждой записи уникальные значения SUGGEST_COLUMN_INTENT_DATA_ID
     * которые используются для получения конкретной записи по URI.
     */
    private static HashMap&amp;lt;String,String&amp;gt; buildColumnMap() {
        HashMap&amp;lt;String,String&amp;gt; map = new HashMap&amp;lt;String,String&amp;gt;();
        map.put(KEY_DATA, KEY_DATA);
        map.put(BaseColumns._ID, &quot;rowid AS &quot; +
                BaseColumns._ID);
        map.put(SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID, &quot;rowid AS &quot; +
                SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID);
        return map;
    }

    /**
     * 
     * @param selection оператор выборки
     * @param selectionArgs аргументы, заменяющие &quot;?&quot; в запросе к БД
     * @param columns возвращаемые столбцы записи
     * @return курсор, указывающий на все записи, совпадающие с поисковым запросом
     */
    private Cursor query(String selection, String[] selectionArgs, String[] columns) {
        /* SQLiteBuilder предоставляет возможность создания отображения для всех
         * необходимых столбцов БД, что позволяет не сообщать контент-провайдеру
         * настоящие имена столбцов.
         */

        SQLiteQueryBuilder builder = new SQLiteQueryBuilder();
        builder.setTables(DATABASE_TABLE);
        builder.setProjectionMap(mColumnMap);

        Cursor cursor = builder.query(mDbHelper.getReadableDatabase(),
                columns, selection, selectionArgs, null, null, null);
        if (cursor == null) {
            return null;
        } else if (!cursor.moveToFirst()) {
            cursor.close();
            return null;
        }
        return cursor;
    }    
     
    /**
     *Создает/открывает БД
     */
    private static class DatabaseHelper extends SQLiteOpenHelper {
  
        DatabaseHelper(Context context) {
  super(context, DATABASE_NAME, null, DATABASE_VERSION);
 }

 @Override
 public void onCreate(SQLiteDatabase db) {
     db.execSQL(DATABASE_CREATE);
 }

 @Override
 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
     Log.w(TAG, &quot;Upgrading database from version &quot; + oldVersion + &quot; to &quot;
   + newVersion + &quot;, which will destroy all old data&quot;);
     db.execSQL(&quot;DROP TABLE IF EXISTS records&quot;);
     onCreate(db);
 }
    }

    public RecordsDbHelper(Context context) {
        mDbHelper = new DatabaseHelper(context);
    }

    /**
     * Добавляет запись в таблицу
     * @param data данные, сохраняемые в таблицу
     * @return id записи, или -1, если добавление не удалось
     */
    public long createRecord(String data) {
        mDb = mDbHelper.getWritableDatabase();
 ContentValues initialValues = new ContentValues();
 initialValues.put(KEY_DATA, data);
 return mDb.insert(DATABASE_TABLE, null, initialValues);
    }
 
}&lt;/code&gt;&lt;/pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font: inherit; line-height: 20px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;The whole project can take on&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://code.google.com/p/androidsearchexample&amp;amp;usg=ALkJrhgfYyia14NQiWfWA0H2ANsrX_A_Ww&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #6da3bd; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;code.google.com&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 13px; font: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Thank you!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/6489950534362983958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/6489950534362983958'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/10/using-android-search-dialog-part-3.html' title='Using Android Search Dialog. Part 3 - Custom Suggestions'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-1088994971135069873</id><published>2011-09-30T15:35:00.000-07:00</published><updated>2011-09-30T15:35:56.094-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Density"/><category scheme="http://www.blogger.com/atom/ns#" term="devices"/><category scheme="http://www.blogger.com/atom/ns#" term="geometric factor"/><category scheme="http://www.blogger.com/atom/ns#" term="manifest"/><category scheme="http://www.blogger.com/atom/ns#" term="Screen size"/><title type='text'>Android-compatible applications on different devices</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span&gt;It&#39;s no secret that the number of devices on the Android large, they differ in hardware, screen size and quality, processing power, and others.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Unlike the iPhone-programmers who know for sure on which device will be running their app, Android-developers need to focus on application compatibility with different devices.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;span&gt;This article focuses on the interoperability of applications, especially applications display on screens with different resolutions and diagonals.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/1c/0d/1c0d62af60b032a3393a0b02e00317b5.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span&gt;First we need to understand the opportunities offered by Android for the screen.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Basics&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Screen size&lt;/b&gt;&amp;nbsp;(screen size) - the physical size of the screen, the predefined values: small, normal, large, extra large *.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;The geometric factor&lt;/b&gt;&amp;nbsp;(aspect ratio) - the ratio of the physical proportions of the screen (width to height), pre-defined values: long (for screens whose size exceeds the width or height of a standard screen size), notlong (for screens whose dimensions correspond to the standard).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Density&lt;/b&gt;&amp;nbsp;(density) - the distribution of pixels with respect to the physical size of the screen.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The density distribution of pixels is important because the same UI element, expressed in pixels for screens with a lower density will appear more than screens high.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Predefined values ​​for the density: ldpi (low), mdpi (medium), hdpi (high), and xhdpi *.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Independent&lt;/b&gt;&amp;nbsp;(from density)&amp;nbsp;&lt;b&gt;pixel&lt;/b&gt;&amp;nbsp;(density-independent or dp) - &quot;virtual&quot; pixel, which can be used to draw the application UI-elements.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This pixel is equivalent to the physical pixel on the screen with a density of 160 dpi.&lt;/span&gt;&lt;span&gt;During the execution of OS Android draws element in accordance with the formula pixel = dp * (density/160), where the density - density of the screen.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;It is also worth noting that OS Android works with the screen resolution, through the values ​​of the density screen (no tools to work directly with the resolution of the developer does not have).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The figure below shows the correlation between density and size of the screen device with predetermined values ​​of these quantities.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/b7/85/b785d728597d92a213a0eebda92facb9.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;* Another point worthy of note: the density xdpi was added to the version of Android 2.2 (API level 8), meaning the screen xlarge - a version of Android 2.3 (API level 9)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Working with the manifest and resource allocation&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;Starting with version Android 1.6, was added to the manifest tag &amp;lt;support-screens&amp;gt;, which is used to define a class of devices, which may be running.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Tag attributes smallScreens, normalScreens, largeScreens, xlargeScreens correspond to certain values ​​above the screen and can be true or false.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Default attribute values ​​vary depending on the version of Android (more details can be found&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/guide/practices/screens_support.html&amp;amp;usg=ALkJrhgXbJFSwLmuVyzLuTtYztIRzeg76w#attrs&quot; style=&quot;color: #6da3bd;&quot;&gt;here&lt;/a&gt;&amp;nbsp;.).&lt;/span&gt;&amp;nbsp;&lt;span&gt;In determining the value of an attribute as true, OS Android gets a signal that is compatible with the appropriate type of screen and does not use additional funding for interoperability (which occurs at a value of false).&lt;/span&gt;&amp;nbsp;&lt;span&gt;It is also worth noting that these tools (functions) are only for compatibility with larger screen sizes (so, if the value normalScreen - true, the rest - false, the application is also compatible with screens large and xlarge, but not compatible with small) .&lt;/span&gt;&amp;nbsp;&lt;span&gt;This tag is also used to filter Market&#39;om Android applications.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The density also has an attribute - anyDensity, which also takes values ​​true / false.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If the attribute value - true, OS Android does not use functions for compatibility with different densities of the screen.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this case, the application must use dp for rendering UI elements, or to manage the calculation of the sizes for different densities.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If the value - false, OS Android includes functions for scaling the elements in accordance with the density of the screen.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Allocation of resources&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;OS Android also provides a means to identify resources that will be used for specific screen sizes and densities.&lt;/span&gt;&lt;span&gt;Resources are placed in appropriate folders.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code style=&quot;font-size: 1em;&quot;&gt;res/layout/my_layout.xml // layout for normal screen size&lt;br /&gt;
res/layout-small/my_layout.xml // layout for small screen size&lt;br /&gt;
res/layout-large/my_layout.xml // layout for large screen size&lt;br /&gt;
res/layout-large-land/my_layout.xml // layout for large screen size in landscape mode&lt;br /&gt;
res/layout-xlarge/my_layout.xml // layout for extra large screen size&lt;br /&gt;
&lt;br /&gt;
res/drawable-ldpi/my_icon.png // image for low density&lt;br /&gt;
res/drawable-mdpi/my_icon.png // image for medium density&lt;br /&gt;
res/drawable-hdpi/my_icon.png // image for high density&lt;br /&gt;
&lt;br /&gt;
res/drawable-nodpi/composite.xml // density independent resource&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Interoperability support screens&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;Briefly support mechanism can be described using the following steps:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;OS Android gets a tag attribute values ​​support-screens of the manifesto.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Loaded resources for the appropriate screen size and density (this happens regardless of the data obtained in step 1).&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;In accordance with Clause 1 OS Android includes / does not include features to ensure compatibility.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Produced drawing elements.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;General recommendations for creating compliant application&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Use the values ​​wrap_content, fill_parent, dp in the mock.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Avoid the use of AbsoluteLayout.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Use class methods ViewConfiguration for standard values ​​size, speed, time.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Use different resources for different values ​​of the density and size of the screen.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Afterword&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;The article does not cover practical matters related to testing applications on devices with different characteristics of screens, I think it&#39;s highlight in a separate post.&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/1088994971135069873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/1088994971135069873'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/android-compatible-applications-on.html' title='Android-compatible applications on different devices'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-4515147046227795676</id><published>2011-09-30T15:33:00.000-07:00</published><updated>2011-09-30T15:33:01.840-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="development"/><title type='text'>Standard application development for Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Android developer is faced with large numbers of files and resources designed for different parts of the program.Even after a month he can not remember which file or resource to which belongs.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;span&gt;Material presented below is based on my experience of many development projects for Android and has been tested in several projects.&lt;/span&gt;&amp;nbsp;&lt;span&gt;As a result, simple rules pile of files and resources into a readable project, saves time and nerves.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Especially when it is convenient to work in a team where the project can join the new programmers.&lt;/span&gt;&lt;span&gt;In Eclipse, you can easily find any resources because they are unique, easy-to-find and understandable manner are sorted in any lists.&lt;/span&gt;&amp;nbsp;&lt;span&gt;General rules allow convenient easy to read someone else&#39;s code and find the necessary resources.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;span&gt;&lt;u&gt;Most of these are my personal opinion.&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #999999; font-weight: bold; line-height: 20px;&quot;&gt;Standard application development Android&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The names of all files&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;br /&gt;
The file name is written in small letters, reflect the human-readable name of the element, perhaps a few words.Gap is replaced by an underscore.&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Location of user files on an SD card&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;br /&gt;
The root directory for all user files, except for time:&lt;br /&gt;
&lt;b&gt;/ Sdcard / project name /&lt;/b&gt;&amp;nbsp;example&amp;nbsp;&lt;b&gt;/ sdcard / TalentMania /&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Catalog for music:&lt;br /&gt;
&lt;b&gt;/ Sdcard / project name / sound /,&lt;/b&gt;&amp;nbsp;eg&amp;nbsp;&lt;b&gt;/ sdcard / TalentMania / sound /&lt;/b&gt;&lt;br /&gt;
Directory for MIDI:&lt;br /&gt;
&lt;b&gt;/ Sdcard / project name / midi /,&lt;/b&gt;&amp;nbsp;eg&amp;nbsp;&lt;b&gt;/ sdcard / TalentMania / midi /&lt;/b&gt;&lt;br /&gt;
The directory for graphics:&lt;br /&gt;
&lt;b&gt;/ Sdcard / project name / img /,&lt;/b&gt;&amp;nbsp;eg&amp;nbsp;&lt;b&gt;/ sdcard / TalentMania / img /&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Subdirectories for files of various aktiviti:&lt;br /&gt;
&lt;b&gt;/ Sdcard / project name / img / title aktiviti /&lt;/b&gt;&amp;nbsp;example&amp;nbsp;&lt;b&gt;/ sdcard / TalentMania / img / guitar /&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Location of temporary files - use the standard functions of a class File:&lt;br /&gt;
&lt;b&gt;createTempFile (String prefix, String suffix, File directory)&lt;/b&gt;&lt;br /&gt;
Creates an empty temporary file in the given directory using the given prefix and suffix as part of the file name.&lt;br /&gt;
&lt;b&gt;createTempFile (String prefix, String suffix)&lt;/b&gt;&lt;br /&gt;
Creates an empty temporary file using the given prefix and suffix as part of the file name.&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Location of files in the application resources&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
The graphics and sounds for use in assetsah (eg library AndEngine) are grouped into the following directories:&lt;br /&gt;
MIDI files -&amp;nbsp;&lt;b&gt;assets / midi /&lt;/b&gt;&lt;br /&gt;
The graphics for sprites -&amp;nbsp;&lt;b&gt;assets / gfx /&lt;/b&gt;&lt;br /&gt;
TTF fonts -&amp;nbsp;&lt;b&gt;assets / font /&lt;/b&gt;&lt;br /&gt;
Common files used by different activity are placed in the root.&amp;nbsp;Files used by only one activity are placed in the subdirectory, for example:&amp;nbsp;&lt;b&gt;assets / gfx / guitar /&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
MP3 files are placed in the directory&amp;nbsp;&lt;b&gt;res / raw /.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Names Icons&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
In the names of icons prefix describing the type of&lt;br /&gt;
&lt;br /&gt;
Icons&amp;nbsp;&lt;b&gt;ic_&lt;/b&gt;&amp;nbsp;Example:&amp;nbsp;&lt;b&gt;ic_star.png&lt;/b&gt;&lt;br /&gt;
Will start&amp;nbsp;&lt;b&gt;ic_launcher_&lt;/b&gt;&amp;nbsp;Example:&amp;nbsp;&lt;b&gt;ic_launcher_calendar.png&lt;/b&gt;&lt;br /&gt;
The icons&amp;nbsp;&lt;b&gt;ic_menu_&lt;/b&gt;&amp;nbsp;Example:&amp;nbsp;&lt;b&gt;ic_menu_archive.png&lt;/b&gt;&lt;br /&gt;
Status bar icon&amp;nbsp;&lt;b&gt;ic_stat_sys_&lt;/b&gt;&amp;nbsp;or&amp;nbsp;&lt;b&gt;ic_stat_notify_&lt;/b&gt;&amp;nbsp;Example:&amp;nbsp;&lt;b&gt;ic_stat_notify_msg.png&lt;/b&gt;&lt;br /&gt;
Icons tab&amp;nbsp;&lt;b&gt;ic_tab_&lt;/b&gt;&amp;nbsp;Example:&amp;nbsp;&lt;b&gt;ic_tab_recent.png&lt;/b&gt;&lt;br /&gt;
Icons dialogue&amp;nbsp;&lt;b&gt;ic_dialog_&lt;/b&gt;&amp;nbsp;Example:&amp;nbsp;&lt;b&gt;ic_dialog_info.png&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Buttons&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;b&gt;bt_imya_pressed.png&lt;/b&gt;&amp;nbsp;(click image) and&amp;nbsp;&lt;b&gt;bt_imya_default.png&lt;/b&gt;&amp;nbsp;(default image)&lt;br /&gt;
xml describing the animation is stored in&amp;nbsp;&lt;u&gt;drawable!&lt;/u&gt;&amp;nbsp;-&amp;nbsp;&lt;b&gt;bt_imya.xml&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Layouts&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
main leyauty correspond to names of callers aktiviti.&lt;br /&gt;
&lt;b&gt;ac_nazvanie_klassa.xml&lt;/b&gt;&amp;nbsp;- matches the name of the class aktiviti&amp;nbsp;&lt;b&gt;AcNazvanieKlassa.java.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Additional view for this leyauta correspond to names of callers aktiviti + name&lt;b&gt;ac_название_класса_название_view_название.xml&lt;/b&gt;&amp;nbsp;view&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;view_nazvanie_view.xml&lt;/b&gt;&amp;nbsp;- general view for different leyautov.&lt;br /&gt;
&lt;b&gt;adt_nazvanie_adaptera.xml&lt;/b&gt;&amp;nbsp;- leyauta name for the adapter list&lt;br /&gt;
&lt;b&gt;dialog_nazvanie_dialoga.xml&lt;/b&gt;&amp;nbsp;- the name of dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Names of elements in the layout&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
Name of the element used in the layout -&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/h5&gt;For&amp;nbsp;&lt;b&gt;example: android: id = &quot;@ + id / &lt;i&gt;&lt;u&gt;Ac&lt;/u&gt;&lt;/i&gt;MenuTemplateTopPanel&quot;&lt;/b&gt;&amp;nbsp;indicates that the element is called &quot;top panel&quot; and is intended for aktiviti&amp;nbsp;&lt;b&gt;AcMenuTemplate&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Animation&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
definition files are stored in the animation&amp;nbsp;&lt;b&gt;res / drawable.&lt;/b&gt;&lt;br /&gt;
For buttons -&amp;nbsp;&lt;b&gt;bt_imya_anim.png&lt;/b&gt;&lt;br /&gt;
For animation -&amp;nbsp;&lt;b&gt;anim_имя_активити_имя_анимации.png&lt;/b&gt;&lt;br /&gt;
If a lot of animation, it is more convenient to place it in a separate directory&amp;nbsp;&lt;b&gt;res / anim&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Graphics&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
Background -&amp;nbsp;&lt;b&gt;bg_orientatsiya_imya.png.&lt;/b&gt;&lt;br /&gt;
Image -&amp;nbsp;&lt;b&gt;im_imya.png&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Name of Package&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
Aktiviti -&amp;nbsp;&lt;b&gt;activities&lt;/b&gt;&lt;br /&gt;
Adapters -&amp;nbsp;&lt;b&gt;adapters&lt;/b&gt;&lt;br /&gt;
Data -&amp;nbsp;&lt;b&gt;data&lt;/b&gt;&lt;br /&gt;
Dialogs -&amp;nbsp;&lt;b&gt;dialogs&lt;/b&gt;&lt;br /&gt;
Interfaces -&amp;nbsp;&lt;b&gt;interfaces&lt;/b&gt;&lt;br /&gt;
Types -&amp;nbsp;&lt;b&gt;views&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Name class&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
Aktiviti -&amp;nbsp;&lt;b&gt;AcNazvanieAktiviti&lt;/b&gt;&lt;br /&gt;
Adapters for lists -&amp;nbsp;&lt;b&gt;AdtNazvanieAdaptera&lt;/b&gt;&lt;br /&gt;
Dialogs -&amp;nbsp;&lt;b&gt;DialogNazvanieDialoga&lt;/b&gt;&lt;br /&gt;
Interface&amp;nbsp;&lt;b&gt;NazvanieInterfeysaInterface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Result&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
The proposed standard is not a dogma, and always subject to change with the accumulation of empirical experience.&amp;nbsp;I hope to hear feedback and suggestions on this topic.&amp;nbsp;It is interesting to know the experience of other developers.&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4515147046227795676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4515147046227795676'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/standard-application-development-for.html' title='Standard application development for Android'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-7822228446847610251</id><published>2011-09-30T15:29:00.000-07:00</published><updated>2011-09-30T15:29:34.345-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="exceptions"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Style"/><category scheme="http://www.blogger.com/atom/ns#" term="methods"/><title type='text'>Recommendations to the style code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #999999; font-family: Verdana, sans-serif; font-size: 16px; font-weight: bold; line-height: 20px;&quot;&gt;The rules of the Java language&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;span&gt;We follow standard conventions for the design of code in Java.&lt;/span&gt;&amp;nbsp;&lt;span&gt;We have added to them some of the rules:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Exceptions: never steal and do not ignore them without explanation.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Exceptions: Do not use generic exceptions, but the code in the libraries at the root of the stack.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Finalizers do not use them.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Imports: fully qualify the imports.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Rules for Java libraries&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;There is agreement about the use of Java libraries and tools for Android.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In some cases, the agreement may be modified, for example, such as using the old code that may be using unapproved pattern or a library.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Rules of Java Style&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Program is much easier to maintain when all files have a consistent style.&lt;/span&gt;&amp;nbsp;&lt;span&gt;We follow the standard style of programming in Java, particular in their Sun&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html&amp;amp;usg=ALkJrhj7f0vTNuuyH0nEw67H--AdRf_6zA&quot; style=&quot;color: #6da3bd;&quot;&gt;Code Conventions for the Java Programming Language&lt;/a&gt;&amp;nbsp;, with a few exceptions and additions.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This style guide is a detailed and comprehensive and widely used Java community.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In addition, we will be obliged to use these rules to the code:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Comments / Javadoc: write them, use a standard style.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Short methods: do not write huge methods.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Margins should be at the top of the file, or directly in front of a method that uses them.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Local variables: limit the scope.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Imports: android; third party (in alphabetical order); java (x)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Padding: 4 spaces, not tabs.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The string length: 100 characters.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Field names: not public, and non-static fields begin with «m».&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Braces: opening braces are not in a separate line.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Abstracts: Use standard annotations.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Abbreviations: abbreviate words as names, for example, XmlHttpRequest, getUrl (), etc.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Style TODO: «TODO: write a description here.&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Consistency: see what&#39;s around you.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The rules of the Java language&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Do not ignore exceptions&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;You may want to write code that ignores exceptions, such as:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; setServerPort(String value) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;try&lt;/span&gt; { serverPort = Integer.parseInt(value); } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;catch&lt;/span&gt; (NumberFormatException e) { } }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;Do not ever do it.&lt;/span&gt;&amp;nbsp;&lt;span&gt;While you think your code will never run into such a condition, or that it does not matter to handle this condition, ignoring exceptions creates hidden problems.&lt;/span&gt;&amp;nbsp;&lt;span&gt;You basically have to handle each exception.&lt;/span&gt;&lt;span&gt;The specifics of each case depends on the situation.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Acceptable alternatives:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Shift your exceptions to the caller.&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; setServerPort(String value) &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;throws&lt;/span&gt; NumberFormatException { serverPort = Integer.parseInt(value); }&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Throw an exception, according to your level of abstraction&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; setServerPort(String value) &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;throws&lt;/span&gt; ConfigurationException { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;try&lt;/span&gt; { serverPort = Integer.parseInt(value); } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;catch&lt;/span&gt; (NumberFormatException e) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; ConfigurationException(&lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;Port &quot;&lt;/span&gt; + value + &lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot; is not valid.&quot;&lt;/span&gt;); } }&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Catch the error and replace the corresponding value in the block catch {}&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;javadoc&quot; style=&quot;color: grey;&quot;&gt;/** Set port. If value is not a valid number, 80 is substituted. */&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; setServerPort(String value) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;try&lt;/span&gt; { serverPort = Integer.parseInt(value); } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;catch&lt;/span&gt; (NumberFormatException e) { serverPort = &lt;span class=&quot;number&quot; style=&quot;color: #2f98ff;&quot;&gt;80&lt;/span&gt;; &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// default port for server } }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Catch the error and throw RuntimeException.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It is dangerous to do so only if you still happen if the issue is.&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;javadoc&quot; style=&quot;color: grey;&quot;&gt;/** Set port. If value is not a valid number, die. */&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; setServerPort(String value) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;try&lt;/span&gt; { serverPort = Integer.parseInt(value); } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;catch&lt;/span&gt; (NumberFormatException e) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; RuntimeException(&lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;port &quot;&lt;/span&gt; + value &lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot; is invalid, &quot;&lt;/span&gt;, e); } }&lt;/code&gt;&lt;/pre&gt;&lt;span&gt;Note that the original exception is passed to the RuntimeException.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If you use a compiler to Java 1.3, then lower the exception.&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;If you believe that ignoring an exception in this case occurs, then at least comment on why you think so.&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;javadoc&quot; style=&quot;color: grey;&quot;&gt;/** If value is not a valid number, original port number is used. */&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; setServerPort(String value) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;try&lt;/span&gt; { serverPort = Integer.parseInt(value); } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;catch&lt;/span&gt; (NumberFormatException e) { &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// Method is documented to just ignore invalid user input. // serverPort will just be unchanged. } }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Do not catch generic exceptions&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;Sometimes it&#39;s tempting to be lazy with exception handling and write something like this:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;try&lt;/span&gt; { someComplicatedIOFunction(); &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// may throw IOException someComplicatedParsingFunction(); // may throw ParsingException someComplicatedSecurityFunction(); // may throw SecurityException // phew, made it all the way } catch (Exception e) { // I&#39;ll just catch all exceptions handleError(); // with one generic handler! }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;You should not do so.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The bottom line is that you may receive an exception, which you did not expect and, eventually, will catch the error at the application level.&lt;/span&gt;&amp;nbsp;&lt;span&gt;That is, if someone adds a new exception type, the compiler will not be able to help you understand that this is another error.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;There are rare exceptions to this rule: certain test code, or code top level where you want to capture all types of errors (in order to prevent their display in the user interface, or to pursue some kind of batch jobs).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Alternatives to the generalized exclusions:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Intercepts each exception separately in the block catch, after a single try.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Maybe it&#39;s inconvenient, but it is still the preferred way to catch all exceptions.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Change your code to a more granular error handling with several blocks try.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Separate IO of parsing, error handling on a case.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Perebroste exception.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In many cases you do not need to handle all exceptions to the current level, just let the method throw them.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span&gt;Remember: the exception - your friends!&lt;/span&gt;&amp;nbsp;&lt;span&gt;Do not get angry when the compiler points to the fact that you do not catches.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Finalizers&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;What it is:&lt;/b&gt;&amp;nbsp;Finalizers - a way to run code before the object is going to the garbage collector.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Pros:&lt;/b&gt;&amp;nbsp;can be useful in treatment, particularly external resources.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Cons:&lt;/b&gt;&amp;nbsp;there is no guarantee when a finalizer will be invoked and, in general, whether it is called.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Solution:&lt;/b&gt;&amp;nbsp;We do not use finalizers.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In most cases, all that you need from a finalizer, you can do with exception handling.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If you really need a finalizer, then declare the close () and document when it is sure to be invoked.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Imports&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;h6 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The wildcard character in the import&lt;/span&gt;&lt;/h6&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;What it is:&lt;/b&gt;&amp;nbsp;When you wish to use Class Bar of package foo, there are two ways to do this:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; foo.*;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; foo.Bar;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;For # 1:&lt;/b&gt;&amp;nbsp;Potentially reduces the number of possible import statements.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;For # 2:&lt;/b&gt;&amp;nbsp;Make it clear which class is actually used.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Makes the code more readable for those who support it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Solution:&lt;/b&gt;&amp;nbsp;Use the style # 2 for the import of any Android code.&lt;/span&gt;&amp;nbsp;&lt;span&gt;An explicit exception is made for the standard libraries (java.util .*, java.io. *, etc) and code for unit testing (junit.framework .*).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Comments / Javadoc&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Each file must have the copyright notice at the beginning.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Next come the announcement of the operators package and import, with each block separated by blank lines.&lt;/span&gt;&amp;nbsp;&lt;span&gt;They are followed by announcements of a class or interface.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Describe what makes the class Javadoc-comments.&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;/* * Copyright © 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;package&lt;/span&gt; com.android.internal.foo; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.os.Blah; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.view.Yada; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; java.sql.ResultSet; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; java.sql.SQLException; &lt;span class=&quot;javadoc&quot; style=&quot;color: grey;&quot;&gt;/** * Does X and Y and provides an abstraction for Z. */&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot; style=&quot;color: black;&quot;&gt;Foo&lt;/span&gt; {&lt;/span&gt; ... }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;Each class is trivial and a public method must contain Javadoc, with at least one sentence that describes what it does.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The phrase should begin with a descriptive verb third person.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Examples:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;javadoc&quot; style=&quot;color: grey;&quot;&gt;/** Returns the correctly rounded positive square root of a double value. */&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;double&lt;/span&gt; sqrt(&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;double&lt;/span&gt; a) { } &lt;span class=&quot;javadoc&quot; style=&quot;color: grey;&quot;&gt;/** * Constructs a new String by converting the specified array of * bytes using the platform&#39;s default character encoding. */&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; String(&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;byte&lt;/span&gt;[] bytes) { }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;You do not need to describe the Javadoc for trivial get and set methods, such as setFoo (), if your Javadoc says only «sets Foo».&lt;/span&gt;&amp;nbsp;&lt;span&gt;If a method does something more complex (eg, compliance with certain restrictions, or if his actions have an important effect outside of himself), then it must be documented.&lt;/span&gt;&amp;nbsp;&lt;span&gt;And if it is not simply an explanation of what it means to Foo, then you should also document it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In general, any method that you write can benefit from Javadoc, no matter public or not.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Public methods are part of the API, so they require a description of the Javadoc.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;To write Javadoc&#39;ov you should follow the&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://java.sun.com/j2se/javadoc/writingdoccomments/&amp;amp;usg=ALkJrhi55ktUl-EXcRMRRWG_Eil-1zrn-Q&quot; style=&quot;color: #6da3bd;&quot;&gt;Sun Javadoc conventions&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Short methods&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Methods should be short and to solve specific problems as much as possible.&lt;/span&gt;&amp;nbsp;&lt;span&gt;However, it is clear that some great methods are feasible, so there is no strict limit to the length of the method.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If the method is more than 40 rows, then you may want to consider whether we can break it into pieces, without breaking the structure of the program.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Local variables&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;The scope of local variables should be kept to a minimum.&lt;/span&gt;&amp;nbsp;&lt;span&gt;By doing this, you improve the readability and maintainability of code, as well as reduce the likelihood of errors.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Each variable must be declared in the deepest unit, which surrounds all the possible locations of the variable.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Local variables must be declared at the place where for the first time to use it.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Nearly every local variable needs initializer.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If you do not know exactly how to initialize a variable, then you should postpone its announcement until you do not know.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;There is one exception, on the block try-catch.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If the variable is initialized with the return statement of the method that throws a checked exception, it must be initialized in the block try.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If the variable should be used outside the block try, then it is declared in front of him, no matter whether you know exactly how it needs to be initialized:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// Instantiate class cl, which represents some sort of Set Set s = null; try { s = (Set) cl.newInstance(); } catch(IllegalAccessException e) { throw new IllegalArgumentException(cl + &quot; not accessible&quot;); } catch(InstantiationException e) { throw new IllegalArgumentException(cl + &quot; not instantiable&quot;); } // Exercise the set s.addAll(Arrays.asList(args));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;But even this case can be avoided by encapsulating try-catch block in the method.&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;Set createSet(Class cl) { &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// Instantiate class cl, which represents some sort of Set try { return (Set) cl.newInstance(); } catch(IllegalAccessException e) { throw new IllegalArgumentException(cl + &quot; not accessible&quot;); } catch(InstantiationException e) { throw new IllegalArgumentException(cl + &quot; not instantiable&quot;); } } ... // Exercise the set Set s = createSet(cl); s.addAll(Arrays.asList(args));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;The variables in loops to be declared within the operator, unless there are compelling reasons not to do so.&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; i = &lt;span class=&quot;number&quot; style=&quot;color: #2f98ff;&quot;&gt;0&lt;/span&gt;; i &amp;lt;= n; i++) { doSomething(i); } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;for&lt;/span&gt; (Iterator i = c.iterator(); i.hasNext(); ) { doSomethingElse(i.next()); }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Imports&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;The order of import statements as follows:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Android imports.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;From imports (com, junit, net, org).&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;java and javax.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;span&gt;To fully comply setting IDE, imports should be the following:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Sorted alphabetically within each group.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Capital letters should be in front of lower case letters (for example, Z in front of a).&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The main groups should be separated by a blank line.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Why?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Order such that:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Imports, which people want to see in the first place, are at the top (android).&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Imports, which people want to see as a last resort, located at the bottom (java).&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;People can easily use this style.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;IDE can follow this style.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Indentation&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;We use 4 spaces for blocks.&lt;/span&gt;&amp;nbsp;&lt;span&gt;We never use tabs.&lt;/span&gt;&amp;nbsp;&lt;span&gt;We use 8 spaces for wrapping, including function calls and assignments, such as correctly as follows:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;Instrument i = someLongExpression(that, wouldNotFit, on, one, line);&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;and so true:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;Instrument i = someLongExpression(that, wouldNotFit, on, one, line);&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Field names&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Not static, not public names begin c «m».&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;static fields begin with «s».&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Other fields begin with a lowercase letter.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Fields public static final (constant) is written entirely in upper case with underscores (ALL_CAPS_WITH_UNDERSCORES)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span&gt;For example:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot; style=&quot;color: black;&quot;&gt;MyClass&lt;/span&gt; {&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; SOME_CONSTANT = &lt;span class=&quot;number&quot; style=&quot;color: #2f98ff;&quot;&gt;42&lt;/span&gt;; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; publicField; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;static&lt;/span&gt; MyClass sSingleton; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; mPackagePrivate; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; mPrivate; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; mProtected; }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Braces&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;For the opening curly brackets are not allocated a separate line, they are in the same line as the code in front of them:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot; style=&quot;color: black;&quot;&gt;MyClass&lt;/span&gt; {&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; func() { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (something) { &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// ... } else if (somethingElse) { // ... } else { // ... } } }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;We require braces to the operator environment.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The exception is when the condition statement and his body was placed in one line.&lt;/span&gt;&amp;nbsp;&lt;span&gt;That is, you can write like this:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (condition) { body(); &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// ok } if (condition) body(); // ok&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;But you can not do:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (condition) body(); &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// bad&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The string length&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Each line of text in the code should be no longer than 100 characters.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Exception: If the comment contains an example of command or URL (it is more convenient to use copy / paste).&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Exception: import string may be longer than 100 characters, because people rarely look at them.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Also, it simplifies the writing tools.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Abbreviations in names&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Think of acronyms and abbreviations as words.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The names of the more readable:&lt;/span&gt;&lt;br /&gt;
&lt;table style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-collapse: collapse; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; clear: both; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; width: 756px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;Well&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;Poorly&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;XmlHttpRequest&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;XMLHTTPRequest&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;getCustomerId&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;getCustomerID&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;span&gt;This style is also used when the acronyms and abbreviations - it&#39;s full name:&lt;/span&gt;&lt;br /&gt;
&lt;table style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-collapse: collapse; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; clear: both; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; width: 756px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;Well&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;Poorly&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;class Html&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;class HTML&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;String url;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;String URL;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;long id;&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;long ID;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Style TODO&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Use TODO comments to the code, which is a temporary, short-term, or good, but not perfect.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Comments should include «TODO:», for example:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// TODO: Remove this code after the UrlTable2 has been checked in. // TODO: Change this to use a flag instead of a constant.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;If your comment is given &quot;In the future, do something,&quot; then make sure it includes a specific date (January 1, 2011), or a particular event &quot;Delete after the release of version 2.1&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Consistency&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;If you change the code, take a moment out to look at the code around you, and to define his style.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If it uses the gaps, then you should use them.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If the comments contain a small set of stars, then you should use them.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The whole point of the recommendations to the style of code to create a common vocabulary so that people focused on what they say rather than how they speak.&lt;/span&gt;&amp;nbsp;&lt;span&gt;We present a global style rules to let people know this language.&lt;/span&gt;&amp;nbsp;&lt;span&gt;But the local style is also important.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If the code that you add to the file looks dramatically different from what was then the future is to throw the reader out of his rhythm, and will prevent him understand the structure.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Try to avoid this.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/7822228446847610251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/7822228446847610251'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/recommendations-to-style-code.html' title='Recommendations to the style code'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-2175718313782863535</id><published>2011-09-30T15:26:00.000-07:00</published><updated>2011-09-30T15:26:04.697-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="settings"/><title type='text'>Settings in the Android-applications</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span&gt;&lt;i&gt;Interested in the topic of development under Android.&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;i&gt;I am writing a small application.&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;i&gt;Faced with the fact that not fully understand how to make settings for the application.&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;i&gt;A little Googling and found an article that helped to understand.&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;i&gt;Decided to translate the article for the Russian-speaking community, including some comments to the original.&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;span&gt;Options are an important part of applications for Android&amp;nbsp;&lt;i&gt;(and not only on Android - hereinafter translator&#39;s note).&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;It is very important - allow users to change application settings, depending on their preferences.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;There are two ways to work with the settings in Android - you can create a file in a directory&amp;nbsp;&lt;i&gt;preferences.xml res / xml,&lt;/i&gt;&amp;nbsp;or work with the settings from your code.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this article I&#39;ll show you how to work with the settings using&amp;nbsp;&lt;i&gt;preferences.xml&lt;/i&gt;&amp;nbsp;file.&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span&gt;Elements of the settings have the following attributes:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;android: key&lt;/i&gt;&amp;nbsp;- the name of the settings on potoromu in the future can get its value&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;android: title&lt;/i&gt;&amp;nbsp;- the title of the item set&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;android: summary&lt;/i&gt;&amp;nbsp;- a brief description of the item set&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;android: defaultValue&lt;/i&gt;&amp;nbsp;- default value&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Now available in the following types of components settings:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;CheckBoxPreference&lt;/i&gt;&amp;nbsp;- a simple checkbox, which returns true or false.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;ListPreference&lt;/i&gt;&amp;nbsp;- radio group (radioGroup), of which can be selected only one item.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Attribute&amp;nbsp;&lt;i&gt;android: entries&lt;/i&gt;&amp;nbsp;points to an array with values ​​in&amp;nbsp;&lt;i&gt;res / values ​​/ arrays.xml,&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;android: entryValues&lt;/i&gt;&amp;nbsp;​​an array of signatures.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;EditTextPreference&lt;/i&gt;&amp;nbsp;- displays a dialog box with the input field.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Returns a string as its value.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;RingtonePreference&lt;/i&gt;&amp;nbsp;- a group of radio buttons to choose a ringtone.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;Preference&lt;/i&gt;&amp;nbsp;- setting, working as a button.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;PreferenceScreen&lt;/i&gt;&amp;nbsp;- screen settings.&lt;/span&gt;&amp;nbsp;&lt;span&gt;When one PreferenceScreen nested in another, it opens a new screen with the settings.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;i&gt;PreferenceCategory&lt;/i&gt;&amp;nbsp;- category settings.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-collapse: collapse; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; clear: both; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; width: 756px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;&lt;i&gt;Screen with the settings&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/a37f9b3f/1a7c8e9f/1677bdc3/cf4aec48.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;&lt;i&gt;EditTextPreference&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/42404c69/35d08308/efa19ca5/05fc3013.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;&lt;i&gt;ListPreference&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/9d6616b5/63afca14/e5048eef/4455dd76.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;&lt;i&gt;RingtonePreference&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/10649e32/c98c2ab4/253c7239/603b9f7e.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;&lt;i&gt;PreferenceScreen&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/c2831688/f8d94d53/63dcbe89/8698e6a8.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Screenshots above are generated using the following&amp;nbsp;&lt;i&gt;preferences.xml:&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;xml&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;pi&quot; style=&quot;color: olive;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceScreen&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; xmlns:android=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceCategory&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;First Category&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;CheckBoxPreference&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Checkbox Preference&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:defaultValue=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:summary=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;This preference can be true or false&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:key=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;checkboxPref&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;ListPreference&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;List Preference&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:summary=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;This preference allows to select an item in a array&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:key=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;listPref&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:defaultValue=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;digiGreen&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:entries=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;@array/listArray&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:entryValues=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;@array/listValues&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceCategory&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceCategory&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Second Category&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;EditTextPreference&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;EditText Preference&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:summary=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;This allows you to enter a string&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:defaultValue=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Nothing&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Edit This Text&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:key=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;editTextPref&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;RingtonePreference&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Ringtone Preference&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:summary=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Select a ringtone&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Ringtones&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:key=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;ringtonePref&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceScreen&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:key=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;SecondPrefScreen&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Second PreferenceScreen&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:summary=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;This is a second PreferenceScreen&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;EditTextPreference&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;An other EditText Preference&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:summary=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;This is a preference in the second PreferenceScreen&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Edit text&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:key=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;SecondEditTextPref&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceScreen&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;Preference&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:title=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;Custom Preference&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:summary=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;This works almost like a button&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:key=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;customPref&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceCategory&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;PreferenceScreen&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Attributes&amp;nbsp;&lt;i&gt;android: entries&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;android: entryValues ​​ListPreference&lt;/i&gt;&amp;nbsp;a link to&amp;nbsp;&lt;i&gt;@ array / listArray&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i&gt;@ array / listValues&lt;/i&gt;&amp;nbsp;​​respectively.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The values ​​are taken from the&amp;nbsp;&lt;i&gt;res / values ​​/ arrays.xml,&lt;/i&gt;&amp;nbsp;which in this case is as follows:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;xml&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;pi&quot; style=&quot;color: olive;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;resources&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;string-array&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;listArray&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;Number 1&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;Number 2&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;Number 3&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;Number 4&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;string-array&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;string-array&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;listValues&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;1&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;2&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;3&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt;4&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;item&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;string-array&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;resources&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In order to show the user screen with the settings to create nebhodimo aktiviti inherited from PreferenceActivity.&lt;/span&gt;&lt;span&gt;Aktiviti example:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;package&lt;/span&gt; org.kaloer.preferenceexample; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.app.Activity; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.content.SharedPreferences; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.os.Bundle; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.preference.Preference; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.preference.PreferenceActivity; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.preference.Preference.OnPreferenceClickListener; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.widget.Toast; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot; style=&quot;color: black;&quot;&gt;Preferences&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;title&quot; style=&quot;color: black;&quot;&gt;PreferenceActivity&lt;/span&gt; {&lt;/span&gt; &lt;span class=&quot;annotation&quot; style=&quot;color: olive;&quot;&gt;@Override&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// Get the custom preference Preference customPref = (Preference) findPreference(&quot;customPref&quot;); customPref .setOnPreferenceClickListener(new OnPreferenceClickListener() { public boolean onPreferenceClick(Preference preference) { Toast.makeText(getBaseContext(), &quot;The custom preference has been clicked&quot;, Toast.LENGTH_LONG).show(); SharedPreferences customSharedPreference = getSharedPreferences( &quot;myCustomSharedPrefs&quot;, Activity.MODE_PRIVATE); SharedPreferences.Editor editor = customSharedPreference .edit(); editor.putString(&quot;myCustomPref&quot;, &quot;The preference has been clicked&quot;); editor.commit(); return true; } }); } }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;A call to the settings aktiviti by clicking on the button on our main aktiviti:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt; &lt;span class=&quot;annotation&quot; style=&quot;color: olive;&quot;&gt;@Override&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState); setContentView(R.layout.main); Button prefBtn = (Button) findViewById(R.id.prefButton); prefBtn.setOnClickListener(&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; OnClickListener() { &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; onClick(View v) { Intent settingsActivity = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; Intent(getBaseContext(), Preferences.&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt;); startActivity(settingsActivity); } }); }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;To use the settings values ​​exposed, add a method&amp;nbsp;&lt;i&gt;getPrefs ()&lt;/i&gt;&amp;nbsp;in the main aktiviti you want to call in the event&lt;i&gt;onStart ().&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;You must use exactly&amp;nbsp;&lt;i&gt;onStart (),&lt;/i&gt;&amp;nbsp;but not&amp;nbsp;&lt;i&gt;onCreate (),&lt;/i&gt;&amp;nbsp;to be sure that the current settings are used, rather than those that were at the time the Glan aktiviti.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Our method&amp;nbsp;&lt;i&gt;getPrefs ()&lt;/i&gt;&amp;nbsp;might look something like this:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;boolean&lt;/span&gt; CheckboxPreference; String ListPreference; String editTextPreference; String ringtonePreference; String secondEditTextPreference; String customPref; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;void&lt;/span&gt; getPrefs() { &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// Get the xml/preferences.xml preferences SharedPreferences prefs = PreferenceManager .getDefaultSharedPreferences(getBaseContext()); CheckboxPreference = prefs.getBoolean(&quot;checkboxPref&quot;, true); ListPreference = prefs.getString(&quot;listPref&quot;, &quot;nr1&quot;); editTextPreference = prefs.getString(&quot;editTextPref&quot;, &quot;Nothing has been entered&quot;); ringtonePreference = prefs.getString(&quot;ringtonePref&quot;, &quot;DEFAULT_RINGTONE_URI&quot;); secondEditTextPreference = prefs.getString(&quot;SecondEditTextPref&quot;, &quot;Nothing has been entered&quot;); // Get the custom preference SharedPreferences mySharedPreferences = getSharedPreferences( &quot;myCustomSharedPrefs&quot;, Activity.MODE_PRIVATE); customPref = mySharedPreferences.getString(&quot;myCusomPref&quot;, &quot;&quot;); }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;And lastly, do not forget to add aktiviti created with the settings in&amp;nbsp;&lt;i&gt;androidmanifest.xml&lt;/i&gt;&amp;nbsp;and add a new row with the name «set_preferences», to refer to the title screen with the settings, for example, «Preferences».&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;xml&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;activity&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;.Preferences&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:label=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;@string/set_preferences&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;activity&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;As a result, we obtain the following:&lt;/span&gt;&lt;br /&gt;
&lt;table style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-collapse: collapse; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; clear: both; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em; width: 756px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;&lt;i&gt;Screen with the main aktiviti&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/2c224db9/a0316291/e0c6b49a/6814ef9c.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; padding-bottom: 0.3em; padding-left: 0.3em; padding-right: 0.3em; padding-top: 0.3em;&quot;&gt;&lt;span&gt;&lt;i&gt;Aktiviti with the settings&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/ceb0e6dd/ef3a1301/f758542d/9e5ef417.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2175718313782863535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2175718313782863535'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/settings-in-android-applications.html' title='Settings in the Android-applications'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-1579949837050535904</id><published>2011-09-30T15:23:00.000-07:00</published><updated>2011-09-30T15:23:38.438-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADT"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="SDK"/><title type='text'>Android. Create a file manager</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;img src=&quot;http://habrastorage.org/storage/habraeffect/70/42/7042963ab99c4637fda61fa751170b35.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;span&gt;Android - a promising and rapidly growing operating system.&lt;/span&gt;&amp;nbsp;&lt;span&gt;And many programmers want to learn how to program applications for OS Android, but a quick search of structured materials in the Internet and, in particular, Lesbian, leads them into a stupor.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Indeed, there is still a problem finding tutorials (especially in Russian) to develop applications for this very popular operating system.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Well, we will gradually improve the situation with Habra.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;I shall warn that the materials are intended for those who do not have experience in developing applications for Android, but very, very much wants to get this experience.&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Getting ready&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;The first thing we need - to install and configure the IDE.&lt;/span&gt;&amp;nbsp;&lt;span&gt;We will use Eclipse, but it is important to note that it is possible to use any development environment.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Detailed instructions for installing and configuring IDE Eclipse is contained in the&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/sdk/installing.html&amp;amp;usg=ALkJrhgX0hZtmZm_cRyxFdI8dtYHHQQbLA&quot; style=&quot;color: #6da3bd;&quot;&gt;documentation for Android site&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;span&gt;In brief:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Install Eclipse Classic&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.eclipse.org/downloads/&amp;amp;usg=ALkJrhjXHQQf_JjdoOQckytanF5vCEJzAQ&quot; style=&quot;color: #6da3bd;&quot;&gt;from here&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Install SDK Starter Package&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/sdk/index.html&amp;amp;usg=ALkJrhi2p4CffIxB2rTfz99K4D5yOXuSOQ&quot; style=&quot;color: #6da3bd;&quot;&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Set ADT Plugin using&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/sdk/eclipse-adt.html&amp;amp;usg=ALkJrhh2TuTKqrlTq-kf0auZ52gnZZUQPw&quot; style=&quot;color: #6da3bd;&quot;&gt;this manual&lt;/a&gt;&amp;nbsp;, for the same instructions perform the steps described in the section Configuring the ADT Plugin&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Launch Eclipse, click&amp;nbsp;&lt;b&gt;Window&amp;gt; Android SDK and AVD Manager&lt;/b&gt;&amp;nbsp;and select the necessary components for installation.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The easiest option - to select all but the bare minimum -&amp;nbsp;&lt;b&gt;SDK Platform Android 2.1&lt;/b&gt;&amp;nbsp;(or 2.2),&amp;nbsp;&lt;b&gt;Android SDK Tools, Android SDK Platform-tools&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span&gt;After all this we have an operating environment for developing applications for OS Android.&lt;/span&gt;&amp;nbsp;&lt;span&gt;But we need a place to test our application, right?&lt;/span&gt;&amp;nbsp;&lt;span&gt;And here we face a choice - either to perform these actions in the emulator or on a real device.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;The emulator can be added to the familiar box,&amp;nbsp;&lt;b&gt;Android SDK and AVD Manager,&lt;/b&gt;&amp;nbsp;clicking the&amp;nbsp;&lt;b&gt;New ...&lt;/b&gt;&amp;nbsp;tab in&lt;b&gt;Virtual Devices.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;Fill in the field Name, specify the version of the API and add our virtual device.&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/habraeffect/ca/c4/cac42df6d6a7e73b368eb4dcfe181de6.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;If you want to test their applications on a real device, see&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/guide/developing/device.html&amp;amp;usg=ALkJrhjZHsbqGCNLb8kB6yp7kdy-tuwsLw&quot; style=&quot;color: #6da3bd;&quot;&gt;here&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It is important to note that in the end you still have to verify its application on a real device, because a little strange to release the application, for example, in the Android Market, as it should be no testing the samples at the existing phone / tablet.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Create Project&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;It&#39;s time to create a new project.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To do this, click&amp;nbsp;&lt;b&gt;File&amp;gt; New&amp;gt; Project,&lt;/b&gt;&amp;nbsp;select the pop-up window&amp;nbsp;&lt;b&gt;Android&amp;gt; Android Project&lt;/b&gt;&amp;nbsp;and click&amp;nbsp;&lt;b&gt;Next.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;The following window appears, which we fill like this:&lt;/span&gt;&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/habraeffect/78/a4/78a41bc4ed6195ef6cc136cd8a91657f.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;span&gt;Now a little explanation.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;i&gt;Project Name&lt;/i&gt;&amp;nbsp;- name of the project in Eclipse.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;i&gt;Application Name&lt;/i&gt;&amp;nbsp;- the name of the application, the one that users will see on the final Android-device.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;i&gt;Package Name&lt;/i&gt;&amp;nbsp;- the name of the package.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Everything is just like any Java-project.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It is important to know that the name must be unique among all the available packages on the target device.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Therefore quite effective classical logic to give a name of the Web domain, recorded on the contrary (as here - ru.alwake), and then - the name of the project.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This step is in some way provide a unique name.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;i&gt;Create Activity&lt;/i&gt;&amp;nbsp;- the name of the class, which in future will be a subclass of Activity.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;i&gt;Min SDK Version&lt;/i&gt;&amp;nbsp;- the minimum version of SDK.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If you look at the above list in the Build Target window, we can conclude that our application runs only for devices with Android&amp;gt; = 2.1 (Android 2.1 SDK version corresponds to 7).&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this case, it&#39;s not very principled, but so be it.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Now you can safely click&amp;nbsp;&lt;b&gt;Finish&lt;/b&gt;&amp;nbsp;and contemplate your project in the panel&amp;nbsp;&lt;b&gt;Package Exploper.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;The project was created and would be nice to get acquainted with some theoretical basis for the Android-device applications, which is well presented&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://habrahabr.ru/blogs/android/16942/&amp;amp;usg=ALkJrhjX8nb-2Fotyy3onR86-VcaomhwvA&quot; style=&quot;color: #6da3bd;&quot;&gt;here&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About our project&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;First let&#39;s define what we want from our file manager.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Ideally - the complete replacement of ASTRO and eStrongs.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In the meantime, we need to provide basic navigation through catalogs, and a &quot;base&quot; we mean that we do not need to go into those folders, which has access to only root.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In addition, in the above, we will display our current location in directory structure.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Well, first let&#39;s talk about the structure of the project:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/habraeffect/01/a8/01a8024030fe4950e096dc6933aed7e7.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;/ Res/drawable- * dpi&lt;/b&gt;&amp;nbsp;- in these three locations we found resources to different extensions of the screen.&lt;/span&gt;&amp;nbsp;&lt;span&gt;At the moment there is only the file icon.png, then there is an icon of our application.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;/ Res / layout&lt;/b&gt;&amp;nbsp;- this folder contains the xml-files that describe the appearance of various forms and form elements.&lt;/span&gt;&amp;nbsp;&lt;span&gt;After creating the project there is a file main.xml, there is also need to create a row.xml, which will describe the appearance of each individual series (ie a list item of the tree of our file.)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;/ Res / values&lt;/b&gt;&amp;nbsp;​​- here we are any constants that we use in our project.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;It should be noted that these XML-files can be edited in visual mode or in text (changing directly xml-code).&lt;/span&gt;&amp;nbsp;&lt;span&gt;We will act on the second method.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To edit the code, you can right-click on the xml-file in the Package Explorer pane and choose&amp;nbsp;&lt;b&gt;Open with&amp;gt; Text Editor.&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;This is so in the future;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;File FileManager.java&lt;/b&gt;&amp;nbsp;- in the file actually contains our main class for the main and only form of application.&lt;/span&gt;&amp;nbsp;&lt;span&gt;All of our code in this project will be posted here.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;File AndroidManifest.xml&lt;/b&gt;&amp;nbsp;- file with the basic properties of our project, particularly given when creating the project (such as, for example, the name).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Accordingly, to change, let&#39;s name, we need to pick the file.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The remaining files we do not really care.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Start writing code&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;In general, everything that was greater - the basic information that every programmer must Android-know.&lt;/span&gt;&amp;nbsp;&lt;span&gt;And now it&#39;s time to deal directly with our code.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;File main.xml:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TableLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:orientation&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;vertical&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TableRow&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/titleManager&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:padding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;5dip&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TableRow&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TableRow&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;ListView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@id/android:list&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_weight&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;2&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:drawSelectorOnTop&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;false&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TableRow&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TableLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhhBqud5q13GWccUkh81Fy7WbALNrA&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;Here we set the markup for our basic layout of the form.&lt;/span&gt;&amp;nbsp;&lt;span&gt;TableLayout here means that the elements we have lined up in a table.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Then at the top table cell element is placed TextView (text box), and the bottom cell - ListView (list).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Both elements have id, using which we can modify the contents of the elements.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For example, using R.id.titleManager for our text field TextView.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;File row.xml:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;40sp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:padding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;5dip&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:gravity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;center_vertical&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhhBqud5q13GWccUkh81Fy7WbALNrA&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;Here we set the markup for each item in our ListView, that is, directly to each individual folder or each file.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this code we set the width of each element, height, padding (padding) and alignment center_vertical - ie Center the vertical.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;File FileManager.java:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;package ru.alwake.filemanager;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import java.io.&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;File;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import java.util.&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ArrayList;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import java.util.&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;List;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.app.AlertDialog;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.app.ListActivity;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.content.DialogInterface;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.content.Intent;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.content.DialogInterface.OnClickListener;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.net.&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Uri;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.os.Bundle;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.view.View;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.widget.ArrayAdapter;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.widget.ListView;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;import android.widget.TextView;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;FileManager extends ListActivity {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;List &amp;lt;String&amp;gt;&lt;/span&gt;&amp;nbsp;directoryEntries =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ArrayList &amp;lt;String&amp;gt;&lt;/span&gt;&amp;nbsp;();&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;File&lt;/span&gt;&amp;nbsp;currentDirectory =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;File&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;/&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / When application started&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;@ Override&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate (Bundle icicle) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;super.onCreate (icicle);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Set main layout&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;setContentView (R.layout.main);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Browse to root directory&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;browseTo&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;File&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;/&quot;));&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Browse to parent directory&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt;&amp;nbsp;upOneLevel () {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if (this.&lt;/span&gt;&amp;nbsp;currentDirectory.getParent ()! =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null)&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;browseTo&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(this.&lt;/span&gt;&amp;nbsp;currentDirectory.getParentFile ());&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Browse to file or directory&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt;&amp;nbsp;browseTo (final&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;File&lt;/span&gt;&amp;nbsp;aDirectory) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / If we want to browse directory&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(aDirectory.isDirectory ()) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Fill list with files from this directory&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;currentDirectory = aDirectory;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;fill (aDirectory.listFiles ());&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Set titleManager text&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;TextView titleManager = (TextView) findViewById (R.id.titleManager);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;titleManager.setText (aDirectory.getAbsolutePath ());&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Else&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / If we want to open file, show this dialog:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Listener when YES button clicked&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;OnClickListener okButtonListener =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;OnClickListener () {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onClick (DialogInterface arg0,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;arg1) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Intent to navigate file&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Intent i =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Intent (android.content.Intent.ACTION_VIEW,&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Uri.&lt;/span&gt;&amp;nbsp;Parse&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;file: / /&quot;&lt;/span&gt;&amp;nbsp;+ aDirectory.getAbsolutePath ()));&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Start this activity&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;startActivity (i);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Listener when NO button clicked&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;OnClickListener cancelButtonListener =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;OnClickListener () {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onClick (DialogInterface arg0,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;arg1) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Do nothing&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Or add something you want&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Create dialog&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AlertDialog.Builder&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(this)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;. SetTitle&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;Confirmation&quot;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / title&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;. SetMessage&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;Want to open file&quot;&lt;/span&gt;&amp;nbsp;+ aDirectory.getName () +&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;?&quot;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Message&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;. SetPositiveButton&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;Yes&quot;,&lt;/span&gt;&amp;nbsp;okButtonListener)&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / positive button&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;. SetNegativeButton&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;No&quot;,&lt;/span&gt;&amp;nbsp;cancelButtonListener)&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / negative button&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;.&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;Show&lt;/span&gt;&amp;nbsp;();&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ /&lt;/span&gt;&amp;nbsp;show&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;dialog&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Fill list&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt;&amp;nbsp;fill&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;(File&lt;/span&gt;&amp;nbsp;[] files) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Clear list&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;directoryEntries.clear ();&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if (this.&lt;/span&gt;&amp;nbsp;currentDirectory.getParent ()! =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;directoryEntries.add&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;..&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Add every file into list&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;for&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;(File&lt;/span&gt;&amp;nbsp;file: files) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;directoryEntries.add (file.getAbsolutePath ());&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Create array adapter to show everything&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;ArrayAdapter&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;lt;String&amp;gt;&lt;/span&gt;&amp;nbsp;directoryList =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;ArrayAdapter&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;&amp;lt;String&amp;gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(this,&lt;/span&gt;&amp;nbsp;R.layout.row,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;DirectoryEntries);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;setListAdapter (directoryList);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / When you clicked onto item&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;@ Override&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt;&amp;nbsp;onListItemClick (ListView l, View v,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;position,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;long&lt;/span&gt;&amp;nbsp;id) {&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Get selected file name&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;selectionRowID = position;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;selectedFileString =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;DirectoryEntries.&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Get&lt;/span&gt;&amp;nbsp;(selectionRowID);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / If we select &quot;..&quot;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;then go upper&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(selectedFileString.equals&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;(&quot;..&quot;))&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;upOneLevel ();&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Else&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ / Browse to clicked file or directory using browseTo ()&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;File&lt;/span&gt;&amp;nbsp;clickedFile =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;clickedFile =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;File&lt;/span&gt;&amp;nbsp;(selectedFileString);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(clickedFile! =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;browseTo (clickedFile);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span&gt;&lt;span style=&quot;color: grey;&quot;&gt;* This source code with WAS Highlighted&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhhBqud5q13GWccUkh81Fy7WbALNrA&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;At the beginning of specified package name (package name).&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Rows 2-18 are responsible for the import we need libraries.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It is important to note that the import libraries, Eclipse can be done automatically, as soon encounters anything unknown.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;In this code, we only have five fairly obvious functions, which is easy to understand.&lt;/span&gt;&amp;nbsp;&lt;span&gt;And it is - a skeleton application, which provides the main navigation on the file structure.&lt;/span&gt;&amp;nbsp;&lt;span&gt;However, in this application there is one problem - when you try to go to the directory to which access is allowed only by root, we get an error and the application quits.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Accordingly, the next time we think about how to get rid of this error and how to display icons corresponding to the type of file.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In addition, we will think about implementing the function Copy-Paste in our file manager.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Eventually supposed to get big and clever application that should give basic information about aspects of programming for Android.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;i&gt;The idea and some of the implementation of the file manager is taken from anddev.org&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;i&gt;I would also like to announce that the next part will AndroidDev twentieth of January.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/1579949837050535904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/1579949837050535904'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/android-create-file-manager.html' title='Android. Create a file manager'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-9048284390371867255</id><published>2011-09-30T15:18:00.000-07:00</published><updated>2011-09-30T15:21:38.533-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADT"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android SDK"/><category scheme="http://www.blogger.com/atom/ns#" term="dalvik"/><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="JDK"/><category scheme="http://www.blogger.com/atom/ns#" term="JRE"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><title type='text'>Write your first application on Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;img src=&quot;http://habrastorage.org/storage/322832e1/ce2f74ef/876337d7/9c133fb0.jpg&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Preface&lt;/h4&gt;&lt;br /&gt;
The purpose of this post - on the one hand to share their successful experience in start developing applications for the Android platform and on the other hand contribute to the development of the market of software for this remarkable and rapidly growing platform for the account (without false modesty, I say) you may have read this post.&amp;nbsp;The network, of course, you can find information on application development, &quot;a little more complicated than helloworld», but as a rule they scattered and they do not describe the various small underwater stones.&amp;nbsp;In this post we look at the full cycle of application development, starting with a clean computer to finished apk-file.Under the cut screens.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=5515158391435587981&amp;amp;postID=9048284390371867255&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Preparing for development&lt;/h4&gt;&lt;br /&gt;
In order to prepare for the development does not require any special actions and manipulations.&amp;nbsp;Will describe the steps you need to do.&amp;nbsp;I is Windows XP, so all should be classified nizheskazannoe it to the OS, although the action without some major changes can be applied to other Windows OS, even Linux.&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Installing the Eclipse development environment&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Install the ADT Plugin for Eclipse&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Installing JDK and JRE&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Install Android SDK&lt;/li&gt;
&lt;/ul&gt;&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Installing the Eclipse development environment&lt;/h5&gt;&lt;br /&gt;
It&#39;s simple.&amp;nbsp;Go to the Downloads section on&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.eclipse.org/downloads/&amp;amp;usg=ALkJrhjXHQQf_JjdoOQckytanF5vCEJzAQ&quot; style=&quot;color: #6da3bd;&quot;&gt;the official site&lt;/a&gt;&amp;nbsp;and download version of the Classic.&amp;nbsp;Then simply unzip the file wherever you want, but I decided to do it in an honorable directory&amp;nbsp;&lt;i&gt;C: \ Eclipse&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Install the ADT Plugin for Eclipse&lt;/h5&gt;&lt;br /&gt;
Start Eclipse, and open dialogue install the plugin via the menu&amp;nbsp;&lt;b&gt;Help → Install new software.&lt;/b&gt;&amp;nbsp;In the Work with the load address is entered plug&amp;nbsp;&lt;a href=&quot;https://dl-ssl.google.com/android/eclipse/&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;i&gt;dl-ssl.google.com/android/eclipse /&lt;/i&gt;&lt;/a&gt;&amp;nbsp;(if not obtained, the plugin can be downloaded and installed manually on the link&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/sdk/eclipse-adt.html&amp;amp;usg=ALkJrhh2TuTKqrlTq-kf0auZ52gnZZUQPw&quot; style=&quot;color: #6da3bd;&quot;&gt;http://developer.android.com/sdk/eclipse-adt. HTML&lt;/a&gt;&amp;nbsp;), then in the table below appear Developer Tools, mark it and go on.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/1761b418/e2d3db36/d943525a/2f1360ac.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
After successful installation, you can restart the environment Eclipse.&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Setting the Environment for Java: JDK and JRE&lt;/h5&gt;&lt;br /&gt;
If you have not already installed Java Development Kit (JDK) and Java Runtime Environment (JRE), then they must be installed.&amp;nbsp;This can be done on&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.oracle.com/technetwork/java/javase/downloads/index.html&amp;amp;usg=ALkJrhhkLLctJlhGPvbRP-plN5urlQWTEA&quot; style=&quot;color: #6da3bd;&quot;&gt;site Oracle&lt;/a&gt;&amp;nbsp;.&amp;nbsp;Download and install JDK and JRE.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/2536b687/0261e139/4683fa9a/d20a3976.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Install Android SDK&lt;/h5&gt;&lt;br /&gt;
The point now we need to - this is to download and install a fresh Android SDK.&amp;nbsp;This is done on&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/sdk/index.html&amp;amp;usg=ALkJrhi2p4CffIxB2rTfz99K4D5yOXuSOQ&quot; style=&quot;color: #6da3bd;&quot;&gt;site for Android developers&lt;/a&gt;&amp;nbsp;.&amp;nbsp;I personally install the SDK again in the director emeritus of&amp;nbsp;&lt;i&gt;C: \ Android.&lt;/i&gt;&amp;nbsp;After that, you need to add a platform and other additional elements SDK.&amp;nbsp;I added all the available versions, since the application and plan to do to early platforms, as well as USB-driver and application examples.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/59ce298a/4f7aa695/7e177888/4d797eaf.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Preparation for the development is completed.&amp;nbsp;Now the next step - the creation of an application.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create Android-application&lt;/h4&gt;&lt;br /&gt;
Before creating your first application, you can create a virtual Android-device, to quickly test it svezhenapisanny your software.&amp;nbsp;First, I want to say a few words about the Android Virtual Device (AVD).&amp;nbsp;This is a virtual smart phone running Android, which you can easily run you have created the program.&amp;nbsp;As you can see the advantage of Android Virtual Device is that you can see clearly how your program will run on different smart phones with Android, rather than buying the entire range and test the application on each of them.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s create a virtual device Android.&amp;nbsp;Follow the menu on the path&amp;nbsp;&lt;b&gt;Window → Android SDK and AVD Manager.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/98a0db97/2e1c2e32/219bf35c/9a79a4f4.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Choose&amp;nbsp;&lt;b&gt;New from the&lt;/b&gt;&amp;nbsp;right side of the window in the window we enter the name of the virtual appliance platform (say Android 2.1), the size of the memory card (say 512 Mb), display type (for example HVGA).&amp;nbsp;Then press down the button Create AVD.&lt;br /&gt;
&lt;br /&gt;
Now create a project.&amp;nbsp;To do this, follow the path to the menu&amp;nbsp;&lt;b&gt;File → New → Other,&lt;/b&gt;&amp;nbsp;from the list of&amp;nbsp;&lt;b&gt;Android → Android Project.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/f35781aa/e7b432bb/9cdf01e6/a90ce2f0.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
As an example, talk about the development of one of my simple program UfaTermometr, showing the current temperature with sensors located on one of the objects of the local energy company.&lt;br /&gt;
&lt;br /&gt;
After creating the project, to the left you will see a directory tree.&amp;nbsp;First and foremost, upload your application icon, or rather three icons for different options.&amp;nbsp;In the folder drawable-hdpi ship png-image with a transparent background, size 72x72, in drawable-mdpi respectively 48x48 and drawable-ldpi the smallest size of 36x36.&amp;nbsp;You can do this by dragging and dropping files directly on the tree.&amp;nbsp;The next step will be the controls.&amp;nbsp;In my program had to be all three elements of the interface: ImageView (just a picture logo of the application), Button (update the value of temperature), and TextView (output temperature).&amp;nbsp;All of these controls must be described in a special xml-file.&amp;nbsp;The tree is located at&amp;nbsp;&lt;b&gt;res → layout → main.xml.&lt;/b&gt;&amp;nbsp;In many respects layout of controls is similar to the layout of Web pages, and there is padding, and margin, and the analog align.&amp;nbsp;Main.xml my application code:&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:orientation&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;vertical&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;ImageView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:src&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@drawable/droid&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_gravity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;center_horizontal|center&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_margin&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;0px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;Button&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/refrbutton&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:gravity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;center_horizontal&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_gravity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;center_horizontal|center&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:textSize&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;30px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:padding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;20px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_marginTop&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;10dip&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:text&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Обновить&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:text&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;...&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:textSize&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100dip&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:gravity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;center_horizontal&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/temper&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:textColor&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;#EEE3C4&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/blockquote&gt;Detail the layout of controls will not, because it&#39;s fairly detailed in the manual and generally intuitive, especially to someone who had to deal with html / css-layout and / or development of any visual medium (eg, Delphi) .&amp;nbsp;The only note I uploaded the image in any ImageView.&amp;nbsp;In the src is the path that starts with the @ symbol and then specify the address of the tree.&amp;nbsp;In your early res I created a subfolder drawable and &quot;threw&quot; logo there, and then just have ImageView way.&amp;nbsp;Easy?&amp;nbsp;For me that much.&lt;br /&gt;
&lt;br /&gt;
Application code is located directly on the path&amp;nbsp;&lt;b&gt;src → «name your package» → «name of the application». Java.&lt;/b&gt;&lt;br /&gt;
By default, a &quot;Plural&quot; main class and she is more you can dance.&amp;nbsp;I will not dwell on the intricacies of such a simple code as in my example, but explain that logic is explained by three simple steps:&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Download HTML-page with the values ​​of temperature&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With regulyarok &quot;pull&quot; the temperature&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Show TextView temperature&lt;/li&gt;
&lt;/ul&gt;Note that when an application requires some kind of system permissions, you must specify them in the manifest&lt;b&gt;AndroidManifest.xml.&lt;/b&gt;&amp;nbsp;In this particular case we are using to connect to the Internet, respectively, add the line &amp;lt;uses-permission android:name=«android.permission.INTERNET»/&amp;gt; in the above xml-file.&lt;br /&gt;
Actually the code that implements the above logic works:&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;package&lt;/span&gt;&amp;nbsp;app.test.ufatermometr;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.app.Activity;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.os.Bundle;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.View;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.widget.TextView;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.widget.Button;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.io.InputStreamReader;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.net.URL;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.net.URLConnection;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;java.util.regex.*;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;UfaTermometr extends Activity&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate(Bundle savedInstanceState)&lt;br /&gt;
{&lt;br /&gt;
super.onCreate(savedInstanceState);&lt;br /&gt;
setContentView(R.layout.main);&lt;br /&gt;
final Button button = (Button) findViewById(R.id.refrbutton);&lt;br /&gt;
button.setOnClickListener(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Button.OnClickListener() {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onClick(View v)&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// клик на кнопку&lt;/span&gt;&lt;br /&gt;
{&lt;br /&gt;
RefreshTemper();&lt;br /&gt;
}&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
RefreshTemper();&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// при запуске грузим температуру сразу&lt;/span&gt;&lt;br /&gt;
};&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;String GetTemper(String urlsite)&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// фукция загрузки температуры&lt;/span&gt;&lt;br /&gt;
{&lt;br /&gt;
String matchtemper =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;&lt;br /&gt;
{&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;// загрузка страницы&lt;/span&gt;&lt;br /&gt;
URL url =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;URL(urlsite);&lt;br /&gt;
URLConnection conn = url.openConnection();&lt;br /&gt;
InputStreamReader rd =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;InputStreamReader(conn.getInputStream());&lt;br /&gt;
StringBuilder allpage =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;StringBuilder();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;n = 0;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;char&lt;/span&gt;&amp;nbsp;[] buffer =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new char&lt;/span&gt;&amp;nbsp;[40000];&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;while&lt;/span&gt;&amp;nbsp;(n &amp;gt;= 0)&lt;br /&gt;
{&lt;br /&gt;
n = rd.read(buffer, 0, buffer.length);&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(n &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
allpage.append(buffer, 0, n);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;// работаем с регулярками&lt;/span&gt;&lt;br /&gt;
final Pattern pattern = Pattern.compile&lt;br /&gt;
(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&amp;lt;span style=\&quot;color:#[a-zA-Z0-9]+\&quot;&amp;gt;[^-+0]+([-+0-9]+)[^&amp;lt;]+&amp;lt;/span&amp;gt;[^(а-яА-ЯёЁa-zA-Z0-9)]+([а-яА-ЯёЁa-zA-Z ]+)&quot;&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
Matcher matcher = pattern.matcher(allpage.toString());&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(matcher.find())&lt;br /&gt;
{&lt;br /&gt;
matchtemper = matcher.group(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;matchtemper;&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;(Exception e)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;matchtemper;&lt;br /&gt;
};&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//----------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;RefreshTemper()&lt;br /&gt;
{&lt;br /&gt;
final TextView tTemper = (TextView) findViewById(R.id.temper);&lt;br /&gt;
String bashtemp =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
bashtemp = GetTemper(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;http://be.bashkirenergo.ru/weather/ufa/&quot;&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
tTemper.setText(bashtemp.concat(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;°&quot;&lt;/span&gt;&amp;nbsp;));&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// отображение температуры&lt;/span&gt;&lt;br /&gt;
};&lt;br /&gt;
}&lt;/code&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
Once the application is written, it is possible to debug and test.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Running and testing applications&lt;/h4&gt;&lt;br /&gt;
We remember about our virtual machine and run the usual button menus or&amp;nbsp;&lt;b&gt;Run → Run&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Here&#39;s a picture we can then contemplate:&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/0bf33952/dbbecb09/16f9bee0/d13e648a.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Now, if you want to share an application, you need to collect apk-file.&amp;nbsp;For this we use the menu&amp;nbsp;&lt;b&gt;File → Export,&lt;/b&gt;and the list of&amp;nbsp;&lt;b&gt;Android → Export Android application.&lt;/b&gt;&amp;nbsp;Next, select the project, then create a keystore keystore and the key key, this will need to fill in a few fields with all sorts of background information.&amp;nbsp;The resulting file can be apk-distribute and even put in the Android Market, but you have to register and pay $ 25, which is in general a bit, especially for the standing of the project.&amp;nbsp;But registration in markets, perhaps another article.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Conclusion&lt;/h4&gt;&lt;br /&gt;
In conclusion I would say that certainly develop applications for Android is pleasant, is rather simple and interesting.&amp;nbsp;Of course, we have considered only the tip of the iceberg, but I hope in the minds of those of you who have not tried doing anything like that &quot;light bulb lit up,&quot; and it is possible that once your application will be in the millions.&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Sources, references&lt;/h5&gt;&lt;br /&gt;
&lt;br /&gt;
A post materials are used:&lt;br /&gt;
&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://ibm.com/&amp;amp;usg=ALkJrhjfJ25plEuNwaT19ZaIU1ITgGmKAA&quot; style=&quot;color: #6da3bd;&quot;&gt;www.ibm.com&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://itblog.name/&amp;amp;usg=ALkJrhhhMn60WZKYHir2hz0r0_dkrhelYA&quot; style=&quot;color: #6da3bd;&quot;&gt;www.itblog.name&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://ru.wikipedia.org/&amp;amp;usg=ALkJrhjgpAMzoZ0FHa_kQS1ZZ9GHeCO1wg&quot; style=&quot;color: #6da3bd;&quot;&gt;Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://rghost.ru/3561566&amp;amp;usg=ALkJrhhiJsyV8XUleLWs5wsgTF4X70OrLg&quot; style=&quot;color: #6da3bd;&quot;&gt;APK-application file&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;UPD: Eliminating Errors&lt;/h4&gt;&lt;br /&gt;
&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://defite.habrahabr.ru/&amp;amp;usg=ALkJrhhDyE1xsI_VjKO4JAr4hzXLRL3Azw&quot; style=&quot;color: #6da3bd;&quot;&gt;Defite&lt;/a&gt;&amp;nbsp;:&lt;br /&gt;
1.&amp;nbsp;Error&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;ERROR: Unable to open class file C: \ workspace \ Test \ gen \ com \ example \ test \ R.java: No such file or directory&lt;/blockquote&gt;solved cleaning project in the menu&amp;nbsp;&lt;strong&gt;Project → Clean&lt;/strong&gt;&amp;nbsp;or restart Eclipse.&lt;br /&gt;
2.&amp;nbsp;When an error occurs&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;emulator: ERROR: no search paths found in this AVD&#39;s configuration.&amp;nbsp;Weird, the AVD&#39;s config.ini file is malformed.&amp;nbsp;Try re-creating it&lt;/blockquote&gt;- A consequence of the fact that you have a Cyrillic user name.&amp;nbsp;Solved: go to the&amp;nbsp;&lt;strong&gt;Computer → System Properties → Advanced Settings → System Environment Variables.&lt;/strong&gt;&amp;nbsp;Create a new variable name and value ANDROID_SDK_HOME - by where the folder AVD (for example, C: \ Android \).&amp;nbsp;&lt;span style=&quot;background-color: #e6ecf9;&quot;&gt;Create, then looking in the same variable, Path, open and in the field of values, separated by semicolons to add the path to the folder tools Android SDK (for example, C: \ Android \ tools).&lt;/span&gt;&amp;nbsp;Save.&amp;nbsp;Launch Eclipse, run the program.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/9048284390371867255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/9048284390371867255'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/write-your-first-application-on-android.html' title='Write your first application on Android'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-2584600955240166106</id><published>2011-09-30T15:16:00.000-07:00</published><updated>2011-09-30T15:16:32.717-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><category scheme="http://www.blogger.com/atom/ns#" term="User interface"/><title type='text'>The basic UI design patterns Android apps</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span&gt;Since the development of applications for Android is gaining popularity, think review of major UI patterns for Android-applications will be useful to someone.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Pending patterns: Dashboard, Action Bar, Quick Actions, Search Bar and Companion Widget.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span&gt;In my opinion theme UI patterns is important for several reasons:&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Attracting users: patterns help make the application more usability, easier to understand.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Entrance to the market: following patterns may play an important role in promoting the application on the app market&#39;y.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;It is not necessary to build a bicycle with a knowledge of patterns is much easier to be engaged in designing application interface, using existing solutions.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span&gt;The principles of interface design,&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/videos/index.html&amp;amp;usg=ALkJrhiEeFlpDj7EXP--fX8wf3-IwhHiEw#v=M1ZBjlCRfz0&quot; style=&quot;color: #6da3bd;&quot;&gt;marked&lt;/a&gt;&amp;nbsp;by engineers Google:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;b&gt;Simple vs Clear:&lt;/b&gt;&amp;nbsp;the interface should be simple (not loaded) and clear to use&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;b&gt;Content vs Chrome:&lt;/b&gt;&amp;nbsp;you must use the maximum screen at the same time reduce its visual complexity (use a limited number of buttons / icons)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;b&gt;Consistent yet engaging:&lt;/b&gt;&amp;nbsp;consistency of user input - the user needs to understand what he is doing / how to do what he needs&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;b&gt;Enhanced by cloud:&lt;/b&gt;&amp;nbsp;the user data should be stored in the cloud, the user should be able to choose the settings (to organize your data) once, without repeated actions.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;UI Design Patterns&lt;/b&gt;&amp;nbsp;(by analogy with Software Design Patterns) describes a general solution for the re-emerging problems / issues and appear as a &quot;byproduct&quot; of the process of development.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The five UI patterns with examples based on&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;ie=UTF8&amp;amp;prev=_t&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://habrahabr.ru/blogs/android/92547/&amp;amp;usg=ALkJrhimmYMr7UkHgR7HVo6OtSznD3vfbw&quot; style=&quot;color: #6da3bd;&quot;&gt;the well-known applications&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;DashBoard&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/f9/1a/f91adaeb3d2d8fa7f1d52d25c0ff6d9f.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Dashboard&lt;/b&gt;&amp;nbsp;(Dashboard) - represents the major features of the application, is the main application menu.&lt;/span&gt;&lt;span&gt;Dashboard occupies the entire screen, is focused on 3-6 most important features of the application may also contain information about the updates.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Because the pattern is essentially the Dashboard application entity, approach to its development should especially carefully.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Action Bar&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/bc/12/bc12b97baab22e3ff368508535bc294f.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Action Bar&lt;/b&gt;&amp;nbsp;provides quick access to additional functions of the application is the best solution representation of the functions used from any application (search, sync, refresh, etc.).&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Action Bar is not meant to replace the menu, but it contains the key actions that the user can execute (you should not be included in the menu to perform these actions).&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this pattern should not contain any contextual actions (such as copy / paste) Action Bar can also be used to guide the user in the application (namely, to show him where he is).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Quick Actions&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/24/0e/240e25260312961855cfa432db38fe62.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Quick Actions&lt;/b&gt;&amp;nbsp;- provides access to contextual features an application is invoked when you click on the &quot;purpose&quot; is displayed on the Eran as a popup.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Key features of Quick Actions: actions must match the context, be simple and straightforward (you can use icons) and actions should not be much.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It is also worth noting that pop-up popup shall not overlap with the &quot;goal&quot; (to appear either below or above in relation to &quot;purpose&quot;).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Use this pattern is recommended when there is no detailed description of the item-a, as well as when your application needs to perform additional actions related to the context.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Quick Actions should not be used when available multiselekt.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Search Bar&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/3f/70/3f70bbd86210dd85670b2a04880fea7e.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Search Bar&lt;/b&gt;&amp;nbsp;- used to search for the application (replace the Action Bar).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Search Bar should support proposals seeking, and may also include a selector for selecting the type of search.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Recommendations for implementing the pattern: to be used for a simple search on the application, provide a rich supply of search (for example, the icon title and description).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Companion Widget&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/af/61/af6177a4f246d0f76180d9ebf567ab3e.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Companion Widget&lt;/b&gt;&amp;nbsp;- Widget presents basic information about the application can be configured by the user.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In addition to icon should be the content (description, icon update, maybe some features of the application) must save the desktop space, and allow the user to customize the appearance of the widget.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Google engineers are encouraged to give more attention to this element of the interface because it is important in the interaction with the user.&lt;/span&gt;&amp;nbsp;&lt;span&gt;A simple shortcut to the application - not the best solution.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The above patterns are fundamental in the development of Android applications, but it does not mean that all of them must be applied.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The main idea is still the basis of which it is possible to consider different solutions (it is to ensure that it is worth developing the idea, not the pattern).&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Good luck with your ideas!&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2584600955240166106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2584600955240166106'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/basic-ui-design-patterns-android-apps.html' title='The basic UI design patterns Android apps'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-5433485565913393611</id><published>2011-09-30T10:03:00.000-07:00</published><updated>2011-09-30T10:03:38.920-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="sms"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Android, the history of the first application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 14px; line-height: 41px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: &#39;normal Verdana&#39;, Tahoma, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #999999; font-family: Verdana, sans-serif; font-size: 14px; font-weight: bold; line-height: 26px;&quot;&gt;Preface&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font-size: 12px; font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span&gt;Good day.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I hasten to note that this post does not pull or how much a benefit, it&#39;s only a story of a beginner, novice, telling about the beginning of my conquest of the android.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Let&#39;s begin.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The idea to write his first in the life of an application for android appeared spontaneously.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Basic knowledge of java were available, and in my head immediately got the idea to write a program to send SMS through service&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://orangetext.md/&amp;amp;usg=ALkJrhigRjussExdO07QAZ_B8R5AaRp3Fg&quot; style=&quot;color: #6da3bd;&quot;&gt;orangetext.md&lt;/a&gt;&amp;nbsp;(yes, this is the Republic of Moldova).&lt;/span&gt;&amp;nbsp;&lt;span&gt;This proved harder than I thought at first glance.&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;content&quot; style=&quot;font-size: 12px; font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Beginning&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;First Things First I decided to start the program interface.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For me was a pleasant surprise that the whole interface is created in the xml file.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For an application I needed 4 boxes for text input, two for its display, one to display a capture images, and a submit button.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In the sample code to show only one example for each:&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;code&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;AbsoluteLayout&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/widget32&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:background&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@drawable/bbg&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/widget41&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;27px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;20px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:text&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;От:&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:textStyle&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;bold&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_x&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;12px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_y&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;12px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;EditText&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/widget42&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;192px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;30px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:textSize&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;18sp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_x&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;37px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_y&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;9px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;EditText&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;Button&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/widget54&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;186px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;34px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:text&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Отправить&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_x&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;30px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_y&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;228px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;ImageView&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/widget56&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;97px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;35px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_x&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;19px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_y&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;162px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;ImageView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhgfmz8OX1vy5POHjWoAHzqS8K05PQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;I will not hide, used to mark the program Droid Draw (http://www.droiddraw.org/).&lt;/span&gt;&amp;nbsp;&lt;span&gt;The second issue was for me, how to use it all in the program.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It turned out easier to nowhere.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It was necessary only to indicate with findViewById () on an already created object in our xml file.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;ImageView imgView&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(ImageView)&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;Widget56);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;final&lt;/span&gt;&amp;nbsp;EditText nume&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(EditText)&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;widget42);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;final&lt;/span&gt;&amp;nbsp;EditText prefix&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(EditText)&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;widget45);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;final&lt;/span&gt;&amp;nbsp;EditText number&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(EditText)&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;widget46);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;final&lt;/span&gt;&amp;nbsp;EditText message&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(EditText)&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;widget50);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;final&lt;/span&gt;&amp;nbsp;EditText captchatext&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(EditText)&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;widget53);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;final&lt;/span&gt;&amp;nbsp;TextView io&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(TextView)&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;widget87);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Button&lt;/span&gt;&amp;nbsp;sendSMS&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(Button)&lt;/span&gt;&lt;/span&gt;&amp;nbsp;findViewById&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(R.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;id.&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;Widget54);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;And then began the most interesting.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It turns out&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://orangetext.md/&amp;amp;usg=ALkJrhigRjussExdO07QAZ_B8R5AaRp3Fg&quot; style=&quot;color: #6da3bd;&quot;&gt;orangetext.md&lt;/a&gt;&amp;nbsp;the first request to send requests the cookies, hanging at the beginning, he was received by a simple String headerValue = con.getHeaderField (6), but it also asks eventvalid values ​​and viewstate.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For me it was a huge screeching halt, because I had no idea where he takes them.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It turned out they fit into the HTML, and from where I was pulled out by simple manipulations.&lt;/span&gt;&amp;nbsp;&lt;span&gt;From the same was received id captcha images, which I later used to display it.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;url&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URL&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;https://www.orangetext.md/Default.aspx%22&quot; style=&quot;color: #6da3bd;&quot;&gt;www.orangetext.md / Default.aspx &quot;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;url.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;openConnection&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setDoInput&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;(true);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setDoOutput&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;(true);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setAllowUserInteraction&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;(true);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;Connection&quot;,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&quot;keep-alive&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept-Encoding&quot;,&lt;/span&gt;&amp;nbsp;&quot;gzip,&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;deflate&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept-Charset&quot;,&lt;/span&gt;&amp;nbsp;&quot;windows-1251,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;utf-8;&lt;/span&gt;&amp;nbsp;q = 0.7, *; q =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;0.7&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Referer&quot;,&lt;/span&gt;&amp;nbsp;&quot;&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.orange.md/%3Fc%3D5%26sc%3D59%2522&amp;amp;usg=ALkJrhiJfTPSqps2QmWZPo4KeFkezdG52Q&quot; style=&quot;color: #6da3bd;&quot;&gt;www.orange.md/?c=5&amp;amp;sc=59 &quot;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept&quot;,&lt;/span&gt;&amp;nbsp;&quot;text / html, application / xhtml + xml, application /&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;xml;&lt;/span&gt;&amp;nbsp;q = 0.9 ,*/*; q =&lt;span style=&quot;color: #009900;&quot;&gt;0.8&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept-Language&quot;,&lt;/span&gt;&amp;nbsp;&quot;ru,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;en-us;&lt;/span&gt;&amp;nbsp;q = 0.7, en; q =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;0.3&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;User-Agent&quot;,&lt;/span&gt;&amp;nbsp;&quot;Mozilla/5.0&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;(Windows;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;U; Windows NT 5.1; ru; rv:&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;1.8.1.12)&lt;/span&gt;Gecko/20080201 Firefox&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Content-Type&quot;,&lt;/span&gt;&amp;nbsp;&quot;application / x-www-form-urlencoded; charset =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;utf-8&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;Pragma&quot;,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&quot;no-cache&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Pattern p&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&amp;nbsp;Pattern.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;Compile&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;text&lt;/span&gt;&amp;nbsp;/&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;html;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000099;&quot;&gt;\ \&lt;/span&gt;&amp;nbsp;s + charset&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;([^&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000099;&quot;&gt;\ \&lt;/span&gt;&amp;nbsp;s]&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;+)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000099;&quot;&gt;\ \&lt;/span&gt;&amp;nbsp;s *&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Matcher m&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;p.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;matcher&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(con.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;getContentType&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;String&lt;/span&gt;&amp;nbsp;charset&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;m.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;matches&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;()?&lt;/span&gt;&lt;/span&gt;&amp;nbsp;M.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;group&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(1):&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;ISO-8859-1&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Reader&lt;/span&gt;&amp;nbsp;r&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;InputStreamReader&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(con.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;getInputStream&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(),&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;charset);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;StringBuilder buf&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;StringBuilder&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;while&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;(true)&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ch&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;r.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;read&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(ch&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;0)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;buf.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;append&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;((char)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;ch);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;String&lt;/span&gt;&amp;nbsp;str&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;buf.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;ToString&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;len&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;str.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;length&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;eventvalid&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;str.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;substring&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;(3122,&lt;/span&gt;&amp;nbsp;(len&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;4540));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;viewstate&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;str.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;substring&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;(1496,&lt;/span&gt;&amp;nbsp;(len&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;4746));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;temp&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;str.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;substring&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;(6490,&lt;/span&gt;&amp;nbsp;(len&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;1240));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;String&lt;/span&gt;&amp;nbsp;headerValue&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;con.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;GetHeaderField&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(6)&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&amp;nbsp;/ requested cookies (the number of cells found with the help of supplements for FireFix - HttpFox)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;temp1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;headerValue.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;substring&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;(0,&lt;/span&gt;&amp;nbsp;(len1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;17))&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&amp;nbsp;/ little cut unnecessary data from the cookie.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;Then I had to screen a capture an image that was generated randomly each time you request.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I tried to get her, sent tezhe cookies that were sent to me at first session, she did let herself get.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;URL1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URL URL&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;https://www.orangetext.md/CaptchaImage.axd?guid=%22&quot; style=&quot;color: #6da3bd;&quot;&gt;www.orangetext.md/CaptchaImage.axd?guid = &quot;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;temp);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;URLConnection&lt;/span&gt;&amp;nbsp;con1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;url1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;OpenConnection&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Host&quot;,&lt;/span&gt;&amp;nbsp;&quot;&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.orangetext.md%2522/&amp;amp;usg=ALkJrhhIAL2zqQm5YmjtYSsS8wse7eJjuQ&quot; style=&quot;color: #6da3bd;&quot;&gt;www.orangetext.md &quot;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Referer&quot;,&lt;/span&gt;&amp;nbsp;&quot;&amp;nbsp;&lt;a href=&quot;https://www.orangetext.md/%22&quot; style=&quot;color: #6da3bd;&quot;&gt;www.orangetext.md/ &quot;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept&quot;,&lt;/span&gt;&amp;nbsp;&quot;image / png, image /&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;*;&lt;/span&gt;&amp;nbsp;q = 0.8 ,*/*; q =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;0.5&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;Cookie&quot;,&lt;/span&gt;&lt;/span&gt;&amp;nbsp;temp1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;lang =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;ro&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept-Encoding&quot;,&lt;/span&gt;&amp;nbsp;&quot;gzip,&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;deflate&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept-Charset&quot;,&lt;/span&gt;&amp;nbsp;&quot;windows-1251,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;utf-8;&lt;/span&gt;&amp;nbsp;q = 0.7, *; q =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;0.7&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Accept-Language&quot;,&lt;/span&gt;&amp;nbsp;&quot;ru,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;en-us;&lt;/span&gt;&amp;nbsp;q = 0.7, en; q =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;0.3&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;User-Agent&quot;,&lt;/span&gt;&amp;nbsp;&quot;Mozilla/5.0&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;(Windows;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;U; Windows NT 5.1; ru; rv:&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;1.8.1.12)&lt;/span&gt;Gecko/20080201 Firefox&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Content-Type&quot;,&lt;/span&gt;&amp;nbsp;&quot;application / x-www-form-urlencoded; charset =&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;utf-8&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setRequestProperty&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;Pragma&quot;,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&quot;no-cache&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;connect&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;Immediately after that I show it through ImageView.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;InputStream&lt;/span&gt;&amp;nbsp;is&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(InputStream)&lt;/span&gt;&lt;/span&gt;&amp;nbsp;con1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;GetContent&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Drawable d1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;Drawable.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;CreateFromStream&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(is,&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;src&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;name&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;imgView.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setImageDrawable&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;(d1);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;The case remained for sending a POST request.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I hung the whole thing on the button.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Been looking for, how to pull the text out of Edith Box, was simply nowhere.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The example below.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;sendSMS.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setOnClickListener&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(new&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Button.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;OnClickListener&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;void&lt;/span&gt;&amp;nbsp;onClick&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #003399;&quot;&gt;(View&lt;/span&gt;&amp;nbsp;v)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;try&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;data&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+ =&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;&amp;amp;&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URLEncoder.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;encode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;__VIEWSTATE&quot;, &quot;UTF-8&quot;)&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;=&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URLEncoder.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;encode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(viewstate,&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;UTF-8&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;data&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+ =&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;&amp;amp;&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URLEncoder.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;encode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;__EVENTVALIDATION&quot;, &quot;UTF-8&quot;)&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;=&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URLEncoder.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;encode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(eventvalid,&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;UTF-8&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;data&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+ =&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;&amp;amp;&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URLEncoder.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;encode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;btnOK&quot;, &quot;UTF-8&quot;)&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;=&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;+&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;URLEncoder.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;encode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;trimite&lt;/span&gt;&amp;nbsp;sms&quot;,&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&quot;UTF-8&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;By opening a new connection by sending the server through setRequestProperty () my old cookies, I made a POST request and simultaneously loads the page, so you can see off a SMS, or not.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;OutputStreamWriter&lt;/span&gt;&amp;nbsp;wr&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;OutputStreamWriter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(con3.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;getOutputStream&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;wr.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;write&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;(data);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;wr.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;flush&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Pattern p1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&amp;nbsp;Pattern.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;Compile&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;text&lt;/span&gt;&amp;nbsp;/&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;html;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000099;&quot;&gt;\ \&lt;/span&gt;&amp;nbsp;s + charset&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;([^&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000099;&quot;&gt;\ \&lt;/span&gt;&amp;nbsp;s]&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;+)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000099;&quot;&gt;\ \&lt;/span&gt;&amp;nbsp;s *&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Matcher m1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;p1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;Matcher&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(con3.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;getContentType&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;String&lt;/span&gt;&amp;nbsp;charset&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;m1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;Matches&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;()?&lt;/span&gt;&lt;/span&gt;&amp;nbsp;M1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;Group&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(1):&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;ISO-8859-1&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Reader&lt;/span&gt;&amp;nbsp;r1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;InputStreamReader&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(con3.&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;getInputStream&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(),&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;charset);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;StringBuilder buf1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;StringBuilder&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;while&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;(true)&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ch1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;r1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;read&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(ch1&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;0)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;buf1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;append&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;((char)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;ch1);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;String&lt;/span&gt;&amp;nbsp;str5&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;buf1.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;ToString&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;Page always static, and change it to just one sentence, depending on the action.&lt;/span&gt;&amp;nbsp;&lt;span&gt;First, it is - success, the second - the error Captcha, and the third - exceeded the allowable number of SMS.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To find out what happened at my end and put it on the screen, I decided simply to look at html-f only one word, which is only a proposal.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If it met there, I decided to print a message in the initial TextView.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;intIndex&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;str6.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;indexOf&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;succes&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;intIndex1&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;str6.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;indexOf&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;depasit&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;intIndex2&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;str6.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;indexOf&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;(&quot;incorect&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(intIndex&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;== -&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1)&lt;/span&gt;&amp;nbsp;{}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;io.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setText&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;Message&lt;/span&gt;&amp;nbsp;was sent&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;successfully.&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(intIndex1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;== -&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1)&lt;/span&gt;&amp;nbsp;{}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;io.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setText&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;You&lt;/span&gt;&amp;nbsp;sent more than five&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;messages.&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: black;&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(intIndex2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;== -&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1)&lt;/span&gt;&amp;nbsp;{}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;io.&amp;nbsp;&lt;span style=&quot;color: #006633;&quot;&gt;setText&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&quot;You&lt;/span&gt;&amp;nbsp;entered the wrong code in the&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;image.&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;Unpleasant surprise for me was that it does not work.&lt;/span&gt;&amp;nbsp;&lt;span&gt;It turned out it in the constraints that need to register in the file AndroidManifest, which I did, giving the program full access to the Internet.&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;uses&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&amp;nbsp;permission&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;android:&lt;/span&gt;&amp;nbsp;name&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;android.permission.INTERNET&quot;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;lt;/&lt;/span&gt;&amp;nbsp;uses&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;- permission&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Epilogue&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;For me, the first application for the android was the gateway to the mobile programming.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I was extremely delighted that this is the exact same java without limitation, wrapped in beautiful packaging.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For those wishing to spread the sources.&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://rghost.ru/3843615&amp;amp;usg=ALkJrhjyPPy0WBFabCpg7IDx8SzWpD5szA&quot; style=&quot;color: #6da3bd;&quot;&gt;Download. zip&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://rghost.ru/3843629&amp;amp;usg=ALkJrhilaOi2sxwPhSAjto2SJXYZ0iwWbw&quot; style=&quot;color: #6da3bd;&quot;&gt;download. apk&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/5433485565913393611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/5433485565913393611'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/android-history-of-first-application.html' title='Android, the history of the first application'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-4056648389578174765</id><published>2011-09-30T09:57:00.000-07:00</published><updated>2011-09-30T09:57:36.897-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="notification bar"/><title type='text'>Android. Working with a status line.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/7b/65/7b656a8f206e42640e605a0e446dd5b3.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span&gt;The article tells about how to deal with the status bar in Android.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This article is intended for beginners only studying for the Android platform under development.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Also worth noting that the status bar is more used to notify the user of any events occurring in a system that unites its target with pop-up notifications Toast.&lt;/span&gt;&amp;nbsp;&lt;span&gt;On Habrahabr already&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://habrahabr.ru/blogs/android/85449/&amp;amp;usg=ALkJrhiUGruR-G7pAlfcSQuq_OwQECQzEw&quot; style=&quot;color: #6da3bd;&quot;&gt;has&lt;/a&gt;&amp;nbsp;a fairly complete article on using Toast, and this post only develops the theme of the notifications.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The text itself was written articles for the sandbox, and in fact Hello world as it is.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Now I&#39;m interested in wondering whether anyone at all, or a direction, or it&#39;s not worth it.&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;A brief notice about the line&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;In the first screenshot shows the status bar is disclosed in a standard envelope Android (some manufacturers of mobile devices in their shells can change its appearance, though the essence remains the same).&lt;/span&gt;&amp;nbsp;&lt;span&gt;The status bar in the Android is mostly used to notify the user of any events occurring in the system, as well as on the outcome of any applications.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The essential difference from the pop-up notifications Toast is that the notification in the status bar does not disappear after a while, and &quot;hang&quot; there until the user somehow they react.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Status bar is useful to receive notifications from applications running in the background, as well as with the emergence of a notification, you can play any sound, vibration, or use the flashing LED on the device (if any).&lt;/span&gt;&amp;nbsp;&lt;span&gt;The notification submitted by the screenshot - is exactly what we are today and will work.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Create a simple notification on the status bar&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;For a start try to create a standard disclaimer to the command line as it is recommended by Google.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The layout of the application interface remain unchanged (notice to appear immediately after you start it).&lt;/span&gt;&amp;nbsp;&lt;span&gt;And so, the sample code (with commentary of what is possible may not be clear):&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;NotificationBar extends Activity {&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;/** Called when the activity is first created. */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;NOTIFY_ID = 1;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Уникальный индификатор вашего уведомления в пределах класса&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate(Bundle savedInstanceState) {&lt;br /&gt;
super.onCreate(savedInstanceState);&lt;br /&gt;
setContentView(R.layout.main);&lt;br /&gt;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Создаем экземпляр менеджера уведомлений&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;icon = android.R.drawable.sym_action_email;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Иконка для уведомления, я решил воспользоваться стандартной иконкой для Email&lt;/span&gt;&lt;br /&gt;
CharSequence tickerText =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Hello Habrahabr&quot;&lt;/span&gt;&amp;nbsp;;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Подробнее под кодом&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;long&lt;/span&gt;&amp;nbsp;when = System.currentTimeMillis();&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Выясним системное время&lt;/span&gt;&lt;br /&gt;
Notification notification =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Notification(icon, tickerText, when);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Создаем экземпляр уведомления, и передаем ему наши параметры&lt;/span&gt;&lt;br /&gt;
Context context = getApplicationContext();&lt;br /&gt;
CharSequence contentTitle =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Habrahabr&quot;&lt;/span&gt;&amp;nbsp;;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Текст заголовка уведомления при развернутой строке статуса&lt;/span&gt;&lt;br /&gt;
CharSequence contentText =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Пример простого уведомления&quot;&lt;/span&gt;&amp;nbsp;;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;//Текст под заголовком уведомления при развернутой строке статуса&lt;/span&gt;&lt;br /&gt;
Intent notificationIntent =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Intent(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;, NotificationBar.&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt;&amp;nbsp;);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Создаем экземпляр Intent&lt;/span&gt;&lt;br /&gt;
PendingIntent contentIntent = PendingIntent.getActivity(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;, 0, notificationIntent, 0);&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt;&amp;nbsp;);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Подробное описание в UPD к статье&lt;/span&gt;&lt;br /&gt;
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Передаем в наше уведомление параметры вида при развернутой строке состояния&lt;/span&gt;&lt;br /&gt;
mNotificationManager.notify(NOTIFY_ID, notification);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// И наконец показываем наше уведомление через менеджер передав его ID&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
}&lt;/code&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: grey;&quot;&gt;* This source code with WAS Highlighted&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhgfmz8OX1vy5POHjWoAHzqS8K05PQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;CharSequence tickerText = «Hello Habrahabr»;&lt;/b&gt;&amp;nbsp;- in this line, we specify the text to be displayed in the minimized status bar for a few seconds with the appearance notice.&lt;/span&gt;&amp;nbsp;&lt;span&gt;After a few seconds it will disappear, and the line will only icon.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://habrastorage.org/storage/habraeffect/76/54/7654509ef6e84b868e40b398089f2cf0.jpg&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;That&#39;s probably it.&lt;/span&gt;&amp;nbsp;&lt;span&gt;You can open the champagne, and watch what we have.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/68/61/6861f182e8d3aecf4bd978f00184a458.jpg&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Create an advanced notification in the status bar&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Now a few complicate the task - we will create a notification is not a pattern that suggests Google, but on its own markup (since there is such a possibility).&lt;/span&gt;&amp;nbsp;&lt;span&gt;And so we create a new markup file in the folder layout, you should get it like this:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:orientation&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;horizontal&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:padding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;3dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;ImageView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/image&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_marginRight&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;10dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/text&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:textColor&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;#000&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhgfmz8OX1vy5POHjWoAHzqS8K05PQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;Also add any folder or image in drawable so then set it to ImageView.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Now the code.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The code is not very different from the code, a simple notice, but nevertheless requires comment&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;NotificationBar extends Activity {&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;/** Called when the activity is first created. */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;NOTIFY_ID = 1;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Уникальный индификатор вашего уведомления в пределах класса&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate(Bundle savedInstanceState) {&lt;br /&gt;
super.onCreate(savedInstanceState);&lt;br /&gt;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Создаем экземпляр менеджера уведомлений&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;icon = android.R.drawable.sym_action_email;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Иконка для уведомления, я решил воспользоваться стандартной иконкой для Email&lt;/span&gt;&lt;br /&gt;
CharSequence tickerText =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Hello Habrahabr&quot;&lt;/span&gt;&amp;nbsp;;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Подробнее под кодом&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;long&lt;/span&gt;&amp;nbsp;when = System.currentTimeMillis();&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Выясним системное время&lt;/span&gt;&lt;br /&gt;
Intent notificationIntent =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Intent(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;, NotificationBar.&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt;&amp;nbsp;);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Создаем экземпляр Intent&lt;/span&gt;&lt;br /&gt;
Notification notification =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Notification(icon, tickerText, when);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Создаем экземпляр уведомления, и передаем ему наши параметры&lt;/span&gt;&lt;br /&gt;
PendingIntent contentIntent = PendingIntent.getActivity(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;, 0, notificationIntent, 0);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Подробное описание смотреть в UPD к статье&lt;/span&gt;&lt;br /&gt;
RemoteViews contentView =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;RemoteViews(getPackageName(), R.layout.notlayout);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Создаем экземпляр RemoteViews указывая использовать разметку нашего уведомления&lt;/span&gt;&lt;br /&gt;
contentView.setImageViewResource(R.id.image, R.drawable.habr);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Привязываем нашу картинку к ImageView в разметке уведомления&lt;/span&gt;&lt;br /&gt;
contentView.setTextViewText(R.id.text,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Привет Habrahabr! А мы тут, плюшками балуемся...&quot;&lt;/span&gt;&amp;nbsp;);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Привязываем текст к TextView в нашей разметке&lt;/span&gt;&lt;br /&gt;
notification.contentIntent = contentIntent;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Присваиваем contentIntent нашему уведомлению&lt;/span&gt;&lt;br /&gt;
notification.contentView = contentView;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Присваиваем contentView нашему уведомлению&lt;/span&gt;&lt;br /&gt;
mNotificationManager.notify(NOTIFY_ID, notification);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Выводим уведомление в строку&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhgfmz8OX1vy5POHjWoAHzqS8K05PQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span&gt;As a result, we can open a second bottle, and observe about this picture:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/21/2c/212ca238b98160a87a1cf82c43341d2e.jpg&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Adding sound and vibration, blinking.&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;For good measure, add the importance of sound in the derivation of the notification and vibration.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Make it&#39;s not hard.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.defaults | = Notification.DEFAULT_SOUND;&lt;/b&gt;&amp;nbsp;- this line sets the notification sound that is used by default.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.sound = Uri.parse («file: / / / sdcard/notification/ringer.mp3»);&lt;/b&gt;&amp;nbsp;- this way you can install the sound from a file on your SD card.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.defaults | = Notification.DEFAULT_VIBRATE;&lt;/b&gt;&amp;nbsp;- this adds a vibration in the Number of time by default.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In addition it is possible to set the time of vibration of their own.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This is done in two lines&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;long [] vibrate = {0,100,200,300};&lt;/b&gt;&amp;nbsp;- create a file in which the first number - the time that you should wait before you start the vibration.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The second meaning - the first vibration in milliseconds (the same, and 3, and 4 value).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Amount of vibration may be infinitely large at the discretion of the programmer.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.vibrate = vibrate;&lt;/b&gt;&amp;nbsp;- assign the array to our notice.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.defaults | = Notification.DEFAULT_LIGHTS;&lt;/b&gt;&amp;nbsp;- this string we can blink with the default settings.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Of course, you can configure and ruchnuyu.Dlya this, we need four lines:&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.ledARGB = 0xff00ff00;&lt;/b&gt;&amp;nbsp;- sets the color for the RGB LED.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.ledOnMS = 300 -&lt;/b&gt;&amp;nbsp;sets the time between blinks&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.ledOffMS = 1000&lt;/b&gt;&amp;nbsp;- sets the time after which the indicator will extinguish burning&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;notification.flags | = Notification.FLAG_SHOW_LIGHTS;&lt;/b&gt;&amp;nbsp;- allow flash&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Here it should be noted that not all devices in general, there are any indicators.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Naturally, all these settings must be done before a line call notice.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Conclusion&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;That&#39;s probably it.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Fasting does not purport to, and yet this information should be enough for beginners.&lt;/span&gt;&amp;nbsp;&lt;span&gt;As a source, as well as a more complete description of the work with NotificationBar can bring&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/guide/topics/ui/notifiers/notifications.html&amp;amp;usg=ALkJrhjzWSFOxwlU4JvenkQwboJ1PokrgA&quot; style=&quot;color: #6da3bd;&quot;&gt;the original&lt;/a&gt;&amp;nbsp;article on&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/&amp;amp;usg=ALkJrhjNn5O4NjShQQazc0PPynB1RVDKNQ&quot; style=&quot;color: #6da3bd;&quot;&gt;developer.android.com&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I hope someone can help, or article in the study of the platform.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thank you for your attention.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;u&gt;UPD:&lt;/u&gt;&amp;nbsp;on closer examination it turned out that the comment to one of the missing lines of code (a code promises to explain, but most explanations there).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Annoying bug fixes, as well as a number of faculty and a status bar that I forgot to inform the user fills&amp;nbsp;&lt;a class=&quot;user_link&quot; href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://djvu.habrahabr.ru/&amp;amp;usg=ALkJrhhHuVV0PtxYyVUUqZwILn-639ZmeA&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://habrahabr.ru/i/bg-user2.gif); background-origin: initial; background-position: 0px 60%; background-repeat: no-repeat no-repeat; color: #666666; font: normal normal normal 92.4%/1.5em arial; padding-left: 14px;&quot;&gt;DjVu&lt;/a&gt;&amp;nbsp;, you can look in the comments:&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://habrahabr.ru/blogs/android/111238/&amp;amp;usg=ALkJrhh5o09VhEZrQWJjACMVROrKczbQmg#comment_3546742&quot; style=&quot;color: #6da3bd;&quot;&gt;1&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://habrahabr.ru/blogs/android/111238/&amp;amp;usg=ALkJrhh5o09VhEZrQWJjACMVROrKczbQmg#comment_3546811&quot; style=&quot;color: #6da3bd;&quot;&gt;2&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;On the existence of serious pitfalls reports&amp;nbsp;&lt;a class=&quot;user_link&quot; href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://sdmitry.habrahabr.ru/&amp;amp;usg=ALkJrhiLss4SXRLlMAK0sHwZGdAQ9_ccmg&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://habrahabr.ru/i/bg-user2.gif); background-origin: initial; background-position: 0px 60%; background-repeat: no-repeat no-repeat; color: #666666; font: normal normal normal 92.4%/1.5em arial; padding-left: 14px;&quot;&gt;sdmitry&lt;/a&gt;&amp;nbsp;&#39;s&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://habrahabr.ru/blogs/android/111238/&amp;amp;usg=ALkJrhh5o09VhEZrQWJjACMVROrKczbQmg#comment_3546874&quot; style=&quot;color: #6da3bd;&quot;&gt;here&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4056648389578174765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4056648389578174765'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/android-working-with-status-line.html' title='Android. Working with a status line.'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-4817515456000489846</id><published>2011-09-30T09:50:00.000-07:00</published><updated>2011-09-30T09:50:48.638-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Drag and Drop"/><category scheme="http://www.blogger.com/atom/ns#" term="MotionEvent"/><category scheme="http://www.blogger.com/atom/ns#" term="Multitouch"/><category scheme="http://www.blogger.com/atom/ns#" term="touchscreen"/><title type='text'>Interaction with the touch screen</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span&gt;Catching up on programming for Android need to know how to interact with a touchscreen - the main input device for most of the Android devices.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This article will be considered:&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Low-level interaction with the touch screen, right above all for game development.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Class MotionEvent&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Processing MotionEvent&#39;ov&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Working with MultiTouch.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Some high-touch processing techniques.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;There will also be shown various examples of ...&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The retreat over the Valley&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Since later in this article, we will actively use the Log, I will briefly tell you about it (those who are already familiar with log Android may safely skip this section of the article).&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;In Android has its own log, which can write applications from all interested Dvalvik VM to your application.&lt;/span&gt;&amp;nbsp;&lt;span&gt;All messages in the log are separated by priority (right to choose the priority of the message is sent to the log is up to you)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;To write to the log enough to cause one of the static class methods Log, differing only in priority sent by their messages.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;These methods are listed below in ascending order of priority:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Log.v (String tag, String msg) - VERBOSE&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Log.d (String tag, String msg) - DEBUG&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Log.i (String tag, String msg) - INFO&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Log.w (String tag, String msg) - WARNING&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Log.e (String tag, String msg) - ERROR&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Log.wtf (String tag, String msg) - What a Terrible Failure&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;It is also possible to send the log exceptions.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this case adds one more argument - Throwable tr.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For example:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Log.v (String tag, String msg, Throwable tr)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span&gt;&lt;b&gt;Print the Log&#39;s window in Eclipse can be as follows:&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;span&gt;&lt;b&gt;Window -&amp;gt; Show View -&amp;gt; Other -&amp;gt; Android -&amp;gt; LogCat&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The concept of MotionEvent&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;MotionEvent class serves as a repository of data on a touch (touch event).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Each time a user spends with his finger on the screen, or even just Tapa, created an entire sequence of instances&amp;nbsp;&lt;b&gt;MotionEvent:&lt;/b&gt;&amp;nbsp;sequence starts when a user touches the screen, continues until the user moves a finger across the screen and ends when the user lifts his finger.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thus there are three main types of action that describes MotionEvent: lowering the finger, his movement and uplift.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Each MotionEvent keeps information about the type of action, which he describes.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To this end, the class provides constant MotionEvent:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;int MotionEvent.ACTION_DOWN - user puts his finger on the screen.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;int MotionEvent.ACTION_MOVE - the user moves a finger across the screen.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;int MotionEvent.ACTION_UP - user lifts the finger from the screen.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;Learn what effect this describes MotionEvent by using the method&amp;nbsp;&lt;b&gt;getAction ().&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;It is worth noting that there is another type of action - MotionEvent.ACTION_CANCEL, which is essentially a symbol of what the sequence is completed correctly, then there is no MotionEvent.ACTION_UP.&lt;/span&gt;&amp;nbsp;&lt;span&gt;All of this will be explained in more detail the example, but a little later.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Receiving and processing of MotionEvents&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Now that we&#39;ve got a general idea of ​​MotionEvent&#39;ah must deal with the fact from us their &quot;take.&quot;&lt;/span&gt;&amp;nbsp;&lt;span&gt;There are 2 ways, let us discuss them separately.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The first method is best when you use one of the standard View.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In the View class has a method SetOnTouchListener (View.OnTouchListener l), an argument which is the class that implements the interface OnTouchListener.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This method allows you to appoint a &quot;listener&quot; MotionEvent&#39;ov.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Interface OnTouchListener commits a class to implement the method public boolean OnTouch (View v, MotionEvent event), the second argument is that you want us to MotionEvent.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Now every time the user will touch the screen, Android will call our method OnTouch, giving him a description of what happened in the argument of that is MotionEvent.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Let us consider an example:&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Here&#39;s our file res / layout / main.xml:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;Xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns: android&lt;/span&gt;&amp;nbsp;= &quot;&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://schemas.android.com/apk/res/android&amp;amp;usg=ALkJrhi-pK4f7RcDE3SLXVhHqaaCecw0cA&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;schemas.android.com / apk / res / android&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: orientation&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_width&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_height&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;id&lt;/span&gt;&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;@ +&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/ ll&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;But our class Activity:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;An&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.app.Activity;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.os.Bundle;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.util.Log;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.MotionEvent;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.View;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.View.OnTouchListener;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.widget.LinearLayout;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;main&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;Activity&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;implements&lt;/span&gt;&amp;nbsp;OnTouchListener&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;{/ / makes our class to translate the interface Activity OnTouchListener&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ ** Called when the activity is first created.&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;* /&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate (Bundle savedInstanceState) {&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;super.&lt;/span&gt;&amp;nbsp;OnCreate (savedInstanceState);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;14&lt;/span&gt;&amp;nbsp;setContentView (R.layout.main);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;15&lt;/span&gt;&amp;nbsp;LinearLayout ll = (LinearLayout)&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this.&lt;/span&gt;&amp;nbsp;FindViewById (R.id.ll);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / We get the desired View&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;16&lt;/span&gt;&amp;nbsp;ll.setOnTouchListener&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(this);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Set the class as a listener for our MotionEvent&#39;ov LinearLayout&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;17}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;18&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;19&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public boolean&lt;/span&gt;&amp;nbsp;onTouch (View v, MotionEvent event)&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / That&#39;s the method that will handle and MotionEvent&#39;y.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;21&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;22&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;Action = event.getAction ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;23&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / The method getAction () Gets the type of action (ACTION_DOWN, ACTION_MOVE or ACTION_UP)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;24&lt;/span&gt;&amp;nbsp;StringBuilder str =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;StringBuilder ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;25&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ nActrion type:&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;26&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Next for better (as a constant ACTION_DOWN, ACTION_MOVE ACTION_UP and numeric)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;27&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / hold switch on the variable Action, and add to our StringBuilder name of the constant&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;28&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;switch&lt;/span&gt;&amp;nbsp;(Action)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;29&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;30&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;MotionEvent.ACTION_DOWN: str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«ACTION_DOWN \ n»);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;31&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;MotionEvent.ACTION_MOVE: str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«ACTION_MOVE \ n»);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;32&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;MotionEvent.ACTION_UP: str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«ACTION_UP \ n»);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;33}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;34&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Use the methods getX () and getY () to obtain the coordinates x and y axes, respectively&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;35&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / It should be noted that the point 0 is located in the upper left corner of the screen.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;36&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / x axis pointing to the right&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;37&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / y axis pointing down (the lower, the greater the coordinate).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;38&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Location:»).&lt;/span&gt;&amp;nbsp;Append (event.getX ()). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;x&quot;).&lt;/span&gt;&amp;nbsp;Append (event.getY ()). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ n&quot;);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Learn coordinates&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;39&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Edge flags:»).&lt;/span&gt;&amp;nbsp;Append (event.getEdgeFlags ()). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ n&quot;);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / method returns information about getEdgeFlags crossing edges of the screen&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;40&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Pressure:»).&lt;/span&gt;&amp;nbsp;Append (event.getPressure ()). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ n&quot;);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Learn pressure&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;41&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Size:»).&lt;/span&gt;&amp;nbsp;Append (event.getSize ()). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ n&quot;);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Learn the pointer size (places a finger on the touch screen)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;42&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Down time:»).&lt;/span&gt;&amp;nbsp;Append (event.getDownTime ()). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«ms \ n»);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / find out the time when the finger was lowered onto the screen in milliseconds&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;43&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Event time:»).&lt;/span&gt;&amp;nbsp;Append (event.getEventTime ()). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«ms»);&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / check the current time (corresponding to the processed MotionEvent&#39;u) in milliseconds&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;44&lt;/span&gt;&amp;nbsp;str.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;Elapsed:&quot;).&lt;/span&gt;&amp;nbsp;Append (event.getEventTime ()-event.getDownTime ());&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / find out how much time has passed since the lowering of a finger, to the current MotionEvent&#39;a&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;45&lt;/span&gt;&amp;nbsp;Log.v&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Mytag»,&lt;/span&gt;&amp;nbsp;str.toString ());&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / In order to be able to monitor these activities, we write about them all the information in the log.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;46&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;true;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Why do we return true will be discussed later&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;47}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;48}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;It is clear that one class can be a listener in several View.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To consider this method takes an argument onTouch View.&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The second way is best, when you write your View class, which must respond to the touch.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In View is a method onTouchEvent (MotionEvent event), which, actually, and can handle MotionEvent&#39;y.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Consider an example:&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Write the class SomeView:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;package&lt;/span&gt;&amp;nbsp;com.example.MotionEventExample1;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.content.Context;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.util.AttributeSet;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.util.Log;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.MotionEvent;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.View;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;SomeView&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;View&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / First, you must implement a constructor.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / It&#39;s simple - just call the superclass constructor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;SomeView (Context context, AttributeSet attrs)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;14&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;super&lt;/span&gt;&amp;nbsp;(context, attrs);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;15}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;16&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;17&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Now proceed directly to processing MotionEvent&#39;ov.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;18&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / You need to rewrite the method onTouchEvent&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;19&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public boolean&lt;/span&gt;&amp;nbsp;onTouchEvent (MotionEvent event)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;21&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;22&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;23&lt;/span&gt;&amp;nbsp;Float X = (Float) event.getX ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;24&lt;/span&gt;&amp;nbsp;Float Y = (Float) event.getY ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;25&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;Action = event.getAction ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;26&lt;/span&gt;&amp;nbsp;String ActionString =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;27&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;switch&lt;/span&gt;&amp;nbsp;(Action)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;28&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;29&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;MotionEvent.ACTION_DOWN: ActionString =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;«ACTION_DOWN»;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;30&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;MotionEvent.ACTION_MOVE: ActionString =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;«ACTION_MOVE»;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;31&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;MotionEvent.ACTION_UP: ActionString =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;«ACTION_UP»;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;break;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;32}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;33&lt;/span&gt;&amp;nbsp;Log.v&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«MyTag», «View OnTouchListener: \ n»&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;«Coords:»&lt;/span&gt;&amp;nbsp;+ X.toString () +&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;x&quot;&lt;/span&gt;&amp;nbsp;+ Y.toString () +&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;\ nAction type:&quot;&lt;/span&gt;&amp;nbsp;+ ActionString);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;34&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;true;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;35}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;36&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;37}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;38&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;And our / res / layout / main.xml:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;Xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns: android&lt;/span&gt;&amp;nbsp;= &quot;&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://schemas.android.com/apk/res/android&amp;amp;usg=ALkJrhi-pK4f7RcDE3SLXVhHqaaCecw0cA&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;schemas.android.com / apk / res / android&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: orientation&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_width&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_height&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;com.example.MotionEventExample1.SomeView&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_width&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_height&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;id&lt;/span&gt;&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;@ +&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/ sv&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Activity class:&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;package&lt;/span&gt;&amp;nbsp;com.example.MotionEventExample1;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;An&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.app.Activity;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.os.Bundle;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;main&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;Activity {&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ ** Called when the activity is first created.&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;* /&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate (Bundle savedInstanceState) {&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;super.&lt;/span&gt;&amp;nbsp;OnCreate (savedInstanceState);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;setContentView (R.layout.main);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The fact that the return handlers MotionEvent&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;As you can see, handlers must return MotionEvent&#39;s boolean value.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In the examples before, we just always return true.&lt;/span&gt;&amp;nbsp;&lt;span&gt;So what do these methods must return a value?&lt;/span&gt;&amp;nbsp;&lt;span&gt;The fact that one View can be multiple listeners (eg onTouchEvent in the View and the outer OnTouch listener) and they have some precedence: OnTouch called first (if any), and after it can be called onTouchEvent.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Call next on the priority of the handler just returned depends on the current value of the handler (true - there is nothing called, false - called the next priority, if any).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thus, Android allows us to share responsibility for handling touch on a few event&#39;ov listeners.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Drag and Drop&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;
&lt;span&gt;So we figured out the basics of handling MotionEvento&#39;ov.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To consolidate the skills we write an application that implements a simple Drag and Drop.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Here is our / res / layout / main.xml:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;Xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns: android&lt;/span&gt;&amp;nbsp;= &quot;&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://schemas.android.com/apk/res/android&amp;amp;usg=ALkJrhi-pK4f7RcDE3SLXVhHqaaCecw0cA&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;schemas.android.com / apk / res / android&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: orientation&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_width&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_height&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;com.example.dragdrop.SomeView&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_width&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_height&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;id&lt;/span&gt;&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;@ +&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/ sv&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Here is our class Activity:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;package&lt;/span&gt;&amp;nbsp;com.example.dragdrop;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.app.Activity;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.os.Bundle;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;main&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;Activity {&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ ** Called when the activity is first created.&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;* /&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate (Bundle savedInstanceState) {&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;super.&lt;/span&gt;&amp;nbsp;OnCreate (savedInstanceState);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;setContentView (R.layout.main);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;But our main class SomeView:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;package&lt;/span&gt;&amp;nbsp;com.example.dragdrop;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.content.Context;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Canvas;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Color;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Paint;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Paint.Style;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.util.AttributeSet;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.MotionEvent;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.View;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;SomeView&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;View&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;14&lt;/span&gt;&amp;nbsp;Paint paint;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;15&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;X;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;16&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;Y;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;17&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;final static int&lt;/span&gt;&amp;nbsp;Radius =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;20;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;18&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;SomeView (Context context, AttributeSet attrs)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;19&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;super&lt;/span&gt;&amp;nbsp;(context, attrs);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;21&lt;/span&gt;&amp;nbsp;paint =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Paint ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;22&lt;/span&gt;&amp;nbsp;paint.setColor (Color.YELLOW);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;23&lt;/span&gt;&amp;nbsp;paint.setStyle (Style.FILL);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;24&lt;/span&gt;&amp;nbsp;X =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;30;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;25&lt;/span&gt;&amp;nbsp;Y =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;30;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;26}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;27&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;28&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public boolean&lt;/span&gt;&amp;nbsp;onTouchEvent (MotionEvent event)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;29&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;30&lt;/span&gt;&amp;nbsp;X =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(int)&lt;/span&gt;&amp;nbsp;event.getX ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;31&lt;/span&gt;&amp;nbsp;Y =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(int)&lt;/span&gt;&amp;nbsp;event.getY ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;32&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;true;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;33}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;34&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;35&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;36&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt;&amp;nbsp;onDraw (Canvas canvas)&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / OnDraw method offered to Android when it needs to draw this View&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;37&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;38&lt;/span&gt;&amp;nbsp;canvas.drawCircle (X, Y, Radius, paint);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;39&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;invalidate (); / /&lt;/span&gt;&amp;nbsp;invalidate ()&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;is needed in order to alert the Android, you have to execute a method OnDraw again, without the View will not be perericovyvatsya.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;40}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;41&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;42}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Multitouch&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;In Android, how much would you finger-not used, information on all of them stored in one MotionEvent&#39;e.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The first method that you want to know if you intend to use multi - getPointerCount (), which returns the number of fingers, fixed on the screen (not always coincide with the actual number due to limitations in hardware).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Each finger on the screen, given the index, and id.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Indexes always start at 0, id - not necessarily.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For clarity let us consider an example.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;The first finger down - it is assigned index = 0 id = 0&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;The second finger down - it is assigned index = 1 and id = 1&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;The first finger raised - the second finger is assigned index = 0 (indices always start at zero), and id is the same&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;The second finger up - MotionEvent&#39;ov no more, until the Next touch.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Id always reserved for a pointer (finger), so that we can always keep track of what you want the pointer.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;When we have finished with the id and the indices, we consider how to get the properties (position, size, etc.) at a specific index, where many of them.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To do this in class MotionEvent methods exist:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;getX (int Index)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;getY (int Index)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;getSize (int Index)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;and so on, we have considered them&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;In the argument of these methods take a pointer to&amp;nbsp;&lt;b&gt;the index.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;But as the index pointer can vary, but often you want to track a specific finger, there is a very important method getPointerId (int index), which allows you to find the specified index id pointer.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Consider this example: rewrite our application (Drag and Drop) so that it viewed the multi-touch.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;(Note: In multi-emulator does not verify, it can only be done on this devayse)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Here is our res / layout / main.xml&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;Xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns: android&lt;/span&gt;&amp;nbsp;= &quot;&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://schemas.android.com/apk/res/android&amp;amp;usg=ALkJrhi-pK4f7RcDE3SLXVhHqaaCecw0cA&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;schemas.android.com / apk / res / android&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: orientation&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_width&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_height&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;com.example.multitouch.SomeView&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_width&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android: layout_height&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;id&lt;/span&gt;&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;@ +&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/ view&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;Our Activity class:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;package&lt;/span&gt;&amp;nbsp;com.example.multitouch;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.app.Activity;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.os.Bundle;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;main&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;Activity {&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ ** Called when the activity is first created.&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span&gt;&lt;span style=&quot;color: green;&quot;&gt;* /&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate (Bundle savedInstanceState) {&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;super.&lt;/span&gt;&amp;nbsp;OnCreate (savedInstanceState);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;setContentView (R.layout.main);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;But the main class - SomeView:&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;1&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;package&lt;/span&gt;&amp;nbsp;com.example.multitouch;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;3&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.content.Context;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;4&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Canvas;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;5&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Color;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;6&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Paint;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;7&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.graphics.Paint.Style;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;8&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.util.AttributeSet;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;9&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.util.Log;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.MotionEvent;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;11&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;import&lt;/span&gt;&amp;nbsp;android.view.View;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;12&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;13&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / We draw the yellow circles under your fingers&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;14&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;SomeView&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;View&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;15&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;16&lt;/span&gt;&amp;nbsp;Paint paint;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / need to set the color.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;17&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;[] X;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;18&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;[] Y;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;19&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;final static int&lt;/span&gt;&amp;nbsp;Radius =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;20;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;PointerCount;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;21&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;SomeView (Context context, AttributeSet attrs)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;22&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;23&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;super&lt;/span&gt;&amp;nbsp;(context, attrs);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;24&lt;/span&gt;&amp;nbsp;paint =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Paint ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;25&lt;/span&gt;&amp;nbsp;paint.setColor (Color.YELLOW);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;26&lt;/span&gt;&amp;nbsp;paint.setStyle (Style.FILL);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;27&lt;/span&gt;&amp;nbsp;PointerCount =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;0;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;28&lt;/span&gt;&amp;nbsp;X =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new int&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;[10]&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / This will be the arrays of coordinates (we will take up to 10 fingers)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;29&lt;/span&gt;&amp;nbsp;Y =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new int&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;[10];&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;30}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;31&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;32&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public boolean&lt;/span&gt;&amp;nbsp;onTouchEvent (MotionEvent event)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;33&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;34&lt;/span&gt;&amp;nbsp;StringBuilder result =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;StringBuilder&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(300);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;35&lt;/span&gt;&amp;nbsp;PointerCount = event.getPointerCount ();&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;36&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;for (int&lt;/span&gt;&amp;nbsp;i =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;0;&lt;/span&gt;&amp;nbsp;i &amp;lt;PointerCount; i + +)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;37&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;38&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;ptrId = event.getPointerId (i);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;39&lt;/span&gt;&amp;nbsp;X [i] =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(int)&lt;/span&gt;&amp;nbsp;event.getX (i);&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Store the coordinates&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;40&lt;/span&gt;&amp;nbsp;Y [i] =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;(int)&lt;/span&gt;&amp;nbsp;event.getY (i);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;41&lt;/span&gt;&amp;nbsp;result.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Pointer Index:»).&lt;/span&gt;&amp;nbsp;Append (i);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;42&lt;/span&gt;&amp;nbsp;result.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;, Pointer Id:&quot;).&lt;/span&gt;&amp;nbsp;Append (ptrId). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ n&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;43&lt;/span&gt;&amp;nbsp;result.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Location:»).&lt;/span&gt;&amp;nbsp;Append (event.getX (i));&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;44&lt;/span&gt;&amp;nbsp;result.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;x&quot;).&lt;/span&gt;&amp;nbsp;Append (event.getX (i)). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ n&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;45&lt;/span&gt;&amp;nbsp;result.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Pressure:»).&lt;/span&gt;&amp;nbsp;Append (event.getPressure (i));&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;46&lt;/span&gt;&amp;nbsp;result.append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Size:»).&lt;/span&gt;&amp;nbsp;Append (event.getSize (i)). Append&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(&quot;\ n&quot;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;47}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;48&lt;/span&gt;&amp;nbsp;Log.v&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;(«Mytag»,&lt;/span&gt;&amp;nbsp;result.toString ());&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / Output all the information in the log&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;49&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;true;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;50}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;51&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;52&lt;/span&gt;&amp;nbsp;@ Override&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;53&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;protected void&lt;/span&gt;&amp;nbsp;onDraw (Canvas canvas)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;54&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;55&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;for (int&lt;/span&gt;&amp;nbsp;i =&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;0;&lt;/span&gt;&amp;nbsp;i &amp;lt;PointerCount; i + +)&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;/ / look how many fingers were on the screen and draw the View&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;56&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;57&lt;/span&gt;&amp;nbsp;canvas.drawCircle (X [i], Y [i], Radius, paint);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;58}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;59&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;invalidate (); / /&lt;/span&gt;&amp;nbsp;invalidate ()&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;is needed in order to alert the Android, you have to execute a method OnDraw again, without the View will not be pereriovyvatsya.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;60}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;61&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;62}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;color: teal;&quot;&gt;63&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Other ways to interact with touchscreen&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Interaction with the screen is quite a low level MotionEvent&#39;y need it primarily for game development.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For more specific, everyday situations in the Android provides a number of interfaces that allow you to identify the most &quot;popular» touch event&#39;y:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;OnClickListener - onClick (View v)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;OnFocusChangeListener - onFocusChange (View v, boolean hasFocus)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;OnKeyListener - onKey (View v, int keyCode, KeyEvent event)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;OnLongClickListener - onLongClick (View v)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;etc.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;They are treated similarly, so that explanation does not need.&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;More information about these methods can be found here:&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/view/View.html&amp;amp;usg=ALkJrhjM5kiR6T8VQXgXW2SGAged38XmEA&quot; style=&quot;color: #6da3bd;&quot;&gt;developer.android.com / reference / android / view / View.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h6 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Used for this article:&lt;/span&gt;&lt;/h6&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/&amp;amp;usg=ALkJrhjNn5O4NjShQQazc0PPynB1RVDKNQ&quot; style=&quot;color: #6da3bd;&quot;&gt;developer.android.com&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Pro Android 2 - Head TouchScreens.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;&lt;b&gt;Thank you for your attention.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4817515456000489846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4817515456000489846'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/interaction-with-touch-screen.html' title='Interaction with the touch screen'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-4422354335377429273</id><published>2011-09-29T14:08:00.000-07:00</published><updated>2011-09-29T14:22:06.306-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Search Dialog"/><title type='text'>Using Android Search Dialog. Recent Query Suggestions. (part 2)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 class=&quot;entry-title single-entry-title&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 26px; font: normal normal normal 2.167em/118% &#39;normal Verdana&#39;, Tahoma, sans-serif; margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 35px; padding-right: 30px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 17px; line-height: 26px;&quot;&gt;&lt;img alt=&quot;image&quot; src=&quot;http://developer.android.com/images/search/search-suggest-recent-queries.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Article essential reading for those who mastered&amp;nbsp;&lt;a href=&quot;http://devmobapps.blogspot.com/2011/09/using-android-search-dialog-simple.html&quot;&gt;the first part&lt;/a&gt;&amp;nbsp;.&amp;nbsp;The article explains how to modify your application so that added to the dialogue hints at a recent search queries.&amp;nbsp;To understand the code and theory (beyond what was required in the first part) requires knowledge of the content providers.&amp;nbsp;It can be gleaned from&amp;nbsp;&lt;a href=&quot;http://developer.android.com/guide/topics/providers/content-providers.html&quot; style=&quot;color: #6da3bd;&quot;&gt;official Gajda&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=5515158391435587981&amp;amp;postID=4422354335377429273&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;A bit of theory&lt;/h4&gt;&lt;br /&gt;
In fact, hints of the recent searches are simply saved queries.&amp;nbsp;When the user selects one of the tips, the Activity, which is responsible for search, type Search gets Intent with a hint of a line, it is already treated before.&amp;nbsp;For displaying tooltips, as well as for the whole dialogue, responds Search Manager, and is used to store the content provider.&lt;br /&gt;
&lt;br /&gt;
When the Search Manager determines our Activity as responsible for finding and providing clues to the search, the following sequence of actions occurs:&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;When the Search Manager receives the search request, it sends a request to the content provider, provides tips.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Content provider returns a cursor that points to clues that coincide with the text search.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Search Manager displays a prompt, using the cursor&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Once a list of tips has been mapped, it may be the following:&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;If the user changes the text of the query, then all of the above steps are repeated.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;If the user starts the search, the hints are ignored.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;If the user selects a clue what to Activity Intent is delivered with the text that prompts the query.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
So, to implement the tips we need the following:&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create a content provider, which will inherit from&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/content/SearchRecentSuggestionsProvider.html&amp;amp;usg=ALkJrhjFZwiEy1aAJRvye1lYILJfPZ8dFw&quot; style=&quot;color: #6da3bd;&quot;&gt;SearchRecentSuggestionsProvider&lt;/a&gt;&amp;nbsp;and declare it in the manifesto&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Change the configuration xml file dialog to add the information about the content provider&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Change Activty so that it retained searches every time we run search&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create a content provider&lt;/h4&gt;&lt;br /&gt;
All we need is a content provider that inherits&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/content/SearchRecentSuggestionsProvider.html&amp;amp;usg=ALkJrhjFZwiEy1aAJRvye1lYILJfPZ8dFw&quot; style=&quot;color: #6da3bd;&quot;&gt;SearchRecentSuggestionsProvider&lt;/a&gt;&amp;nbsp;.&amp;nbsp;This class makes for virtually all of the developer and all that is required of us - is to write a constructor.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;File SuggestionProvider.java&lt;/b&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.example.search;&lt;br /&gt;
&lt;br /&gt;
import android.content.SearchRecentSuggestionsProvider;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;SuggestionProvider extends SearchRecentSuggestionsProvider {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;AUTHORITY =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;com.example.search.SuggestionProvider&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static int&lt;/span&gt;&amp;nbsp;MODE = DATABASE_MODE_QUERIES;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;SuggestionProvider() {&lt;br /&gt;
setupSuggestions(AUTHORITY, MODE);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
Method&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/content/SearchRecentSuggestionsProvider.html&amp;amp;usg=ALkJrhjFZwiEy1aAJRvye1lYILJfPZ8dFw#setupSuggestions(java.lang.String,%20int)&quot; style=&quot;color: #6da3bd;&quot;&gt;setupSuggestions ()&lt;/a&gt;&amp;nbsp;takes a string and the authorization mode of the database content provider.&amp;nbsp;The string can be any authorization, the only requirement - is unique.&amp;nbsp;However, official documentation is recommended to use the full name of the content provider, including the name of the package.&amp;nbsp;Mode database should include&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/content/SearchRecentSuggestionsProvider.html&amp;amp;usg=ALkJrhjFZwiEy1aAJRvye1lYILJfPZ8dFw#DATABASE_MODE_QUERIES&quot; style=&quot;color: #6da3bd;&quot;&gt;DATABASE_MODE_QUERIES&lt;/a&gt;&amp;nbsp;, and optionally you can add&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/content/SearchRecentSuggestionsProvider.html&amp;amp;usg=ALkJrhjFZwiEy1aAJRvye1lYILJfPZ8dFw#DATABASE_MODE_2LINES&quot; style=&quot;color: #6da3bd;&quot;&gt;DATABASE_MODE_2LINES&lt;/a&gt;&amp;nbsp;.&amp;nbsp;In the second case to the table hint is added to the column that allows you to display hints for each of the second row.&amp;nbsp;Look in the code is as follows:&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static int&lt;/span&gt;&amp;nbsp;MODE = DATABASE_MODE_QUERIES | DATABASE_MODE_2LINES;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
Now do not forget that you must declare our content provider in the manifest.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;File AndroidManifest.xml&lt;/b&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;manifest&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;package&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;com.example.search&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:versionCode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:versionName&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;application&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:icon&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@drawable/icon&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:label&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/app_name&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;activity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;.Main&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:label&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/app_name&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;action&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.intent.action.MAIN&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;category&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;action&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.intent.action.SEARCH&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;meta-data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.app.searchable&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:resource&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@xml/searchable&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;activity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;provider&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;.SuggestionProvider&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:authorities&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;com.example.search.SuggestionProvider&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;application&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;uses-sdk&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:minSdkVersion&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;5&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;manifest&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Changing the configuration file&lt;/h4&gt;&lt;br /&gt;
&lt;br /&gt;
To use our dialogue content provider for tips to add to his options android: searchSuggestAuthority and android: searchSuggestSelection&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;File searchable.xml&lt;/b&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;searchable&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:label&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/app_name&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:hint&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/search_hint&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:searchSuggestAuthority&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;com.example.search.SuggestionProvider&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:searchSuggestSelection&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot; ?&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;searchable&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
The value of android: searchSuggestAuthority must exactly match the string authorize the content provider.&lt;br /&gt;
The value of android: searchSuggestSelection must be a question mark placed after a space, because this is an argument from a sample database and the question mark is automatically replaced with the text typed by the user.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Change Activity&lt;/h4&gt;&lt;br /&gt;
&lt;br /&gt;
All we need - is to save the query text for this class is instantiated&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/provider/SearchRecentSuggestions.html&amp;amp;usg=ALkJrhjEIQu79HYuQJ_HXiSnVgVAu6YpFg&quot; style=&quot;color: #6da3bd;&quot;&gt;SearchRecentSuggestions&lt;/a&gt;&amp;nbsp;and calls&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/provider/SearchRecentSuggestions.html&amp;amp;usg=ALkJrhjEIQu79HYuQJ_HXiSnVgVAu6YpFg#saveRecentQuery(java.lang.String,%20java.lang.String)&quot; style=&quot;color: #6da3bd;&quot;&gt;saveRecentQuery ()&lt;/a&gt;&amp;nbsp;.&amp;nbsp;This happens every time the Activity Intent comes with a request for search data.&amp;nbsp;In the method&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/provider/SearchRecentSuggestions.html&amp;amp;usg=ALkJrhjEIQu79HYuQJ_HXiSnVgVAu6YpFg#saveRecentQuery(java.lang.String,%20java.lang.String)&quot; style=&quot;color: #6da3bd;&quot;&gt;saveRecentQuery ()&lt;/a&gt;&amp;nbsp;takes two parameters, the first is mandatory and is a string search query, the second - optional, required if you use&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/content/SearchRecentSuggestionsProvider.html&amp;amp;usg=ALkJrhjFZwiEy1aAJRvye1lYILJfPZ8dFw#DATABASE_MODE_2LINES&quot; style=&quot;color: #6da3bd;&quot;&gt;DATABASE_MODE_2LINES&lt;/a&gt;&amp;nbsp;to display the second line of text on the tooltip.&lt;br /&gt;
&lt;br /&gt;
The official documentation is also recommended to provide an interface for clearing the entire table hints.Apparently, it is necessary to ensure user&#39;s privacy.&amp;nbsp;We just add another menu item, when clicked, will be called clearing the entire history of requests.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;File Main.java&lt;/b&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.example.search;&lt;br /&gt;
&lt;br /&gt;
import android.app.ListActivity;&lt;br /&gt;
import android.app.SearchManager;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.database.Cursor;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.provider.SearchRecentSuggestions;&lt;br /&gt;
import android.view.Menu;&lt;br /&gt;
import android.view.MenuInflater;&lt;br /&gt;
import android.view.MenuItem;&lt;br /&gt;
import android.view.View;&lt;br /&gt;
import android.widget.Button;&lt;br /&gt;
import android.widget.EditText;&lt;br /&gt;
import android.widget.SimpleCursorAdapter;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;Main extends ListActivity {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;EditText text;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;Button add;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;RecordsDbHelper mDbHelper;&lt;br /&gt;
&lt;br /&gt;
@Override&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate(Bundle savedInstanceState) {&lt;br /&gt;
super.onCreate(savedInstanceState);&lt;br /&gt;
setContentView(R.layout.main);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Создаем экземпляр БД&lt;/span&gt;&lt;br /&gt;
mDbHelper =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;RecordsDbHelper(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Открываем БД для записи&lt;/span&gt;&lt;br /&gt;
mDbHelper.open();&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Получаем Intent&lt;/span&gt;&lt;br /&gt;
Intent intent = getIntent();&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Проверяем тип Intent&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(Intent.ACTION_SEARCH.equals(intent.getAction())) {&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Берем строку запроса из экстры&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;query = intent.getStringExtra(SearchManager.QUERY);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Создаем экземпляр SearchRecentSuggestions&lt;/span&gt;&lt;br /&gt;
SearchRecentSuggestions suggestions =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;SearchRecentSuggestions(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;,&lt;br /&gt;
SuggestionProvider.AUTHORITY, SuggestionProvider.MODE);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Сохраняем запрос&lt;/span&gt;&lt;br /&gt;
suggestions.saveRecentQuery(query,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Выполняем поиск&lt;/span&gt;&lt;br /&gt;
showResults(query);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
add = (Button) findViewById(R.id.add);&lt;br /&gt;
text = (EditText) findViewById(R.id.text);&lt;br /&gt;
add.setOnClickListener(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;View.OnClickListener() {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onClick(View view) {&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;data = text.getText().toString();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(!data.equals(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&quot;&lt;/span&gt;&amp;nbsp;)) {&lt;br /&gt;
saveTask(data);&lt;br /&gt;
text.setText(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&quot;&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
});&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt;&amp;nbsp;saveTask(&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;data) {&lt;br /&gt;
mDbHelper.createRecord(data);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt;&amp;nbsp;showResults(&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;query) {&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Ищем совпадения&lt;/span&gt;&lt;br /&gt;
Cursor cursor = mDbHelper.fetchRecordsByQuery(query);&lt;br /&gt;
startManagingCursor(cursor);&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;[]&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;[] { RecordsDbHelper.KEY_DATA };&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;[] to =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new int&lt;/span&gt;&amp;nbsp;[] { R.id.text1 };&lt;br /&gt;
&lt;br /&gt;
SimpleCursorAdapter records =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;SimpleCursorAdapter(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;,&lt;br /&gt;
R.layout.record, cursor,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&amp;nbsp;, to);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Обновляем адаптер&lt;/span&gt;&lt;br /&gt;
setListAdapter(records);&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Создаем меню для вызова поиска (интерфейс в res/menu/main_menu.xml)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;boolean onCreateOptionsMenu(Menu menu) {&lt;br /&gt;
MenuInflater inflater = getMenuInflater();&lt;br /&gt;
inflater.inflate(R.menu.main_menu, menu);&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return true&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;boolean onOptionsItemSelected(MenuItem item) {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;switch&lt;/span&gt;&amp;nbsp;(item.getItemId()) {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;R.id.search_record:&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Вызываем поиск&lt;/span&gt;&lt;br /&gt;
onSearchRequested();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return true&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;R.id.clear_recent_suggestions:&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Очищаем историю&lt;/span&gt;&lt;br /&gt;
SearchRecentSuggestions suggestions =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;SearchRecentSuggestions(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;,&lt;br /&gt;
SuggestionProvider.AUTHORITY, SuggestionProvider.MODE);&lt;br /&gt;
suggestions.clearHistory();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return true&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;default&lt;/span&gt;&amp;nbsp;:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;super.onOptionsItemSelected(item);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Conclusion&lt;/h5&gt;&lt;br /&gt;
This article used the documentation from&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/&amp;amp;usg=ALkJrhiHfR1IZ49Odct6TCuAuHfQeagTPA&quot; style=&quot;color: #6da3bd;&quot;&gt;developer.android.com&lt;/a&gt;&lt;br /&gt;
The entire project is modified to&amp;nbsp;code.google.com&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4422354335377429273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4422354335377429273'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/using-android-search-dialog-recent.html' title='Using Android Search Dialog. Recent Query Suggestions. (part 2)'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-5361727891955647198</id><published>2011-09-29T14:01:00.000-07:00</published><updated>2011-09-29T14:03:32.646-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Search Dialog"/><title type='text'>Using Android Search Dialog. A simple application (part 1)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;img alt=&quot;image&quot; src=&quot;http://developer.android.com/images/search/search-ui.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
This article is for those who have already written the HelloWorld for Android, and know what the Activity and Intent, as well as where there is manifest, and why you need layout&#39;y.&amp;nbsp;Otherwise, you acquainted with this material, for example,&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/guide/index.html&amp;amp;usg=ALkJrhjbUxwpmsJr-RcSC23JKlK2ofHYQg&quot; style=&quot;color: #6da3bd;&quot;&gt;developer.android.com&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;
&lt;br /&gt;
The article describes how to create a simple application that uses a mechanism to implement the search capabilities built based on the framework.&amp;nbsp;After reading, you can also configure your application so that it searches through the data using a standard Android Search Dialog.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=5515158391435587981&amp;amp;postID=5361727891955647198&amp;amp;from=pencil&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;A bit of theory&lt;/h4&gt;&lt;br /&gt;
Android Search Dialog (hereinafter - the &quot;search dialog&quot;) is controlled using a search framework.&amp;nbsp;This means that the developer does not need to worry over how to paint or how to catch the search query.&amp;nbsp;For this job you will&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/app/SearchManager.html&amp;amp;usg=ALkJrhj5fQDKnqPls31royTRGVQOrVR2pQ&quot; style=&quot;color: #6da3bd;&quot;&gt;SearchManager&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;
&lt;br /&gt;
So, when a user starts searching, SearchManager creates Intent, and sends it to the Activity, which is responsible for searching for data (in this case the query is placed in the extras).&amp;nbsp;That is, in fact in the application must have at least one Activity, which receives Intent&#39;y search, searches, and provides the user with the results.&amp;nbsp;To realize you need:&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Xml configuration file (it contains information about the dialogue)&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Activity, which will receive queries, perform searches and display the results on screen&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;The mechanism of calling the search dialog (since not all devices with Android on board are on the case of the search button)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;The configuration file&lt;/h4&gt;&lt;br /&gt;
Start by creating a configuration file, because it&#39;s the easy part.&amp;nbsp;Of course, you need to prepare in advance, to create a new project, Activity (I used Activity «Main» and the name of the project «SearchExample»).&amp;nbsp;All that is needed for the configuration - is to create a file in a subdirectory searchable.xml res / xml / your project, with the following content.&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;searchable&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:label&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/app_name&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:hint&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/search_hint&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;searchable&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
Required attribute is only android: label, and it must refer to a string that is the same as the name of the application.&amp;nbsp;The second attribute, android: hint is used to display an empty row in the dialog.&amp;nbsp;For example, it might be &quot;Search Videos&quot; or &quot;search contacts&quot;, etc.&amp;nbsp;This attribute specifies which data to be searched.&amp;nbsp;It is also important to know that the element searchable supports many other attributes, you can read more&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/guide/topics/search/searchable-config.html&amp;amp;usg=ALkJrhgg9PajE3XO1wykNYrEudyOlv1Tfw&quot; style=&quot;color: #6da3bd;&quot;&gt;here&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Create an Activity&lt;/h4&gt;&lt;br /&gt;
Minimally, all we need from the UI Activity - a list to display the search results and the mechanism of calling the search dialog.&amp;nbsp;Let&#39;s do that by adding just the text field and button, so that we ourselves can fill the base.Looking ahead, I will say that the data will be stored in a database SQLite.&lt;br /&gt;
&lt;br /&gt;
We describe the interface of Activity as follows (the file is in res / layout / main.xml).&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:orientation&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;vertical&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:orientation&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;horizontal&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:gravity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;top&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;EditText&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/text&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:hint&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/text&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_weight&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;100.0&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;Button&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/add&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:text&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/add&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;ListView&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@android:id/list&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_gravity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;left&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@android:id/empty&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:text&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/no_records&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
As follows:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/a7/15/a715eddee03e6950400c9baf3be28a7c.jpg&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
We also need to layout the form of a list item, describe it in the simplest way (the file is in res / layout / record.xml)&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/text1&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
Also, do not forget about the resource file that stores our string (a file in res / values ​​/ strings.xml)&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;resources&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;app_name&quot; &amp;gt;&lt;/span&gt;&amp;nbsp;SearchExample&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;add&quot; &amp;gt;&lt;/span&gt;&amp;nbsp;Add&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text&quot; &amp;gt;&lt;/span&gt;&amp;nbsp;Enter text&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;no_records&quot; &amp;gt;&lt;/span&gt;&amp;nbsp;There are no records in the table&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;search_hint&quot; &amp;gt;&lt;/span&gt;&amp;nbsp;Search the records&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;search&quot; &amp;gt;&lt;/span&gt;&amp;nbsp;Search&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;string&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;resources&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
I recall that when the user performs a search, you need to send SearchManager Intent with the search query to our Activity.&amp;nbsp;To SearchManager knew exactly where to send the Intent, must declare it in the manifest.&amp;nbsp;So, go to AndroidManifest.xml, and change it so that it could take Activity type Intent&#39;y Search.&amp;nbsp;In addition, we apply our configuration file searchable.xml.&amp;nbsp;Thus, the manifest will look something like this:&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;manifest&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;package&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;com.example.search&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:versionCode&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:versionName&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;application&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:icon&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@drawable/icon&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:label&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/app_name&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;activity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;.Main&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:label&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@string/app_name&quot; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;action&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.intent.action.MAIN&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;category&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;action&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.intent.action.SEARCH&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;meta-data&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;android.app.searchable&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;android:resource&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@xml/searchable&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;activity&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;application&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;uses-sdk&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:minSdkVersion&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;5&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: maroon;&quot;&gt;manifest&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
Now, you can now check that all you have done correctly.&amp;nbsp;Call the dialogue on the emulator you can, for example, by pressing the search button.&amp;nbsp;Well, or if you check on devayse, then holding down the &quot;Menu&quot;.&amp;nbsp;Should look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://habrastorage.org/storage/habraeffect/18/d6/18d6c204c3ba5ff4c469e4c59511266d.jpg&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Perform a search&lt;/h4&gt;&lt;br /&gt;
After we announced our Activity and make the necessary changes in AndroidManifest.xml, we can consider itself doing a search.&amp;nbsp;It includes three stages:&lt;br /&gt;
&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Receipt of an inquiry&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Data Search&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;output results&lt;/li&gt;
&lt;/ul&gt;&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Receipt of an inquiry&lt;/h5&gt;&lt;br /&gt;
Since SearchManager sends Intent type Search our Activity, then all you need to do is check on the Intent of this type at the start of Activity.&amp;nbsp;Then, if we get the desired Intent, then you can retrieve it from the extrusion, and search.&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Data Search&lt;/h5&gt;&lt;br /&gt;
Since the type of data storage structures for different applications can vary, the methods for them and theirs.&amp;nbsp;In our case, the easiest way to query the database table query SQLite LIKE.&amp;nbsp;Of course, it is better to use FTS3, it is much faster, more about FTS3 can be read on the site&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.sqlite.org/fts3.html&amp;amp;usg=ALkJrhgFCZvzXdq3YE7RyzIWNylYbPCe3A&quot; style=&quot;color: #6da3bd;&quot;&gt;SQLite.org&lt;/a&gt;&amp;nbsp;.&amp;nbsp;Ideally, as one should always expect that the search may take a long time, so you can create some ProgressDialog, so we have not hung interface, and that the user knows that the application works.&lt;br /&gt;
&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Output results&lt;/h5&gt;&lt;br /&gt;
In general, the output of the results - it is a problem UI, but since we use the ListView, then for us the problem is solved by simply updating the adapter.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Source&lt;/h4&gt;&lt;br /&gt;
Finally, I cite the full source code of two classes with commentary.&amp;nbsp;First - Main, heir ListActivity, it is used to populate the database and display the results.&amp;nbsp;The second class - RecordsDbHelper, it implements an interface to interact with the database.&amp;nbsp;The most important methods - add entries and search for matches, with a query LIKE.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;File Main.java&lt;/b&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.example.search;&lt;br /&gt;
&lt;br /&gt;
import android.app.ListActivity;&lt;br /&gt;
import android.app.SearchManager;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.database.Cursor;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.view.Menu;&lt;br /&gt;
import android.view.MenuInflater;&lt;br /&gt;
import android.view.MenuItem;&lt;br /&gt;
import android.view.View;&lt;br /&gt;
import android.widget.Button;&lt;br /&gt;
import android.widget.EditText;&lt;br /&gt;
import android.widget.SimpleCursorAdapter;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;Main extends ListActivity {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;EditText text;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;Button add;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;RecordsDbHelper mDbHelper;&lt;br /&gt;
&lt;br /&gt;
@Override&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate(Bundle savedInstanceState) {&lt;br /&gt;
super.onCreate(savedInstanceState);&lt;br /&gt;
setContentView(R.layout.main);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Создаем экземпляр БД&lt;/span&gt;&lt;br /&gt;
mDbHelper =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;RecordsDbHelper(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Открываем БД для записи&lt;/span&gt;&lt;br /&gt;
mDbHelper.open();&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Получаем Intent&lt;/span&gt;&lt;br /&gt;
Intent intent = getIntent();&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Проверяем тип Intent&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(Intent.ACTION_SEARCH.equals(intent.getAction())) {&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Берем строку запроса из экстры&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;query = intent.getStringExtra(SearchManager.QUERY);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Выполняем поиск&lt;/span&gt;&lt;br /&gt;
showResults(query);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
add = (Button) findViewById(R.id.add);&lt;br /&gt;
text = (EditText) findViewById(R.id.text);&lt;br /&gt;
add.setOnClickListener(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;View.OnClickListener() {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onClick(View view) {&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;data = text.getText().toString();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(!data.equals(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&quot;&lt;/span&gt;&amp;nbsp;)) {&lt;br /&gt;
saveTask(data);&lt;br /&gt;
text.setText(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&quot;&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
});&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt;&amp;nbsp;saveTask(&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;data) {&lt;br /&gt;
mDbHelper.createRecord(data);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private void&lt;/span&gt;&amp;nbsp;showResults(&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;query) {&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Ищем совпадения&lt;/span&gt;&lt;br /&gt;
Cursor cursor = mDbHelper.fetchRecordsByQuery(query);&lt;br /&gt;
startManagingCursor(cursor);&lt;br /&gt;
&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;[]&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;[] { RecordsDbHelper.KEY_DATA };&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;[] to =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new int&lt;/span&gt;&amp;nbsp;[] { R.id.text1 };&lt;br /&gt;
&lt;br /&gt;
SimpleCursorAdapter records =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;SimpleCursorAdapter(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;,&lt;br /&gt;
R.layout.record, cursor,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;&amp;nbsp;, to);&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Обновляем адаптер&lt;/span&gt;&lt;br /&gt;
setListAdapter(records);&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Создаем меню для вызова поиска (интерфейс в res/menu/main_menu.xml)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;boolean onCreateOptionsMenu(Menu menu) {&lt;br /&gt;
MenuInflater inflater = getMenuInflater();&lt;br /&gt;
inflater.inflate(R.menu.main_menu, menu);&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return true&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;boolean onOptionsItemSelected(MenuItem item) {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;switch&lt;/span&gt;&amp;nbsp;(item.getItemId()) {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;case&lt;/span&gt;&amp;nbsp;R.id.search_record:&lt;br /&gt;
onSearchRequested();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return true&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;default&lt;/span&gt;&amp;nbsp;:&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;super.onOptionsItemSelected(item);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;File RecordsDbHelper.java&lt;/b&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.example.search;&lt;br /&gt;
&lt;br /&gt;
import android.content.ContentValues;&lt;br /&gt;
import android.content.Context;&lt;br /&gt;
import android.database.Cursor;&lt;br /&gt;
import android.database.SQLException;&lt;br /&gt;
import android.database.sqlite.SQLiteDatabase;&lt;br /&gt;
import android.database.sqlite.SQLiteOpenHelper;&lt;br /&gt;
import android.util.Log;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public class&lt;/span&gt;&amp;nbsp;RecordsDbHelper {&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;KEY_DATA =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;data&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;KEY_ROWID =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;_id&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;TAG =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;RecordsDbHelper&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;DatabaseHelper mDbHelper;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;SQLiteDatabase mDb;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;DATABASE_CREATE =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;CREATE TABLE records(_id INTEGER PRIMARY KEY AUTOINCREMENT, &quot;&lt;/span&gt;&lt;br /&gt;
+&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;data TEXT NOT NULL);&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;DATABASE_NAME =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;data&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;DATABASE_TABLE =&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;records&quot;&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;DATABASE_VERSION = 1;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;final Context mCtx;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;private static class&lt;/span&gt;&amp;nbsp;DatabaseHelper extends SQLiteOpenHelper {&lt;br /&gt;
&lt;br /&gt;
DatabaseHelper(Context context) {&lt;br /&gt;
super(context, DATABASE_NAME,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;, DATABASE_VERSION);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@Override&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onCreate(SQLiteDatabase db) {&lt;br /&gt;
&lt;br /&gt;
db.execSQL(DATABASE_CREATE);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@Override&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;onUpgrade(SQLiteDatabase db,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;oldVersion,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;newVersion) {&lt;br /&gt;
Log.w(TAG,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Upgrading database from version &quot;&lt;/span&gt;&amp;nbsp;+ oldVersion +&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot; to &quot;&lt;/span&gt;&lt;br /&gt;
+ newVersion +&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;, which will destroy all old data&quot;&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
db.execSQL(&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;DROP TABLE IF EXISTS tasks&quot;&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
onCreate(db);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;RecordsDbHelper(Context ctx) {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;&amp;nbsp;.mCtx = ctx;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;RecordsDbHelper open() throws SQLException {&lt;br /&gt;
mDbHelper =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;DatabaseHelper(mCtx);&lt;br /&gt;
mDb = mDbHelper.getWritableDatabase();&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return this&lt;/span&gt;&amp;nbsp;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public void&lt;/span&gt;&amp;nbsp;close() {&lt;br /&gt;
mDbHelper.close();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Добавляем запись в таблицу&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public long&lt;/span&gt;&amp;nbsp;createRecord(&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;data) {&lt;br /&gt;
ContentValues initialValues =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;ContentValues();&lt;br /&gt;
initialValues.put(KEY_DATA, data);&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;mDb.insert(DATABASE_TABLE,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;, initialValues);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;//Поиск запросом LIKE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;Cursor fetchRecordsByQuery(&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;query) {&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;mDb.query(&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&amp;nbsp;, DATABASE_TABLE,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;String&lt;/span&gt;&amp;nbsp;[] { KEY_ROWID,&lt;br /&gt;
KEY_DATA }, KEY_DATA +&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot; LIKE&quot;&lt;/span&gt;&amp;nbsp;+&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&#39;%&quot;&lt;/span&gt;&amp;nbsp;+ query +&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;%&#39;&quot;&lt;/span&gt;&amp;nbsp;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;,&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;&amp;nbsp;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://virtser.net/blog/post/source-code-highlighter.aspx&amp;amp;usg=ALkJrhjbMGe-rfbdu8PAcN4EYGn73gwRjQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Source Code Highlighter&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;h5 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Conclusion&lt;/h5&gt;&lt;br /&gt;
Used for this article documents with&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/&amp;amp;usg=ALkJrhiHfR1IZ49Odct6TCuAuHfQeagTPA&quot; style=&quot;color: #6da3bd;&quot;&gt;developer.android.com&lt;/a&gt;&lt;br /&gt;
The whole project can take on&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://code.google.com/p/androidsearchexample/&amp;amp;usg=ALkJrhjvW0d1YrxAReMYRif15HrsiSSRbw&quot; style=&quot;color: #6da3bd;&quot;&gt;code.google.com&lt;/a&gt;&amp;nbsp;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/5361727891955647198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/5361727891955647198'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/using-android-search-dialog-simple.html' title='Using Android Search Dialog. A simple application (part 1)'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-4989932872742210037</id><published>2011-09-29T13:45:00.000-07:00</published><updated>2011-09-29T13:45:02.637-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="AsyncTask"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="HTTP"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="layout"/><category scheme="http://www.blogger.com/atom/ns#" term="list"/><category scheme="http://www.blogger.com/atom/ns#" term="list adapter"/><category scheme="http://www.blogger.com/atom/ns#" term="listview"/><category scheme="http://www.blogger.com/atom/ns#" term="MediaPlayer"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><title type='text'>10 useful solutions for the Android Developer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #999999; font-family: Verdana, sans-serif; font-size: 18px; font-weight: bold; line-height: 20px;&quot;&gt;Content&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Entry&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About the adapters list (&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;) with subcategories (for grouping items in the list)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About the lists that contain any of the (list items do anything complicated or alter themselves for selection)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About forced invalidation of the lists&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About caching images for&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;(for lists with images)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About&amp;nbsp;adapters, iterates through the cursor (to support pagination on the list)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About&amp;nbsp;authorization via OAuth to Android&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About using&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;MediaPlayer&lt;/code&gt;&amp;nbsp;and bufferring video feed over HTTP&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About the turn of a few&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;AsyncTask&lt;/code&gt;&amp;nbsp;(alternate to perform background tasks)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About changing illumination of the selected item in&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;About adding&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/&amp;amp;usg=ALkJrhgn5_ihZy87L4SdC2_3h0sJ9GRgmQ&quot; style=&quot;color: #6da3bd;&quot;&gt;QuickActions&lt;/a&gt;&amp;nbsp;in project&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Three more small solving&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;a href=&quot;&quot; name=&quot;habracut&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;/a&gt;&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;1.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Entry&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;Last summer (already), I had a great desire to write a client for Android-web service&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://vimeo.com/&amp;amp;usg=ALkJrhgZSO9elBWvJSi2ZIf4aZWtJZ5JeQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Vimeo&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I like this service, and as for me, it would be convenient to watch for updates in subscriptions to the video device.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;I conceived&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://code.google.com/p/vimeoid&amp;amp;usg=ALkJrhgpFWJ2SHuu1a_8wBNS_yWgN_Z4xQ&quot; style=&quot;color: #6da3bd;&quot;&gt;this project&lt;/a&gt;&amp;nbsp;for myself as an academic (in the sense that I&#39;m learning), but the result was to make quite a tangible part (you can see&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://code.google.com/p/vimeoid/wiki/Screenshots&amp;amp;usg=ALkJrhgZfH6rllvJkNVAjSOMoCtTGZG_Hw&quot; style=&quot;color: #6da3bd;&quot;&gt;screenshots of what is done&lt;/a&gt;&amp;nbsp;), but it has not yet been completed.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This client does not just me,&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.androlib.com/android.application.com-makotosan-vimeodroid-qmBCn.aspx&amp;amp;usg=ALkJrhjIrfV8GvwO8SNytNyQZEPAxivBuA&quot; style=&quot;color: #6da3bd;&quot;&gt;his version&lt;/a&gt;&amp;nbsp;is almost the same time (he was the first) began to make me&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://vimeo.com/makotosan&amp;amp;usg=ALkJrhiTIBel617Z-JQTrAMANli-grFnfw&quot; style=&quot;color: #6da3bd;&quot;&gt;makotosan&lt;/a&gt;&amp;nbsp;and his version so far, it seems, also has done).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In any case, the process of writing project, I gained some knowledge base, which I hasten to share.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Not all threads exclusive, but some see the subtleties are not disclosed on the Internet or buried pretty deep in its bowels.&amp;nbsp;&lt;em&gt;I will give examples of additional codes iskhodnyh vimeoid, this will allow you podcmotret as the topic under consideration operates in real time (NB:&lt;/em&gt;&amp;nbsp;some links lead to specific line in the code).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;2.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Lists with subcategories&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;Aside from the usual use of&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;, is often required to make a list in which items are grouped into several sections in the form header section, paragraph, item, item, ..., a section heading, paragraph, item, ..., a section heading, paragraph, point, and so on ...&lt;/span&gt;&amp;nbsp;&lt;span&gt;In the picture are sections «Statistics» and «Information».&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;(Hereafter I will use the word as an analogue to the English&amp;nbsp;&lt;em&gt;point item,&lt;/em&gt;&amp;nbsp;to distinguish between a list item, which may be heading, and the point from point customary element, which can not be a title)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;List partitioning&quot; src=&quot;http://vimeoid.googlecode.com/hg/screens/guest_channel.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Headers should not react to clicks and the selection and must have their own kind.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This can be achieved by redefining except&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView&lt;/code&gt;&amp;nbsp;method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getItemViewType&lt;/code&gt;&amp;nbsp;,&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getViewTypeCount&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;isEnabled&lt;/code&gt;&amp;nbsp;adapter of this list and it otnasledovav, for example,&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;BaseAdapter&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public class SectionedItemsAdapter extends BaseAdapter {.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
&lt;/pre&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;An example of vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/adapter/SectionedActionsAdapter.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;SectionedActionsAdapter&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;Primarily infest constants that uniquely identify the item type, one for the header, the second for the item (that is, types may be greater than two, but in this case it is better to use the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;enum&lt;/code&gt;&amp;nbsp;to a set of identifiers):&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public static final int ITEM_VIEW_TYPE = 0; \ \ item&lt;/span&gt;
&lt;span&gt; public static final int SECTION_VIEW_TYPE = 1 \ \ section&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;Then constant containing the number of types of elements (in our case - two):&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public static final int VIEW_TYPES_COUNT = SECTION_VIEW_TYPE + 1;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;The adapter will contain information on all elements, so the implementation&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getCount&lt;/code&gt;&amp;nbsp;,&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getItem&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getItemId&lt;/code&gt;depend on your situation.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getItemViewType&lt;/code&gt;&amp;nbsp;should return the type of the constant element in his position.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For an undetermined type of element in the class&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Adapter&lt;/code&gt;&amp;nbsp;there is a constant&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;IGNORE_ITEM_VIEW_TYPE&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public int getItemViewType (int position) {&lt;/span&gt;
   &lt;span&gt; if (...) return ITEM_VIEW_TYPE;&lt;/span&gt;
   &lt;span&gt; if (...) return SECTION_VIEW_TYPE;&lt;/span&gt;
   &lt;span&gt; return IGNORE_ITEM_VIEW_TYPE;&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;In my case I keep the adapter list of sections that contain them owned items.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thus, each partition can be asked how many items within it at the cost of this to know the type.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;This method can now be used to override the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView&lt;/code&gt;&amp;nbsp;:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public View getView (int position, View convertView, ViewGroup parent) {&lt;/span&gt;
    &lt;span&gt; final int viewType = getItemViewType (position);&lt;/span&gt;
    &lt;span&gt; if (viewType == IGNORE_ITEM_VIEW_TYPE) throw new IllegalStateException (&quot;Failed to get object at position&quot; + position);&lt;/span&gt;
    &lt;span&gt; if (viewType == SECTION_VIEW_TYPE) {&lt;/span&gt; 
        &lt;span&gt; convertView =.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; / / Here you can get through LayoutInflater Layout for the section title&lt;/span&gt;
    &lt;span&gt; } Else if (viewType == ITEM_VIEW_TYPE) {&lt;/span&gt;
        &lt;span&gt; convertView =.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; / / Here you can get through LayoutInflater Layout for the item&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;
    &lt;span&gt; return convertView;&lt;/span&gt;    
&lt;span&gt; }&lt;/span&gt;    
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;The method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;isEnabled&lt;/code&gt;&amp;nbsp;should return&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;false&lt;/code&gt;&amp;nbsp;for the items that can not be pressed and that can not move the cursor, and&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;true&lt;/code&gt;&amp;nbsp;for others.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Here, again, will&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getItemViewType&lt;/code&gt;&amp;nbsp;:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public boolean isEnabled (int position) {&lt;/span&gt; 
    &lt;span&gt; return getItemViewType (position)! = SECTION_VIEW_TYPE};&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;Method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getViewTypeCount&lt;/code&gt;&amp;nbsp;returns the most constant, the number of possible types of elements:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public int getViewTypeCount () {return VIEW_TYPES_COUNT;}&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;By the way, you can store a reference to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;LayoutInflater&lt;/code&gt;&amp;nbsp;in the adapter and get it from that created it aktiviti through the constructor.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;That&#39;s all you need to work with a list of sections, if necessary - look over here, but first give some explanations.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The example I use a structure for storing data of the sections and paragraphs.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The structure of the partition is stored identifier section, its title and structure of the items contained therein.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Structure keeps a pointer to point to the parent structure of the section heading, paragraph, the path to the icon and the click handler on the point (about it in the next chapter).&lt;/span&gt;&amp;nbsp;&lt;span&gt;The designers of both structures are available only for adapters:&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;An example of vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/adapter/LActionItem.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;LActionItem&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;So I simplified the adding of groups and items in the list.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The adapter has methods:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public int addSection (String title);&lt;/span&gt;
&lt;span&gt; public LActionItem addItem (int section, int icon, String title);&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;Method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;addSection&lt;/code&gt;&amp;nbsp;returns a group ID, which can then be used to add items to this group:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; final int suitsSection = adapter.addSection (&quot;Suits&quot;);&lt;/span&gt;
&lt;span&gt; adapter.addItem (suitsSection, R.drawable.heart, &quot;Hearts&quot;);&lt;/span&gt;
&lt;span&gt; adapter.addItem (suitsSection, R.drawable.diamond, &quot;Diamonds&quot;);&lt;/span&gt;
&lt;span&gt; adapter.addItem (suitsSection, R.drawable.spade, &quot;Spades&quot;);&lt;/span&gt;
&lt;span&gt; adapter.addItem (suitsSection, R.drawable.cross, &quot;Crosses&quot;);&lt;/span&gt;
&lt;span&gt; final int figuresSection = adapter.addSection (&quot;Figures&quot;);&lt;/span&gt;
&lt;span&gt; adapter.addItem (figuresSection, R.drawable.king, &quot;King&quot;);&lt;/span&gt;
&lt;span&gt; adapter.addItem (figuresSection, R.drawable.queen, &quot;Queen&quot;);&lt;/span&gt;
&lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;3.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Lists with responsive elements&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;Sometimes you need to when you click on the item list, it changed its status and / or switched aktiviti.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For example, the &quot;Follow&quot; in the list of actions on account of Twitter may contain an icon with a minus, if you have not follovili this person and change the icon on the plus and come after you for confirmation of follovinge.&lt;/span&gt;&amp;nbsp;&lt;span&gt;You can handle the selected item in the current&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListActivity&lt;/code&gt;&amp;nbsp;and depending on the position to make a decision, but if the list is contained somewhere within the normal&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Activity&lt;/code&gt;&amp;nbsp;, then perhaps the choice is easier to handle in the adapter.&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;An example of vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/adapter/SectionedActionsAdapter.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;SectionedActionsAdapter&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Uses:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/adapter/LActionItem.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;LActionItem&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Used in:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/base/SingleItemActivity_.java?r=85e18485bdda1c526141170f67e65f4e00202f34#49&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;SingleItemActivity_&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;If you agree with that, your adapter can implement the interface&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;OnItemClickListener&lt;/code&gt;&amp;nbsp;:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public class ActionsAdapter extends.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; implements OnItemClickListener&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;And using it aktiviti you can do:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; final ListView actionsList = (ListView) findViewById (R.id.actionsList);&lt;/span&gt;
&lt;span&gt; final SectionedActionsAdapter actionsAdapter = new ActionsAdapter (...);&lt;/span&gt;
&lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; / / Fill the adapter values&lt;/span&gt;
&lt;span&gt; actionsList.setAdapter (actionsAdapter);&lt;/span&gt;
&lt;span&gt; actionsList.setOnItemClickListener (actionsAdapter);&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;In my case, for points in each section serve some kind of action - go to aktiviti or change the view point of the request to the server.&lt;/span&gt;&amp;nbsp;&lt;span&gt;So I chose to make the structure of the publicly available properties for sections and paragraphs, and the structure of the items contain handler&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;OnClick&lt;/code&gt;&amp;nbsp;which takes&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;View&lt;/code&gt;&amp;nbsp;on which there was a choice, so you can change the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;View&lt;/code&gt;&amp;nbsp;directly from them.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thanks to this adapter, you can simply pass the handler:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public void onItemClick (AdapterView &amp;lt;?&amp;gt; parent, View view, int position, long id) {&lt;/span&gt;
    &lt;span&gt; final LActionItem item = (LActionItem) getItem (position);&lt;/span&gt;
    &lt;span&gt; if (item.onClick! = null) item.onClick (view);&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;Using the above method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;addItem&lt;/code&gt;&amp;nbsp;can install the handler:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; final LActionItem heartsItem = adapter.addItem (suitsSection, R.drawable.heart, &quot;Hearts&quot;);&lt;/span&gt;
&lt;span&gt; heartsItem.onClick = new OnClickListener () {public void onClick (View view) {.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; }};&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;4.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Forced invalidation of the lists&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;in Android, as we know, are arranged with the trick, this trick -&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://android.amberfog.com/%3Fp%3D296&amp;amp;usg=ALkJrhhU9JWztyzhjhQ5Zl7YWJzPtsWgww&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;em&gt;ListView Recycler&lt;/em&gt;&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Prinitsip&amp;nbsp;&lt;em&gt;Recycler&lt;/em&gt;&#39;and, if briefly, is that if the list of items than fit on the screen as you scroll down the list of kinds of new elements are created and reused the old forms - in this implementation work prinitsipe&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView&lt;/code&gt;&amp;nbsp;in adapters.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;If at some point need to upgrade (invalidirovat) The specific form of the element well-known (or even a child form) of the list at a time when it is visible on the screen, you can call&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView.invalidate()&lt;/code&gt;&amp;nbsp;or&lt;code style=&quot;font-size: 1em;&quot;&gt;Adapter.notifyDataSetChanged()&lt;/code&gt;&amp;nbsp;, but sometimes these irrational methods update and neighboring species, if at all, all visible (especially if the layout&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/&amp;amp;usg=ALkJrhhy3be6nlA7hJciC2uAjhTOqESWTQ&quot; style=&quot;color: #6da3bd;&quot;&gt;is built correctly&lt;/a&gt;&amp;nbsp;).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Is there a way to get the current form of a list item using the method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView.getChildAt(position)&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;However, the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;position&lt;/code&gt;&amp;nbsp;in this case is not an index entry in the list, as would be expected, and the index relative to visible on-screen forms.&lt;/span&gt;&amp;nbsp;&lt;span&gt;So useful are these methods:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public static View getItemViewIfVisible (AdapterView &amp;lt;?&amp;gt; holder, int itemPos) {&lt;/span&gt;
    &lt;span&gt; int firstPosition = holder.getFirstVisiblePosition ();&lt;/span&gt;
    &lt;span&gt; int wantedChild = itemPos - firstPosition;&lt;/span&gt;
    &lt;span&gt; if (wantedChild &amp;lt;0 | | wantedChild&amp;gt; = holder.getChildCount ()) return null;&lt;/span&gt;
    &lt;span&gt; return holder.getChildAt (wantedChild);&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;

&lt;span&gt; public static void invalidateByPos (AdapterView &amp;lt;?&amp;gt; parent, int position) {&lt;/span&gt;
    &lt;span&gt; final View itemView = getItemViewIfVisible (parent, position);&lt;/span&gt;
    &lt;span&gt; if (itemView! = null) itemView.invalidate ();&lt;/span&gt;        
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;invalidateByPos&lt;/code&gt;&amp;nbsp;update form only if it is visible on the screen (by force causing&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView&lt;/code&gt;&amp;nbsp;adapter), and if the item does not see -&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView&lt;/code&gt;&amp;nbsp;adapter will be automatically called when the form appears in the sight when you scroll through the list.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To update a child form of the element, you can use the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getViewIsVisible&lt;/code&gt;&amp;nbsp;, it will return the form element from which you can access its child types and&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;null&lt;/code&gt;&amp;nbsp;, if the view is not visible to the user and updating is not necessary.&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Methods described in class:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/util/Utils.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;Utils&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;5.&lt;/span&gt;&amp;nbsp;&lt;span&gt;About caching images for lists&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;img alt=&quot;List with pictures&quot; src=&quot;http://vimeoid.googlecode.com/hg/screens/guest_videos.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;If you create a list of&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;, which contains an image downloaded from the network, this chapter is for you.&lt;/span&gt;&lt;span&gt;It is unwise to be on every call&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView&lt;/code&gt;&amp;nbsp;adapter to get the image on the URL again - of course it would be better to a) cache b) request only if the form with the image visible to the user.&lt;/span&gt;&amp;nbsp;&lt;span&gt;At the moment this problem is so often the programmers would get up on Android, there is already a&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview&amp;amp;usg=ALkJrhjBdUPF8Ek6mY-wCyifvaosp3heBA&quot; style=&quot;color: #6da3bd;&quot;&gt;lot of her decisions&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;My version from the same source, this solution&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012&amp;amp;usg=ALkJrhhl26CGNOayV9FHGy6TrBDVXBUf6Q#3068012&quot; style=&quot;color: #6da3bd;&quot;&gt;Fedor Vlasov&lt;/a&gt;&amp;nbsp;, corrected for my needs.&lt;/span&gt;&amp;nbsp;&lt;span&gt;First, I made ​​a directory for storing cached images of static - that is, once it is created during the lifetime of the application and consistently clears the call&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;clearCache&lt;/code&gt;&amp;nbsp;(this method is useful to call in&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;onDestroy()&lt;/code&gt;&amp;nbsp;in aktiviti using&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ImageLoader&lt;/code&gt;&amp;nbsp;or&lt;code style=&quot;font-size: 1em;&quot;&gt;finalize()&lt;/code&gt;&amp;nbsp;for using it adapter), slightly changed the way the creation of this catalog (see&lt;code style=&quot;font-size: 1em;&quot;&gt;Utils.createCacheDir()&lt;/code&gt;&amp;nbsp;).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Second, the designer can pass ids of images to be displayed on site Pictures in the process of downloading and / or download if it failed.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In the third a couple of small changes.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In general, this class could be done and Singleton, changing settings before using it, but it&#39;s up to you.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In my case, one by one instance is created for each running&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListActivity&lt;/code&gt;&amp;nbsp;and passed to each adapter in need&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;(or created in the adapter itself, if the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;is inside the regular&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Activity&lt;/code&gt;&amp;nbsp;).&lt;/span&gt;&amp;nbsp;&lt;span&gt;The basic method -&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;displayImage(String url, ImageView view)&lt;/code&gt;&amp;nbsp;, the definition speaks for itself.&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Source of vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/com/fedorvlasov/lazylist/ImageLoader.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;ImageLoader&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Uses the methods of:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/util/Utils.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;Utils&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;6.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Adapters, iterates through the cursors&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;This chapter deals with the pagination in the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;That is, the user sees the first&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;n&lt;/code&gt;&amp;nbsp;items, scrolls the list up to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;n&lt;/code&gt;&amp;nbsp;-matrix element, and only after a request is made ​​for the next&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;n&lt;/code&gt;&amp;nbsp;elements of the database or the server.&lt;/span&gt;&lt;span&gt;Then, the user scrolls down the list until the element&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;2n&lt;/code&gt;&amp;nbsp;, and we request the following pack sizes&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;n&lt;/code&gt;&amp;nbsp;, etc.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In&lt;em&gt;vimeoid&lt;/em&gt;&amp;nbsp;I make the following query when you click on&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;footerView&lt;/code&gt;&amp;nbsp;that says &quot;Load more ...&quot; from the list: do not automatically, but the technique is roughly the same. &amp;lt;/ p&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Download by clicking on&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;footerView&lt;/code&gt;&amp;nbsp;:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/base/ItemsListActivity_.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;ItemsListActivity_&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The implementation for the guest:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/guest/ItemsListActivity.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;ItemsListActivity&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Implementation for registered users:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/user/ItemsListActivity.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;ItemsListActivity&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;Here, a more complex hierarchy of classes, loading each page through a special&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;AsyncTask&lt;/code&gt;&amp;nbsp;, after which the background Vimeo API call informs the caller aktiviti, remained there still elements and not the last page whether it is, and aktiviti updates its forms in accordance with these data.&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The adapter contains a set of cursors:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/adapter/EasyCursorsAdapter.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;EasyCursorsAdapter&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;In order to provide paged, you can just keep a list of the containers for pages (eg, cursor) in the adapter, and the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView()&lt;/code&gt;&amp;nbsp;, if requested by one of the last items, run a query on the following page (preferably -&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;AsyncTask&lt;/code&gt;&amp;nbsp;), which in receiving a new container will add it to the adapter and the adapter can cause&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;notifyDataSetChanged()&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&lt;span&gt;Like this:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; private final Page [] pages = new Page [MAX_PAGES_COUNT];&lt;/span&gt;

&lt;span&gt; public View getView (final int position, View convertView, ViewGroup parent) {&lt;/span&gt;

    &lt;span&gt; if (! waitingNextPage &amp;amp; &amp;amp;&lt;/span&gt; 
        &lt;span&gt; (Pages.length &amp;lt;MAX_PAGES_COUNT) &amp;amp; &amp;amp;&lt;/span&gt; 
        &lt;span&gt; (Position&amp;gt; = ((pages.length * PER_PAGE) - 2))) {&lt;/span&gt;

        &lt;span&gt; final AsyncTask &amp;lt;Integer,.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&amp;gt; NextPageTask =.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .;&lt;/span&gt;
        &lt;span&gt; nextPageTask.execute (pages.length);&lt;/span&gt;
        &lt;span&gt; / / NextPageTask is addSource, when it receives a new page&lt;/span&gt;

        &lt;span&gt; waitingNextPage = true;&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt; 

    &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;

&lt;span&gt; }&lt;/span&gt;

&lt;span&gt; public void addSource (Page page) {&lt;/span&gt;
   &lt;span&gt; if (pages.length&amp;gt; = MAX_PAGES_COUNT) return;&lt;/span&gt; 
   &lt;span&gt; pages [pages.length] = page;&lt;/span&gt;
   &lt;span&gt; waitingNextPage = false;&lt;/span&gt;
   &lt;span&gt; notifyDataSetChanged ();&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;EasyCursorsAdapter&lt;/code&gt;&amp;nbsp;- a good example, where as a counterpart to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Page&lt;/code&gt;&amp;nbsp;appears&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Cursor&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Surely there are alternatives would be happy if they mentioned in the comments.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;7.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Sign in via OAuth to Android&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;If you write a client for any complex web service - you are confronted with the problem of authorization, the vast number of web services for its implementation now uses&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://en.wikipedia.org/wiki/OAuth&amp;amp;usg=ALkJrhiO9T4ilNzFAhyca9JrljNbJQaTDw&quot; style=&quot;color: #6da3bd;&quot;&gt;OAuth&lt;/a&gt;&amp;nbsp;and Vimeo just among those.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;It is not necessary to write the implementation itself is somewhat thankless task, since there is already a great library&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://code.google.com/p/oauth-signpost/&amp;amp;usg=ALkJrhibY_L12O0-lLLoJWqHBitwkthe_A&quot; style=&quot;color: #6da3bd;&quot;&gt;signpost&lt;/a&gt;&amp;nbsp;and better alternatives as far as I know, yet.&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;An example of vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/connection/VimeoApi.java?r=85e18485bdda1c526141170f67e65f4e00202f34#101&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;VimeoApi&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Uses a signpost:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/connection/JsonOverHttp.java?r=85e18485bdda1c526141170f67e65f4e00202f34#164&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;JsonOverHttp&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Aktiviti that receives user token:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/ReceiveCredentials.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;ReceiveCredentials&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;His description on the manifest:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/AndroidManifest.xml?r=85e18485bdda1c526141170f67e65f4e00202f34#22&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;AndroidManifest.xml&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;First you need to get a unique key for your application from a Web service and specify the Web service URL, which will vozvraschatsya user when authorization is successful (eg,&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;vimeoid://oauth.done&lt;/code&gt;&amp;nbsp;) (but in the case of Android it pass when asked to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;/request_token&lt;/code&gt;&amp;nbsp;).&lt;/span&gt;&amp;nbsp;&lt;span&gt;Usually this is done via the web interface of the service.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The algorithm first authorization to Android is the following:&lt;/span&gt;&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Specify the signpost where the service entry points are located in OAuth&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Request to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;/request_token&lt;/code&gt;&amp;nbsp;get a couple of token / secret annex for unauthorized requests for this key (kolbek-URL&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;vimeoid://oauth.done&lt;/code&gt;&amp;nbsp;pass here):&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;provider.retrieveRequestToken(Uri callbackUri)&lt;/code&gt;&amp;nbsp;.&amp;nbsp;&lt;em&gt;NB:&lt;/em&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;retrieveRequestToken&lt;/code&gt;&amp;nbsp;not return a token, and immediately&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Uri&lt;/code&gt;&amp;nbsp;, same&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;authUri&lt;/code&gt;&amp;nbsp;by which we must turn to next paragraph&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Aktiviti run a browser, go to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;/authorize&lt;/code&gt;&amp;nbsp;, by passing a token application and, if necessary, adding additional parameters to the required rights:&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;startActivity(new Intent(Intent.ACTION_VIEW, authUri + ...))&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The user will see the page in the style of &quot;Allow this application to access your account?&quot; (When he logged out of service, he will offer to login).&lt;/span&gt;&amp;nbsp;&lt;span&gt;If it allows access, the browser is redirected to the address kolbeka&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;vimeoid://oauth.done?...&lt;/code&gt;&amp;nbsp;, but since your&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;AndroidManifest.xml&lt;/code&gt;&amp;nbsp;to capture such a special URL described aktiviti, Android user returns to your application, it is the opening aktiviti -&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ReceiveCredentials&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;In aktiviti&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ReceiveCredentials&lt;/code&gt;&amp;nbsp;you get the user token in the parameters of&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Uri uri = getIntent().getData()&lt;/code&gt;&amp;nbsp;, now on the token to obtain the secret through a request to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;/access_token&lt;/code&gt;&amp;nbsp;:&lt;code style=&quot;font-size: 1em;&quot;&gt;provider.retrieveAccessToken(Uri uri)&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Now you can save the token and secret user, for example, in private&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;SharedPreferences&lt;/code&gt;&amp;nbsp;:&lt;code style=&quot;font-size: 1em;&quot;&gt;consumer.getToken()&lt;/code&gt;&amp;nbsp;,&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;consumer.getTokenSecret()&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span&gt;You can then sign each request to Web Service API token obtained:&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;consumer.sign(Object request)&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;If your application has been restarted, before any requests can be checked if there are any tokens&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;SharedPreferences&lt;/code&gt;&amp;nbsp;, if there is - to remind them&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;signpost&lt;/code&gt;&amp;nbsp;&#39;in:&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;consumer.setTokenWithSecret(String token, String secret)&lt;/code&gt;&amp;nbsp;, and if not - ask the secret user again (or refresh tokens, if the Web service allows it).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Important note: on Android signpost works only with&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;CommonsHttpOAuthConsumer&lt;/code&gt;&amp;nbsp;/&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;CommonsHttpOAuthProvider&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&lt;span&gt;Classes&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;DefaultOAuth*&lt;/code&gt;&amp;nbsp;do not work.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;8.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Media Player buffering and video via HTTP&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/reference/android/media/MediaPlayer.html&amp;amp;usg=ALkJrhg97qkminK5tWpnSXDPhSkz4C-PpA&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;MediaPlayer&lt;/code&gt;&lt;/a&gt;&amp;nbsp;as it turned out, it is very difficult to get to work just as you want, when playing videos.&lt;/span&gt;&amp;nbsp;&lt;span&gt;To get the video I had to perform an unusual request from the HTTP-specific headers, so getting the stream and had to write by hand bufferizirovanie.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Streaming on analogue&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://blog.pocketjourney.com/2009/12/27/android-streaming-mediaplayer-tutorial-updated-to-v1-5-cupcake/&amp;amp;usg=ALkJrhhNtVD9N2j_80nJCxdF4HGyw9P0zA&quot; style=&quot;color: #6da3bd;&quot;&gt;samples for audio files&lt;/a&gt;&amp;nbsp;, I did not work, so for now I just load the video completely and start playing when it is already loaded (if your card is not enough space, I warn the user).&lt;/span&gt;&amp;nbsp;&lt;span&gt;When you close the player or playing I failed to clear the cache.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Still, the behavior&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;VideoView&lt;/code&gt;&amp;nbsp;/&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;SurfaceView&lt;/code&gt;&amp;nbsp;switching within a single species leyauta also works very mixed (black screen every other time), so we had to leave in the layout banal single&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;VideoView&lt;/code&gt;&amp;nbsp;and show&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ProgressDialog&lt;/code&gt;&amp;nbsp;over him while the video loads.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Again, if you know something about the streaming video means&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;MediaPlayer&lt;/code&gt;&amp;nbsp;(or the receipt of the chunks by hand), write in the comments.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Therefore, if in your case, you have enough call&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;MediaPlayer.setDataSource(Uri uri)&lt;/code&gt;&amp;nbsp;, you can skip the next paragraph for more in her and does not tell.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;If you also had to get the flow manually, I will turn your attention to a couple of points, the rest just show you the code, it should tell it all himself:&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;An example of vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/media/VimeoVideoPlayingTask.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;VimeoVideoPlayingTask&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Called from aktiviti:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/Player.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;Player&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Leyaut:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/res/layout/player.xml?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;player.xml&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;Load flow better using&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;AsyncTask&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I just aggregate&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;MediaPlayer&lt;/code&gt;&amp;nbsp;inside&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;...PlayingTask&lt;/code&gt;&amp;nbsp;for convenience, you can choose any other way, but it&#39;s definitely better to get flow through&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;AsyncTask&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this case, the method&lt;code style=&quot;font-size: 1em;&quot;&gt;onPreExecute&lt;/code&gt;&amp;nbsp;you can prepare your player and customize it to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;doInBackground&lt;/code&gt;&amp;nbsp;get the video stream and return the stream to&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;onPostExecute&lt;/code&gt;&amp;nbsp;, where and start playing.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Again, it is convenient to display the download progress percentage, because&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;doInBackground&lt;/code&gt;&amp;nbsp;known quantity of the data.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;If the boot stream is thrown, the message it has shown through&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;runOnUiThread&lt;/code&gt;&amp;nbsp;, because the task was interrupted.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Running&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getWindow().setFormat(PixelFormat.TRANSPARENT);&lt;/code&gt;&amp;nbsp;intended to displayed over player types do not go over it after hiding it.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Although if you want to use&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ViewSwitcher&lt;/code&gt;&amp;nbsp;, it still does not help.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;The code of the stream on the URL something like this:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public static InputStream getVideoStream (long videoId)&lt;/span&gt; 
       &lt;span&gt; throws FailedToGetVideoStreamException, VideoLinkRequestException {&lt;/span&gt;
    &lt;span&gt; try {&lt;/span&gt;           
        &lt;span&gt; final HttpClient client = new DefaultHttpClient ();&lt;/span&gt;
        &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
        &lt;span&gt; HttpResponse response = client.execute (request);&lt;/span&gt;
        &lt;span&gt; if ((response == null) | | (response.getEntity () == null))&lt;/span&gt;
            &lt;span&gt; throw new FailedToGetVideoStreamException (&quot;Failed to get video stream&quot;);&lt;/span&gt;
        &lt;span&gt; lastContentLength = response.getEntity (). getContentLength ();&lt;/span&gt;
        &lt;span&gt; return response.getEntity (). getContent ();&lt;/span&gt;
    &lt;span&gt; } Catch (URISyntaxException use) {&lt;/span&gt;
        &lt;span&gt; throw new VideoLinkRequestException (&quot;URI creation failed:&quot; + use.getLocalizedMessage ());&lt;/span&gt;
    &lt;span&gt; } Catch (ClientProtocolException cpe) {&lt;/span&gt;
        &lt;span&gt; throw new VideoLinkRequestException (&quot;Client call failed:&quot; + cpe.getLocalizedMessage ());&lt;/span&gt;
    &lt;span&gt; } Catch (IOException ioe) {&lt;/span&gt;
        &lt;span&gt; throw new VideoLinkRequestException (&quot;Connection failed:&quot; + ioe.getLocalizedMessage ());&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;9.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Queues of&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;AsyncTask&lt;/code&gt;&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;span&gt;If you often have to perform several background tasks one by one (when completed one - to run the next), this free pattern that hides itself in the transitions to the linked list, you will do.&lt;/span&gt;&amp;nbsp;&lt;span&gt;For example, you might want to run at startup Activity consecutive multiple requests to the API of a Web service or database.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The main thing is that the parameter types and result of all these problems have always been the same.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;Here is the interface problem, which knows that it has the following problem:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public interface HasNextTask &amp;lt;Params&amp;gt; {&lt;/span&gt;
    &lt;span&gt; public int getId ();&lt;/span&gt;
    &lt;span&gt; void setNextTask (HasNextTask &amp;lt;Params&amp;gt; task);&lt;/span&gt;
    &lt;span&gt; public HasNextTask &amp;lt;Parames&amp;gt; getNextTask ();&lt;/span&gt;
    &lt;span&gt; public AsyncTask &amp;lt;?,?,?&amp;gt; execute (Params. .. params);&lt;/span&gt; 
                         &lt;span&gt; / / Overlap with AsyncTask &amp;lt;Params, ...&amp;gt;&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;An interface that monitors all the moments when the task successfully or unsuccessfully performed:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public interface PerformHandler &amp;lt;Params, Result&amp;gt; {&lt;/span&gt;
    &lt;span&gt; public void onPerfomed (int taskId, Result result, HasNextTask &amp;lt;Params&amp;gt; nextTask);&lt;/span&gt;
    &lt;span&gt; public void onError (Exception e, String description);&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;The interface&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;HasNextTask&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;What is represented by dots, can be taken in the child class or the class itself to make the abstract, that the methods&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;doInBackground&lt;/code&gt;&amp;nbsp;/&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;onPostExecute&lt;/code&gt;&amp;nbsp;implemented directly in&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;createTask&lt;/code&gt;&amp;nbsp;queue:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public class TaskInQueue &amp;lt;Params, Result&amp;gt; extends AsyncTask &amp;lt;Params, Void, Result&amp;gt;&lt;/span&gt; 
                                         &lt;span&gt; implements HasNextTask &amp;lt;Params&amp;gt; {&lt;/span&gt;

    &lt;span&gt; private final int taskId;&lt;/span&gt;
    &lt;span&gt; private HasNextTask &amp;lt;Params&amp;gt; nextTask = null;&lt;/span&gt;
    &lt;span&gt; private final PerformHandler &amp;lt;Params, Result&amp;gt; listener;&lt;/span&gt;

    &lt;span&gt; public TaskInQueue (PerformHandler &amp;lt;Params, Result&amp;gt; listener, int taskId) {&lt;/span&gt;
        &lt;span&gt; this.taskId = taskId;&lt;/span&gt;
        &lt;span&gt; this.listener = listener;&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; @ Override&lt;/span&gt;
    &lt;span&gt; public Result doInBackground (Params. .. params) {.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; / * Task * /}&lt;/span&gt;

    &lt;span&gt; @ Override&lt;/span&gt;
    &lt;span&gt; protected void onPostExecute (Result result) {&lt;/span&gt;
        &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; / / Handle the result if necessary&lt;/span&gt;
        &lt;span&gt; listener.onPerformed (taskId, result, nextTask);&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; @ Override public int getId () {return taskId;}&lt;/span&gt;

    &lt;span&gt; @ Override&lt;/span&gt; 
    &lt;span&gt; public void setNextTask (HasNextTask &amp;lt;Params&amp;gt; nextTask) {&lt;/span&gt;
        &lt;span&gt; if (this.nextTask! = null)&lt;/span&gt; 
            &lt;span&gt; throw new IllegalStateException (&quot;Next task is already set&quot;);&lt;/span&gt;
        &lt;span&gt; this.nextTask = nextTask;&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; @ Override&lt;/span&gt;
    &lt;span&gt; public HasNextTask &amp;lt;Params&amp;gt; getNextTask () {return nextTask;};&lt;/span&gt;

&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;And most importantly, the implementation of the queue:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public abstract class TasksQueue &amp;lt;Params, Result&amp;gt;&lt;/span&gt; 
                &lt;span&gt; implements PerformHandler &amp;lt;Params, Result&amp;gt;, Runnable {&lt;/span&gt;

    &lt;span&gt; public static final String TAG = &quot;TasksQueue&quot;;&lt;/span&gt;

    &lt;span&gt; private HasNextTask &amp;lt;Params&amp;gt; firstTask = null;&lt;/span&gt;
    &lt;span&gt; private HasNextTask &amp;lt;Params&amp;gt; lastTask = null;&lt;/span&gt;
    &lt;span&gt; private Map &amp;lt;Integer, Params&amp;gt; tasksParams = null;&lt;/span&gt;
    &lt;span&gt; private int currentTask = -1;&lt;/span&gt;
    &lt;span&gt; private boolean running = false; / / now runs one of the tasks&lt;/span&gt;
    &lt;span&gt; private boolean started = false; / / turn launched&lt;/span&gt;
    &lt;span&gt; private int size = 0;&lt;/span&gt;

    &lt;span&gt; protected HasNextTask &amp;lt;Params&amp;gt; createTask (int taskId) {/ / you can override&lt;/span&gt;
        &lt;span&gt; return new TaskInQueue &amp;lt;Params, Result&amp;gt; (this, taskId);&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; @ Override&lt;/span&gt;
    &lt;span&gt; public HasNextTask &amp;lt;Params&amp;gt; add (int taskId, Params params) {&lt;/span&gt;
        &lt;span&gt; Log.d (TAG, &quot;Adding task&quot; + taskId);&lt;/span&gt;
        &lt;span&gt; final HasNextTask &amp;lt;Params&amp;gt; = createTask (taskId);&lt;/span&gt;
        &lt;span&gt; if (isEmpty ()) {&lt;/span&gt;
            &lt;span&gt; firstTask = task;&lt;/span&gt;
            &lt;span&gt; lastTask = task;&lt;/span&gt;
            &lt;span&gt; tasksParams = new HashMap &amp;lt;Integer, Params&amp;gt; ();&lt;/span&gt;
        &lt;span&gt; } Else {&lt;/span&gt;
            &lt;span&gt; lastTask.setNextTask (task);&lt;/span&gt;
            &lt;span&gt; lastTask = task;&lt;/span&gt;
        &lt;span&gt; }&lt;/span&gt;
        &lt;span&gt; tasksParams.put (task.getId (), params);&lt;/span&gt;
        &lt;span&gt; size + = 1;&lt;/span&gt;
        &lt;span&gt; return task;&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; @ Override&lt;/span&gt;
    &lt;span&gt; public void run () {&lt;/span&gt;
        &lt;span&gt; Log.d (TAG, &quot;Running first task&quot;);&lt;/span&gt;
        &lt;span&gt; if (! isEmpty ())&lt;/span&gt;
            &lt;span&gt; try {&lt;/span&gt;
                &lt;span&gt; started = true;&lt;/span&gt;
                &lt;span&gt; execute (firstTask);&lt;/span&gt;
            &lt;span&gt; } Catch (Exception e) {&lt;/span&gt;
                &lt;span&gt; onError (e, e.getLocalizedMessage ());&lt;/span&gt;
                &lt;span&gt; finish ();&lt;/span&gt;
            &lt;span&gt; }&lt;/span&gt;
        &lt;span&gt; else throw new IllegalStateException (&quot;Queue is empty&quot;);&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; @ Override&lt;/span&gt;
    &lt;span&gt; public void onPerfomed (int taskId, Result result, HasNextTask &amp;lt;Params&amp;gt; nextTask) {&lt;/span&gt;
        &lt;span&gt; Log.d (TAG, &quot;Task&quot; + taskId + &quot;performed&quot;);&lt;/span&gt;
        &lt;span&gt; if (taskId! = currentTask)&lt;/span&gt; 
            &lt;span&gt; throw new IllegalStateException (&quot;Tasks queue desynchronized&quot;);&lt;/span&gt;
        &lt;span&gt; running = false;&lt;/span&gt;
        &lt;span&gt; try {&lt;/span&gt;
            &lt;span&gt; if (nextTask! = null) {&lt;/span&gt;
                &lt;span&gt; execute (nextTask);&lt;/span&gt;
            &lt;span&gt; } Else finish ();&lt;/span&gt;
        &lt;span&gt; } Catch (Exception e) {&lt;/span&gt;
            &lt;span&gt; onError (e, &quot;Error while executing task&quot; +&lt;/span&gt; 
                       &lt;span&gt; ((NextTask! = Null)? NextTask.getId (): taskId));&lt;/span&gt;
            &lt;span&gt; finish ();&lt;/span&gt;                
        &lt;span&gt; }&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; protected void execute (HasNextTask &amp;lt;Result&amp;gt; task) throws Exception {&lt;/span&gt;
        &lt;span&gt; Log.d (TAG, &quot;Trying to run task&quot; + task.getId ());&lt;/span&gt;
        &lt;span&gt; if (running) throw new IllegalStateException (&quot;Tasks queue desynchronized&quot;);&lt;/span&gt;
        &lt;span&gt; currentTask = task.getId ();&lt;/span&gt;
        &lt;span&gt; running = true;&lt;/span&gt;
        &lt;span&gt; Log.d (TAG, &quot;Running task&quot; + task.getId ());&lt;/span&gt;
        &lt;span&gt; task.execute (tasksParams.get (task.getId ())). get (); / / wait for result&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; protected void finish () {&lt;/span&gt;
        &lt;span&gt; firstTask = null;&lt;/span&gt;
        &lt;span&gt; lastTask = null;&lt;/span&gt;
        &lt;span&gt; if (tasksParams! = null) tasksParams.clear ();&lt;/span&gt;
        &lt;span&gt; tasksParams = null;&lt;/span&gt;
        &lt;span&gt; currentTask = -1;&lt;/span&gt;
        &lt;span&gt; running = false;&lt;/span&gt;
        &lt;span&gt; started = false;&lt;/span&gt;
        &lt;span&gt; size = 0;&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; public boolean isEmpty () {return (firstTask == null);}&lt;/span&gt;

    &lt;span&gt; public boolean started () {return started;}&lt;/span&gt;

    &lt;span&gt; public boolean running () {return running;}&lt;/span&gt;

    &lt;span&gt; public int size () {return size;}&lt;/span&gt;        

&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;Now in your aktiviti at any time you can easily create all background tasks:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; protected final TasksQueue secondaryTasks;&lt;/span&gt;

&lt;span&gt; private final int TASK_1 = 0;&lt;/span&gt;
&lt;span&gt; private final int TASK_2 = 1;&lt;/span&gt;
&lt;span&gt; private final int TASK_3 = 2;&lt;/span&gt;

&lt;span&gt; public ... Activity () {/ / constructor&lt;/span&gt;

    &lt;span&gt; secondaryTasks = new TasksQueue &amp;lt;..., ...&amp;gt;() {&lt;/span&gt;

        &lt;span&gt; / / Here you can override createTask&lt;/span&gt; 

        &lt;span&gt; @ Override public void onPerfomed (int taskId, ... result) throws JSONException {&lt;/span&gt;
            &lt;span&gt; super.onPerfomed (taskId, result);&lt;/span&gt;
            &lt;span&gt; onSecondaryTaskPerfomed (taskId, result);&lt;/span&gt;
        &lt;span&gt; }&lt;/span&gt;

        &lt;span&gt; @ Override public void onError (Exception e, String message) {&lt;/span&gt;
            &lt;span&gt; Log.e (TAG, message + &quot;/&quot; + e.getLocalizedMessage ());&lt;/span&gt;
            &lt;span&gt; Dialogs.makeExceptionToast (ItemsListActivity.this, message, e);&lt;/span&gt;
        &lt;span&gt; }&lt;/span&gt;

    &lt;span&gt; };&lt;/span&gt;

    &lt;span&gt; secondaryTasks.add (TASK_1, ...);&lt;/span&gt;
    &lt;span&gt; secondaryTasks.add (TASK_2, ...);&lt;/span&gt;
    &lt;span&gt; secondaryTasks.add (TASK_3, ...);&lt;/span&gt;

&lt;span&gt; }&lt;/span&gt;

&lt;span&gt; protected void someMethod () {&lt;/span&gt;
    &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
    &lt;span&gt; if (! secondaryTasks.isEmpty ()) secondaryTasks.run ();&lt;/span&gt;
    &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;

&lt;span&gt; protected void onSecondaryTaskPerfomed (int taskId, ... result) {&lt;/span&gt;
    &lt;span&gt; switch (taskId) {&lt;/span&gt;
        &lt;span&gt; case TASK_1:.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
        &lt;span&gt; case TASK_2:.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
        &lt;span&gt; case TASK_3:.&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
        &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;By the way, thanks to the interface&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Runnable&lt;/code&gt;&amp;nbsp;such a queue can be run in a separate thread:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; new Thread (secondaryTasks, &quot;Tasks Queue&quot;). start ();&lt;/span&gt;
&lt;/pre&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;In turn vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/user/ApiTasksQueue.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;ApiTasksQueue&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Created in:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/user/SingleItemActivity.java?r=85e18485bdda1c526141170f67e65f4e00202f34#49&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;SingleItemActivity&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Initialized in the task:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/user/item/UserActivity.java?r=85e18485bdda1c526141170f67e65f4e00202f34#122&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;UserActivity&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Processing of completed tasks in:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/user/item/UserActivity.java?r=85e18485bdda1c526141170f67e65f4e00202f34#301&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;UserActivity&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;10.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Backlight selection in ListView&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;img alt=&quot;The selected entry in the list&quot; src=&quot;http://vimeoid.googlecode.com/hg/screens/user_video.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In the picture shows a blue band, this custom highlight the selected item, it has four states - pressed, which has a focus that is prohibited by and pressed the animation of the transition from a jammed for a long tapa.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The first three and squeezed state - the so-called&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;9-patch&lt;/code&gt;&amp;nbsp;, you&#39;ve probably&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/guide/developing/tools/draw9patch.html&amp;amp;usg=ALkJrhj8MAVEfP8JeEs3Ty5waMHrf2Xazg&quot; style=&quot;color: #6da3bd;&quot;&gt;heard about them&lt;/a&gt;&amp;nbsp;, the animation -&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;xml&lt;/code&gt;&amp;nbsp;-file animations.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In order to describe the state to highlight the selection in the layout, specify&lt;code style=&quot;font-size: 1em;&quot;&gt;android:listSelector=&quot;@drawable/selector_bg&quot;&lt;/code&gt;&amp;nbsp;for your&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;selector_bg.xml&lt;/code&gt;&amp;nbsp;- this is another&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;xml&lt;/code&gt;&amp;nbsp;-file, a set of rules about how the backlit, depending on conditions.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The system goes through each rule and as soon as the first rule is matched, it is true, but these are ignored.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The algorithm is simple, but the build rules in the right order do not always work out right away.&lt;/span&gt;&amp;nbsp;&lt;span&gt;See examples:&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Description:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/res/drawable/selector_bg.xml?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;selector_bg.xml&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Animation:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/res/drawable/selector_bg_transition.xml?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;selector_bg_transition.xml&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Declared in:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/res/layout/generic_list.xml?r=85e18485bdda1c526141170f67e65f4e00202f34#16&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;generic_list.xml&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img alt=&quot;Editor nine-patch&quot; src=&quot;http://developer.android.com/images/draw9patch-norm.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;From 9-patch is a cunning, too, just what is wrong in the layout - and they drive around and goes around the entire list, too.&lt;/span&gt;&amp;nbsp;&lt;span&gt;The main rule is - check the above description of the&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListView&lt;/code&gt;&amp;nbsp;, make sure that&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;layout_width&lt;/code&gt;&amp;nbsp;and&lt;code style=&quot;font-size: 1em;&quot;&gt;layout_height&lt;/code&gt;&amp;nbsp;installed&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;fill_parent&lt;/code&gt;&amp;nbsp;and also double-check the items above in the hierarchy.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Then, if you did not help, you can correct the nine-patch.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thin black lines denote the top and left of the images that will be stretched if the content is not got a picture.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thin black lines (optional) on the right and bottom indicate the region in which the content itself will be written.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Find the right position, too, turns out not once, have to experiment.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Do not even think to create a nine-patch without an editor of the box, it is unnecessary removal of the brain - areas highlighted in the editor for content and errors, and even when everything seems right, do not always perceived layout infleyterom as expected.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Prohibited condition&quot; src=&quot;http://vimeoid.googlecode.com/hg/apk/res/drawable/selector_bg_disabled.9.png?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;img alt=&quot;The state of focus&quot; src=&quot;http://vimeoid.googlecode.com/hg/apk/res/drawable/selector_bg_focus.9.png?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;img alt=&quot;Pressed state&quot; src=&quot;http://vimeoid.googlecode.com/hg/apk/res/drawable/selector_bg_pressed.9.png?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;img alt=&quot;Squeezed state&quot; src=&quot;http://vimeoid.googlecode.com/hg/apk/res/drawable/selector_bg_longpress.9.png?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;11.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Add QuickActions&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;img alt=&quot;Example QuickActions&quot; src=&quot;http://vimeoid.googlecode.com/hg/screens/user_videos.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/&amp;amp;usg=ALkJrhgn5_ihZy87L4SdC2_3h0sJ9GRgmQ&quot; style=&quot;color: #6da3bd;&quot;&gt;QuickActions&lt;/a&gt;&amp;nbsp;- a small library for pop-up dialogs with activities such as in the figure (and not only these, because their design can be changed easily.)&lt;/span&gt;&amp;nbsp;&lt;span&gt;They have become a new popular trend of the appearance of an official twitter client.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Must be other implementation, in&amp;nbsp;&lt;em&gt;vimeoid&lt;/em&gt;&amp;nbsp;I use this, and it also touched up a bit for their needs.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;In order to display a dialog instead of the context menu when you long to Tape element on the list, enough to override a method&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;onCreateContextMenu&lt;/code&gt;&amp;nbsp;in&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;ListActivity&lt;/code&gt;&amp;nbsp;as follows:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public void onCreateContextMenu (ContextMenu menu, View v, ContextMenuInfo menuInfo) {&lt;/span&gt;      
    &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
    &lt;span&gt; final AdapterView.AdapterContextMenuInfo info = extractMenuInfo (menuInfo);&lt;/span&gt;
    &lt;span&gt; final QuickAction quickAction =&lt;/span&gt; 
          &lt;span&gt; createQuickActions (info.position, getItem (info.position), info.targetView);&lt;/span&gt;
    &lt;span&gt; if (quickAction! = null) quickAction.show ();&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;

&lt;span&gt; protected QuickAction createQuickActions (final int position, final ... item, View view) {&lt;/span&gt;
    &lt;span&gt; QuickAction qa = new QuickAction (view);&lt;/span&gt;
    &lt;span&gt; qa.addActionItem (getString (R.string ...),&lt;/span&gt; 
                     &lt;span&gt; getResources (). getDrawable (R.drawable ...),&lt;/span&gt; 
            &lt;span&gt; new QActionClickListener () {&lt;/span&gt;
                &lt;span&gt; @ Override public void onClick (View v, QActionItem item) {&lt;/span&gt;
                    &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
                &lt;span&gt; }&lt;/span&gt;
            &lt;span&gt; });&lt;/span&gt;
    &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt; &lt;span&gt; .&lt;/span&gt;
    &lt;span&gt; return qa;&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;The directory containing the modified Library&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://code.google.com/p/vimeoid/source/browse/lib-qactions%3Fr%3D85e18485bdda1c526141170f67e65f4e00202f34&amp;amp;usg=ALkJrhix88SMXFh-s223kZt6PLGuPANxOw&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;lib-qactions&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;Used in:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/activity/user/list/VideosActivity.java?r=85e18485bdda1c526141170f67e65f4e00202f34#113&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;VideosActivity&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;About adding an external library in the Eclipse project described in&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/guide/developing/eclipse-adt.html&amp;amp;usg=ALkJrhjtFW4eyv0KQaWs0ChnFuRteDVJoA#libraryProject&quot; style=&quot;color: #6da3bd;&quot;&gt;this article&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In short, it is enough to create a separate library for Android-source project, set the checkbox&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;isLibrary&lt;/code&gt;&amp;nbsp;see&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Android&lt;/code&gt;&amp;nbsp;in the properties of this project, and in the main project add to a project with a library point of&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Library&lt;/code&gt;&amp;nbsp;-&amp;gt;&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Add&lt;/code&gt;&amp;nbsp;from the same section.&lt;/span&gt;&amp;nbsp;&lt;span&gt;In this case&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;R&lt;/code&gt;&amp;nbsp;-file from the project with the library will be added to the main project.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;12.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Three more small solving&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;12a.&lt;/span&gt;&amp;nbsp;&lt;span&gt;A single place to call various activity&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;If your application aktiviti many different and they are invoked in a similar way, it might be convenient to transfer their calls including filling&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;Extras&lt;/code&gt;&amp;nbsp;in a separate class:&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;An example of vimeoid:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/vimeoid/source/browse/apk/src/org/vimeoid/util/Invoke.java?r=85e18485bdda1c526141170f67e65f4e00202f34&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;Invoke&lt;/code&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;12b.&lt;/span&gt;&amp;nbsp;&lt;span&gt;About placeholder in localization&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Maybe this is obvious, but the rows of&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;strings.xml&lt;/code&gt;&amp;nbsp;pleyshodery can use to substitute some value independent of the locale inside the lines, for example:&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;&amp;lt;string name=&quot;image_info&quot;&amp;gt;Image size: {width}x{height}&amp;lt;/string&amp;gt;&lt;/code&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;This function will&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;format&lt;/code&gt;&amp;nbsp;, so you can call:&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;format(getString(R.string.image_info), &quot;width&quot;, String.valueOf(600), &quot;height&quot;, String.valueOf(800))&lt;/code&gt;&amp;nbsp;:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span&gt; public static String format (String source, String ... params) {&lt;/span&gt;
    &lt;span&gt; String result = source;&lt;/span&gt;
    &lt;span&gt; int pos = 0;&lt;/span&gt;
    &lt;span&gt; while (pos &amp;lt;params.length) {&lt;/span&gt;
        &lt;span&gt; result = result.replaceAll (&quot;\ \ {&quot; + params [pos + +] + &quot;\ \}&quot;, params [pos ++]);&lt;/span&gt;
    &lt;span&gt; }&lt;/span&gt;
    &lt;span&gt; return result;&lt;/span&gt;
&lt;span&gt; }&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span&gt;&lt;strong&gt;Upd.&lt;/strong&gt;&amp;nbsp;It turned out as I thought it was a bicycle: There is a standard function&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://developer.android.com/intl/de/reference/android/content/Context.html&amp;amp;usg=ALkJrhiEV8O_BoBytVohOPuJIHfhpmyRLA#getString%28int,%20java.lang.Object...%29&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;getString(int resId, Object... formatArgs)&lt;/code&gt;&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Thank&amp;nbsp;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://zochek.habrahabr.ru/&amp;amp;usg=ALkJrhgqwF5qp3P2wVl31nLL9cPgSMxjRA&quot; style=&quot;color: #6da3bd;&quot;&gt;zochek&lt;/a&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;color: #999999; font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;12c.&lt;/span&gt;&amp;nbsp;&lt;span&gt;About incorrect layout&lt;/span&gt;&lt;/h4&gt;&lt;br /&gt;
&lt;span&gt;Be sure to read these articles in infleyter android really very sensitive to the complex structures and if you write a complex application, leyauty sooner or later will have to optimize:&lt;/span&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: disc; margin-bottom: 1.5em; margin-left: 2.65em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/&amp;amp;usg=ALkJrhhy3be6nlA7hJciC2uAjhTOqESWTQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Layout Tricks # 1&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.curious-creature.org/2009/02/25/android-layout-trick-2-include-to-reuse/&amp;amp;usg=ALkJrhiNqpT4rJKi8EFfxO8cRksYsZKKow&quot; style=&quot;color: #6da3bd;&quot;&gt;Layout Tricks # 2&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.curious-creature.org/2009/03/01/android-layout-tricks-3-optimize-part-1/&amp;amp;usg=ALkJrhh8gyCbTXPnPETR1_IvqVIiExiikQ&quot; style=&quot;color: #6da3bd;&quot;&gt;Layout Tricks # 3&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.curious-creature.org/2009/03/16/android-layout-tricks-4-optimize-part-2/&amp;amp;usg=ALkJrhgd2D0XJniCERy53l-KIQyHt8OWsw&quot; style=&quot;color: #6da3bd;&quot;&gt;Layout Tricks # 4&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span&gt;&lt;a href=&quot;http://translate.googleusercontent.com/translate_c?hl=ru&amp;amp;rurl=translate.google.com&amp;amp;sl=ru&amp;amp;tl=en&amp;amp;twu=1&amp;amp;u=http://www.curious-creature.org/2009/03/04/speed-up-your-android-ui/&amp;amp;usg=ALkJrhgV13vIjVuyB8QFwJpSPPIllIGEKg&quot; style=&quot;color: #6da3bd;&quot;&gt;Speed ​​up your Android UI&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span&gt;My pererenderivayuschiesya leyauty often at one point and failed&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;getView&lt;/code&gt;&amp;nbsp;adapter has called almost every second (and still sometimes is, but already much less).&lt;/span&gt;&amp;nbsp;&lt;span&gt;After replacing many nested slozhnostrukturirovannyh&lt;code style=&quot;font-size: 1em;&quot;&gt;LinearLayout&lt;/code&gt;&amp;nbsp;s to less invested and elegant&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;RelativeLayout&lt;/code&gt;&amp;nbsp;, infleyteru was clearly easier and myself too, because the hierarchy has become shorter and make small changes to become easier.&lt;/span&gt;&amp;nbsp;&lt;span&gt;I have not yet had time to replace everywhere, but now otnoschus to leyautam carefully.&lt;/span&gt;&amp;nbsp;&lt;span&gt;Also watch out for, so that&lt;code style=&quot;font-size: 1em;&quot;&gt;width/height=wrap_content&lt;/code&gt;&amp;nbsp;used only possible for simple elements, the use of&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;wrap_content&lt;/code&gt;&amp;nbsp;as parameters the width / height&amp;nbsp;&lt;code style=&quot;font-size: 1em;&quot;&gt;LinearLayout&lt;/code&gt;&amp;nbsp;and other complex types can lead to difficult consequences.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4989932872742210037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4989932872742210037'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/10-useful-solutions-for-android.html' title='10 useful solutions for the Android Developer'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-4573597440479155891</id><published>2011-09-29T11:00:00.000-07:00</published><updated>2011-09-29T11:00:08.784-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="API"/><category scheme="http://www.blogger.com/atom/ns#" term="calendar"/><category scheme="http://www.blogger.com/atom/ns#" term="events"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="URI"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Android Calendar API</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;img src=&quot;http://habrastorage.org/storage/902fb097/6ffd64be/4b30b7e8/99a0ab83.jpg&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span title=&quot;В этой статье речь пойдет об использовании недокументированного API для работы со стандартным календарем Android.&quot;&gt;This article focuses on the use of undocumented API to work with standard calendar Android.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Кто заинтересовался – под кат.&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Зачем!?&quot;&gt;&lt;b&gt;For what?!&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span title=&quot;Я столкнулся с такой задачей, когда писал приложение для составления своего университетского расписания.&quot;&gt;I ran into this problem when he wrote an application to form an university schedule.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Удобно иметь свое расписание отдельно, да еще и стандартный календарь не поддерживает повторение событий через одну неделю, что необходимо для двухнедельного (чет./нечет.) расписания.&quot;&gt;It is convenient to have their schedules separately, so even a standard calendar does not support repeating events in one week, which is necessary for a two-week (Thu / odd.) Schedule.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Идеей фикс была функция приложения, которая позволит “заполнить” введенным расписанием Android календарь.&quot;&gt;Idée fixe was a function of the application, which will &quot;fill&quot; introduced by the schedule Android calendar.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Плюсы очевидны: синхронизация с Google Calendar от google (простите за тавтологию), встроенные виджеты календаря (очень уж хорош этот виджет от HTC Sense) и гора виджетов от сторонних производителей, которые хоть покажут следующее событие, хоть загруженность недели, и т.д.&quot;&gt;Pluses are obvious: Sync with Google Calendar from google (pardon the tautology), built-in calendar widget (very much good this widget from HTC Sense) and a mountain of widgets from third-party manufacturers, which show at least the next event, though utilization of the week, etc.&lt;/span&gt;&lt;span title=&quot;Тут и понадобилась работа с календарем Android.&quot;&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span title=&quot;Использовать недокументированное API — это ПЛОХО!&quot;&gt;Use an undocumented API - this is BAD!&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Понятно?&quot;&gt;Got it?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;img align=&quot;left&quot; src=&quot;http://habrastorage.org/storage/5c2d2d85/202852ca/fe017dce/41d70e60.jpg&quot; style=&quot;margin-bottom: 5px; margin-right: 30px; margin-top: 5px; max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Does&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;solve the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;problem of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the obvious&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;need to use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;an undocumented&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;API?&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The answer&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;- no.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The proper&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;method is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to use the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;API Google Calendar,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;advise&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;you&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;make&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;my own applications.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;But&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the &quot;right&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;method&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;imposes&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;several limitations:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;• Do not use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the lack of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;connection to the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Internet;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;•&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the need to synchronize&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the calendar&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;after filling&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;• Data&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;(and there are&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;not&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;enough&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in filling&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the whole year&lt;/span&gt;) go&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to the server&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and then&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;go&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;back&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;sync&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;which obviously&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;increases the traffic&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in half.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;In my opinion,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is much more convenient&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to use the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;offline&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;version of the calendar&lt;/span&gt;, which&lt;span class=&quot;hps&quot;&gt;at any opportunity&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, you can synchronize&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;guglokalendarem&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Unfortunately&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;google&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;did not care&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;about developers&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for Android&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;has not published&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;an official&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;API, but&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to our delight&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Android&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;source code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;open&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and intelligent people&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;have long&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;found the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;magic&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;URI&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;content providers&lt;/span&gt;.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;We ask&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the user for&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;permission&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to work&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with calendar&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;Paradox&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;API does not have&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;resolution of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the documentation&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;You just have to&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;add them to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;vashAndroidManifest.xml&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;pre style=&quot;background-color: white; font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;xml&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;uses-permission&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;android.permission.READ_CALENDAR&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;uses-permission&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;uses-permission&lt;/span&gt;&lt;span class=&quot;attribute&quot; style=&quot;color: #2f98ff;&quot;&gt; android:name=&lt;span class=&quot;value&quot; style=&quot;color: #339900;&quot;&gt;&quot;android.permission.WRITE_CALENDAR&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot; style=&quot;color: #4d7386;&quot;&gt;&amp;lt;/&lt;span class=&quot;title&quot; style=&quot;color: #4d7386;&quot;&gt;uses-permission&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;h4 style=&quot;font-family: Verdana, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;URI&lt;/span&gt;&lt;/h4&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;To use the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;calendar,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Android&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, we&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;must turn to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;its&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;content&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;provider&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for a particular&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;URI.&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;Much to our&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;chagrin&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that the URI&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is different&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in different versions of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;operating systems and&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;is likely to change&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;in the next (&lt;/span&gt;&lt;span class=&quot;&quot;&gt;the costs&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;undocumented&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;API).&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;But the problem&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is solved.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;For&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Froyo [2.2]&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and is likely&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for the following versions&lt;/span&gt;&lt;span class=&quot;&quot;&gt;-content: / / com.android.calendar / calendars.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;For versions&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;&amp;lt;2.2 - content: / / calendar / calendars.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;As you can see&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, it&#39;s not&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;so bad.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;You can&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;determine the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;version of the system&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;use the appropriate&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;URI, but&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I went&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the other way.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I watch&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;if there&#39;s&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a URI&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;&amp;lt;2.2&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;if&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;there is no one&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, then&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the remainder&lt;/span&gt;&lt;span class=&quot;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// Calendar URI before 2.2&lt;/span&gt;
Uri calendars = Uri.parse(&lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;content://calendar/calendars&quot;&lt;/span&gt;);
Cursor managedCursor = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;this&lt;/span&gt;.managedQuery(calendars, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;_id&quot;&lt;/span&gt;, &lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;name&quot;&lt;/span&gt; }, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;);
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt;(managedCursor == &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt; || managedCursor.getCount() == &lt;span class=&quot;number&quot; style=&quot;color: #2f98ff;&quot;&gt;0&lt;/span&gt;)
{
 &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// 2.2 (Froyo)&lt;/span&gt;
}
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;else&lt;/span&gt;
{
 &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// &amp;lt; 2.2&lt;/span&gt;
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;We assume&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that the URI&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;received.&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;Get the list of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;calendars&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;For users of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Google Calendar&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;do not have to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;explain&lt;/span&gt;, and&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;explain&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to the rest&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Public Access&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;consists of one or&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;several small&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;calendars, which&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;can vary in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;color&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;markers.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;This is usually&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;something like&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;&quot;personal&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;&quot;, &quot;&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;work&quot;, &quot;&lt;/span&gt;training&quot;, etc.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Establish such&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;calendars can&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;only&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;visit&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;guglokalendarya&lt;/span&gt;, in the&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;android&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;standard means&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;you can do.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;To add an&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, we need to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;know the ID of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the calendar.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;To perform&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;this task,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;use the construction&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the preceding paragraph.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;String[] projection = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; String[] { &lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;_id&quot;&lt;/span&gt;, &lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;name&quot;&lt;/span&gt; };
Cursor managedCursor = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;this&lt;/span&gt;.managedQuery(URI, projection, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;);
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (managedCursor != &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; managedCursor.moveToFirst()) 
        {
         String calName;
         String calID;         
         &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; nameColumn = managedCursor.getColumnIndex(&lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;name&quot;&lt;/span&gt;);
         &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; idColumn = managedCursor.getColumnIndex(&lt;span class=&quot;string&quot; style=&quot;color: #339900;&quot;&gt;&quot;_id&quot;&lt;/span&gt;);
         do 
         {
          calName = managedCursor.getString(nameColumn);
          calID = managedCursor.getString(idColumn);
          &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (calName != &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;) &lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;// … UI         &lt;/span&gt;
            } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;while&lt;/span&gt; (managedCursor.moveToNext());
            managedCursor.close();
        }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Now&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the resulting&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;set of names&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;can be displayed&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;interface&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and allow the user&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to choose&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;Add&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;event&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;Then&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;work&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with the calendar&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with any other&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;content provider&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;This can be&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;read&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the documentation.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;ContentValues event = new ContentValues();
event.put(&quot;calendar_id&quot;, calID);  // ID календаря мы получили ранее
event.put(&quot;title&quot;, title); // Название события
event.put(&quot;description&quot;, desc); // Описание события
event.put(&quot;eventLocation&quot;, loc); // Место проведения
event.put(&quot;dtstart&quot;, start); // время начала
event.put(&quot;dtend&quot;, end); // время окончания
eventsURI=Uri.parse(URI + “/events&quot;); 
this.getContentResolver().insert(eventsURI, event);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Let&#39;s talk&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;about the fields&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of the event.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The description field&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, I&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;advise you to use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to indicate&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;events.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Use this field&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;can then be&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;removed&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;en masse&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;all the events&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;generated&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by your program.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Field&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;names, descriptions and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;venue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;are string&lt;/span&gt;&lt;span class=&quot;&quot;&gt;.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;We should also&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;mention the&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;time field.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;These fields&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;have&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;type long,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;but&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;these fields&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;can be generated&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, for example,&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;the following function&lt;/span&gt;&lt;span class=&quot;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;long&lt;/span&gt; pickDate(&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; year, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; month, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; day, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; hour, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; minute) 
{
     Calendar rightNow = Calendar.getInstance();
     &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; timeShift = rightNow.get(Calendar.ZONE_OFFSET);     
     &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;return&lt;/span&gt; Date.UTC(year - &lt;span class=&quot;number&quot; style=&quot;color: #2f98ff;&quot;&gt;1900&lt;/span&gt;, month, day, hour - (timeShift / &lt;span class=&quot;number&quot; style=&quot;color: #2f98ff;&quot;&gt;3600000&lt;/span&gt;), minute, &lt;span class=&quot;number&quot; style=&quot;color: #2f98ff;&quot;&gt;0&lt;/span&gt;);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;With&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;her, I think&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;will understand&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;themselves&lt;/span&gt;, let me note&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;only&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it responds to the&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;current&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;time zone&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;Remove&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Event&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-size: 16px;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;To delete a message&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by ID&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to add&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it to the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;URI.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;comment&quot; style=&quot;color: grey;&quot;&gt;//eventsURI = URI + events/&lt;/span&gt;
uri = ContentUris.withAppendedId(eventsURI, EVENT_ID);
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;this&lt;/span&gt;.getContentResolver().delete(uri, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;); 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-size: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;To remove the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;other&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;fields&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;you can&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;get&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;all&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;mouse&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;events, like&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;we&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;did with the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;calendars&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, and then&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;selectively&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;remove&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the ID&lt;/span&gt;&lt;span class=&quot;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;&lt;b&gt;Finally&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;In conclusion, I&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;remind you that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;you&#39;re using&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;at your own&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;risk.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;During&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;development, I&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;once&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;wrote a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;URI&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is not&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and my phone&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;every time you&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;sync&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;started to issue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;an error (&lt;/span&gt;&lt;span class=&quot;&quot;&gt;corrected&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;erasure&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of information&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;from the calendar&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;altogether&lt;/span&gt;&lt;span class=&quot;&quot;&gt;.)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;Another&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;trouble -&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the emulator&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is no&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;calendar&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, for&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to repeat&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;all the above&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;fails.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;And it&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;concluded.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I can&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;not take the opportunity&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;popiarit&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the application,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;which was discussed&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the article.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;You can find&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it in the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;market&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;under the name&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;uTimetable.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;img align=&quot;left&quot; src=&quot;http://habrastorage.org/storage/651d1731/6c419718/0503bc14/83c86706.png&quot; style=&quot;margin-bottom: 5px; margin-right: 30px; margin-top: 5px; max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;img align=&quot;left&quot; src=&quot;http://habrastorage.org/storage/ba453ec1/bb74ef14/1ef98fc7/8e233af0.png&quot; style=&quot;margin-bottom: 5px; margin-right: 30px; margin-top: 5px; max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;img align=&quot;left&quot; src=&quot;http://habrastorage.org/storage/9d8b66b1/0eeb5a13/04e0eb6f/dcde0eca.png&quot; style=&quot;margin-bottom: 5px; margin-right: 30px; margin-top: 5px; max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;img src=&quot;http://habrastorage.org/storage/69101187/d0b8dc59/69ecb8ec/eda2a75e.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4573597440479155891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4573597440479155891'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/android-calendar-api.html' title='Android Calendar API'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-7354314091248947335</id><published>2011-09-29T10:33:00.000-07:00</published><updated>2011-09-29T10:38:35.955-07:00</updated><title type='text'>A bug in Android or problem with Spinner in full screen mode</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 class=&quot;entry-title single-entry-title&quot; style=&quot;font: normal normal normal 2.167em/118% &#39;normal Verdana&#39;, Tahoma, sans-serif; margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 35px; padding-right: 30px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Yesterday, my&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;friend&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Max&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;wrote me&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;GTalk&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;about&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;one&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;unusual&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;problem.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;He develops&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a kind of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;full-screen&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;application that calls&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a dialogue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with the widget&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Spinner.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;And&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it would be&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;cool&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, but there is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a bug&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;- when you click&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;on the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Spinner&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in full screen mode&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;with the appearance of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;selection dialog&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Status Bar&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;appears&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for 1-2 seconds&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;This&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;situation occurs&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;if the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Spinner&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is a large&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;number of items.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;It looks like this&lt;/span&gt;&lt;span class=&quot;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://androidforums.ru/uploads/monthly_09_2010/post-2-1285230560.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 16px; line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;I began to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;explore&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the sources&lt;/span&gt;&amp;nbsp;of the&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Spinner&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and discovered that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;when displaying&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the dialog&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;with the elements&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;when you click on -&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Spinner&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;creates a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialogue that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;does not include&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;the full screen&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;version&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The code looks&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as follows.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;    &lt;span class=&quot;annotation&quot; style=&quot;color: olive;&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;boolean&lt;/span&gt; performClick() {
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;boolean&lt;/span&gt; handled = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;super&lt;/span&gt;.performClick();
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (!handled) {
            handled = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;true&lt;/span&gt;;
            Context context = getContext();
            &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;final&lt;/span&gt; DropDownAdapter adapter = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; DropDownAdapter(getAdapter());
            AlertDialog.Builder builder = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;new&lt;/span&gt; AlertDialog.Builder(context);
            &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (mPrompt != &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;) {
                builder.setTitle(mPrompt);
            }
            mPopup = builder.setSingleChoiceItems(adapter,
                    getSelectedItemPosition(), &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;this&lt;/span&gt;).show();
        }
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;return&lt;/span&gt; handled;
    }&lt;/code&gt;&lt;/pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 16px; line-height: normal;&quot;&gt;There was&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;only one solution in my head -&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;&amp;nbsp;create&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;class&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;based on the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Spinner&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and cut off&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;his&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;metod performClick&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;().&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;But the difficulty&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;lies in the fact&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that the reference to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialogue&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;Spinner&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is stored in the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;private variable&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;mPopup.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;This problem&lt;/span&gt;, we went around,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;using reflection&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to access this&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;variable&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;after you create&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the dialog&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;call&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the method&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;necessary&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to set the properties&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialog&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to properly display&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it full screen&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;To increase the security&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;this&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;method for the solution&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to our problem,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;we&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;abstracted&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;from&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the field name&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;mPopup&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;just&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the cycle of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;looking for&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a variable of type&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;AlertDialog,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;so&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;even&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;if the developers&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;change the name&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of the variable&lt;/span&gt;&lt;span class=&quot;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;will work.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Here is the code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of the new class&lt;/span&gt;&lt;span class=&quot;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-size: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;package&lt;/span&gt; maximyudin.spinnerbug;
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; java.lang.reflect.Field;&lt;/code&gt;&lt;code class=&quot;java&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #f8f8f8; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; display: block; font-size: 12px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.app.AlertDialog;
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.content.Context;
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.util.AttributeSet;
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.view.WindowManager;
&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;import&lt;/span&gt; android.widget.Spinner;

&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;class&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;title&quot; style=&quot;color: black;&quot;&gt;NoTitleSpinner&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;title&quot; style=&quot;color: black;&quot;&gt;Spinner&lt;/span&gt; {&lt;/span&gt;
    &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; NoTitleSpinner(Context context, AttributeSet attrs, &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;int&lt;/span&gt; defStyle) {
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;super&lt;/span&gt;(context, attrs, defStyle);
    }

    &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; NoTitleSpinner(Context context, AttributeSet attrs) {
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;super&lt;/span&gt;(context, attrs);
    }

    &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; NoTitleSpinner(Context context) {
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;super&lt;/span&gt;(context);
    }

    &lt;span class=&quot;annotation&quot; style=&quot;color: olive;&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;boolean&lt;/span&gt; performClick() {
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;boolean&lt;/span&gt; status = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;super&lt;/span&gt;.performClick();
        Field privateStringField = &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;;
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;try&lt;/span&gt; {
            Field[] fields = Spinner.&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt;.getDeclaredFields();
            &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;for&lt;/span&gt; (Field field : fields) {
                &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (field.getType().getName()
                        .equals(AlertDialog.&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;class&lt;/span&gt;.getName())) {
                    privateStringField = field;
                    &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;break&lt;/span&gt;;
                }
            }
            &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;if&lt;/span&gt; (privateStringField == &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;null&lt;/span&gt;) {
                &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;false&lt;/span&gt;;
            }

            privateStringField.setAccessible(&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;true&lt;/span&gt;);
            AlertDialog dialog = (AlertDialog) privateStringField.get(&lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;this&lt;/span&gt;);
            dialog.getWindow().setFlags(
                    WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;catch&lt;/span&gt; (IllegalArgumentException e) {
        } &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;catch&lt;/span&gt; (IllegalAccessException e) {
        }
        &lt;span class=&quot;keyword&quot; style=&quot;color: #4d7386;&quot;&gt;return&lt;/span&gt; status;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Now &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;instead of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Spinner&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;you&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;need&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;to use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;our&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;NoTitleSpinner&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Fully&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;project code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;posted&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;&lt;a href=&quot;http://dl.dropbox.com/u/2158590/SpinnerBug.zip&quot;&gt;here&lt;/a&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;P.S.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;We&#39;ve added&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;this bug&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;bug-report&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;-&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;follow the news&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;here&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&amp;nbsp;—&amp;nbsp;&lt;/b&gt;&lt;a href=&quot;http://code.google.com/p/android/issues/detail?id=11419&quot;&gt;code.google.com/p/android/issues/detail?id=11419&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/7354314091248947335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/7354314091248947335'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/bug-in-android-or-problem-with-spinner.html' title='A bug in Android or problem with Spinner in full screen mode'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-2486224064401144397</id><published>2011-09-29T10:11:00.000-07:00</published><updated>2011-09-29T10:18:26.423-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="dialogue"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="list adapter"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>Android dialog box with icons in the menu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;The idea&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;was conceived&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Insanely&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;simple&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;would even say&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;stupid&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;And when I&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;started&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;to do something&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;here&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I wanted to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;do&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dramatically&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;beautiful&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialog box&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by selecting the&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;menu&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;icons.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Such a dialogue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is present&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the standard&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Android&lt;/span&gt;, for example,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a long&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;tap&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;on the desktop&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;opens the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialog&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to add&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;content (&lt;/span&gt;widget&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;oboiny&lt;/span&gt;, etc.).&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;So, welcome to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;cat&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;As mentioned&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;above,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in front of me&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;was to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;make&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a dialog box&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;like this:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;img src=&quot;http://a.imageshack.us/img830/3236/iconifizeddialogmenu.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Googling&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for a while and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;reading the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;official&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;docks on&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the platform&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;could not find&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;how to implement&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;such a dialogue&lt;/span&gt;&lt;span class=&quot;&quot;&gt;.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;After some time of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;digging&lt;/span&gt;, I found&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a result that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;will&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;most quickly&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;apparent to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;experienced&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Android&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;developers.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;The answer&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;was simple&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;he was lying&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;on the surface.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Its essence is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for the dialog&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;you just need to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;substitute the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Builder&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the appropriate&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;data provider&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;(&lt;/span&gt;of course&lt;span class=&quot;&quot;&gt;, the provider&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;must&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;write&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;themselves&lt;/span&gt;.)&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;So now&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;there will be some&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;amount of code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with comments&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;about what&lt;/span&gt;&#39;s going on.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;The list of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;(ISP)&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the possible types of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;accounts&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt;&amp;nbsp;AccountTypesProvider {&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;List&amp;lt;AccountType&amp;gt; accountTypes =&amp;nbsp;Collections.unmodifiableList(Arrays.asList(&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AccountType(AccountType.TWITTER_ACCOUNT,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Twitter&quot;&lt;/span&gt;, R.drawable.twitter_icon_big),&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AccountType(AccountType.FACEBOOK_ACCOUNT,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Facebook&quot;&lt;/span&gt;, R.drawable.facebook_icon_big),&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AccountType(AccountType.BUZZ_ACCOUNT,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Google Buzz&quot;&lt;/span&gt;, R.drawable.buzz_icon_big),&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AccountType(AccountType.LINKEDIN_ACCOUNT,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;LinkedIn&quot;&lt;/span&gt;, R.drawable.linkedin_icon_big),&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AccountType(AccountType.VKONTAKTE_ACOUNT,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;ВКонтакте&quot;&lt;/span&gt;, R.drawable.vkontakte_icon_big)&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;));&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/li&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/ol&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://virtser.net/blog/post/source-code-highlighter.aspx&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;Source Code Highlighter&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;This is a simple&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;wrapper&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;around&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a list&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of possible types of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;accounts.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Account Type&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a simple POJO&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;class that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;consists of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;an identifier (&lt;/span&gt;a constant),&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the name of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the service and&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;the resource identifier&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;icons&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for this type of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;service.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;ListAdapter&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;display a list of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;account types&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in a given&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;layout&#39;e&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;final&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt;&amp;nbsp;AccountsTypesListAdapter extends ArrayAdapter&amp;lt;AccountType&amp;gt; {&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;Activity context;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;List&amp;lt;AccountType&amp;gt; accountTypes;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;AccountsTypesListAdapter(Activity context, List&amp;lt;AccountType&amp;gt; accountTypes) {&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;super(context, R.layout.select_account_item, accountTypes);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.context = context;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.accountTypes = accountTypes;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;@Override&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;View getView(&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;position, View convertView, ViewGroup parent) {&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LayoutInflater inflater = context.getLayoutInflater();&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;View row = inflater.inflate(R.layout.select_account_item, parent,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TextView label = (TextView) row.findViewById(R.id.text_item);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;label.setText(accountTypes.get(position).title);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ImageView icon = (ImageView) row.findViewById(R.id.icon_item);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;icon.setImageResource(accountTypes.get(position).bigIconId);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;&amp;nbsp;row;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;}&lt;/li&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/ol&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://virtser.net/blog/post/source-code-highlighter.aspx&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;Source Code Highlighter&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;First you need&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to pass&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the constructor&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a list of types&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;will work&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the adapter&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;list.&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;Binding&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;specific&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;item&#39;a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;leyautu&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;occurs&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the overridden method&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;getView ().&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;It&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is loaded&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;leyaut&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the specified resource&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is retrieved&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;widgets and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;they&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;recorded&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;data on&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a particular element&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of the list.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Incidentally, the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;index of that element&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is automatically available&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;through the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;option&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;position.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;This&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;list&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;adapter&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;works with&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;just such a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;layout&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;?&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:orientation&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;horizontal&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:padding&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;10px&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ImageView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/icon_item&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;TextView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;@+id/text_item&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;wrap_content&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;fill_parent&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:paddingLeft&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;10px&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:paddingTop&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;5px&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:textStyle&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;bold&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;android:textColor&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;#000000&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/ol&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://virtser.net/blog/post/source-code-highlighter.aspx&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;Source Code Highlighter&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: whitesmoke; color: #333333; font-family: arial, sans-serif; font-size: 16px; line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;All that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;now remains&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;- is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;designed&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to tie&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a sheet&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;-&lt;/span&gt;adapter&lt;span class=&quot;&quot;&gt;-specific&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;showSelectAccountTypeDialog(Activity context, String title, OnClickListener dialogListener) {&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AlertDialog.Builder builder =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AlertDialog.Builder(context);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;builder.setTitle(title);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;builder.setAdapter(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;AccountsTypesListAdapter(context, AccountTypesProvider.accountTypes), dialogListener);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;builder.create().show();&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/ol&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://virtser.net/blog/post/source-code-highlighter.aspx&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;Source Code Highlighter&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;and call&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;activity&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;dialogue&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the right place&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol style=&quot;list-style-image: initial; list-style-position: initial; list-style-type: decimal; margin-bottom: 1.5em; margin-left: 3em; margin-right: 1em; margin-top: 1.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;displaySelectAccountTypeDialog() {&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ApplicationDialogs.showSelectAccountTypeDialog(&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Select network&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt;&amp;nbsp;OnClickListener() {&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;@Override&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&amp;nbsp;onClick(DialogInterface dialogInterface,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;nbsp;selectedItemId) {&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setupAccount(selectedItemId);&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/ol&gt;&lt;code style=&quot;font-size: 1em;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;* This source code was highlighted with&amp;nbsp;&lt;a href=&quot;http://virtser.net/blog/post/source-code-highlighter.aspx&quot; style=&quot;color: #6da3bd;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;Source Code Highlighter&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Dialogue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;after its completion&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;will return&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the index of the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;parameter&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;item&#39;a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;selectedItemId&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the listener&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, which is specified&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;when calling the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialogue.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;In this simple&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;case, this&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;coincides with the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;ID&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;type of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;account (&lt;/span&gt;item&#39;a&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the list)&lt;/span&gt;, so no&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;additional&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;changes&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;or&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;extractions&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;are required.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;For my&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;problem&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the index&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is more than enough&lt;/span&gt;.&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit; font-size: small;&quot;&gt;In the end, I turned a nice dialogue&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;img src=&quot;http://a.imageshack.us/img829/8237/selectaccounttypepopupmc.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2486224064401144397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2486224064401144397'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/android-dialog-box-with-icons-in-menu.html' title='Android dialog box with icons in the menu'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-5347420418329443714</id><published>2011-09-28T15:54:00.000-07:00</published><updated>2011-09-28T15:57:18.690-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="customization"/><category scheme="http://www.blogger.com/atom/ns#" term="NumberPicker"/><category scheme="http://www.blogger.com/atom/ns#" term="widget"/><title type='text'>NumberPicker use and customization of its appearance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Probably&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;many&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of you have used&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;widgets such&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;DatePicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;TimePicker.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;But the functionality&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;widget&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is limited&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;ability to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;choose the date&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and time, but&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;wanted more&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;- to use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;this feature&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to select&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;any number&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in a specified range&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;(as in&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;kontroleNumericUpDown&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;C #).&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Such a possibility&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;exists.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;DatePicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;widget&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;hps atn&quot;&gt;system-&lt;/span&gt;&lt;span class=&quot;&quot;&gt;based&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;TimePicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;widget&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;NumberPicker,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;you&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;can not use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the box.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;To use it you&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;need to write a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;little&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;code.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;First, add&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;NumberPicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;our main&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;layout, xml-&lt;/span&gt;&lt;span class=&quot;&quot;&gt;code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is as follows:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit; font-size: small;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;RelativeLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;&lt;a href=&quot;http://schemas.android.com/apk/res/android%22&quot; style=&quot;color: #6da3bd;&quot;&gt;schemas.android.com/apk/res/android&quot;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;com.android.internal.widget.NumberPicker&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@+id/numTestNumberPicker&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_centerInParent&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;/com.android.internal.widget.NumberPicker&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;/RelativeLayout&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;We&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;have 3&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;NumberPicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;method&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that we need&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;setRange, getCurrent&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;setCurrent.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I guess&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by the names of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the methods&lt;/span&gt;, it is clear&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;they do.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The difficulty is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that these methods&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;are hidden&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for the developer&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;they can only&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;call&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;using reflection&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;For ease of use&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, I wrote a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;helper-&lt;/span&gt;class that&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;allows you to work&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with these methods.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Class code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is shown below:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;package&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;maximyudin.NumberPickerDemo&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;java.lang.reflect.Method&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;&amp;nbsp;NumberPicker&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Object&lt;/span&gt;&amp;nbsp;picker&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;private&lt;/span&gt;&amp;nbsp;Class&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;?&amp;gt;&lt;/span&gt;&amp;nbsp;classPicker&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;NumberPicker&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Object&lt;/span&gt;&amp;nbsp;o&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;picker&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;o&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;classPicker&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;picker.&lt;span style=&quot;color: #006633;&quot;&gt;getClass&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;void&lt;/span&gt;&amp;nbsp;setRange&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;start,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;end&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;try&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Method&lt;/span&gt;&amp;nbsp;m&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;classPicker.&lt;span style=&quot;color: #006633;&quot;&gt;getMethod&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;setRange&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m.&lt;span style=&quot;color: #006633;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;picker,&amp;nbsp;start,&amp;nbsp;end&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;e&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Integer&lt;/span&gt;&amp;nbsp;getCurrent&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Integer&lt;/span&gt;&amp;nbsp;current&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;try&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Method&lt;/span&gt;&amp;nbsp;m&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;classPicker.&lt;span style=&quot;color: #006633;&quot;&gt;getMethod&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;getCurrent&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;current&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;m.&lt;span style=&quot;color: #006633;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;picker&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;e&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;return&lt;/span&gt;&amp;nbsp;current&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;void&lt;/span&gt;&amp;nbsp;setCurrent&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;current&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;try&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Method&lt;/span&gt;&amp;nbsp;m&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;classPicker.&lt;span style=&quot;color: #006633;&quot;&gt;getMethod&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;setCurrent&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m.&lt;span style=&quot;color: #006633;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;picker,&amp;nbsp;current&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;e&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;In&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;konstrukture&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;class&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;passed&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a real object&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;NumberPicker (&lt;/span&gt;which&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;LinearLayout),&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;obtained&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;by&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;findViewById&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;our main&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;layout.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Consider&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;how to use&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;freshly&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;NumberPicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in practice.&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;package&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;maximyudin.NumberPickerDemo&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;android.app.Activity&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;android.os.Bundle&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;android.widget.LinearLayout&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;&amp;nbsp;NumberPickerDemo&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;extends&lt;/span&gt;&amp;nbsp;Activity&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;void&lt;/span&gt;&amp;nbsp;onCreate&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;Bundle&amp;nbsp;savedInstanceState&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;super&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;savedInstanceState&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setContentView&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;layout&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LinearLayout&amp;nbsp;numTestNumberPickerView&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;LinearLayout&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;findViewById&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;id&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;numTestNumberPicker&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NumberPicker&amp;nbsp;numTestNumberPickerObject&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;NumberPicker&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;numTestNumberPickerView&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;numTestNumberPickerObject.&lt;span style=&quot;color: #006633;&quot;&gt;setRange&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;numTestNumberPickerObject.&lt;span style=&quot;color: #006633;&quot;&gt;setCurrent&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;currentPos&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;numTestNumberPickerObject.&lt;span style=&quot;color: #006633;&quot;&gt;getCurrent&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Basically all&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;quite simple&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;when using the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;helper-&lt;/span&gt;&lt;span class=&quot;&quot;&gt;class.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The screen&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;looks as follows&lt;/span&gt;&lt;span class=&quot;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://androidforums.ru/uploads/monthly_05_2010/post-2-1273604101.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span title=&quot;Теперь приступим ко второй части статьи — полноценному изменению внешнего вида виджета.&quot;&gt;We now proceed to the second part of the article - full change in the appearance of the widget.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Для этого используется набор заранее подготовленных мной изображений (из моей программы MyTasks) различных состояний кнопок (&#39;+&#39; и &#39;-&#39;) и текстового поля виджета, именно из них состоит NumberPicker.&quot;&gt;For this purpose, a set of prepared me pictures (from my program MyTasks) different states of the buttons (&#39;+&#39; and &#39;-&#39;) and a text field widget, it is from them is NumberPicker.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Взять их можноотсюда.&quot;&gt;Get them mozhnootsyuda.&lt;/span&gt;&lt;span title=&quot;.&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Изображения представлены в формате Nine-Patch (9-Patch), такой тип изображений может растягиваться в зависимости, например, от их контента, они часто применяются для установки фона различных виджетов, в том числе и в моем случае.&quot;&gt;The images presented in a format Nine-Patch (9-Patch), a type of image can be stretched, depending, for example, of their content, they are often used to set the background of various widgets, including in my case.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Подробней о 9-Patch вы можете прочитать тут.&quot;&gt;More information on the 9-Patch you can read here.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Изображения необходимо положить в папку drawable, либо в папку drawable-mdpi (-ldpi, -hdpi), как в моем случае.&quot;&gt;Images need to put it in the drawable, or a folder drawable-mdpi (-ldpi,-hdpi), as in my case.&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Для того, чтобы эти изображения заработали нужным нам способом (то бишь реагировали на различные состояния виджетов) необходимо сформировать три xml-файла в селектор-формате (по файлу на каждый виджет — две кнопки и текстовое поле).&quot;&gt;In order to fit these images have earned us a way (that is responsive to the different states of widgets) necessary to form three xml-file-selector in the format (a file on each widget - two buttons and a text box).&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Селектор представляет собой набор элементов с атрибутами, которые обозначают различные состояния виджета (выбран, нажат, неактивный и т.д.).&quot;&gt;The selector is a set of elements with attributes, which represent different states of the widget (selected, pressed, inactive, etc.).&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Эти файлы вы также должны поместить в папку drawable, либо drawable-mdpi (-ldpi, -hdpi).&quot;&gt;These files can also be placed under the drawable, or drawable-mdpi (-ldpi,-hdpi).&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Ниже представлены эти три файла.&quot;&gt;Below are the three files.&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Для кнопки &#39;+&#39; (timepicker_up_btn.xml)&quot;&gt;&lt;b&gt;Button for &#39;+&#39; (timepicker_up_btn.xml)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;selector&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;&lt;a href=&quot;http://schemas.android.com/apk/res/android%22&quot; style=&quot;color: #6da3bd;&quot;&gt;schemas.android.com/apk/res/android&quot;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_up_picker_notselected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_up_picker_pressed&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_up_picker_selected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_up_picker_disabled&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_up_picker_disabled_focus&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;/selector&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;For a text box&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;(ed_picker_background.xml)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;selector&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;&lt;a href=&quot;http://schemas.android.com/apk/res/android%22&quot; style=&quot;color: #6da3bd;&quot;&gt;schemas.android.com/apk/res/android&quot;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_window_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/edit_picker_notselected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;﻿&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_window_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/edit_picker_notselected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/edit_picker_pressed&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/edit_picker_selected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/edit_picker_notselected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/edit_picker_notselected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/edit_picker_notselected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;/selector&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;For&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;button&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;&#39;-&#39; (timepicker_down_btn.xml)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;selector&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;&lt;a href=&quot;http://schemas.android.com/apk/res/android%22&quot; style=&quot;color: #6da3bd;&quot;&gt;schemas.android.com/apk/res/android&quot;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_down_picker_notselected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_down_picker_pressed&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_down_picker_selected&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_down_picker_disabled&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;item&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_pressed&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_enabled&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:state_focused&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:drawable&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@drawable/btn_down_picker_disabled_focus&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;/selector&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Now we need to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;slightly modify&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the constructor&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;helper-&lt;/span&gt;class&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that was created&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;NumberPicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;at the outset.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;This will allow us&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to create&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;an object&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;NumberPicker&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;change the appearance of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;its components.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The code&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of the modified&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;class&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is shown below.&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;package&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;maximyudin.NumberPickerDemo&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;java.lang.reflect.Method&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;android.view.View&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;android.widget.EditText&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;import&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #006699;&quot;&gt;android.widget.LinearLayout&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;&amp;nbsp;NumberPicker&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Object&lt;/span&gt;&amp;nbsp;picker&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;private&lt;/span&gt;&amp;nbsp;Class&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;?&amp;gt;&lt;/span&gt;&amp;nbsp;classPicker&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;NumberPicker&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;LinearLayout&amp;nbsp;numberPickerView&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;picker&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;numberPickerView&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;classPicker&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;picker.&lt;span style=&quot;color: #006633;&quot;&gt;getClass&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #666666;&quot;&gt;//&amp;nbsp;Кнопка&amp;nbsp;&#39;+&#39;,&amp;nbsp;тип&amp;nbsp;-&amp;nbsp;NumberPickerButton&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;View&lt;/span&gt;&amp;nbsp;upButton&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;numberPickerView.&lt;span style=&quot;color: #006633;&quot;&gt;getChildAt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;upButton.&lt;span style=&quot;color: #006633;&quot;&gt;setBackgroundResource&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;drawable&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;timepicker_up_btn&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #666666;&quot;&gt;//&amp;nbsp;Текстовое&amp;nbsp;поле,&amp;nbsp;тип&amp;nbsp;-&amp;nbsp;EditText&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EditText&amp;nbsp;edDate&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;EditText&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;numberPickerView.&lt;span style=&quot;color: #006633;&quot;&gt;getChildAt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;edDate.&lt;span style=&quot;color: #006633;&quot;&gt;setTextSize&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;17&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;edDate.&lt;span style=&quot;color: #006633;&quot;&gt;setBackgroundResource&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;drawable&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;ed_picker_background&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #666666;&quot;&gt;//&amp;nbsp;Кнопка&amp;nbsp;&#39;-&#39;,&amp;nbsp;тип&amp;nbsp;-&amp;nbsp;NumberPickerButton&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;View&lt;/span&gt;&amp;nbsp;downButton&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;numberPickerView.&lt;span style=&quot;color: #006633;&quot;&gt;getChildAt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;downButton.&lt;span style=&quot;color: #006633;&quot;&gt;setBackgroundResource&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;drawable&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;timepicker_down_btn&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;void&lt;/span&gt;&amp;nbsp;setRange&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;start,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;end&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;try&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Method&lt;/span&gt;&amp;nbsp;m&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;classPicker.&lt;span style=&quot;color: #006633;&quot;&gt;getMethod&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;setRange&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m.&lt;span style=&quot;color: #006633;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;picker,&amp;nbsp;start,&amp;nbsp;end&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;e&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Integer&lt;/span&gt;&amp;nbsp;getCurrent&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Integer&lt;/span&gt;&amp;nbsp;current&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;try&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Method&lt;/span&gt;&amp;nbsp;m&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;classPicker.&lt;span style=&quot;color: #006633;&quot;&gt;getMethod&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;getCurrent&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;current&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;m.&lt;span style=&quot;color: #006633;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;picker&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;e&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;return&lt;/span&gt;&amp;nbsp;current&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;void&lt;/span&gt;&amp;nbsp;setCurrent&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;&amp;nbsp;current&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;try&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #003399;&quot;&gt;Method&lt;/span&gt;&amp;nbsp;m&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;classPicker.&lt;span style=&quot;color: #006633;&quot;&gt;getMethod&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;setCurrent&quot;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;int&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m.&lt;span style=&quot;color: #006633;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;picker,&amp;nbsp;current&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;catch&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #003399;&quot;&gt;Exception&lt;/span&gt;&amp;nbsp;e&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;The result is shown&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the figure below&lt;/span&gt;&lt;span class=&quot;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;div class=&quot;content&quot; style=&quot;font: normal normal normal 1.083em/1.54em Verdana, sans-serif; margin-bottom: 0.83em; margin-left: 35px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://androidforums.ru/uploads/monthly_05_2010/post-2-1273604390.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dl.dropbox.com/u/2158590/Articles/NumberPickerDemo.zip&quot; style=&quot;color: #6da3bd;&quot;&gt;Full project source&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;In this&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;article of mine&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is complete&lt;/span&gt;, I hope&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I helped you&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;learn something&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;new.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Waiting for&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;comments&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;amendments, if&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;there is someone to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;offer.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/5347420418329443714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/5347420418329443714'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/numberpicker-use-and-customization-of.html' title='NumberPicker use and customization of its appearance'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-4909474841394896482</id><published>2011-09-28T12:31:00.001-07:00</published><updated>2011-09-28T15:05:54.730-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="User interface"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>How to make android user interfase (UI) more easy</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;gt-res-wrap&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; border-bottom-color: rgb(245, 245, 245); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(245, 245, 245); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(245, 245, 245); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(245, 245, 245); border-top-style: solid; border-top-width: 1px;&quot;&gt;&lt;div class=&quot;almost_half_cell&quot; id=&quot;gt-res-content&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;zoom: 1;&quot;&gt;&lt;span class=&quot;&quot; id=&quot;result_box&quot; lang=&quot;en&quot; style=&quot;display: block; font-size: 16px; min-height: 93px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;I thought that&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;it would be nice&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to have a program&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;/&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;​​site&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to automatically generate&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;UI&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;simply &lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;drag and drop&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;items.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I found&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.blogger.com/%C2%A0http://www.droiddraw.org/&quot;&gt;this.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;&lt;i&gt;Have a nice day!&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;gt-res-tools&quot; style=&quot;background-color: whitesmoke; color: #888888; height: 26px; margin-top: -7px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 0px;&quot;&gt;&lt;div id=&quot;gt-src-tools-l&quot; style=&quot;float: left;&quot;&gt;&lt;/div&gt;&lt;div id=&quot;gt-res-tools-r&quot; style=&quot;float: right;&quot;&gt;&lt;div id=&quot;gt-res-rate&quot; style=&quot;float: left;&quot;&gt;&lt;div aria-haspopup=&quot;true&quot; class=&quot;goog-inline-block goog-toolbar-menu-button&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; background-attachment: initial; background-clip: initial; background-color: initial; background-image: initial; background-origin: initial; background-position: 0px 50%; background-repeat: initial initial; border-bottom-color: transparent; border-bottom-left-radius: 2px 2px; border-bottom-right-radius: 2px 2px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: transparent; border-left-style: solid; border-left-width: 1px; border-right-color: transparent; border-right-style: solid; border-right-width: 1px; border-top-color: transparent; border-top-left-radius: 2px 2px; border-top-right-radius: 2px 2px; border-top-style: solid; border-top-width: 1px; color: #444444; cursor: default; display: inline-block; font-size: 11px; font-weight: bold; height: 24px; line-height: 24px; list-style-image: initial; list-style-position: initial; list-style-type: none; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; text-decoration: none; vertical-align: middle;&quot; tabindex=&quot;0&quot; title=&quot;&quot;&gt;&lt;div class=&quot;goog-inline-block goog-toolbar-menu-button-outer-box&quot; style=&quot;display: inline-block; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative;&quot;&gt;&lt;div class=&quot;goog-inline-block goog-toolbar-menu-button-inner-box&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; display: inline-block; padding-bottom: 0px; padding-left: 2px; padding-right: 2px; padding-top: 0px; position: relative; vertical-align: top;&quot;&gt;&lt;div class=&quot;goog-inline-block goog-toolbar-menu-button-caption&quot; style=&quot;display: inline-block; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative;&quot;&gt;&lt;span class=&quot;goog-flat-menu-button-img gt-rate-icon jfk-button-img&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://www.gstatic.com/translate/buttons6.png); background-origin: initial; background-position: -94px -3px; background-repeat: no-repeat no-repeat; display: inline-block; height: 21px; margin-top: -3px; opacity: 0.667; vertical-align: middle; width: 21px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4909474841394896482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/4909474841394896482'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/how-to-make-android-user-interfase-ui.html' title='How to make android user interfase (UI) more easy'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-2955518632143457084</id><published>2011-09-28T11:27:00.000-07:00</published><updated>2011-09-28T15:06:58.676-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="toast"/><title type='text'>User notification: Toast</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span style=&quot;background-color: white;&quot; title=&quot;Начинаю цикл статей о способах оповещения пользователя.&quot;&gt;Hi!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span title=&quot;Начинаю цикл статей о способах оповещения пользователя.&quot;&gt;I&#39;m begining a series of articles about how to alert the user.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Цикл рассчитан на новичков.&quot;&gt;Course is designed for beginners.&lt;/span&gt;&lt;span title=&quot;Существует три способа оповещения пользователя: через Toast, через Notification и через различные виды Dialog.&quot;&gt;There are three ways to alert the user: Toast, Notification and through different types of Dialog.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Сегодня я расскажу об использовании первого типа оповещения — Toast.&quot;&gt;Today I will discuss of the first type of warning - Toast.&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Введение&quot;&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Toast представляет собой всплывающее сообщение, которое позволяет быстро оповестить пользователя о произошедшем событии, например, сохранении настроек программы на SD-карте.&quot;&gt;Toast is a pop-up window that allows you to quickly notify the user about the event has occurred, such as maintaining the program settings to SD-card.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Особенность Toast заключается в том, что во время появления сообщения пользователь может взаимодействовать с находящимися за ним Activity, либо с домашним экраном (home screen).&quot;&gt;Toast feature is that during the message, the user can interact with them is behind Activity, or with a home screen (home screen).&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Также стоит заметить, что пользователь не может контролировать закрытие Toast с помощью аппаратной кнопки Back или другими возможными способами, сообщение плавно появляется и потом само же плавно исчезает.&quot;&gt;Also worth noting that the user can not control the closing of Toast with hardware Back button or other possible means, the message appears and then smoothly itself as smoothly disappears.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Время задержки между появлением и исчезновением можно задавать программно.&quot;&gt;The time delay between the appearance and disappearance can be set programmatically.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;В большинстве случаев Toast представляет собой короткое сообщение, но присутствует возможность задать произвольный внешний вид Toast, например, добавить изображение рядом с текстом.&quot;&gt;In most cases, Toast is a short message, but there is an opportunity to ask any appearance of Toast, for example, add an image next to the text.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Помимо этого можно управлять расположением Toast на экране.&quot;&gt;In addition, you can control the location of Toast on the screen.&lt;/span&gt;&lt;span title=&quot;Toast может быть создан из Activity, либо из Service.&quot;&gt;Toast can be created from an Activity, or from the Service.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;В случае создания из сервиса Toast появляется поверх Activity, которое имеет фокус, либо поверх домашнего экрана.&quot;&gt;In the case of a service Toast appears on top of Activity, which has the focus, or top of the home screen.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span title=&quot;В случае создания из сервиса Toast появляется поверх Activity, которое имеет фокус, либо поверх домашнего экрана.&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Создание простого Toast&quot;&gt;&lt;b&gt;Create a simple Toast&lt;/b&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Создать простой Toast можно через статичный метод makeText класса Toast, задав необходимые параметры.&quot;&gt;Create a simple Toast can be a static method of class makeText Toast, setting the necessary parameters.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; font-family: arial, sans-serif;&quot;&gt;Toast.&lt;span style=&quot;color: #006633;&quot;&gt;makeText&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;getApplicationContext&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Привет,&amp;nbsp;мир!&quot;&lt;/span&gt;,&amp;nbsp;Toast.&lt;span style=&quot;color: #006633;&quot;&gt;LENGTH_SHORT&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;The details&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;given&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;application context&lt;/span&gt;, the message&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;delay&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;wrote about&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;earlier.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The message can&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;be set&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;directly&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in the form of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;text,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;or&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;using a text&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;-&lt;/span&gt;line&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;resource&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for example&lt;/span&gt;, R.string.hello_world,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;which stores&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the text to be&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;displayed,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in this case,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;&quot;Hello,&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;world!&lt;/span&gt;&quot;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The delay may&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;be short&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;- LENGTH_SHORT,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;or&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;long&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;- LENGTH_LONG.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;By default, the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is given&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a short delay&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The software&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;delay&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is given&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;setDuration.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;The essence&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;of the method&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;makeText&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is:&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;inside the method&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;creates an&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;set&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the text and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;type of delay&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Further,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the object&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;can be either&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;used&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as in my case&lt;/span&gt;, the method&lt;span class=&quot;hps&quot;&gt;show,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;which displays&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;created by&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;or&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;set&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;additional properties&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for example&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, its location&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;on the screen&lt;/span&gt;, or&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;you create&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the look&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;created&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as follows:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://androidforums.ru/uploads/monthly_02_2010/post-2-1267013667.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;Change the position of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;on the screen&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;location&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;specified&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by the method&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;setGravity&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as follows&lt;/span&gt;:&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;Toast&amp;nbsp;toast&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;Toast.&lt;span style=&quot;color: #006633;&quot;&gt;makeText&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;getApplicationContext&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Привет,&amp;nbsp;мир!&quot;&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;Toast.&lt;span style=&quot;color: #006633;&quot;&gt;LENGTH_LONG&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;setGravity&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;Gravity.&lt;span style=&quot;color: #006633;&quot;&gt;CENTER&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span title=&quot;Первый параметр метода задает выравнивание, вариантов которого довольно много в классе Gravity.&quot;&gt;The first parameter sets the alignment method, versions of which quite a lot in the class of Gravity.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Второй и третий параметры задают на сколько пикселей будет смещен Toast по горизонтали вправо и по вертикали вниз соответственно относительно значения, заданного в первом параметре.&quot;&gt;The second and third parameters specify how many pixels will be shifted horizontally to the right Toast and vertically downward, respectively, relative to the value in the first parameter.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Результат приведенного выше кода отображается следующим образом:&quot;&gt;The result of the above code displays as follows:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://androidforums.ru/uploads/monthly_02_2010/post-2-1267013673.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span title=&quot;Добавление изображения в простой Toast&quot;&gt;&lt;b&gt;Adding images in an easy Toast&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span title=&quot;Для добавления изображения в стандартный Toast потребуется программно создать объект класса ImageView и задать для него изображение из ресурсов с помощью метода setImageResource.&quot;&gt;To add an image in standard Toast software required to create an object of class ImageView and ask for a picture of the resources using the setImageResource.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Затем потребуется получить стандартный внешний вид Toast, если посмотреть в отладчике он является LinearLayout, и добавить в него созданный объект ImageView с указанием в какую позицию добавить изображение, в моем случае я указал нулевую позицию, чтобы изображение было добавлено выше текста.&quot;&gt;You will then get the standard look of Toast, if you look in the debugger it is LinearLayout, and add the created object ImageView showing in what position to add a picture, in my case I have a zero position so that the image has been added above the text.&amp;nbsp;&lt;/span&gt;&lt;span title=&quot;Код для создания этого Toast с изображением представлен ниже.&quot;&gt;Code to create this image with Toast is presented below.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;Toast&amp;nbsp;toast&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;Toast.&lt;span style=&quot;color: #006633;&quot;&gt;makeText&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;getApplicationContext&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Привет,&amp;nbsp;мир!&quot;&lt;/span&gt;,&amp;nbsp;Toast.&lt;span style=&quot;color: #006633;&quot;&gt;LENGTH_LONG&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;setGravity&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;Gravity.&lt;span style=&quot;color: #006633;&quot;&gt;CENTER&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;LinearLayout&amp;nbsp;toastView&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;LinearLayout&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;toast.&lt;span style=&quot;color: #006633;&quot;&gt;getView&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;ImageView&amp;nbsp;imageWorld&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;ImageView&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;getApplicationContext&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;imageWorld.&lt;span style=&quot;color: #006633;&quot;&gt;setImageResource&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;drawable&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;world&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toastView.&lt;span style=&quot;color: #006633;&quot;&gt;addView&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;imageWorld,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;thus created&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is as follows:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://androidforums.ru/uploads/monthly_02_2010/post-2-1267013684.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the creation of complex&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;hps&quot;&gt;To create a complex&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to create your own&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;layout,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;code is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as follows:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:android&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;&lt;a href=&quot;http://schemas.android.com/apk/res/android%22&quot; style=&quot;color: #6da3bd;&quot;&gt;schemas.android.com/apk/res/android&quot;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:background&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;#ffffffff&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:orientation&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@+id/llToast&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;TextView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_margin&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1dip&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:textColor&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;#ffffffff&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:gravity&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:background&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;#bb000000&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@+id/tvTitleToast&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;/TextView&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:orientation&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@+id/llToastContent&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_marginLeft&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1dip&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_marginRight&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1dip&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_marginBottom&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;1dip&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:padding&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;15dip&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:background&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;#44000000&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;ImageView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_gravity&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;center&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@+id/tvImageToast&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;TextView&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_height&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:paddingRight&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;10dip&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:paddingLeft&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;10dip&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:layout_width&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:gravity&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;background-color: white; color: #009900;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:textColor&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;#ff000000&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: red;&quot;&gt;&quot;@+id/tvTextToast&quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;background-color: white; color: black;&quot;&gt;&amp;lt;/LinearLayout&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;background-color: white; color: black;&quot;&gt;&amp;lt;/LinearLayout&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;I created a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;dialogue&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;with the headline&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;which is&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;located&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;inside&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the image and text&lt;/span&gt;.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;Now, this&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;layout&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is necessary to register&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;ask&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;for the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;message&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;title and text&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, and set&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the image.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;This is done&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as follows&lt;/span&gt;&lt;span class=&quot;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;border-left-color: rgb(187, 187, 187); border-left-style: solid; border-left-width: 2px; clear: both; margin-bottom: 0.83em; margin-left: 0px; margin-right: 0px; margin-top: 0.83em; padding-bottom: 0px; padding-left: 15px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;LayoutInflater&amp;nbsp;inflater&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;getLayoutInflater&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;span style=&quot;color: #003399;&quot;&gt;View&lt;/span&gt;&amp;nbsp;layout&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;inflater.&lt;span style=&quot;color: #006633;&quot;&gt;inflate&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;layout&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;toast&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;ViewGroup&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;findViewById&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;id&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;llToast&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;ImageView&amp;nbsp;image&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;ImageView&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;layout.&lt;span style=&quot;color: #006633;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;id&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;tvImageToast&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;image.&lt;span style=&quot;color: #006633;&quot;&gt;setImageResource&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;drawable&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;world&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;TextView&amp;nbsp;title&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;TextView&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;layout.&lt;span style=&quot;color: #006633;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;id&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;tvTitleToast&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;title.&lt;span style=&quot;color: #006633;&quot;&gt;setText&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Внимание&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;TextView&amp;nbsp;text&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;TextView&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&amp;nbsp;layout.&lt;span style=&quot;color: #006633;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;R.&lt;span style=&quot;color: #006633;&quot;&gt;id&lt;/span&gt;.&lt;span style=&quot;color: #006633;&quot;&gt;tvTextToast&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;text.&lt;span style=&quot;color: #006633;&quot;&gt;setText&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;Привет,&amp;nbsp;мир!&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;Toast&amp;nbsp;toast&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: black;&quot;&gt;new&lt;/span&gt;&amp;nbsp;Toast&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;getApplicationContext&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;setGravity&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;Gravity.&lt;span style=&quot;color: #006633;&quot;&gt;RIGHT&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: #339933;&quot;&gt;|&lt;/span&gt;&amp;nbsp;Gravity.&lt;span style=&quot;color: #006633;&quot;&gt;TOP&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;12&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: #cc66cc;&quot;&gt;40&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;setDuration&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;Toast.&lt;span style=&quot;color: #006633;&quot;&gt;LENGTH_LONG&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;setView&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;layout&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;toast.&lt;span style=&quot;color: #006633;&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;span class=&quot;hps&quot;&gt;The first two lines&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;are initialized&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by filling&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the View object&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;xml-file&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;from&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;(&lt;/span&gt;used for this&lt;span class=&quot;hps&quot;&gt;instance&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;LayoutInflater,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;obtained&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;by the method&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;getLayoutInflater),&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;created earlier.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The first parameter of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;inflate&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;sets the ID of&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;a previously created&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps atn&quot;&gt;layout - R.layout.toast (&lt;/span&gt;in&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;this case, it&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;corresponds to the file&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;res / layout / toast.xml).&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Then&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;obtained by&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;reference to the&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;&quot;&gt;, caption&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;text&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;messages&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;and filled with&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the desired data&lt;/span&gt;.&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Then&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;immediately&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;create a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;set&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the parameters and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;layout&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;as&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the one&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;prescribed&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;layout,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;which&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;we&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;initialized&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;earlier&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;this&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is done&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;using the&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;setView.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;The result of all&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;these manipulations&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;we&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;get&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;which looks like&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the figure below.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 13px; line-height: 20px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;image&quot; src=&quot;http://androidforums.ru/uploads/monthly_02_2010/post-2-1267013691.png&quot; style=&quot;max-width: 100%; vertical-align: bottom;&quot; /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 16px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;hps&quot;&gt;In this&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;first article&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;on how to&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;alert the user&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;is finished.&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;If you find a&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;mistake&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;or&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;want to add&lt;/span&gt;&lt;span class=&quot;hps&quot;&gt;some other&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;ways to work with&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;Toast,&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;write&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;comments, and&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;I will&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;add&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;your comments&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;in&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;hps&quot;&gt;the article.&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2955518632143457084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/2955518632143457084'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/hi-im-begining-series-of-articles-about.html' title='User notification: Toast'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-6070660098097351500</id><published>2011-09-28T10:26:00.000-07:00</published><updated>2011-09-28T15:07:26.387-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="google+"/><title type='text'>Google+ Now Open To All, With a Ton of New Features</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 22px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I woke up some days ago to a perfect storm of Google+ announcements. Firstly, the big news – Google+ is&amp;nbsp;&lt;a href=&quot;http://googleblog.blogspot.com/2011/09/google-92-93-94-95-96-97-98-99-100.html&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2e84db; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;Google+ announcement&quot;&gt;now available to anyone&lt;/a&gt;&amp;nbsp;with a Google account. No invite required. This is great news, as it lowers the barrier to entry significantly. I can now invite all my friends to join, and they can invite their friends, etc. Unfortunately it also means my&amp;nbsp;Google+ Invites app&amp;nbsp;&amp;nbsp;is now entirely obsolete. Well, that was fun while it lasted&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; border-color: initial; border-style: initial; font-style: inherit; height: auto;&quot;&gt;&lt;img alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; src=&quot;http://makingmoneywithandroid.com/wp-includes/images/smilies/icon_smile.gif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; height: auto; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; max-height: 13px; max-width: 610px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline;&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;But that’s not the only Google+ news. In&amp;nbsp;&lt;a href=&quot;http://googleblog.blogspot.com/2011/09/google-92-93-94-95-96-97-98-99-100.html&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2e84db; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;Google+ announcement&quot;&gt;the same blog post&lt;/a&gt;&amp;nbsp;Google announced a bunch of new Hangout features, including mobile video &amp;amp; publicly broadcast streams. Also, you’ll now be able to share your screen and/or Google Docs with Hangout participants (which puts Google+ squarely in the business arena). And we&amp;nbsp;&lt;em style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;finally&lt;/em&gt;&amp;nbsp;have the ability to search Google+! This has probably been the most requested feature, and the ability to search posts as well as people makes the service far more useful.&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;And just in case you weren’t impressed with those features – Google published another blog post a few minutes later&amp;nbsp;&lt;a href=&quot;http://googlemobile.blogspot.com/2011/09/google-101-102-103-104-105-106-107.html&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2e84db; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;Google+ features announcment&quot;&gt;announcing features 101 through 107&lt;/a&gt;. This includes a slew of mobile features, such as +mentions, the ability to +1 comments, and change your profile picture all from the mobile app. These are more incremental updates, but it’s great to see Google actively pushing development like this, and responding to the small features that people have been asking for. I don’t know any other Google product which has had so many feature updates in such a short period of time. Hopefully they continue to keep up the good work. I believe Google+ has huge potential, and it’s by far the most promising social service from Google yet.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Something interesting to note (in case you thought this post wasn’t related to Android development&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; border-color: initial; border-style: initial; font-style: inherit; height: auto;&quot;&gt;&lt;img alt=&quot;:-P&quot; class=&quot;wp-smiley&quot; src=&quot;http://makingmoneywithandroid.com/wp-includes/images/smilies/icon_razz.gif&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; height: auto; margin-bottom: 0px !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 0px !important; max-height: 13px; max-width: 610px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline;&quot; /&gt;&lt;/span&gt;&amp;nbsp;), Google seems to be having difficulty synchronizing feature releases between their Android and iOS apps. This stands to reason – Apple requires approval for updates in the App Store, while Google would have no delays releasing an app on the Android Market. But this is a significant area of concern for many developers. The more app stores you distribute to, the harder it becomes to keep them all up to date. The code base will differ between stores; content policy differs; and even product packaging has to be done differently. It’s worth taking note – Google doesn’t have it any easier.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Add me if you wish =)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;https://plus.google.com/100694486792208770526/posts&quot;&gt;https://plus.google.com/100694486792208770526/posts&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/6070660098097351500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/6070660098097351500'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/i-woke-up-some-days-ago-to-perfect.html' title='Google+ Now Open To All, With a Ton of New Features'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-687100213863894700</id><published>2011-09-28T10:03:00.000-07:00</published><updated>2011-09-28T15:08:45.076-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="android market"/><category scheme="http://www.blogger.com/atom/ns#" term="money"/><category scheme="http://www.blogger.com/atom/ns#" term="succes story"/><title type='text'>How to make $250 a day (and get banned from the Android Market)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;A few months ago&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 22px;&quot;&gt;I did something which, in retrospect, was probably rather stupid. But it was surprisingly successful while it lasted. As&amp;nbsp;I wrote earlier, I’ve been using&amp;nbsp;&lt;a href=&quot;http://plus.google.com/&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;Google+&quot;&gt;Google+&lt;/a&gt;&amp;nbsp;since the day after it was launched. I myself received an invite from a stranger who was offering invites publicly. For this reason, I’ve been keen to share invites with anyone else who’s looking for one. I put up&amp;nbsp;a post on this blog offering free invites, and got a huge response from the Android community. In fact, there were so many responses that it overwhelmed my email after a few days. There’s no way I could have kept up with the demand.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Rather than stop accepting requests altogether, I wanted to make it easier to handle the load.&lt;em style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;(NB: At this stage there was no limit to the number of Google+ invites you could send.)&lt;/em&gt;&amp;nbsp;My first thought, trying to work out a faster way to do things, was “hey, is there an Android app for this?” A quick search turned up a negative. No Android apps offering Google+ invites. So, why not make one? It seemed a pretty good idea, so I spent that afternoon writing a simple app that accepted an email address, and a description of the request. The data was sent to a PHP script on my server, so I could go through and invite the email addresses stored in a database.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Actually, it’s not that simple to write an Android app that POSTs data asynchronously to a server, checks the response, and handles errors gracefully. I re-used some classes from another unreleased project, but it was still a bigger job than I expected. But the actual coding is an issue for another day. The most interesting part came when I released the app on the Android Market.&lt;span id=&quot;more-493&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-style: inherit; font-weight: bold; letter-spacing: -2px; line-height: 40px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;First release&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I titled my app “Google+ Invites” – since that describes it pretty well. Because I was in a bit of a hurry, I decided to just modify the official Google+ logo, so that people could easily identify it as related to the social network. This is the logo that I came up with:&amp;nbsp;&lt;a href=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/web_hi_res_512.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;img alt=&quot;Logo for the Google+ Invites App&quot; class=&quot;alignnone size-medium wp-image-453&quot; height=&quot;300&quot; src=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/web_hi_res_512-300x300.png&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-style: none; border-color: initial; border-color: initial; border-left-style: none; border-right-style: none; border-style: initial; border-top-style: none; border-width: initial; font-style: inherit; height: auto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 610px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline;&quot; title=&quot;Google+ Invites&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;A little too similar to the original perhaps? Well, I thought it was a creative adaptation and went with it. Looking in retrospect, it wasn’t the wisest idea. But that’s how the app was initially released to the Android Market, on the 9th July. By the 10th July, the Developer Console was showing 326 installs. I thought that was pretty good – about the same amount as when I first released&amp;nbsp;my program. That number of installs, you can attribute to being in the “Just In” category. But this time, the downloads kept coming in. The next day there were another 300 installs. The day after, 500, then 700. By the 13th, this app had about 1,730 total installs.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;By this time, there were so many people asking for invites that I simply wasn’t able to complete them all. Even with a plain-text list of email addresses, inviting someone to Google+ was (at that stage) a very manual process. I had to copy &amp;amp; paste every email address, click “Invite”, and then add them to one of my circles so they could see my welcome post. So I was hit with the same dilemma I had offering invites on the blog – how to cut down the number of requests, or prioritise them somehow.&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-style: inherit; font-weight: bold; letter-spacing: -2px; line-height: 40px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;The “Points” System&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;In the back of my mind, I knew there was some kind of advertising network that used incentive advertising. For those not familiar with the terminology – in “normal” advertising streams, the advertiser pays the publisher (app developer) when a user clicks the ad. For obvious reasons, you’re not allowed to encourage people to click these ads. But with incentive advertising, you are. Because you don’t get paid when they click an ad – you get paid when they complete an action (such as signing up, downloading an app, etc.). Looking around a little bit, I found&lt;a href=&quot;http://www.tapjoy.com/&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;TapJoy Advertising&quot;&gt;TapJoy&lt;/a&gt;, which is a fairly well established incentive advertising network. The SDK is pretty easy to setup. You actually download the source files, and include them in your app TapJoy currently doesn’t offer a JAR library option, although I’d like to see this happen some time soon. Other networks such as&amp;nbsp;&lt;a href=&quot;http://www.admob.com/&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;AdMob advertising network&quot;&gt;AdMob&amp;nbsp;&lt;/a&gt;use the JAR method, and it’s a lot simpler to integrate with source control.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;wp-caption alignright&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; float: right; font-style: inherit; font-weight: bold; height: auto; margin-bottom: 10px; margin-left: 20px; margin-right: 0px; margin-top: 5px; max-width: 620px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px; text-align: center; vertical-align: baseline; width: 250px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/finished.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;img alt=&quot;Google+ Invites&quot; height=&quot;400&quot; src=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/finished.png&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-style: none; border-color: initial; border-color: initial; border-color: initial; border-left-style: none; border-right-style: none; border-style: initial; border-top-style: none; border-width: initial; font-style: inherit; height: auto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 610px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; title=&quot;Main App Screen&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;wp-caption-text&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Clicking &quot;Get Points&quot; loads the TapJoy offerwall&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Using TapJoy, I implemented a “points” system in my app. When someone downloads the app, they can submit their email address to request an invite immediately. But at this stage, they’ll be placed at the bottom of the queue. With about 2,000 invites to be processed, it could take a while to get one. If someone wants to get higher in the queue, they have to get more points.&amp;nbsp;&lt;strong style=&quot;font-weight: bold;&quot;&gt;You can earn points by completing offers on TapJoy&lt;/strong&gt;. This basically involves downloading a game, or “liking” something on Facebook. Simple tasks, mostly free, but the TapJoy pays me a small amount every time someone completes an offer. Using this method, I can hand out the first invites to people who are willing to put a bit of effort into to get one.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I’ve noticed that this system is a bit controversial. Some people see the money-making side of things, and say it’s all a scam to make profit. Well, sure – I’d love to make some profit from this app! It actually takes a lot of time to invite all those people. I don’t see anything wrong with offering people the option of paying (with their time) for priority access. I’ll still try to invite everyone, whether they’ve completed offers or not. Just the people with more points, will get processed first.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Basically I could choose between taking down the app from the Android Market due to high demand, or implementing this points system. So I opted to use TapJoy, as an experiment using incentive advertising. I actually included AdMob advertising in the same app, as a comparison. Didn’t really know what to expect, but it was a great chance to try a new system.&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-style: inherit; font-weight: bold; letter-spacing: -2px; line-height: 40px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;The Rise….&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;One day later, I got some pretty amazing results. Another 1000 downloads on the Android Market, 717 views of the TapJoy offerwall, and&amp;nbsp;&lt;strong style=&quot;font-weight: bold;&quot;&gt;a total of $20 from TapJoy alone&lt;/strong&gt;. In 24 hours, I made more from TapJoy than an entire month with AdMob. The eCPM for TapJoy was $28, while AdMob was about $0.10.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;But I thought, maybe it won’t last. Maybe that was just a spike, and we’ll see some slightly more sane figures come out tomorrow. The next day there were over 2,000 page views, and total revenue of $56. Doesn’t look like it was a spike after all. The eCPM was very similar. So, given the huge success of the TapJoy experiment so far, I kept inviting people on Google+, so that I could justify keeping the app on the Market. I thought $50 a day was amazing, certainly considering the amount of effort it took to write the app. I’d be more than happy if it kept up the pace, and didn’t grow any further at all. But there was even more of a surprise in store. Take a look at the graph below (&lt;em style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;left hand column&lt;/em&gt;), showing the download figures for the “Google+ Invites” app:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;wp-caption alignnone&quot; id=&quot;attachment_504&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; font-weight: bold; height: auto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 620px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px; text-align: center; vertical-align: baseline; width: 490px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/SC20110803-123112.jpeg&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;img alt=&quot;Screenshot of Andlytics&quot; class=&quot;size-full wp-image-504&quot; height=&quot;800&quot; src=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/SC20110803-123112.jpeg&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-style: none; border-color: initial; border-color: initial; border-color: initial; border-left-style: none; border-right-style: none; border-style: initial; border-top-style: none; border-width: initial; font-style: inherit; height: auto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 610px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; title=&quot;Google+ Invites Download Stats&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;wp-caption-text&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Columns (left-to-right): Date, Total Downloads, Active Installs, Increase day-over-day, Percentage Active (Screenshot taken with Andlytics app)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;And then look at the TapJoy revenue for the same period (up until July 17th):&amp;nbsp;&lt;a href=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/TapJoy.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-502&quot; height=&quot;358&quot; src=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/TapJoy.png&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-style: none; border-color: initial; border-color: initial; border-left-style: none; border-right-style: none; border-style: initial; border-top-style: none; border-width: initial; font-style: inherit; height: auto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 610px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline;&quot; title=&quot;TapJoy Revenue&quot; width=&quot;698&quot; /&gt;&lt;/a&gt;As the downloads shot up, so did the revenue. On the 17th of July, with 7,600 downloads&amp;nbsp;&lt;strong style=&quot;font-weight: bold;&quot;&gt;I actually made $300 in a single day&lt;/strong&gt;, just from TapJoy ads in this app! At that stage about 3,700 people had requested an invite.&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-style: inherit; font-weight: bold; letter-spacing: -2px; line-height: 40px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;….and The Fall.&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;But sadly, the 17th was my last day of triple-digit income. Not because of any changes by TapJoy, and certainly not due to lack of interest by users (in fact, I had just reached 2nd place on the&amp;nbsp;&lt;a href=&quot;http://www.appbrain.com/&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;AppBrain - Android Apps&quot;&gt;AppBrain&lt;/a&gt;&amp;nbsp;”Hot Apps” list). But just before mid-day on the 17th, Google suspended my app from the Android Market. And that’s it, really.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; float: none; font-style: inherit; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;ins style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: inline-table; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; text-decoration: underline; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;ins id=&quot;aswift_0_anchor&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; display: block; height: 60px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; text-decoration: underline; visibility: visible; width: 468px;&quot;&gt;&lt;/ins&gt;&lt;/span&gt;&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;60&quot; hspace=&quot;0&quot; id=&quot;aswift_0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_0&quot; scrolling=&quot;no&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; top: 0px; vertical-align: baseline;&quot; vspace=&quot;0&quot; width=&quot;468&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Once the app was suspended, all the charts dropped off completely. I had the app listed on a few third-party app stores (including&amp;nbsp;&lt;a href=&quot;http://slideme.org/&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;SlideME App Store&quot;&gt;SlideME&amp;nbsp;&lt;/a&gt;and&amp;nbsp;&lt;a href=&quot;http://www.amazon.com/mobile-apps/b?ie=UTF8&amp;amp;node=2350149011&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;Amazon App Store for Android&quot;&gt;Amazon&lt;/a&gt;), but the number of actual downloads was miniscule. The Android Market was the only one that mattered.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;It was a bit scary actually – receiving an email from Google that one of my apps has been suspended. I’d always been prepared in the back of my mind, thinking that if Google has a problem with it and wants to take it down, that’s fine. I wasn’t aiming to do anything sly, and did read the terms &amp;amp; conditions of the Android Market and Google+ to make sure that offering invites like this wasn’t illegal in some way.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;But the actual email had absolutely no information about&amp;nbsp;&lt;em style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;why&lt;/em&gt;&amp;nbsp;the app was suspended. Not a word. Here’s the full text:&lt;/span&gt;&lt;/div&gt;&lt;blockquote style=&quot;background-attachment: initial; background-clip: initial; background-color: #f1f1f1; background-origin: initial; background-position: 10px 15px; border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-bottom-width: 4px; border-color: initial; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 4px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 4px; border-style: initial; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 4px; font-style: italic; font-weight: bold; margin-bottom: 20px; margin-left: 10px; margin-right: 10px; margin-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 10px; padding-top: 10px; quotes: &#39;&#39;; text-shadow: rgb(153, 153, 153) 0px 1px 1px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;Subject&lt;/strong&gt;: Notification from Android Market&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;This is a notification that the application, Google+ Invites with package ID com.bb.plusinvites has been removed from Android Market due to a violation of the Developer Content Policy. Please review the&amp;nbsp;&lt;a href=&quot;http://market.android.com/support/bin/answer.py?answer=113474&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;Content Policies&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href=&quot;http://www.google.com/mobile/android/market-policies.html&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;Business and Program Policies&lt;/a&gt;&amp;nbsp;before you create or upload additional applications. Note that repeated violations may result in a suspension of your Android Market Publisher account.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;For more information, or to contact us, please reply to this email, or visit the&amp;nbsp;&lt;a href=&quot;http://market.android.com/support&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;Android Market Help Center&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Thanks,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;The Android Market Team&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;After re-reading the policies mentioned in the email, I concluded that the most likely cause for suspension was trademark concerns. I had been very careful in the Market description (and in the app itself) to include disclaimers, mentioning that my app was in no way affiliated with Google, etc. But the logo was a major slip-up. It’s quite possible that somebody could mistake my app for an official Google app at first glance, simply due to the logo. I should have been more careful with that, but at the time I didn’t lend it a thought. I think Google would be perfectly justified in complaining, if that was indeed the problem.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;What I’m not so happy about though, is Google’s communication once an app is suspended. There are absolutely no details provided about the cause. In my case, I had identified an area which was&amp;nbsp;&lt;em style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;probably&lt;/em&gt;&amp;nbsp;the cause of concern. But how do I know they won’t find some other issue to complain about? The email mentions “repeated violations may result in a suspension of your Android market Publisher account.” Should I risk losing my entire account, by changing the icon, and fixing what I could only&amp;nbsp;&lt;em style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;guess&lt;/em&gt;&amp;nbsp;was the problem?&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;The actual liason (if you could call it that) with the Android Market team is a topic for another time. But to cut a long story short, I eventually got a&amp;nbsp;&lt;em style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;hint&lt;/em&gt;&amp;nbsp;that trademark infringement was indeed the concern, and that I could try uploading a new version that fixed this issue. But due to some “internal accounting issues”, Google claimed they could not re-instate my app. I had to upload a new version, with a different package ID. Basically I lost my entire user base for that app, and risked losing my Android Market publisher account if I hadn’t correctly guessed the cause of infringement. A pretty big gamble if you ask me.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;wp-caption alignright&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; float: right; font-style: inherit; font-weight: bold; height: auto; margin-bottom: 10px; margin-left: 20px; margin-right: 0px; margin-top: 5px; max-width: 620px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px; text-align: center; vertical-align: baseline; width: 250px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/web_hi_res_5122.png&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;img alt=&quot;Social Invites Plus Logo&quot; height=&quot;240&quot; src=&quot;http://makingmoneywithandroid.com/wp-content/uploads/2011/07/web_hi_res_5122.png&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-style: none; border-color: initial; border-color: initial; border-color: initial; border-left-style: none; border-right-style: none; border-style: initial; border-top-style: none; border-width: initial; font-style: inherit; height: auto; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 610px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; title=&quot;Social Invites Plus&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;wp-caption-text&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;The new logo, sans any Google references&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I did take the gamble though – and uploaded a new version called “&lt;a href=&quot;https://market.android.com/details?id=com.bb.invitesplus&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;Social Invites Plus on the Android Market&quot;&gt;Social Invites Plus&lt;/a&gt;” with a completely new logo. It seemed to pass the test, and has remained active to this date. But it hasn’t taken off like the first app did – and I’ve lost all the ratings, comments and active installs from the previous version. I can’t even release an update telling people it’s been removed.&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-style: inherit; font-weight: bold; letter-spacing: -2px; line-height: 40px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top: 5px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Conclusion&lt;/span&gt;&lt;/h2&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I’m not too concerned about the evanescence of the current app. It was always intended to be a kind of experiment – it just happened to be a very successful experiment. Recently&amp;nbsp;Google&amp;nbsp;&lt;a href=&quot;http://www.makeuseof.com/tag/invite-people-google-sharing-link-news/&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;Google+ revamped invite system&quot;&gt;set a limit to the number of Google+ invites&lt;/a&gt;&amp;nbsp;you can send per account. I’ve now got 150 invites remaining, so obviously I won’t be able to continue inviting everyone (although I did get through a few thousand in the preceding weeks). This means, for all intents and purposes, the Google+ Invites app (“Social Invites Plus”) is now dead.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;I made note on the Android Market right from the beginning that this was an unofficial app, and therefore holds no guarantees of continuity. I’ll try to invite everyone who’s earned points so far, in consideration of the effort they put in. But for everyone else I’ve posted a message explaining the situation, and will be releasing an update on the Android Market with more details. Not much else I can do until Google opens the doors to more users. Which will happen sooner or later – but who knows when.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 20px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Despite the abrupt ending, this was a very interesting and worthwhile experience – the first app that I could really call successful, and my first experience with incentive advertising networks. What are some of the lessons I’ve learned?&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; list-style-type: none; margin-bottom: 20px; margin-left: 25px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;Incentive advertising can be very effective&lt;/strong&gt;&lt;br /&gt;
If you’ve got some goods or services of value that you can offer from within your app, incentive advertising (from companies like&amp;nbsp;&lt;a href=&quot;http://www.tapjoy.com/&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; target=&quot;_blank&quot; title=&quot;TapJoy Incentive Advertising&quot;&gt;TapJoy&lt;/a&gt;) can be far more effective than click-based alternatives such as AdMob.&lt;/span&gt;&lt;/li&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;The Android Market is key to success&lt;/strong&gt;&lt;br /&gt;
For many apps, the third-party app stores have a significant impact on sales and revenue. But for all my apps so far, the Google Android Market has been the predominating revenue generator. Without the Android Market this app would never have taken off.&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;Positive comments (and ratings) are worth a lot&lt;/strong&gt;&lt;br /&gt;
Many people who downloaded this app did so because of the positive comments. After inviting people to Google+, I shared a post with them, asking if they could spend a few moments to post about their experience on the Android Market page. I learned later that many people thought the app was a scam based on the description, but were won over by the dozens of happy users posting positive comments.&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;Relatively few installs are needed to drive rankings&lt;/strong&gt;&lt;br /&gt;
My app had only got 6,000 odd installs in a few days when it started to hit the trending charts. These aren’t really big numbers, so it doesn’t take a lot to become a trending or “hot” app. Once you’ve got that rank, it can become self-perpetuating and drive even more downloads.&lt;/li&gt;
&lt;li style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-style: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;font-weight: bold;&quot;&gt;Don’t copy other people’s stuff&lt;/strong&gt;&lt;br /&gt;
It seems obvious – but don’t copy Google’s (or anyone else’s) trademarks or logos. Even for a short-term experiment. It might seem tempting to piggy-back off the success of a popular name, but it’s not worth the risk. Big corporations don’t understand, even if you’re “trying to do the right thing”.&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/687100213863894700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/687100213863894700'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/how-to-make-250-day-and-get-banned-from.html' title='How to make $250 a day (and get banned from the Android Market)'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5515158391435587981.post-6620116736322212219</id><published>2011-09-26T06:27:00.000-07:00</published><updated>2011-09-28T15:09:23.802-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>New Editing Features in Eclipse plug-in for Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;At the Google I/O conference a month ago, we demonstrated the next version of the Android Development Tools (ADT) plugin. Today we’re happy to announce that version 11 is done and available for download!&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;ADT 11 focuses on editor improvements. First, it offers several new visual refactoring operations, such as “Extract Include” and “Extract Style,” which help automatically extract duplicated layout fragments and style attributes into reusable layouts, styles, and themes.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Second, the visual layout editor now supports fragments, palette configurations, and improved support for custom views.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Last, XML editing has been improved with new quick fixes, code completion in more file types and many “go to declaration” enhancements.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;ADT 11 packs a long list of new features and enhancements. Please visit our&amp;nbsp;&lt;a href=&quot;http://developer.android.com/sdk/eclipse-adt.html&quot; style=&quot;color: #006699;&quot;&gt;ADT page&lt;/a&gt;&amp;nbsp;for more details. For an in-depth demo, check out the video of our Android Development Tools session at Google I/O, below.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;390&quot; src=&quot;http://www.youtube.com/embed/Oq05KqjXTvs&quot; width=&quot;640&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Please note that the visual layout editor depends on a layout rendering library that ships with each version of the platform component in the SDK. We are currently working on a number of improvements to this library as well, which we plan to release soon for all platform versions. When we release the updates, some new features in ADT 11 will be “unlocked” - such as support for ListView previewing - so keep an eye on this blog for further announcements.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGjYaUkrIesdxNfr5VQ4p1qHkap4xqayFugjg_vzFYMTXxojvlG0fm5G9KHxDwwSm0yeu5AjoNZaO3mdiChE9MSogzobVnyD9gOkeByhik1c8TdGCYinUM3C_5HJ0wJHhKCW07amJrknc/s1600/screenshot+%25281%2529.png&quot; style=&quot;color: #006699;&quot; target=&quot;_bank&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5615220481912167202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGjYaUkrIesdxNfr5VQ4p1qHkap4xqayFugjg_vzFYMTXxojvlG0fm5G9KHxDwwSm0yeu5AjoNZaO3mdiChE9MSogzobVnyD9gOkeByhik1c8TdGCYinUM3C_5HJ0wJHhKCW07amJrknc/s400/screenshot+%25281%2529.png&quot; style=&quot;border-bottom-color: rgb(0, 0, 0); border-bottom-style: solid; border-bottom-width: 0px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: solid; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: solid; border-right-width: 0px; border-style: initial; border-top-color: rgb(0, 0, 0); border-top-style: solid; border-top-width: 0px; cursor: pointer; display: block; height: 388px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: center; width: 640px;&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;Sorry for my poor English :)&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/6620116736322212219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5515158391435587981/posts/default/6620116736322212219'/><link rel='alternate' type='text/html' href='http://devmobapps.blogspot.com/2011/09/new-editing-features-in-eclipse-plug-in.html' title='New Editing Features in Eclipse plug-in for Android'/><author><name>Mixalbl4</name><uri>http://www.blogger.com/profile/02305484760889141789</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/Oq05KqjXTvs/default.jpg" height="72" width="72"/></entry></feed>