<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Android code , Android Phone, Android Developers</title>
	<atom:link href="http://www.android-code.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.android-code.com</link>
	<description>Android code , Android Phone, Android Developers and New Google Android Technologies</description>
	<lastBuildDate>Mon, 23 Apr 2012 06:54:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Hello World! Complete</title>
		<link>http://www.android-code.com/2011/04/12/291/</link>
		<comments>http://www.android-code.com/2011/04/12/291/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 05:03:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=291</guid>
		<description><![CDATA[Your next step is to import the package TextView from android.widget. This will give you access to the TextView and let you create your own instance of it. Place this code near the top of your current HelloWorldText.java file, where the existing import statements are import android.widget.TextView; Now, create an instance of TextView. By creating [...]]]></description>
			<content:encoded><![CDATA[<p>Your next step is to import the package TextView from android.widget. This will<br />
give you access to the TextView and let you create your own instance of it. Place this<br />
code near the top of your current HelloWorldText.java file, where the existing import<br />
statements are<br />
import android.widget.TextView;<br />
Now, create an instance of TextView. By creating the TextView instance, you can use<br />
it to display text to the screen without directly modifying main.xml. Place the following<br />
code after the onCreate( ) statement is fired:<br />
TextView HelloWorldTextView = new TextView(this);</p>
<p><a href="http://www.android-code.com/wp-content/uploads/2011/04/android.jpg"><img class="aligncenter size-full wp-image-292" title="android" src="http://www.android-code.com/wp-content/uploads/2011/04/android.jpg" alt="" width="419" height="350" /></a></p>
<p><strong>NOTE</strong><br />
TextView takes a handle to the current context as an argument. Pass this to the<br />
TextView to associate it with the current context. If you follow the hierarchy<br />
through the SDK, HelloWorldText extends Activity, which extends<br />
ApplicationContext, which in turn extends Context. This is how you can<br />
pass this to your TextView.<br />
The preceding line creates an instance of TextView named HelloWorldTextView<br />
and then instantiates HelloWorldTextView, by setting it to a new TextView. The new<br />
TextView is passed the context of this to be fully instantiated.<br />
Now that the TextView is defined, you can add your text to it. The following line of<br />
code assigns the text “Hello World!” to the TextView:<br />
HelloWorldTextView.setText(&#8220;Hello World!&#8221;);<br />
This line lets you set the text of your TextView. setText( ) lets you assign a string to the<br />
TextView.</p>
<p>Your TextView has been created and now contains the message that you want to<br />
display. However, simply passing “Hello World!” to the TextView does not display<br />
anything to the screen. As discussed previously, you need to set the ContentView to</p>
<p>&nbsp;</p>
<p>display something to the screen. You have to use the following code to set TextView<br />
to the context and display it to the screen:<br />
setContentView(HelloWorldTextView);<br />
Examining this line, you can see that you pass to setContentView your TextView. The<br />
preceding three lines of code are what it takes to make your Hello World! application.<br />
You created a TextView, assigned your text to it, and set it to the screen. All things<br />
considered, this is not very complicated at all.<br />
The full contents of your HelloWorldText.java file should look like the following:<br />
package android_programmers_guide.HelloWorldText;</p>
<p>import android.app.Activity;<br />
import android.os.Bundle;<br />
import android.widget.TextView;<br />
public class HelloWorldText extends Activity {<br />
/** Called when the activity is first created. */<br />
@Override<br />
public void onCreate(Bundle icicle) {<br />
super.onCreate(icicle);<br />
/**Hello World JFD */<br />
/**BEGIN           */<br />
/**Create TextView */<br />
TextView HelloWorldTextView = new TextView(this);<br />
/**Set text to Hello World */<br />
HelloWorldTextView.setText(&#8220;Hello World!&#8221;);</p>
<p>/**Set ContentView to TextView */<br />
setContentView(HelloWorldTextView);<br />
/**END             */<br />
}<br />
}<br />
Now compile and run your new Hello World! application in the Android Emulator.<br />
Choose Run | Run or press CTRL-F11 to launch the application in the Android Emulator. The following illustration depicts the results of your Hello World! application.</p>
<p>You have just created your first full Android Activity. This small project demonstrated<br />
a fairly common execution of a Hello World! application. You set a TextView to the<br />
Activity’s ContentView and displayed the “Hello World!” message to a cell phone screen<br />
in the Android Emulator. The following section looks at a slightly different way of<br />
implementing Hello World!, using an image.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2011/04/12/291/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello World! Again</title>
		<link>http://www.android-code.com/2011/03/21/hello-world-again/</link>
		<comments>http://www.android-code.com/2011/03/21/hello-world-again/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 07:44:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=284</guid>
		<description><![CDATA[While I have discussed the existence of this TextView in the xml, I have not yet discussed why it works without any corresponding code. I mentioned earlier in this book hat there are two ways to design a UI for Android: through the code, and through the main.xml file. The preceding code sample creates a [...]]]></description>
			<content:encoded><![CDATA[<p>While I have discussed the existence of this TextView in the xml, I have not yet discussed why it works without any corresponding code. I mentioned earlier in this book hat there are two ways to design a UI for Android: through the code, and through the main.xml file. The preceding code sample creates a TextView in xml and sets the text to “Hello World, HelloWorldText.” Edit this line of the main.xml file to read as follows:<br />
android:text=&#8221;This is the text of an Android TextView!&#8221;<br />
Rerun the project, and your results should appear as they do in this illustration. Take some time and experiment with the xml TextView.<br />
Then you can move on to another way of creating a Hello World! application.</p>
<p><strong>Hello World! Again</strong><br />
In this section, you will create another Hello World! application for Android. However, this time you will program the UI in code rather than by using the xml file—and you will actually do most of the work. The first step here is to remove the TextView code that is in main.xml. The following section of code represents the TextView. Removing it essentially makes your application an empty shell.<br />
&lt;TextView<br />
android:layout_width=&#8221;fill_parent&#8221;<br />
android:layout_height=&#8221;wrap_content&#8221;<br />
android:text=&#8221;Hello World, HelloWorldText&#8221;<br />
/&gt;</p>
<p>After you have removed the TextView code, your main.xml file should look like this:<br />
&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
<span> &lt;LinearLayout xmlns:android=<a class="smarterwiki-linkify" href="http://schemas.android.com/apk/res/android">http://schemas.android.com/apk/res/android</a></span><br />
android:orientation=&#8221;vertical&#8221;<br />
android:layout_width=&#8221;fill_parent&#8221;<br />
android:layout_height=&#8221;fill_parent&#8221;<br />
&gt;<br />
&lt;/LinearLayout&gt;<br />
Now that you have a clean main.xml file, and thus a clean application shell, you can<br />
begin to add the code that will display “Hello World!” on the screen. Start by opening the<br />
HelloWorldText.java file and removing the following line:<br />
setContentView(R.layout.main);</p>
<p><strong>NOTE</strong><br />
You still need to set a ContentView for your new application; however, you are going<br />
to implement it slightly differently from how it is implemented here, so it is best to just<br />
remove the entire statement for now.<span class="smarterwiki-popup-bubble smarterwiki-popup-bubble-active" style="top: 688px; left: 349px; margin-left: -54px; margin-top: -60px; opacity: 1;"><span class="smarterwiki-popup-bubble-body"><span class="smarterwiki-popup-bubble-links-container"><span class="smarterwiki-popup-bubble-links"><span class="smarterwiki-popup-bubble-links-row"><a class="smarterwiki-popup-bubble-link" title="Search Google" href="http://www.google.com/search?q=iPhone%20developer%20Company%20provides%20mobile%20application%20development%20services%20that%20offers%20complete%20mobile%20computing%20solution%20for%20all%20needs.%0D%0A%0D%0ACheapest%20cell%20phone%20plans%20Consumer%20Cellular%20is%20a%20nationwide%20provider%20of%20best%20cell%20phone%20plans%20and%20cell%20phones%20for%20senior%20citizens%2C%20young%20and%20adults%20which%20are%20cheap%2C%20affordable%20and%20without%20any%20contracts." target="_blank"><img class="smarterwiki-popup-bubble-link-favicon" src="https://www.google.com/favicon.ico" alt="" /></a><a class="smarterwiki-popup-bubble-link" title="Search Surf Canyon" href="http://search.surfcanyon.com/search?f=nrl1&amp;q=iPhone%20developer%20Company%20provides%20mobile%20application%20development%20services%20that%20offers%20complete%20mobile%20computing%20solution%20for%20all%20needs.%0D%0A%0D%0ACheapest%20cell%20phone%20plans%20Consumer%20Cellular%20is%20a%20nationwide%20provider%20of%20best%20cell%20phone%20plans%20and%20cell%20phones%20for%20senior%20citizens%2C%20young%20and%20adults%20which%20are%20cheap%2C%20affordable%20and%20without%20any%20contracts.&amp;partner=fastestfox" target="_blank"><img class="smarterwiki-popup-bubble-link-favicon" src="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AycnKOmdmaastLTDuIB8j/yAfI/87Oz7eg4OFi+no6Rj///8A////AP///wD///8A////AP///wD6+voDfHx+kyAfI/8gHyP/LCsv+FJRVPhHRkr6IiEl/SAfI/8tLTDuuLe5T////wD///8A////AP///wD///8AfHx+kyAfI/8wLzP4qqqr+Pv7+////////////+3t7f+Dg4X9IB8j/yMiJvq/vr9H////AP///wD///8AyMfIPyIhJf8wLzP429vb+P///////////////////////////////66ur/0gHyP/ODc74////wD///8A////AHRzda4wLjH/rKyt+P/////8/Pz/h4eJ/z8+Qv9GRUn/rq6v////////////iIiK/6ijnP/269Y/////AP///wBQTlDzR0VI+vv7+///////oqGh/zg2Of8hICT/IB8j/yAfI//c3Nz/7de7/9alX//GfhL/48KOfv///wD///8AWFZX/3Vzdfr//////////4iGhv9SUFL/MC8z/2ZlaP+1jmz/unMv/7NjFf+zYxX/s2MV/9atin7WrYp+1q2KfmdlZf91c3T8//////////+npaT/bWtr/0tJS/81Mzf/jIB5/9Gidv+/eDD/v3gw/8B6M//NlWD/x4pO/8WFRvqLiIjXbmxs/+rq6v//////6Ofn/4yJiP9lY2T/Q0JE/0tKTf/09PT/9uvc/+K5gP/apFL/9+zaP////wD///8AwcDAe357e/+koqL9///////////09PT/zs3N/8jHx//5+fn//////+7u7/9/f4H/4tfC//rv2T////8A////APb29g+YlZXjhYKB/7W0s//9/f3//////////////////////+vr6/9paGn/NTQ3/319f6f///8A////AP///wD///8A6OjnMpmWle6MiYf/lZOS/8XEw//b2tr/0dHR/6elpv9hYGH/TkxO/25sb8L09PQM////AP///wD///8A////AP///wDv7+4jsa6tu5KPjf+Kh4b/gX59/3h2df9vbW3/amho96alpof4+PgH////AP///wD///8A////AP///wD///8A////AP///wDs6+srz87Nb8XDw37Av75+zMvKXvLy8hT///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAPA/AADAHwAAgA8AAIAHAAAABwAAAAcAAAAHAAAAAAAAAAcAAIAHAACABwAAwA8AAOAfAAD//wAA//8AAA%3D%3D" alt="" /></a></span><span class="smarterwiki-popup-bubble-links-row"><a class="smarterwiki-popup-bubble-link" title="Search DuckDuckGo" href="http://duckduckgo.com/?q=iPhone%20developer%20Company%20provides%20mobile%20application%20development%20services%20that%20offers%20complete%20mobile%20computing%20solution%20for%20all%20needs.%0D%0A%0D%0ACheapest%20cell%20phone%20plans%20Consumer%20Cellular%20is%20a%20nationwide%20provider%20of%20best%20cell%20phone%20plans%20and%20cell%20phones%20for%20senior%20citizens%2C%20young%20and%20adults%20which%20are%20cheap%2C%20affordable%20and%20without%20any%20contracts." target="_blank"><img class="smarterwiki-popup-bubble-link-favicon" src="https://ff.duckduckgo.com/favicon.ico" alt="" /></a><a class="smarterwiki-popup-bubble-link" title="Search Wikipedia" href="http://www.google.com/search?hl=com&amp;btnI=I%27m+Feeling+Lucky&amp;q=iPhone%20developer%20Company%20provides%20mobile%20application%20development%20services%20that%20offers%20complete%20mobile%20computing%20solution%20for%20all%20needs.%0D%0A%0D%0ACheapest%20cell%20phone%20plans%20Consumer%20Cellular%20is%20a%20nationwide%20provider%20of%20best%20cell%20phone%20plans%20and%20cell%20phones%20for%20senior%20citizens%2C%20young%20and%20adults%20which%20are%20cheap%2C%20affordable%20and%20without%20any%20contracts.+wikipedia" target="_blank"><img class="smarterwiki-popup-bubble-link-favicon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAYAAACQjC21AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAIpwAACKcBMsYCAwAAAAd0SU1FB9kFEwgQLXKnj9oAAAPsSURBVDiNdVRZSGRXEH1Joz8icSIMJsEQEvKvov4ICoOYIAp+KKISkLiAgij5UGOMjgoug6CiKC64i/sSpVHcl7jv7W6722pcWmyNoqBW6hRpyYSZC8W7975bdU+dOrcUIlL+axYWFq+SkpLybWxsYo17VlZWX/H6DebOzs4/ent7/+Lu7v7z/31h7y8U5fvV1VWNra3tIObGvZqamtaHh4fHxMTExb29vcejoyMKCwt7jIqKWuD/bz4Y0MXF5e319bU2JyfngA99x/YJ22empqZuERERKwcHB9Td3U37+/u0srJCc3NzNDIyQk1NTVcqleonPvv6JSCPL87OznQ8p+TkZC2vv2GzcnNz+83a2joqLy9vCQFnZ2dpfX2dlpaWqLe3lzo7O+WStLS0ORMTE7+XgCkpKTX07/Dz86PIyEhDVlaWISMjgxISEmRfp9PRzs4O7e7uEtMi6EZHRyVweHg4gp6bm5tbKK958PlbODES+ZmZmQmkxjsE2d3dHWm1WsrOzqa6ujoaGhqigYEBGh4epvT0dCovLyd7e3sfhR3fGR0vLy9fULa0tMj8/PycNBoNcVGIi0NxcXHU09NDY2Nj1N/fL2mXlZXJJV5eXkXK9va2DojggIDPz8/iuLGxQcvLy8IXEN7c3JBer5f14uKiIOzr66P29naqqqqiiooK8vf3n1aYbP3ExIQcZkkIKgcHBwJ/BoNB1ltbW8IbF466urrk3OTkpFhDQ4MEZA7Jx8fnSGEJ6I2pHh4eyvf2ViglVBbBwBMQb25u0sLCgnAXExMjVLS1tVFJSYmkHRoa+pfCmydwPjk5EYf7+3txwBoVRTFmZmZetFdcXEyBgYGUm5srVa6traWioiIqKCig4ODgVYVJnUE6LGpBhLQQDMjAHeaQzPT0tASG7iorK0U2kAwC4hIE9PT0HFZYvB7j4+NPQHlxcSGFOD4+Fvnw8xKOUGnwxAWkqakpqSz7CJ/V1dXEmiV+/+To6Pi7CJvFq356ehIHaA2ogPjq6krSRlVbW1ulqoODgyIbyMfX15dKS0spNjYWAf+2tLT8UgLyJAIPHinPz89LFcEXJIJUcdHa2ppIBAjVajWlpqYSNwcqLCwUdEFBQX9+ysP4llXcSf7gFO6A8PT0lJqbm4UXvB6kBc6QKgz/sAfu8Ers7OzecYxv3+s2PD53dXX9FVUFCiCqr6+njo4OSRMBwSN3FylKfn4+MQgKCAhAC1N9rB+aODk5vWUU5+ARUoHu8CpQ0cbGRjFcxA3kkjtRAft8/dEGazRuRabcZH8ICQkpjo6OVjNHmvj4+GXuiyMeHh453ATCzMzMXn3I9x8oCiuuorpqawAAAABJRU5ErkJggg==" alt="" /></a></span></span></span></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2011/03/21/hello-world-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Chat for Android in 30 Lines of Code</title>
		<link>http://www.android-code.com/2010/12/06/video-chat-for-android-in-30-lines-of-code/</link>
		<comments>http://www.android-code.com/2010/12/06/video-chat-for-android-in-30-lines-of-code/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 09:33:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>
		<category><![CDATA[Android Mobile]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=268</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.android-code.com/2010/12/06/video-chat-for-android-in-30-lines-of-code/"><em>Click here to view the embedded video.</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/12/06/video-chat-for-android-in-30-lines-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TIP Part 2</title>
		<link>http://www.android-code.com/2010/11/22/tip-part-2/</link>
		<comments>http://www.android-code.com/2010/11/22/tip-part-2/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 10:06:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=258</guid>
		<description><![CDATA[Considering that the setContentView( ) method is being told to set main.xml as the current View, and main.xml contains a TextView that says “Hello World, HelloWorldText,” it may be safe to assume that compiling and running HelloWorldText now will give you your Hello World! application. To test this, run your unaltered HelloWorldText application. Choose Run [...]]]></description>
			<content:encoded><![CDATA[<p>Considering that the setContentView( ) method is being told to set main.xml as the<br />
current View, and main.xml contains a TextView that says “Hello World, HelloWorldText,”<br />
it may be safe to assume that compiling and running HelloWorldText now will give<br />
you your Hello World! application. To test this, run your unaltered HelloWorldText<br />
application. Choose Run | Run to open the Run As dialog box, select Android Application,<br />
and click OK.</p>
<p><a href="http://www.android-code.com/wp-content/uploads/2010/11/1.jpg"><img class="aligncenter size-full wp-image-261" title="android programming" src="http://www.android-code.com/wp-content/uploads/2010/11/1.jpg" alt="" width="455" height="450" /></a></p>
<p>The new project you just established contains the code to create a Hello World!<br />
application on its own. However, that is not very engaging, nor does it teach you very<br />
much about programming an Android application. You need to dissect the project and<br />
see exactly how the project displayed the “Hello World!” message.<br />
What happened when you created the new Android project is that the Android plugin<br />
modified main.xml. This is a perfect example of one way to modify the UI in Android.<br />
The following lines of code are added to main.xml by the Android SDK when the project<br />
is created:<br />
&lt;TextView<br />
android:layout_width=&#8221;fill_parent&#8221;<br />
android:layout_height=&#8221;wrap_content&#8221;<br />
android:text=&#8221;Hello World, HelloWorldText&#8221;<br />
/&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/11/22/tip-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TIP</title>
		<link>http://www.android-code.com/2010/11/09/tip/</link>
		<comments>http://www.android-code.com/2010/11/09/tip/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 07:25:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=255</guid>
		<description><![CDATA[If you do not see the android.os.Bundle import statement in your project, expand the tree within your development window. Eclipse rolls up all the import statements under the first one, so you must expand the tree to see the rest of them. Focusing now on your class HelloWorldText, you can see that it extends the [...]]]></description>
			<content:encoded><![CDATA[<p>If you do not see the android.os.Bundle import statement in your project, expand the<br />
tree within your development window. Eclipse rolls up all the import statements under<br />
the first one, so you must expand the tree to see the rest of them.<br />
Focusing now on your class HelloWorldText, you can see that it extends the Activity<br />
class. Activity is imported from the previous lines. All applications derive the Activity class,<br />
and this derivation is required for running an application on Android. For something to<br />
run and be displayed on the screen, it must be derived from Activity.<br />
The HelloWorldText class holds the code needed to create, display, and run your<br />
application. Right now there is only one method in your HelloWorldText class that is<br />
defined with code in it, onCreate( ).<br />
The onCreate( ) method takes in icicle as a bundle. That is, all of the current<br />
state information is bundled as an icicle object and held in memory. You will not be<br />
directly handling icicle in this application, but you need to be aware of its presence<br />
and purpose.</p>
<p>The next line in the file is the one that really does some perceptible action:<br />
setContentView(R.layout.main);<br />
The method setContentView( ) sets the Activity’s content to the specified resource.<br />
In this case, we are using the main.xml file from the layout directory via the pointer in<br />
the R.java file. The main.xml file, right now, contains nothing more than the size of the<br />
HelloWorldText screen and a TextView. The TextView is derived from View and is used<br />
to display text in an Android environment. Reviewing the contents of main.xml, you can<br />
see that it contains the following line:<br />
android:text=&#8221;Hello World, HelloWorldText&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/11/09/tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.java File</title>
		<link>http://www.android-code.com/2010/10/29/java-file/</link>
		<comments>http://www.android-code.com/2010/10/29/java-file/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 04:45:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=247</guid>
		<description><![CDATA[&#60;activity&#62;.java File The file in the src directory that you will spend the most time with is &#60;activity&#62;.java (HelloWorldText.java in this example), which is created by the Android plugin and named to match the Activity name that you specified in the New Android Project wizard. Unlike most of the files you have examined in this [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;activity&gt;.java File The file in the src directory that you will spend the most time with<br />
is &lt;activity&gt;.java (HelloWorldText.java in this example), which is created by the Android<br />
plugin and named to match the Activity name that you specified in the New Android<br />
Project wizard. Unlike most of the files you have examined in this section, this file is<br />
completely editable; in fact, it will do very little for you if you do not modify it with<br />
your code.<br />
After briefly looking at what is in your HelloWorldText.java file as it is created by the<br />
Android plugin, you will then edit the file to create your first Android Activity.</p>
<p>package android_programmers_guide.HelloWorldText;<br />
import android.app.Activity;<br />
import android.os.Bundle;</p>
<p>public class HelloWorldText extends Activity {<br />
/** Called when the activity is first created. */<br />
@Override<br />
public void onCreate(Bundle icicle) {<br />
super.onCreate(icicle);<br />
setContentView(R.layout.main);<br />
}<br />
}<br />
The three lines at the top of the file are the standard preprocessor directives—that is,<br />
as in most programming languages, statements that are directives to the compiler to run<br />
before the application process. In this case, you have the definition and inclusion of your<br />
package android_programmers_guide.HelloWorldText.<br />
The next two lines import specific packages from the Android SDK via android.jar:<br />
import android.app.Activity;<br />
and</p>
<p>import android.os.Bundle;<br />
These lines tell the project to include all the code from the imported packages before all<br />
the code in your application. These two lines are critical for your base Android application<br />
and should not be removed..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/10/29/java-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Open Source Project</title>
		<link>http://www.android-code.com/2010/10/16/android-open-source-project/</link>
		<comments>http://www.android-code.com/2010/10/16/android-open-source-project/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 12:22:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Google Android]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=239</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.android-code.com/2010/10/16/android-open-source-project/"><em>Click here to view the embedded video.</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/10/16/android-open-source-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>R.java File</title>
		<link>http://www.android-code.com/2010/10/14/r-java-file/</link>
		<comments>http://www.android-code.com/2010/10/14/r-java-file/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 05:09:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=236</guid>
		<description><![CDATA[R.java File The file R.java is an auto-generated file that is added to your application by the Android plugin. This file contains pointers into the drawable, layout, and values directories (or the items within the directories, as is the case with strings and icons). You should never have to modify this file directly. You will [...]]]></description>
			<content:encoded><![CDATA[<p>R.java File The file R.java is an auto-generated file that is added to your application by the Android plugin. This file contains pointers into the drawable, layout, and values directories (or the items within the directories, as is the case with strings and icons). You should never have to modify this file directly. You will be referencing R.java in most of your applications. The code that was auto-generated for the HelloWorldText application follows:</p>
<p>/* AUTO-GENERATED FILE.  DO NOT MODIFY.<br />
*<br />
* This class was automatically generated by the<br />
* aapt tool from the resource data it found.  It<br />
* should not be modified by hand.<br />
*/<br />
package testPackage.HelloWorldText;<br />
public final class R {<br />
public static final class attr {<br />
}<br />
public static final class drawable {<br />
public static final int icon=0x7f020000;<br />
}<br />
public static final class layout {<br />
public static final int main=0x7f030000;<br />
}<br />
public static final class string {<br />
public static final int app_name=0x7f040000;<br />
}<br />
}</p>
<p><strong>NOTE</strong><br />
The comment section of the R.java file provides an explanation of the origin of the file. It states that the file was created by the aapt tool. In Chapter 6, when you create a command-line–only version of the Hello World! application, you will use command-line tools to create all of the auto-generated files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/10/14/r-java-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Directories in android</title>
		<link>http://www.android-code.com/2010/10/04/directories-in-android/</link>
		<comments>http://www.android-code.com/2010/10/04/directories-in-android/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 08:04:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=228</guid>
		<description><![CDATA[Directories There are also three directories in the project root—res, assets, and src—each of which has a distinct purpose. These directories play an integral part in the operation of your application. res Directory The res directory is where your in project resources are held and compiled into your application. When you create a new Android [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Directories</strong></p>
<p>There are also three directories in the project root—res, assets, and src—each of which has a distinct purpose. These directories play an integral part in the operation of your application.</p>
<p><strong>res Directory</strong></p>
<p>The res directory is where your in project resources are held and compiled into your application. When you create a new Android project, the res directory contains three subdirectories: drawable, layout, and values. You will use the drawable and layout directories in many of your projects to hold and display images and layouts respectively, whereas the values directory holds string globals that can be used throughout your</p>
<p>application.</p>
<p><strong>NOTE</strong></p>
<p>A reference to the res directory and its contents is contained by the R.java file, located in the src directory. This file is covered in much more detail later in the chapter. The drawable directory contains actual image files that your application can use and reference. The layout directory holds an XML file, main.xml, that is referenced by your application when building its interface. In most of the applications in this book, you will</p>
<p>be editing the main.xml file included in the layout directory. This will allow you to insert Views into the application’s visual layout and display them. An unaltered main.xml file contains the following code:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</p>
<p>&lt;LinearLayout xmlns:android=http://schemas.android.com/apk/res/android</p>
<p>android:orientation=&#8221;vertical&#8221;</p>
<p>android:layout_width=&#8221;fill_parent&#8221;</p>
<p>android:layout_height=&#8221;fill_parent&#8221;</p>
<p>&gt;</p>
<p>&lt;TextView</p>
<p>android:layout_width=&#8221;fill_parent&#8221;</p>
<p>android:layout_height=&#8221;wrap_content&#8221;</p>
<p>android:text=&#8221;Hello World, HelloWorldText&#8221;</p>
<p>/&gt;</p>
<p>&lt;/LinearLayout&gt;</p>
<p>The last directory under res, values, holds an XML file named strings. The strings.xml file is used to hold global string values that can be referenced by your application.</p>
<p><strong>assets Directory</strong></p>
<p>The assets directory is used to hold raw asset files. The files contained in the assets directory can include audio files for streaming and animation assets. we will not use any audio assets in the applications for this book because the beta audio drivers for the Android Emulator are not yet optimized.</p>
<p><strong>src Directory</strong></p>
<p>The src directory contains all the source files for your project. When your project is first created, it will contain two files, R.java and &lt;activity&gt;.java (in this example,</p>
<p>HelloWorldText.java), described next.</p>
<p><strong>NOTE</strong></p>
<p>&lt;activity&gt;.java is always named according to your Activity name.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/10/04/directories-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Manifest File</title>
		<link>http://www.android-code.com/2010/09/28/android-manifest-file/</link>
		<comments>http://www.android-code.com/2010/09/28/android-manifest-file/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 10:07:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android applications]]></category>

		<guid isPermaLink="false">http://www.android-code.com/?p=222</guid>
		<description><![CDATA[AndroidManifest.xml The AndroidManifest.xml file is where your global settings are made. If you are an ASP.NET developer, you can think of AndroidManifest.xml as Web.config and Global.asax rolled into one. (If you are not an ASP.NET developer, this means that AndroidManifest.xml is a place for storing settings.) AndroidManifest.xml will include such settings as application permissions, Activities, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>AndroidManifest.xml</strong></p>
<p>The AndroidManifest.xml file is where your global settings are made. If you are an ASP.NET developer, you can think of AndroidManifest.xml as Web.config and Global.asax rolled into one. (If you are not an ASP.NET developer, this means that AndroidManifest.xml is a place for storing settings.) AndroidManifest.xml will include such settings as application permissions, Activities, and intent filters.</p>
<p>The standard AndroidManifest.xml file should contain the following information:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;manifest xmlns:android=http://schemas.android.com/apk/res/android<br />
package=&#8221;testPackage.HelloWorldText&#8221;&gt;<br />
&lt;application android:icon=&#8221;@drawable/icon&#8221;&gt;<br />
&lt;activity android:label=&#8221;@string/app_name&#8221;&gt;<br />
&lt;intent-filter&gt;<br />
&lt;action android:value=&#8221;android.intent.action.MAIN&#8221; /&gt;<br />
&lt;category android:value=&#8221;android.intent.category.LAUNCHER&#8221;<br />
/&gt;<br />
&lt;/intent-filter&gt;<br />
&lt;/activity&gt;<br />
&lt;/application&gt;<br />
&lt;/manifest&gt;<br />
As you create future applications, you will be adding information to this file. Notice that the package name you supplied is listed here, as well as the action that your Activity will handle.</p>
<p><strong>Referenced Libraries</strong></p>
<p>A list of the Referenced Libraries is also included in the root of the project. Typically, for a beginner project, you should see only one library here. Expand the Referenced Libraries branch and examine its contents, the libraries that are currently referenced by your application project. Given that this is a new Android project, you will see one library in your project’s references, android.jar, the Android SDK. (If you are familiar with the Java SDK, android.java is analogous to Java’s rt.java file, containing many of the Java APIs found in rt.java.) The Android plugin ensures that this file is the only library referenced by your application. The application needs to reference the SDK to gain access to all the classes contained in the SDK libraries, such as your Views, Controls, and even the Google API.</p>
<p><strong>CAUTION</strong><br />
Eclipse enables you to add other user-defined libraries and external classes to your project’s references. However, unless you are sure that those external references will work with your Android application (and thus on the Android platform), you should think twice before you add them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.android-code.com/2010/09/28/android-manifest-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

