<?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-7996687336276685265</id><updated>2024-09-08T20:21:37.299+02:00</updated><category term="blogs"/><category term="links"/><title type='text'>Android from Scratch</title><subtitle type='html'>Musings, rants, questions and answers on Nexus 7, and Android in general.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</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>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-2620182891426399144</id><published>2013-01-02T11:35:00.000+01:00</published><updated>2013-01-02T11:35:51.497+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogs"/><category scheme="http://www.blogger.com/atom/ns#" term="links"/><title type='text'>Good post on first experiences with Nexus 7</title><content type='html'>Starting with Nexus 7 myself, I&#39;ve found this &lt;a href=&quot;http://clouddiscussions.wordpress.com/2012/10/09/my-first-week-with-the-nexus-7/&quot; target=&quot;_blank&quot;&gt;blogpost&lt;/a&gt; about first experiences with N7 by another beginner. Good read!</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/2620182891426399144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2013/01/good-post-on-first-experiences-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/2620182891426399144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/2620182891426399144'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2013/01/good-post-on-first-experiences-with.html' title='Good post on first experiences with Nexus 7'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-7658869485744897975</id><published>2013-01-02T07:37:00.001+01:00</published><updated>2013-01-02T10:01:55.412+01:00</updated><title type='text'>Taking screenshots on Nexus 7</title><content type='html'>&lt;div dir=&quot;ltr&quot;&gt;
Every now and then a man wants to take a schreenshot of his phone or tablet, even a desktop. For some reason in the early days of screenshot-taking history, that used to require a specific software, and in the case of Android even a rooted device. But not anymore!&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Long have gone the days of the screenshot-taking troubles, assuming you&#39;re using a newer OS, which as a &lt;a href=&quot;https://plus.google.com/u/0/103845640786455331995/posts&quot; target=&quot;_blank&quot;&gt;Nexus 7&lt;/a&gt; user, you are.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Simply press and hold at the same time Volume Down and Power button. You&#39;ll hear a sound and the screenshot will be taken.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Here it is, my first official screenshot on Nexus 7.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHoi2ELpcZvaPnVKhXWiAqlvO8a8rSGN_2FN2lyb8AJ8DO9mH1lj0FXegJCq1Qc3G2I4K5ex_HIoKdskYpETc518NXp_4psMylmSvFNfUxwbtoqHMTRxFlHAhCPwdCL9Uk8sqnN3IdPHhz/s1600/Screenshot_2013-01-02-07-25-51.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHoi2ELpcZvaPnVKhXWiAqlvO8a8rSGN_2FN2lyb8AJ8DO9mH1lj0FXegJCq1Qc3G2I4K5ex_HIoKdskYpETc518NXp_4psMylmSvFNfUxwbtoqHMTRxFlHAhCPwdCL9Uk8sqnN3IdPHhz/s640/Screenshot_2013-01-02-07-25-51.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Also, a small notification icon will appear in the upper left corner...&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYP0AuQFMzZyVisFqYK9PiwzzWu2ZIUB1HeE2HcOqzf2IPCMEhWO9ZBwq8bRXYgDsBoeqGQIVPVV_v05SD4pivcs1-DeHyU1kNvzu3k7AFIYHeamKWMwIbayHyWMlE4apJx-kk8gcQavfq/s1600/Screenshot_2013-01-02-07-29-22.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYP0AuQFMzZyVisFqYK9PiwzzWu2ZIUB1HeE2HcOqzf2IPCMEhWO9ZBwq8bRXYgDsBoeqGQIVPVV_v05SD4pivcs1-DeHyU1kNvzu3k7AFIYHeamKWMwIbayHyWMlE4apJx-kk8gcQavfq/s640/Screenshot_2013-01-02-07-29-22.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
Which, when tapped, will open your favourite image viewing application...&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp5W5lhJjoYtm0zel7zU8YKSJUB51E0QUURr28nxN01Kj1lUSAcN2WfBwWuZGO7UXwn3xgvN01A24DxQYEkfkV05pLZQe_tDG1r2-KyHBZi1IC16fNz9dhVV6zimw7R0cB7D8AVciFyEOp/s1600/Screenshot_2013-01-02-07-29-36.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp5W5lhJjoYtm0zel7zU8YKSJUB51E0QUURr28nxN01Kj1lUSAcN2WfBwWuZGO7UXwn3xgvN01A24DxQYEkfkV05pLZQe_tDG1r2-KyHBZi1IC16fNz9dhVV6zimw7R0cB7D8AVciFyEOp/s640/Screenshot_2013-01-02-07-29-36.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot;&gt;
You can share your new and fresh screenshot from that application, or if you want to look at the files on the &quot;disk&quot; (i.e. internal storage), look at /storage/emulated/0/Pictures/Screenshots&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHCod-FQFobMHqrmTJXqYeKXE9PKjmraum8GpuQ_EWUEG9vcCfHcuSPQpqUgLc40GoqqZd-KcCAVfvUnYRc8hyU2iZFnm5UMonBuP1hUgagZZ2_kABtcU4cDlVN2kvpfoqUCB6udktzxal/s1600/Screenshot_2013-01-02-07-32-04.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt; &lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHCod-FQFobMHqrmTJXqYeKXE9PKjmraum8GpuQ_EWUEG9vcCfHcuSPQpqUgLc40GoqqZd-KcCAVfvUnYRc8hyU2iZFnm5UMonBuP1hUgagZZ2_kABtcU4cDlVN2kvpfoqUCB6udktzxal/s640/Screenshot_2013-01-02-07-32-04.png&quot; /&gt; &lt;/a&gt; &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/7658869485744897975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2013/01/taking-screenshots-on-nexus-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/7658869485744897975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/7658869485744897975'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2013/01/taking-screenshots-on-nexus-7.html' title='Taking screenshots on Nexus 7'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHoi2ELpcZvaPnVKhXWiAqlvO8a8rSGN_2FN2lyb8AJ8DO9mH1lj0FXegJCq1Qc3G2I4K5ex_HIoKdskYpETc518NXp_4psMylmSvFNfUxwbtoqHMTRxFlHAhCPwdCL9Uk8sqnN3IdPHhz/s72-c/Screenshot_2013-01-02-07-25-51.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-6886838536191667165</id><published>2011-01-01T16:54:00.000+01:00</published><updated>2011-01-01T16:54:46.240+01:00</updated><title type='text'>Finally, a good and simple tutorial on Activities and Intents</title><content type='html'>It is suprisingly difficult to find a good, short tutorial on Activities, Intents and data transfer betweed Activities. But finally, here&#39;s one which is both good and short: &lt;a href=&quot;http://saigeethamn.blogspot.com/2009/08/android-developer-tutorial-for_31.html&quot; linkindex=&quot;43&quot;&gt;http://saigeethamn.blogspot.com/2009/08/android-developer-tutorial-for_31.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/6886838536191667165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2011/01/finally-good-and-simple-tutorial-on.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/6886838536191667165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/6886838536191667165'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2011/01/finally-good-and-simple-tutorial-on.html' title='Finally, a good and simple tutorial on Activities and Intents'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-5158200135152261390</id><published>2010-12-24T17:01:00.001+01:00</published><updated>2010-12-26T20:17:19.321+01:00</updated><title type='text'>Installing Cyanogen MOD on Motorola Milestone</title><content type='html'>&lt;a href=&quot;http://www.cyanogenmod.com/&quot; linkindex=&quot;33&quot;&gt;Cyanogen MOD&lt;/a&gt;&amp;nbsp; is not officially supported on Motorola Milestone, but thanks to mr. nadlabak and his website, http://android.doshaska.net/, it&#39;s now possible to have it running on MM. The installation procedure is not complicated, but if you&#39;re new to all this android hacking, there might be some unclarities. This step by step guide is aimed to technology-savvy, but unexperienced android users. Of course, standard disclaimers apply, it works for me, your mileage might vary, don&#39;t do this if you&#39;re affraid, and definitelly don&#39;t cry here if you brick your phone :-) You&#39;ve been warned, and all that...&lt;br /&gt;
&lt;br /&gt;
I asume that you already have Froyo installed, although this procedure might even work on stock Motorola 2.1-update1. However, I haven&#39;t tried it.&lt;br /&gt;
&lt;br /&gt;
The Froyo installation procedure is explained here:&lt;br /&gt;
&lt;a href=&quot;http://androidfromscratch.blogspot.com/2010/12/motorola-milestone-and-how-to-upgrade.html&quot; linkindex=&quot;34&quot;&gt;http://androidfromscratch.blogspot.com/2010/12/motorola-milestone-and-how-to-upgrade.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#39;s start. For the installation procedure, the preparation is even more important and takes longer than the procedure itself.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Preparation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Since Cyanogen mod, or any other mod, works best on a completelly clean phone (factory reset), you&#39;ll need to backup your data, settings etc. I&#39;ve found useful to:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Backup the list of APN&#39;s (internet access points via mobile network). For that, I use APN Backup &amp;amp; Restore, &lt;a href=&quot;http://www.appbrain.com/app/apn-backup-restore/com.riteshsahu.APNBackupRestore&quot; linkindex=&quot;35&quot;&gt;http://www.appbrain.com/app/apn-backup-restore/com.riteshsahu.APNBackupRestore&lt;/a&gt; Cyanogen mod messed up my existing APN&#39;s and this tool easily restored them.&lt;/li&gt;
&lt;li&gt;Backup the list of applications you have installed. For that, I use Zemna AppList backup (&lt;a href=&quot;http://www.appbrain.com/app/zemna-applist-backup/net.zemna.android.applistbackup&quot; linkindex=&quot;36&quot;&gt;http://www.appbrain.com/app/zemna-applist-backup/net.zemna.android.applistbackup&lt;/a&gt;) since I prefer installing the application rather than restoring them.&lt;/li&gt;
&lt;li&gt;Now install Titanium Backup (&lt;a href=&quot;http://www.appbrain.com/app/titanium-backup-%E2%98%85-root/com.keramidas.TitaniumBackup&quot; linkindex=&quot;37&quot;&gt;http://www.appbrain.com/app/titanium-backup-%E2%98%85-root/com.keramidas.TitaniumBackup&lt;/a&gt;) and backup all your application and data: open it, then select Menu&amp;gt;Batch&amp;gt;Backup all user apps + system data. Your phone should be rooted (see &lt;a href=&quot;http://androidfromscratch.blogspot.com/2010/12/motorola-milestone-and-how-to-upgrade.html&quot; linkindex=&quot;38&quot;&gt;http://androidfromscratch.blogspot.com/2010/12/motorola-milestone-and-how-to-upgrade.html&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;Now we have all backed up and can start with the cyanogen-related part of the procedure. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Download&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You&#39;ll need the cyanogen itself, available here: &lt;a href=&quot;http://code.google.com/p/cyanogenmod4milestone/downloads/list&quot; linkindex=&quot;39&quot;&gt;http://code.google.com/p/cyanogenmod4milestone/downloads/list&lt;/a&gt; Download file called update-cm-6.1....zip. For the most recent version, changelog etc. see &lt;a href=&quot;http://android.doshaska.net/cm6&quot; linkindex=&quot;40&quot;&gt;http://android.doshaska.net/cm6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Since cyanogen mod doesn&#39;t come with Google&#39;s applications, such as GMail etc., you&#39;ll need to download it separatelly from here: &lt;a href=&quot;http://wiki.cyanogenmod.com/index.php?title=Latest_Version#Google_Apps&quot; linkindex=&quot;41&quot;&gt;http://wiki.cyanogenmod.com/index.php?title=Latest_Version#Google_Apps&lt;/a&gt; Scroll down and right (yes, the table is too wide) and download the latest version for HDPI devices for CM6. Currenty, this is the direct link: &lt;a href=&quot;http://android.d3xt3r01.tk/cyanogen/gapps/gapps-hdpi-20101114-signed.zip&quot; linkindex=&quot;42&quot;&gt;http://android.d3xt3r01.tk/cyanogen/gapps/gapps-hdpi-20101114-signed.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now we need the software which will install the actual mod into the android system. It&#39;s called OpenRecovery and it&#39;s available here: &lt;a href=&quot;http://modmymobile.com/forums/563-motorola-milestone-roms/531599-open-recovery-v1-46-11-21-2010-a.html&quot; linkindex=&quot;43&quot;&gt;http://modmymobile.com/forums/563-motorola-milestone-roms/531599-open-recovery-v1-46-11-21-2010-a.html&lt;/a&gt; (or more precisely, &lt;a href=&quot;http://modmymobile.com/forums/downloads.php?do=file&amp;amp;id=28089&quot; linkindex=&quot;44&quot;&gt;http://modmymobile.com/forums/downloads.php?do=file&amp;amp;id=28089&lt;/a&gt;) Currently, version 1.46 is needed, but make sure to check &lt;a href=&quot;http://android.doshaska.net/cm6&quot; linkindex=&quot;45&quot;&gt;http://android.doshaska.net/cm6&lt;/a&gt; for requirements etc.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Setup&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Unzip OpenRecovery in a temporary directory. You&#39;ll see a file called update.zip and a folder called OpenRecovery with a number of subfolders, one of which is &#39;updates&#39;. Copy update-cm-6.1...zip and gapps-hdpi-....zip downloaded earlier, to this folder.&lt;br /&gt;
&lt;br /&gt;
Now, copy OpenRecovery folder and update.zip to your SD card. Make sure to have it copied in the root folder of your card. It&#39;s probably the easiest to put the card in a card reader, mount it as F:\ (or whatever) and copy the mentioned files directly there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Finally!&lt;br /&gt;
&lt;br /&gt;
Boot your phone in recovery mode (turn it off, then turn on by pressing and holding both powerbutton and X button on the keyboard - or camera button, on older Milestones). When an exclamation mark appears, at the same time press Volume Up and Camera buttons. You&#39;ll be presented by a list of several options, one of which is to apply sdcard:update.zip. Select it using arrows on the keyboard (touchscreen doesn&#39;t work here). You&#39;ll see a new menu, with several options.&lt;br /&gt;
&lt;br /&gt;
You might want to do Nandroid backup, just in case. Select that option and follow the prompts. You never know... &lt;br /&gt;
&lt;br /&gt;
Now the fun starts. First, select all three Wipe options (Dalvik cache, Data/Factory reset and Cache partition), one by one. If you didn&#39;t do your backups, you&#39;ve just lost all your data. Congratulations!&lt;br /&gt;
&lt;br /&gt;
Apply the update. Select that option. On the next screen you&#39;ll see listed 5 items. First select update-cm-6.1....zip. When done, repeat the procedure and select gapps-hdpi-....zip.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
From this moment on, you have Cyanogen MOD 6.1 installed on your Motorola Milestone! Go get yourself a beer.&lt;br /&gt;
&lt;br /&gt;
On the main screen you might want to select Root phone, just in case. &lt;br /&gt;
&lt;br /&gt;
Reboot your phone and enjoy all new and fresh Cyanogen on Milestone. :-)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Restore applications and data&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
After rebooting the phone, you&#39;ll see that it acts like it was never turned on before and that you need to setup your accounts etc. Simply follow the procedures. If you&#39;re lucky, your mobile internet connection will work and as soon as you setup your Google account, the Market application will start to download your apps. In my case, APN&#39;s were all messed up. Fortunatelly, android is smart enough to offer setup of wireless connection in that case, so make sure you have one available. Wait for Market to download your applications.&lt;br /&gt;
&lt;br /&gt;
Now start APN Backup and Restore and backup your APN&#39;s. You&#39;ll probably need to select the one you want to use: Open Settings&amp;gt;Wireless and Networks&amp;gt;Mobile Networks&amp;gt;Access Point Names and select the right one.&lt;br /&gt;
&lt;br /&gt;
Next, open Zemna Applist backup and follow the procedure. Check which applications are still missing and install them.&lt;br /&gt;
&lt;br /&gt;
At the end, open Titanium Backup, click Backup/Restore and for each application and setting selected, click Restore and choose Data only.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Done!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s it. It looks complicated, but when done once or twice, it&#39;s really easy.&lt;br /&gt;
&lt;br /&gt;
Enjoy your CM6.1 on MM, leave comments below and follow &lt;a href=&quot;http://android.doshaska.net/cm6&quot; linkindex=&quot;46&quot;&gt;http://android.doshaska.net/cm6&lt;/a&gt; for updates on Cyanogen MOD for Motorola Milestone.</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/5158200135152261390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/12/installing-cyanogen-mod-on-motorola.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/5158200135152261390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/5158200135152261390'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/12/installing-cyanogen-mod-on-motorola.html' title='Installing Cyanogen MOD on Motorola Milestone'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-6722757608395087242</id><published>2010-12-15T07:36:00.000+01:00</published><updated>2010-12-15T07:36:42.757+01:00</updated><title type='text'>Motorola Milestone and how to upgrade it to 2.2 (Froyo)</title><content type='html'>The most recent Milestones come with Android 2.1-update1. If you want to try Froyo, you either have to wait for Motorola to issue 2.2 over-the-air, or you can try G.O.T. mod for Milestone.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;a class=&quot;linkification-ext&quot; href=&quot;http://groupoften.wordpress.com/2010/10/16/g-o-t-2-2-1-released/&quot; linkindex=&quot;27&quot; title=&quot;Linkification: http://groupoften.wordpress.com/2010/10/16/g-o-t-2-2-1-released/&quot;&gt;http://groupoften.wordpress.com/2010/10/16/g-o-t-2-2-1-released/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Although the upgrading/modding procedure is fairly simple for anyone who has a decent experience with computers, the step-by-step guides are either confusing or unavailable at all.&lt;br /&gt;
&lt;br /&gt;
This procedure explains how I GOT&#39;ed my Milestone. It takes about ten minutes (yes, ten minutes only) and works everytime, at least on my device. So...&lt;br /&gt;
&lt;br /&gt;
Preparation:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Backup your system (data and application) using Titanium backup or any other tool&lt;/li&gt;
&lt;li&gt;Backup your APN list using APN Backup &amp;amp; Restore, &lt;a class=&quot;linkification-ext&quot; href=&quot;http://www.appbrain.com/app/apn-backup-restore/com.riteshsahu.APNBackupRestore&quot; linkindex=&quot;28&quot; title=&quot;Linkification: http://www.appbrain.com/app/apn-backup-restore/com.riteshsahu.APNBackupRestore&quot;&gt;http://www.appbrain.com/app/apn-backup-restore/com.riteshsahu.APNBackupRestore&lt;/a&gt; - this is important if you have set up custom APN&#39;s, so that you don&#39;t have to set it up manually again.&lt;/li&gt;
&lt;li&gt;Backup your application list using Zemna AppList backup (&lt;a class=&quot;linkification-ext&quot; href=&quot;http://www.appbrain.com/app/zemna-applist-backup/net.zemna.android.applistbackup&quot; linkindex=&quot;29&quot; title=&quot;Linkification: http://www.appbrain.com/app/zemna-applist-backup/net.zemna.android.applistbackup&quot;&gt;http://www.appbrain.com/app/zemna-applist-backup/net.zemna.android.applistbackup&lt;/a&gt;) if you want to download the new application versions (I prefer this option, rather than restoring them from backup)&lt;/li&gt;
&lt;li&gt;You&#39;ll need a windows machine. There are some Linux based tools, but for such a delicate procedure as this one, I prefer windows (although being a linux user myself for 15 years)&lt;/li&gt;
&lt;li&gt;You&#39;ll need a USB cable&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Download:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;RSD Lite, e.g. from here: &lt;a class=&quot;linkification-ext&quot; href=&quot;http://craigcrawford.pwp.blueyonder.co.uk/milestone/RSDLite4.6.rar&quot; linkindex=&quot;30&quot; title=&quot;Linkification: http://craigcrawford.pwp.blueyonder.co.uk/milestone/RSDLite4.6.rar&quot;&gt;http://craigcrawford.pwp.blueyonder.co.uk/milestone/RSDLite4.6.rar&lt;/a&gt;. Install it. This tool is used to transfer the flash ROM to the device&lt;/li&gt;
&lt;li&gt;Open Recovery from GOT, &lt;a class=&quot;linkification-ext&quot; href=&quot;http://groupoften.wordpress.com/2010/10/22/new-g-o-t-openrecovery-v2-01-launched/&quot; linkindex=&quot;31&quot; title=&quot;Linkification: http://groupoften.wordpress.com/2010/10/22/new-g-o-t-openrecovery-v2-01-launched/&quot;&gt;http://groupoften.wordpress.com/2010/10/22/new-g-o-t-openrecovery-v2-01-launched/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GOT Firmware for your region, from here: &lt;a class=&quot;linkification-ext&quot; href=&quot;http://groupoften.wordpress.com/2010/10/16/g-o-t-2-2-1-released&quot; linkindex=&quot;32&quot; title=&quot;Linkification: http://groupoften.wordpress.com/2010/10/16/g-o-t-2-2-1-released&quot;&gt;http://groupoften.wordpress.com/2010/10/16/g-o-t-2-2-1-released&lt;/a&gt; (scroll down a little)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
Flashing the firmware:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Connect USB cable and copy unzipped OpenRecovery 2.01 files to SD Card. You should have update.zip in the root of the sdcard folder, and OpenRecovery and OpenRecovery-CFG alongside&lt;/li&gt;
&lt;li&gt;Change USB connection to Portal &amp;amp; Tools.&lt;/li&gt;
&lt;li&gt;Start RSD Lite and select GOT_RTEU_2_2_1FULL.sbf (or whichever you downloaded)&lt;/li&gt;
&lt;li&gt;Check to see your phone in the list, with status Connected...&lt;/li&gt;
&lt;li&gt;Click Start and wait. The phone will show some information and the message SW Update in progress.. It takes about 5 minutes to fully flash the device and additional 3-4 minutes to reboot. When done, RSD Lite will show the status Finished and Result PASS. Close RSD Lite and disconnect the USB cable.&lt;/li&gt;
&lt;li&gt;Unlock the phone and follow the setup procedure (setup your google account etc...). The phone will start to download applications from the Market, if you have set the backup options etc. You can wait for all applications to be downloaded or, if you don&#39;t have enough patience, turn off the phone to prepare for the rooting procedure.&lt;/li&gt;
&lt;li&gt;Now it&#39;s time to root the phone, overclock it and so on. Open the slide keyboard, press and hold X and then press the power button. Keep both buttons pressed until the exclamation mark appears. Now press volume up and camera buttons. Simple menu will appear. Select &quot;apply sdcard:update.zip&quot; using keyboard (touch screen doesn&#39;t work yet).&lt;/li&gt;
&lt;li&gt;Select and run Root Phone option.&lt;/li&gt;
&lt;li&gt;Now select Launch 2.2.1 Menu, then Overclock menu. Set max rate to 1200MHz. Go back, then select max vsel and set it to 80 on Page 3. Go back and Apply Overclock. Go back and select Fix 2.2.1 Bugs.&lt;/li&gt;
&lt;li&gt;Reboot the phone.&lt;/li&gt;
&lt;/ul&gt;Open application list and find Superuser. It will probably try to update itself. If successful, then your phone is rooted! Congratulations!&lt;br /&gt;
&lt;br /&gt;
This procedure, of course, comes without any warranty. Use your brain and don&#39;t blame me if something goes wrong. If you don&#39;t understand what is ROM, firmware etc. please do some more reading before trying anything related to phone modding and rooting.&lt;br /&gt;
&lt;br /&gt;
Leave your questions, corrections etc. in comments.</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/6722757608395087242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/12/motorola-milestone-and-how-to-upgrade.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/6722757608395087242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/6722757608395087242'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/12/motorola-milestone-and-how-to-upgrade.html' title='Motorola Milestone and how to upgrade it to 2.2 (Froyo)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-5716114277734060571</id><published>2010-11-19T22:24:00.000+01:00</published><updated>2010-11-19T22:24:27.056+01:00</updated><title type='text'>Checkbox icon on the right-hand side - not so simple</title><content type='html'>I&#39;m currently struggling to find the easiest solution on how to put the checkbox icon on the right-hand side, but it seems it is not possible with xml layout settings. Here are a few links which might be helpful, but not completely:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Trying with &lt;a href=&quot;http://developer.android.com/reference/android/widget/CheckedTextView.html&quot; linkindex=&quot;192&quot;&gt;CheckedTextView&lt;/a&gt;:&lt;br /&gt;
http://stackoverflow.com/questions/3114745/how-do-i-make-the-checkbox-in-android-checkedtextview-be-left-aligned-instead-of&lt;br /&gt;
&lt;br /&gt;
Setting the custom image for checkbox:&lt;br /&gt;
http://it-ride.blogspot.com/2010/04/how-to-android-favorite-button-right.html&lt;br /&gt;
http://stackoverflow.com/questions/3965484/custom-checkbox-image-android&lt;br /&gt;
http://stackoverflow.com/questions/3192173/change-icons-of-checked-and-unchecked-for-checkbox-for-android&lt;br /&gt;
&lt;br /&gt;
However, it looks I&#39;ll have to implement a custom control:&lt;br /&gt;
http://developer.android.com/guide/topics/ui/custom-components.html</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/5716114277734060571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/checkbox-icon-on-right-hand-side-not-so.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/5716114277734060571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/5716114277734060571'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/checkbox-icon-on-right-hand-side-not-so.html' title='Checkbox icon on the right-hand side - not so simple'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-446807070880367636</id><published>2010-11-07T22:19:00.000+01:00</published><updated>2010-11-07T22:19:10.106+01:00</updated><title type='text'>How to maintain a set of variables throughout the whole application?</title><content type='html'>Well, use &lt;a href=&quot;http://developer.android.com/reference/android/app/Application.html&quot; linkindex=&quot;16&quot;&gt;android.app.Application&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public class MyApplication extends Application { &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String getMyValue() {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;
You&#39;ll have to register in in AndroidManifest.xml:&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;application android:label=&quot;@string/app_name&quot;&amp;nbsp; android:name=&quot;MyApplication&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc...&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
And then use it in your Activities:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;MyApplication application = (myApplication) getApplication();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;String myValue = application.getMyValue()&lt;/span&gt;&lt;/span&gt;;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/446807070880367636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/how-to-maintain-set-of-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/446807070880367636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/446807070880367636'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/how-to-maintain-set-of-variables.html' title='How to maintain a set of variables throughout the whole application?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-4007125984832376877</id><published>2010-11-06T20:49:00.049+01:00</published><updated>2010-11-07T12:34:25.755+01:00</updated><title type='text'>Buttons at the bottom of the screen</title><content type='html'>How to force buttons (e.g. OK, Cancel) to stick to the bottom of the screen, the way most default applications show?&lt;br /&gt;
&lt;br /&gt;
Not OK:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1EEO0WOZL65Kt1vM29dweJyKm0JsNTHOf-GRCMGPF3JNvvlkWePLAA3HMPQGv4f0P_3anYING8rePIEA_ZE-rW2VD3rCY6Xf43foEtS02w50OspOwFmUtOC7siwvO4_Iw5dFUbcNQjs9v/s1600/screenshot-not-ok.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;758&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1EEO0WOZL65Kt1vM29dweJyKm0JsNTHOf-GRCMGPF3JNvvlkWePLAA3HMPQGv4f0P_3anYING8rePIEA_ZE-rW2VD3rCY6Xf43foEtS02w50OspOwFmUtOC7siwvO4_Iw5dFUbcNQjs9v/s320/screenshot-not-ok.png&quot; width=&quot;215&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Code:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:orientation=&quot;vertical&quot;&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextView android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;fill_parent&quot; android:id=&quot;@+id/worldTextView&quot;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:text=&quot;@string/helloWorld&quot;&amp;gt;&amp;lt;/TextView&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Button android:text=&quot;OK&quot; android:id=&quot;@+id/Button01&quot;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_height=&quot;wrap_content&quot; android:layout_width=&quot;fill_parent&quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/blockquote&gt;&amp;nbsp;Better, but still not OK:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgUO26R5ve_Pcau4_6hNuJlsGjBGW2ui_wyyHqyw-bSDVf4HjtjTK9bBGOx3tjiTHKpoz1abgj8BWOXB5KD6NWv6pwmhg69LDN51jfECSISMqOajTVSCLp9I2Vo7R4CYAkgzSnP3zlofe8/s1600/screenshot-not-ok1.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;759&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgUO26R5ve_Pcau4_6hNuJlsGjBGW2ui_wyyHqyw-bSDVf4HjtjTK9bBGOx3tjiTHKpoz1abgj8BWOXB5KD6NWv6pwmhg69LDN51jfECSISMqOajTVSCLp9I2Vo7R4CYAkgzSnP3zlofe8/s320/screenshot-not-ok1.png&quot; width=&quot;215&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Code:&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/div&gt;&lt;blockquote style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;&lt;b&gt;fill_parent&lt;/b&gt;&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; android:orientation=&quot;vertical&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;b&gt;LinearLayout&lt;/b&gt; android:layout_width=&quot;wrap_content&quot; &lt;b&gt;android:layout_height=&quot;0dip&quot;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;android:layout_weight=&quot;1&quot;&lt;/b&gt; android:orientation=&quot;vertical&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextView android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;fill_parent&quot; android:id=&quot;@+id/worldTextView&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:text=&quot;@string/helloWorld&quot;&amp;gt;&amp;lt;/TextView&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Button android:text=&quot;OK&quot; android:id=&quot;@+id/Button01&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_height=&quot;wrap_content&quot; android:layout_width=&quot;fill_parent&quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;The OK button is at the bottom of the screen, but still doesn&#39;t look &quot;professional&quot;. It needs to fill the width of the screen, and we need that gray frame around it.&lt;br /&gt;
&lt;br /&gt;
Like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMVgSkaJLdg3v8ApqOP5ldShlQ7ePRveaxNkWaY-80KbiDFH6C8vPhXge9WIC754wKOR3kwE4yVbzLnnwbm3OzQnQsTh4XgrfSUnYbfWcguXQJH9zpHbntrxJKyoQJTiQC0It7md4ebuma/s1600/screenshot-ok.png&quot; imageanchor=&quot;1&quot; linkindex=&quot;760&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMVgSkaJLdg3v8ApqOP5ldShlQ7ePRveaxNkWaY-80KbiDFH6C8vPhXge9WIC754wKOR3kwE4yVbzLnnwbm3OzQnQsTh4XgrfSUnYbfWcguXQJH9zpHbntrxJKyoQJTiQC0It7md4ebuma/s320/screenshot-ok.png&quot; width=&quot;214&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:orientation=&quot;vertical&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LinearLayout android:layout_width=&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_height=&quot;0dip&quot; android:layout_weight=&quot;1&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:orientation=&quot;vertical&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextView android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;fill_parent&quot; android:id=&quot;@+id/worldTextView&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:text=&quot;@string/helloWorld&quot;&amp;gt;&amp;lt;/TextView&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;b&gt;LinearLayout&lt;/b&gt; android:layout_width=&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;style=&quot;@android:style/ButtonBar&quot;&lt;/b&gt; android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:orientation=&quot;vertical&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Button android:text=&quot;OK&quot; android:id=&quot;@+id/Button01&quot;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_height=&quot;wrap_content&quot; &lt;b&gt;android:layout_width=&quot;fill_parent&quot;&lt;/b&gt;&amp;gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
It took me a few hours to figure it out. I guess somebody with more GUI experience would know that by default. It&#39;s funny that such an expected look of screen is not explained in those few books I consulted. Anyway, enjoy.</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/4007125984832376877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/buttons-at-bottom-of-screen.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/4007125984832376877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/4007125984832376877'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/buttons-at-bottom-of-screen.html' title='Buttons at the bottom of the screen'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1EEO0WOZL65Kt1vM29dweJyKm0JsNTHOf-GRCMGPF3JNvvlkWePLAA3HMPQGv4f0P_3anYING8rePIEA_ZE-rW2VD3rCY6Xf43foEtS02w50OspOwFmUtOC7siwvO4_Iw5dFUbcNQjs9v/s72-c/screenshot-not-ok.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-3497874050309701352</id><published>2010-11-05T23:24:00.000+01:00</published><updated>2010-11-05T23:24:27.728+01:00</updated><title type='text'>Forcing numbers in EditTextPreference</title><content type='html'>As an addition to my &lt;a href=&quot;http://androidfromscratch.blogspot.com/2010/11/validating-edittextpreference.html&quot; linkindex=&quot;45&quot;&gt;previous post&lt;/a&gt;: how to limit text input to numbers only, when using EditTextPreferences? Try with &lt;a href=&quot;http://developer.android.com/reference/android/text/method/DigitsKeyListener.html&quot; linkindex=&quot;46&quot;&gt;DigitsKeyListener&lt;/a&gt;!&lt;br /&gt;
&lt;br /&gt;
public class Preferences extends PreferenceActivity {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; addPreferencesFromResource(R.xml.settings);&lt;br /&gt;
...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; EditTextPreference etp = (EditTextPreference) findPreference(key);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; EditText et = (EditText) etp.getEditText();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; et.setKeyListener(DigitsKeyListener.getInstance());&lt;br /&gt;
... etc&lt;br /&gt;
&lt;br /&gt;
Simple and easy!</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/3497874050309701352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/forcing-numbers-in-edittextpreference.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/3497874050309701352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/3497874050309701352'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/forcing-numbers-in-edittextpreference.html' title='Forcing numbers in EditTextPreference'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-7007659239985042523</id><published>2010-11-05T17:09:00.000+01:00</published><updated>2010-11-05T17:09:15.576+01:00</updated><title type='text'>Validating EditTextPreference</title><content type='html'>One of the first challenges I encountered is how to validate EditTextPreference before actually using it. For example, I needed an integer between 0 and 15, but of course user could enter any number (or even text). This is how I solved it:&lt;br /&gt;
&lt;br /&gt;
First, implement &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;OnSharedPreferenceChangeListener&lt;/span&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;public class Preferences extends PreferenceActivity implements&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;OnSharedPreferenceChangeListener {&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
Then register the listener:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt; &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onResume() {&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onResume();&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;getPreferenceScreen().getSharedPreferences()&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&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; .registerOnSharedPreferenceChangeListener(this);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void onPause() {&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; super.onPause();&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;getPreferenceScreen().getSharedPreferences()&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&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; .unregisterOnSharedPreferenceChangeListener(this);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
Now implement &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;onSharedPreferenceChanged()&lt;/span&gt; method:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String key) {&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&quot;mypref&quot;.equals(key)) {&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String value = sharedPreferences.getString(key, &quot;&quot;);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int v = Integer.parseInt(value);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // do whatever is needed&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (RuntimeException e) {&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String deflt = ... # fetch default value &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; EditTextPreference p = (EditTextPreference) findPreference(key);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; p.setText(def);&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
It&#39;s important to set the text value on EditTextPreference p, and not directrly to manipulate sharedPreferences, as entered value would remain in the dialog box.&lt;br /&gt;
&lt;br /&gt;
Of course, similar approach can be applied to any preference.</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/7007659239985042523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/validating-edittextpreference.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/7007659239985042523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/7007659239985042523'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/validating-edittextpreference.html' title='Validating EditTextPreference'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996687336276685265.post-5798455774314754048</id><published>2010-11-05T10:14:00.000+01:00</published><updated>2010-11-05T10:14:40.021+01:00</updated><title type='text'>Welcome!</title><content type='html'>What happens when a fairly experienced (server side) developer opens Android&#39;s development environment and starts to build an application? Well, this blog.</content><link rel='replies' type='application/atom+xml' href='http://androidfromscratch.blogspot.com/feeds/5798455774314754048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/welcome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/5798455774314754048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996687336276685265/posts/default/5798455774314754048'/><link rel='alternate' type='text/html' href='http://androidfromscratch.blogspot.com/2010/11/welcome.html' title='Welcome!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04799693744569792465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>