<?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-1769644752191447320</id><updated>2024-08-29T22:57:00.946-07:00</updated><category term="android"/><category term="android dev"/><category term="android development"/><category term="android development checkbox"/><category term="development"/><category term="android beginner"/><category term="android beginner tutorial"/><category term="android checkbox"/><category term="android development views"/><category term="android html"/><category term="android html source"/><category term="android multiple screens"/><category term="android tutorials"/><category term="android views"/><category term="beginner"/><category term="check box"/><category term="checkbox"/><category term="html"/><category term="multiple android views"/><category term="r.strings"/><category term="reference"/><category term="screens android"/><category term="strings reference"/><category term="tutorial"/><category term="tutorials"/><category term="views android"/><category term="webpage source"/><title type='text'>Android Armory</title><subtitle type='html'>Learn how to create your own Android applications</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-2884354893939082998</id><published>2011-12-06T08:33:00.001-08:00</published><updated>2011-12-20T13:04:29.728-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="android dev"/><category scheme="http://www.blogger.com/atom/ns#" term="android development"/><category scheme="http://www.blogger.com/atom/ns#" term="android html"/><category scheme="http://www.blogger.com/atom/ns#" term="android html source"/><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="webpage source"/><title type='text'>Android Getting HTML from Webpages</title><content type='html'>Before you can access the internet you must enable internet access, add the line below to your AndroidManifest.xml file (I added mine under the minSdkVersion entry)&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;&amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;
Now you can add this function to get the HTML of a website.. &lt;br /&gt;
&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt;1:  public String getHTML(String urlToRead) {  
2:    URL url;  
3:    HttpURLConnection conn;  
4:    BufferedReader rd;  
5:    String line;  
6:    String result = &quot;&quot;;  
7:    try {  
8:      url = new URL(urlToRead);  
9:      conn = (HttpURLConnection) url.openConnection();  
10:      conn.setRequestMethod(&quot;GET&quot;);  
11:      rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));  
12:      while ((line = rd.readLine()) != null) {  
13:       result += line;  
14:      }  
15:      rd.close();  
16:    } catch (Exception e) {  
17:      Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();  
18:    }  
19:    return result;  
20:   }  
&lt;/code&gt;&lt;/pre&gt;
And example usage..&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;String s = getHTML(&quot;http://lerietaylor.com/&quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;Toast.makeText(getApplicationContext(), s, Toast.LENGTH_LONG).show();&lt;/span&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/2884354893939082998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/12/android-getting-html-from-webpages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/2884354893939082998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/2884354893939082998'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/12/android-getting-html-from-webpages.html' title='Android Getting HTML from Webpages'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-5205321757800322497</id><published>2011-11-01T11:24:00.000-07:00</published><updated>2011-11-01T11:25:19.022-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="android checkbox"/><category scheme="http://www.blogger.com/atom/ns#" term="android dev"/><category scheme="http://www.blogger.com/atom/ns#" term="android development"/><category scheme="http://www.blogger.com/atom/ns#" term="android development checkbox"/><category scheme="http://www.blogger.com/atom/ns#" term="check box"/><category scheme="http://www.blogger.com/atom/ns#" term="checkbox"/><category scheme="http://www.blogger.com/atom/ns#" term="development"/><title type='text'>Using Android Checkboxes</title><content type='html'>In almost any settings window/screen you will probably need to use a check box, to &quot;tick&quot; something on or off. We are going to do some easy check boxes to help make a selection of what kind of fruit we would like to eat. Once the box is selected we will press a &quot;save settings&quot; button to show our selection.&lt;br /&gt;
&lt;br /&gt;
I will assume you already know how to setup a project already. I will be (and have always been) using Eclipse as my IDE. We will have two screens, the first screen will have a button to allow us to move to our settings screen. The next screen is our settings screen, which will let us choose out fruit as mentioned earlier. Below is our first screen in graphical mode in our IDE.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&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/AVvXsEiFJuOjBpT3c6tvb3pcx53-0IEGDNix_wb70k8XLKKz5rbgM4V5eukKtaTGQWzGGr3JrpyCwI-1PHu0bOwTq-PjNH3izAHGPDC-yya17IHxRRe_GIOToFRuJWmkzLkqBZnTH_sKmPZYujBX/s1600/screen1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJuOjBpT3c6tvb3pcx53-0IEGDNix_wb70k8XLKKz5rbgM4V5eukKtaTGQWzGGr3JrpyCwI-1PHu0bOwTq-PjNH3izAHGPDC-yya17IHxRRe_GIOToFRuJWmkzLkqBZnTH_sKmPZYujBX/s320/screen1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
After placing our button on the screen we now make a new activity for our settings screen and a new XML file for our settings screen. If you do not know how to make&amp;nbsp; a new screen I advise you refer to the other tutorials on this website.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;The second activity, I named it &lt;b&gt;Settings.java&lt;/b&gt; and the XML file is named &lt;b&gt;settings.xml&lt;/b&gt;. Here is the code for both files, just in case you need a refresher.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Settings.java&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;package com.lerie.chkboxdemo;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;&lt;br /&gt;public class Settings extends Activity {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Called when the activity is first created. */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.settings);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;}&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;settings.xml&lt;/b&gt;&lt;br /&gt;
&lt;i&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:orientation=&quot;vertical&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
and don&#39;t forget to add the new screen to your AndroidManifest.xml file:&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activity class=&quot;.Settings&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:name=&quot;.Settings&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; android:label=&quot;Settings&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/activity&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
As of now, the settings button won&#39;t do anything until we set the listener event up. It is quite simple, you can find a tutorial on this website for that as well, it looks a bit like this..&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Button next = (Button) findViewById(R.id.button1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next.setOnClickListener(new View.OnClickListener() {&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; public void onClick(View view) {&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; Intent myIntent = new Intent(view.getContext(), Settings.class);&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; startActivityForResult(myIntent, 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
When the button is clicked it will show the settings screen. Let&#39;s design our settings screen now. We will add three checkboxes and a button. If we wanted to group the checkboxes we would simply use RadioButtons instead of checkboxes to make it much easier. With checkboxes we can make multiple selections.&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/AVvXsEi8W4B26j7pqXunDfC7Rt0OYTCYP82ITjK35T9VJohewH00v797n_0iuiGja7aBSoiT6GqND5z3rtIqCU59Sa8I3lUCNGB4SzRC3DT6xqBCpndaSKhDPGRA2spnVRD9o3ZklDZXIMc-6wFB/s1600/screen2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;236&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8W4B26j7pqXunDfC7Rt0OYTCYP82ITjK35T9VJohewH00v797n_0iuiGja7aBSoiT6GqND5z3rtIqCU59Sa8I3lUCNGB4SzRC3DT6xqBCpndaSKhDPGRA2spnVRD9o3ZklDZXIMc-6wFB/s320/screen2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
When we make a selection then press the &quot;save settings&quot; button it will pop up a message (with Toast) and show us what we selected then move back to the Main screen we started on. So we need to get the values or at least the state of the checkboxes. It&#39;s pretty blatant and straight forward. We will check the &quot;ischecked&quot; method, which is a bool.&lt;br /&gt;
&lt;br /&gt;
First, let&#39;s get the checkboxes..&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CheckBox apple = (CheckBox) findViewById(R.id.chkApple);&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; CheckBox orange = (CheckBox) findViewById(R.id.chkOrange);&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; CheckBox peach = (CheckBox) findViewById(R.id.chkPeach);&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
After that we can check the methods for the checkboxes..&lt;br /&gt;
&lt;br /&gt;
&lt;i&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; if(apple.isChecked())&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; {&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;&amp;nbsp; Toast.makeText(Settings.this, &quot;You chose an apple.&quot;, Toast.LENGTH_SHORT).show();&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; }&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; &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; if(orange.isChecked())&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; {&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;&amp;nbsp; Toast.makeText(Settings.this, &quot;You chose an orange.&quot;, Toast.LENGTH_SHORT).show();&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; }&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; &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; if(peach.isChecked())&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; {&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;&amp;nbsp; Toast.makeText(Settings.this, &quot;You chose a peach.&quot;, Toast.LENGTH_SHORT).show();&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; }&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
and then start our other activity..&lt;br /&gt;
&lt;br /&gt;
&lt;i&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; Intent myIntent = new Intent(view.getContext(), ChkBoxDemoActivity.class);&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; startActivityForResult(myIntent, 0);&lt;/i&gt;&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/AVvXsEhhFUgb-mmvHkEZmFcmf2Pn5wSULM7PnTBuujF2BoJpPeTp-xLZ6fRf4DI8GGIdPXrduUHCHFOrsNVNSlFf0l_zozAlQHaFrJZTqYLillNepdrgN0bCm8K1vH5zWWIUW4o5_Q53ySOTBqWI/s1600/screen4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhFUgb-mmvHkEZmFcmf2Pn5wSULM7PnTBuujF2BoJpPeTp-xLZ6fRf4DI8GGIdPXrduUHCHFOrsNVNSlFf0l_zozAlQHaFrJZTqYLillNepdrgN0bCm8K1vH5zWWIUW4o5_Q53ySOTBqWI/s320/screen4.jpg&quot; width=&quot;229&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHYd52AqsswyH1t31jp_QD64VtF1QDhN77uQj1FYiF-tOwhJBOrwKHe6QYEik-D8be1JyCAGHRqX6EfI8GfBryg28bCmgfe-pqRH72efS8nsKvmURbHCOTZX4e7dDPUVNuuEB49yrmzqED/s1600/screen3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;251&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHYd52AqsswyH1t31jp_QD64VtF1QDhN77uQj1FYiF-tOwhJBOrwKHe6QYEik-D8be1JyCAGHRqX6EfI8GfBryg28bCmgfe-pqRH72efS8nsKvmURbHCOTZX4e7dDPUVNuuEB49yrmzqED/s320/screen3.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/5205321757800322497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/11/using-checkboxes-effectively.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/5205321757800322497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/5205321757800322497'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/11/using-checkboxes-effectively.html' title='Using Android Checkboxes'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJuOjBpT3c6tvb3pcx53-0IEGDNix_wb70k8XLKKz5rbgM4V5eukKtaTGQWzGGr3JrpyCwI-1PHu0bOwTq-PjNH3izAHGPDC-yya17IHxRRe_GIOToFRuJWmkzLkqBZnTH_sKmPZYujBX/s72-c/screen1.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Santee, CA, USA</georss:featurename><georss:point>32.8383828 -116.9739167</georss:point><georss:box>32.7850178 -117.0528807 32.8917478 -116.8949527</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-3783887496452614214</id><published>2011-07-15T12:12:00.000-07:00</published><updated>2011-07-15T12:12:48.871-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="r.strings"/><category scheme="http://www.blogger.com/atom/ns#" term="reference"/><category scheme="http://www.blogger.com/atom/ns#" term="strings reference"/><title type='text'>Using String Resources</title><content type='html'>For quick string references, like a global string, you should try and use the string resource. You can set a string resource by opening the file in your project explorer located at &lt;b&gt;values/strings.xml&lt;/b&gt;. In this file is where we will define our strings.&lt;br /&gt;
&lt;br /&gt;
To manually enter a string (assuming your in Eclipse) double click the &lt;b&gt;values/strings.xml&lt;/b&gt; file, when the new window opens at the bottom select &quot;strings.xml&quot;. In here you can add your own strings in the following format: &lt;i&gt;&amp;lt;string name=&quot;{a_name_here}&quot;&amp;gt;{you put the string&#39;s value in here}&amp;lt;/string&amp;gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
for example, I could store a URL for later use, it would look something like..&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #fff2cc; color: black; padding: 5px;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;resources&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;string name=&quot;app_url_1&quot;&amp;gt;http://google.com/&amp;lt;/string&amp;gt;&lt;br /&gt;
&amp;lt;/resource&amp;gt;&lt;/div&gt;&lt;br /&gt;
We can reference that string in our code like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #fff2cc; color: black; padding: 5px;&quot;&gt;String s = getString(R.string.app_url_1);&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/3783887496452614214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/07/using-string-resources.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/3783887496452614214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/3783887496452614214'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/07/using-string-resources.html' title='Using String Resources'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><thr:total>0</thr:total><georss:featurename>San Diego, CA, USA</georss:featurename><georss:point>32.7153292 -117.15725509999999</georss:point><georss:box>32.4256327 -117.35807359999998 33.0050257 -116.95643659999999</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-6283624721036267771</id><published>2011-05-07T12:41:00.000-07:00</published><updated>2011-05-07T12:41:05.886-07:00</updated><title type='text'>Enable Only One Instance of Your Activity</title><content type='html'>Open your AndroidManifest and place this code in an activity element that has the MAIN and LAUNCHER intent filters.&lt;br /&gt;
&lt;blockquote&gt;android:launchMode=&quot;singleInstance&quot;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/6283624721036267771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/05/enable-only-one-instance-of-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/6283624721036267771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/6283624721036267771'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/05/enable-only-one-instance-of-your.html' title='Enable Only One Instance of Your Activity'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-3200528434855872200</id><published>2011-05-04T18:57:00.000-07:00</published><updated>2011-05-04T18:58:13.102-07:00</updated><title type='text'>Publish your Android Application</title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&amp;nbsp;The Android Market&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The official place to sell Android applications is the Android Market. You can view the market by visiting the website here: &lt;a href=&quot;https://market.android.com/&quot;&gt;https://market.android.com/&lt;/a&gt;. Reading the market can help you see which apps are in demand and which area you should develop an app for. All apps need to be digitally signed before they can be sold in the Android Marketplace.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;
The Distributable File&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Android applications are packaged as APK files. You can use the ADT plugin inside Eclipse to digitally sign and compile your applications, that is what we will be focusing on here. Digitally signed applications have a public and private key. A keystore is a place where your (personal) certificates are held. You never want to lose your keystore, make a backup and put it somewhere safe.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Create an APK File&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Right click the project and select &lt;b&gt;Android Tools&lt;/b&gt; then &lt;b&gt;Export Signed Application Package&lt;/b&gt;.&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;http://i51.tinypic.com/iyefyr.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;249&quot; src=&quot;http://i51.tinypic.com/iyefyr.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Next, give a name to your project&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;http://i55.tinypic.com/210lu8m.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://i55.tinypic.com/210lu8m.jpg&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the next window you will click the &lt;b&gt;Create new keystore&lt;/b&gt; radio button. Select a location on your hardrive by clicking the &lt;b&gt;Browse&lt;/b&gt; button and save APK your file, you can name it anything you want. You will need to supply a password by typing it in the two boxes below, like seen below.&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;http://i54.tinypic.com/28a6n0z.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://i54.tinypic.com/28a6n0z.jpg&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the next part you will need to provide some info, we will only provide the very basics. Provide the password and your name. I am not sure why you must provide at least a 25 year certificate expiration date but... yea, 25 years.. &lt;br /&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;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://i55.tinypic.com/kamrt3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://i55.tinypic.com/kamrt3.jpg&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;Then finish..&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;http://i55.tinypic.com/op5zd.jpg%20&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;http://i55.tinypic.com/op5zd.jpg%20&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;You can sign up and get your Android market account from here, &lt;a href=&quot;http://market.android.com/publish&quot;&gt;http://market.android.com/publish&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/3200528434855872200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/05/publish-your-android-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/3200528434855872200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/3200528434855872200'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/05/publish-your-android-application.html' title='Publish your Android Application'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://i51.tinypic.com/iyefyr_th.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-6321402367685226985</id><published>2011-04-27T13:45:00.000-07:00</published><updated>2012-04-23T12:20:40.231-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="android dev"/><category scheme="http://www.blogger.com/atom/ns#" term="android development"/><category scheme="http://www.blogger.com/atom/ns#" term="android development views"/><category scheme="http://www.blogger.com/atom/ns#" term="android multiple screens"/><category scheme="http://www.blogger.com/atom/ns#" term="android views"/><category scheme="http://www.blogger.com/atom/ns#" term="multiple android views"/><category scheme="http://www.blogger.com/atom/ns#" term="screens android"/><category scheme="http://www.blogger.com/atom/ns#" term="views android"/><title type='text'>Android Multiple Views</title><content type='html'>When I first started writing Android apps I never read much  documentation as I am a hand on kind of guy. I always do this, I never  read the documentation fully and always have to go back over my steps.  It’s ok, I just learn slower eh? Well, the problem arose when I wanted  to create multiple views. Creating multiple views doesn’t just consist  or creating the XML and switching them via an OnClickListener under a  button.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
You will also need to create another Activity (java file) for the  multiple views to work. We are going to make a simple application that  will use two buttons and two views. Each view will have a button that  switches to the other view. Many applications require more than one  view. If you need to setup the environment please refer to my first  article, Your First Android App.&lt;br /&gt;
&lt;br /&gt;
I named my project MultiViews and am using Android 2.3. The first thing  you can do is go ahead and create the views. The first view has a button  that links our second view. The first view is stored in main.xml and  our second one is main2.xml. They are identical besides the names of the  buttons and the caption on the buttons. Here is a screen shot and the  code from both views.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i56.tinypic.com/5jtrm9.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b class=&quot;bbc&quot;&gt;main.xml&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;  
2:  &amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;  
3:    android:orientation=&quot;vertical&quot;  
4:    android:layout_width=&quot;fill_parent&quot;  
5:    android:layout_height=&quot;fill_parent&quot;  
6:    &amp;gt;  
7:    &amp;lt;Button android:text=&quot;View 2&quot;  
8:          android:id=&quot;@+id/button1&quot;  
9:          android:layout_width=&quot;fill_parent&quot;  
10:          android:layout_height=&quot;wrap_content&quot;&amp;gt;  
11:      &amp;lt;/Button&amp;gt;  
12:  &amp;lt;/LinearLayout&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://i53.tinypic.com/161jn6r.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://i53.tinypic.com/161jn6r.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b class=&quot;bbc&quot;&gt;main2.xml&lt;/b&gt;&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;  
2:  &amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;  
3:    android:orientation=&quot;vertical&quot;  
4:    android:layout_width=&quot;fill_parent&quot;  
5:    android:layout_height=&quot;fill_parent&quot;  
6:    &amp;gt;  
7:    &amp;lt;Button android:text=&quot;View 1&quot;  
8:          android:id=&quot;@+id/button2&quot;  
9:          android:layout_width=&quot;fill_parent&quot;  
10:          android:layout_height=&quot;wrap_content&quot;&amp;gt;  
11:      &amp;lt;/Button&amp;gt;  
12:  &amp;lt;/LinearLayout&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Now, create a new activity MultiViews2.java This will contain  essentially the same as the first MultiViews.java file. Here is the  First and Second activities files.&lt;br /&gt;
&lt;br /&gt;
&lt;b class=&quot;bbc&quot;&gt;MultiViews.java&lt;/b&gt;&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  package com.ler.multiviews;  
2:   import android.app.Activity;  
3:  import android.content.Intent;  
4:  import android.os.Bundle;  
5:  import android.view.View;  
6:  import android.widget.Button;  
7:   public class MultiViews extends Activity {  
8:    /** Called when the activity is first created. */  
9:    @Override  
10:    public void onCreate(Bundle savedInstanceState) {  
11:      super.onCreate(savedInstanceState);  
12:      setContentView(R.layout.main);  
13:    }  
14:  }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b class=&quot;bbc&quot;&gt;MultiViews2.java&lt;/b&gt;&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  package com.ler.multiviews;  
2:   import android.app.Activity;  
3:  import android.content.Intent;  
4:  import android.os.Bundle;  
5:  import android.view.View;  
6:  import android.widget.Button;  
7:   public class MultiViews2 extends Activity {  
8:    /** Called when the activity is first created. */  
9:    @Override  
10:    public void onCreate(Bundle savedInstanceState) {  
11:      super.onCreate(savedInstanceState);  
12:      setContentView(R.layout.main2);  
13:    }  
14:  }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
We now have to add the Listeners to the Activity files, to let us click the buttons. Here is the first one:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:      Button next = (Button) findViewById(R.id.button1);  
2:      next.setOnClickListener(new View.OnClickListener() {  
3:        public void onClick(View view) {  
4:          Intent myIntent = new Intent(view.getContext(), MultiViews2.class);  
5:          startActivityForResult(myIntent, 0);  
6:        }  
7:      });  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
and the second:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:      Button next = (Button) findViewById(R.id.button1);  
2:      next.setOnClickListener(new View.OnClickListener() {  
3:        public void onClick(View view) {  
4:          Intent myIntent = new Intent(view.getContext(), MultiViews.class);  
5:          startActivityForResult(myIntent, 0);  
6:        }  
7:      });  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Now, you will need to open your &lt;b&gt;AndroidManifest.xml&lt;/b&gt; file and add the Activity to it, the second class we wrote.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga-NM0WsJJS9gPOmKInkgsa1wvJu7Yz6lpJ4fhHNqEA26RRQtbGwJo0Bcig9k7_eBcHS_54hxEnbdIClCCegSzlV3eNwl8Iv19M-WLLxKeYg8NLlklveGUZ4em6v3xqb0j2V4O-ZTf1Tsx/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  &amp;lt;activity android:name=&quot;.MultiViews2&quot;&amp;gt;&amp;lt;/activity&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/6321402367685226985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/04/android-multiple-views.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/6321402367685226985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/6321402367685226985'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/04/android-multiple-views.html' title='Android Multiple Views'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://i56.tinypic.com/5jtrm9_th.jpg" height="72" width="72"/><thr:total>1</thr:total><georss:featurename>California, USA</georss:featurename><georss:point>36.778261 -119.4179324</georss:point><georss:box>30.278364 -129.5253544 43.278158 -109.3105104</georss:box></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-4273650344877287988</id><published>2011-04-27T13:43:00.000-07:00</published><updated>2013-01-31T12:20:33.629-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="android beginner"/><category scheme="http://www.blogger.com/atom/ns#" term="android beginner tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="android dev"/><category scheme="http://www.blogger.com/atom/ns#" term="android development"/><category scheme="http://www.blogger.com/atom/ns#" term="android development checkbox"/><category scheme="http://www.blogger.com/atom/ns#" term="android tutorials"/><category scheme="http://www.blogger.com/atom/ns#" term="beginner"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Creating Your First Android App</title><content type='html'>Today I am going to walk you through installing and setting up the  Android SDK so you can create android applications. Android runs on  Java, so if you don’t know Java, please step away now. If you want to  try it anyway, keep following along. We first need to install JDK, the &lt;a class=&quot;bbc_url&quot; href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/index-jdk5-jsp-142662.html&quot; rel=&quot;nofollow external&quot; title=&quot;External link&quot;&gt;Java Development Kit&lt;/a&gt;. We will be installing JDK 5 which is the latest version as of writing this.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
We will be using Windows to install these on, I will be using x86, you  can probably follow along on the other OS’s Java supports, but if your  semi new to this, you might want to open Windows in a VM to follow  along. Hopefully by now your installing or at least downloading the JDK.  I downloaded jdk-6u24-windows-i586.exe. I even created a small YouTube  video for the install, which is pretty much point and click next..&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/5NhxfxjEqX0?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
We haven’t really discussed what kind of app we will be making. We will  be writing a simple app of course, nothing too fancy. We will not be  integrating controls at this time such as Buttons or Labels, that will  follow in the next tutorial where we will be creating a simple  calculator. For now, we need to continue with our setup and install our  IDE, we will be using &lt;a class=&quot;bbc_url&quot; href=&quot;http://www.eclipse.org/downloads/&quot; rel=&quot;nofollow external&quot; title=&quot;External link&quot;&gt;Eclipse&lt;/a&gt;. The &lt;a class=&quot;bbc_url&quot; href=&quot;http://www.eclipse.org/downloads/&quot; rel=&quot;nofollow external&quot; title=&quot;External link&quot;&gt;Eclipse IDE&lt;/a&gt;  is something I have been using for quite some time, since I went  through the core. No, not the corps., the core. The core is something  familiar to programmers, it is the basis/structure from which most  coders who have gone to school learn the basics and fundamentals for  programming.&lt;br /&gt;
&lt;br /&gt;
Once Eclipse installs it has options to download and install the Android  SDK. I will be downloading and installing helios SR2. There is an  option to download it via torrent, which id the option I am going to  use. Once it is done downloading just extract the eclipse folder to a  place of your choosing and start the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i52.tinypic.com/2a0jabp.jpg&quot; height=&quot;396&quot; width=&quot;640&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
On the left is the default package for the Eclipse IDE we downlaoded,  click the eclipse.exe to get it going. It will ask you to select a  workspace, just hit ok or whatever it asks, unless you want to specify a  different location. Once it loads go into the Help menu at the top and  select Install New Software. A new windows will pop up and enter the  URL: &lt;a class=&quot;bbc_url&quot; href=&quot;https://dl-ssl.google.com/android/eclipse&quot; rel=&quot;nofollow external&quot; title=&quot;External link&quot;&gt;https://dl-ssl.googl...android/eclipse&lt;/a&gt;  into it and press enter. Select them all and click Next at the bottom  to start installing. It may take a while depending on your PC’s speed  and internet connection, just be patient. Accept the License Agreements  and click Finish. You will have to restart Eclipse.&lt;br /&gt;
&lt;br /&gt;
Now, go to Window then select Preferences and select Android from the  left menu and then select the Android version, we will be using 1.5 for  this project, press the Apply button.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i52.tinypic.com/2lcsq48.jpg&quot; height=&quot;200&quot; width=&quot;500&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Now open the AVD manager.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i56.tinypic.com/11wee4w.jpg&quot; height=&quot;374&quot; width=&quot;682&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Select start to start the Android emulator. It may take a while to load, it looks something like below.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i55.tinypic.com/2ibhw6p.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
The images presented in this tutorial are for the 1.5 AVD, however here  is a video that shows how to load the AVD, but it is using 2.3, it still  shows you how to load the AVD from within Eclipse.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/uGjTNYBquN0?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
For now, we can just load a new Android project and do a simple Hello  World. Select File then New Project and select the Android project.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i56.tinypic.com/35knxuw.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Now setup the projects preferences.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i51.tinypic.com/23h6644.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Instead of typing 1.5 for the Minimum SDK version type 3 instead. My  bad, when compiling the project you can get an error like this:  [2011-03-16 12:00:05 - HelloWorld] Manifest attribute ‘minSdkVersion’ is  set to ’1.5′. Integer is expected. Then you will know exactly what I  did wrong previously, typing 1.5 instead of 3. You should be able to  open the AndroidManifest.xml file and edit the 1.5 and change it to 3.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i56.tinypic.com/2vja26c.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Now, we should be good to go and place a simple Hello World in the source.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;package&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lerie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;helloworld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Activity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;HelloWorld&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Activity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;/** Called when the activity is first created. */&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
You can now open the AVD manager, launch the Android and run the demo. (the green play button in the toolbar). Enjoy.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; src=&quot;http://i53.tinypic.com/rvle1g.jpg&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/4273650344877287988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/04/creating-your-first-android-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/4273650344877287988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/4273650344877287988'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/04/creating-your-first-android-app.html' title='Creating Your First Android App'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://i52.tinypic.com/2a0jabp_th.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-889107549523460256</id><published>2011-04-27T13:37:00.001-07:00</published><updated>2011-05-05T08:57:57.188-07:00</updated><title type='text'>Creating Mockups with DroidDraw</title><content type='html'>&lt;a class=&quot;bbc_url&quot; href=&quot;http://www.droiddraw.org/&quot; rel=&quot;nofollow external&quot; title=&quot;External link&quot;&gt;DroidDraw&lt;/a&gt;  is a free tool in java meant to help ease the life of a droid  developer. I love the interface in Eclipse but nothing beats this when  your on the go. It is lacking controls but works well for beginners,  probably someone like you. it&#39;s not a bad tool at all, enjoy.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
The first thing you should do is decide on a layout. I will select the &lt;b class=&quot;bbc&quot;&gt;Table Layout&lt;/b&gt;. Just drag the &lt;b class=&quot;bbc&quot;&gt;TableLayout control&lt;/b&gt; onto the droid interface to the left.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; height=&quot;292&quot; src=&quot;http://i55.tinypic.com/242a1j8.jpg&quot; width=&quot;600&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
next, position the &lt;b class=&quot;bbc&quot;&gt;TableLayout&lt;/b&gt; however you want, as wide or high as you want. Our other controls will be inside here.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; width=&quot;600&quot; src=&quot;http://i54.tinypic.com/219b9ys.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
next, drag a &lt;b class=&quot;bbc&quot;&gt;TableRow&lt;/b&gt; onto the &lt;b class=&quot;bbc&quot;&gt;TableLayout&lt;/b&gt; and make sure to select the &lt;b class=&quot;bbc&quot;&gt;TableLayout&lt;/b&gt; when you drag it over.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; height=&quot;270&quot; src=&quot;http://i53.tinypic.com/nv3xit.jpg&quot; width=&quot;600&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
now we can add some controls. Add a button by dragging it onto the TableRow you put up just a minute ago.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;Posted Image&quot; class=&quot;bbc_img&quot; width=&quot;600&quot; height=&quot;270&quot; src=&quot;http://i54.tinypic.com/2uszeir.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
When your done, you can click the generate button at the top then copy that code into your view&#39;s XML file.&lt;br /&gt;
&lt;br /&gt;
I have attached the project files to this post.</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/889107549523460256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/04/creating-mockups-with-droiddraw.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/889107549523460256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/889107549523460256'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/04/creating-mockups-with-droiddraw.html' title='Creating Mockups with DroidDraw'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://i55.tinypic.com/242a1j8_th.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1769644752191447320.post-1619477531644685611</id><published>2011-04-27T13:34:00.000-07:00</published><updated>2011-12-06T08:31:33.703-08:00</updated><title type='text'>Clicking a Button</title><content type='html'>This isn&#39;t a copy and paste tutorial that your accustomed to seeing in this section. I thought I would step up and show one of my skills since this section seems lacking. I will probably write more Android tutorials including how to create the APK file to actually put them on an Android. In this tutorial we are going to click a button. Simple I know, but most can&#39;t even get past this. If you don&#39;t know anything about Java or event listeners then you might want to go read up on it before you continue. Also in this tutorial you will use Toast to show that you clicked the button since it&#39;s the easiest way.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Android&#39;s toast is a little popup message that fades in and out as we call it. We can control it&#39;s fade time and some other features as indicated on the developer page but that isn&#39;t what we are focusing on here. We are focused on actually getting one to display after a button has been clicked. Toast is a view.&lt;br /&gt;
&lt;br /&gt;
The first thing we need to do is add a button to our layout. Select the XML file from the folder tree on the left (in the Package Explorer) and double click (open) the XML file.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The file should load in the pane on the right hand side. If this is a  new project delete the default text that comes with it. If you delete  the text here be sure to delete it from the &lt;b class=&quot;bbc&quot;&gt;app_strings&lt;/b&gt;  also. Not deleting it from app_strings won&#39;t damage the application but  it&#39;s nice to keep it clean. Click and drag the button onto the form.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Now change the width so it&#39;s not so ugly.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Now that our button&#39;s name is &lt;b class=&quot;bbc&quot;&gt;button1&lt;/b&gt;. We  are going to add another library to reference at the top witht he rest  that will give us access to use the OnClickListener event handler.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;i style=&quot;background-color: yellow;&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;widget&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Toast&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;br /&gt;
create a button and locate our button in the interface and apply it tot he newly created button. &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;i style=&quot;background-color: yellow;&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; btn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; findViewById&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;button1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;br /&gt;
then add an eventlistener to it&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;i style=&quot;background-color: yellow;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;btn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setOnClickListener&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;OnClickListener&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onClick&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Toast&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;makeText&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getApplicationContext&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Button clicked!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;br /&gt;
It should be ready to go, here is what the end result s hould look like.  I have also attached the project files for it tot his post.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span id=&quot;goog_1140403296&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1140403297&quot;&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidarmory.blogspot.com/feeds/1619477531644685611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidarmory.blogspot.com/2011/04/clicking-button.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/1619477531644685611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1769644752191447320/posts/default/1619477531644685611'/><link rel='alternate' type='text/html' href='http://androidarmory.blogspot.com/2011/04/clicking-button.html' title='Clicking a Button'/><author><name>LerieT</name><uri>http://www.blogger.com/profile/10507288184890403745</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Mz9tm50HNmR6yYEfRhLhLthqeRhjTI6t7Y69jXSGlCQS9oFqC6VpZUgi1HK9OfOWn1RrNsQeS1hreX0n6X2FeJZFlKxIUTuhxypFipOl8DofCrlucjg3TCBdslN6JQ/s220/9090cv.png'/></author><thr:total>0</thr:total></entry></feed>