tomsfacts
Newbie
Alright folks, I am new to development. I have spent countless hours reading through development guides, practicing in eclipse, reading the android developers guide etc.
I always wished that there was a guide that showed me a simple tutorial that did more than display hello world, but also wasn't too complex for a complete noob to understand.
That's why I have created this simple guide to give a jump start to those who are in the position I once was.
This will show you how to make an app that has two text entry fields (called EditText's), take the user input from those fields, and when a button is pressed it will display the user inputted text on two seperate text display fields (called textView's).
Step 1 - Setup Eclipse and Android SDK
There are lots of simple to follow guides on how to do this so I won't waste my time here. I would look at the guide on developer.android.com
Step 2 - Open Eclipse and Create New Android Application
Go ahead and open Eclipse, and go to file-->New-->Android Project
Project Name: Change Text
Create New Project in Workspace [X]
Use Default Location [X]
Build Target: Use whatever target you can choose, it really does not matter for this tutorial
Application Name: Change Text
Package Name: com.tomsfacts.changetext (this is where you use your dev name/company name, for instance if Motorola made this app, they would put Motorola instead of tomsfacts).
Create Activity: [X] mainActivity
Min SDK Version:Use the corresponding number to what build target you used. (I am using Android 2.0 so I enter in "5" in this field)
Click Finish
Step 3 - Make the XML Layout File
Alright so Android uses Java for all of its coding guts, but for the actual user interface it uses an XML file, which makes it a lot easier to format your applications.
So in the left navigation area you will need to expand your folder called "ChangeText". Navigate to res-->layout-->and double click the main.xml
You should now be looking at the xml file. Make sure the tab in the bottom left is on graphical layout. You should be staring at a TextView that has something like "hello world" displayed on it.
Go ahead and locate the palette on the left hand side. Scroll down to TextView, and drag it over to the xml, placing it below the "hello world".
Now drag over two EditTexts and place them below the TextViews.
Now drag a button over to the xml and place it below the EditTexts.
Essentially what has just happened is Eclipse automatically generated an xml layout file for your application with no need for coding! To see the generated code click on the main.xml tab.
Go to the main.xml tab, and find the first TextView code. It starts with <TextView and ends with /> or sometimes</TextView>. In the first textview, add this line of code:
android:id=
I always wished that there was a guide that showed me a simple tutorial that did more than display hello world, but also wasn't too complex for a complete noob to understand.
That's why I have created this simple guide to give a jump start to those who are in the position I once was.
This will show you how to make an app that has two text entry fields (called EditText's), take the user input from those fields, and when a button is pressed it will display the user inputted text on two seperate text display fields (called textView's).
Step 1 - Setup Eclipse and Android SDK
There are lots of simple to follow guides on how to do this so I won't waste my time here. I would look at the guide on developer.android.com
Step 2 - Open Eclipse and Create New Android Application
Go ahead and open Eclipse, and go to file-->New-->Android Project
Project Name: Change Text
Create New Project in Workspace [X]
Use Default Location [X]
Build Target: Use whatever target you can choose, it really does not matter for this tutorial
Application Name: Change Text
Package Name: com.tomsfacts.changetext (this is where you use your dev name/company name, for instance if Motorola made this app, they would put Motorola instead of tomsfacts).
Create Activity: [X] mainActivity
Min SDK Version:Use the corresponding number to what build target you used. (I am using Android 2.0 so I enter in "5" in this field)
Click Finish
Step 3 - Make the XML Layout File
Alright so Android uses Java for all of its coding guts, but for the actual user interface it uses an XML file, which makes it a lot easier to format your applications.
So in the left navigation area you will need to expand your folder called "ChangeText". Navigate to res-->layout-->and double click the main.xml
You should now be looking at the xml file. Make sure the tab in the bottom left is on graphical layout. You should be staring at a TextView that has something like "hello world" displayed on it.
Go ahead and locate the palette on the left hand side. Scroll down to TextView, and drag it over to the xml, placing it below the "hello world".
Now drag over two EditTexts and place them below the TextViews.
Now drag a button over to the xml and place it below the EditTexts.
Essentially what has just happened is Eclipse automatically generated an xml layout file for your application with no need for coding! To see the generated code click on the main.xml tab.
Go to the main.xml tab, and find the first TextView code. It starts with <TextView and ends with /> or sometimes</TextView>. In the first textview, add this line of code:
android:id=
rientation="vertical"
