We are excited to kick off yet another series, this time on developing Android applications, and I hope you are too. We figured a change of pace was in order, since every now and then, we like to share something new and exciting with our readers. So I am sure our readers would be interested in learning to create Android apps of their own!
In this series so far;
Part 1: How To Set up Android SDK for App Development?
Part 2: Creating your First "Hello World" Android App
Part 3: In progress...
Getting the Android SDK
Previously, when we were working on older versions of Android, putting the SDK together was a bit of a mess. You had to install Java, get the Eclipse IDE, install the JDK, and then download the various APIs (Android Versions) you want to test your apps on once finished. Now though, there's a much better solution.
You can now get the all-in-one ADT (Android Developer Tools) Bundle free from the Android Developers' website. It is a convenient package that contains all the thing you'll need to build your own apps. Follow the link below to download the SDK.
Click the Download the SDK button at the right, and choose your download options to download the bundle for free.
Once the zip file is downloaded, extract it, and then place the extracted folder in a convenient location. And that's it! Your Android SDK is ready to go! It doesn't even need an install! You just need to have java installed on your computer. You can get that from java.oracle.com.
Getting Started
In the extracted folder, you will see a folder named eclipse. Open up that folder, and then open eclipse.exe. You have now started the IDE, and you're now ready to code! But before we move on to that, let me quickly walk you through the interface.
When you open it up, it might look something like this.
Well, not quite like it, because I already have made a small app for the purpose of this demonstration. But the basic interface will look the same.
Towards the left side is the Package Explorer. You can track your projects in this window, and also keep track of all the files and resources in your project. It'll give you quick access.
Down below where you see Problems, Javadoc etc, that's your multi-purpose output window. You can view warnings or errors here, and other message. It can also be used to show your program's output, since it is a native Java compiler.
On the left you have the properties window. You will see attributes for your User-Interface objects here. For example, you will see the background color, ID, text, etc of a button on your screen. Remember: You can move any of these windows around, and dock them wherever you like. Now let's take a look at the inner window.
Now, on the top, you have the file tabs. You can switch between different open files in your project easily. On the left ( Form Widgets, Text Fields etc), are the different objects you can use in the drag-and-drop interface. You can use these tools to visually design your app. Note that this is only available if you have a layout XML file open. If you go over to a java file, these will disappear, and you'll see a bunch of code instead.
Another thing of note is the Device Selector. See the Nexus One written on the top? You can change that to another device from the drop-down menu. This tool will let you see how your app will look on a certain device.
While we're on the subject of devices, let me show you the Android Emulator before signing off.
Go to Window on the top, and then click on Android Virtual Device Manager. Now, click on New to create a new test platform.
Towards the left side is the Package Explorer. You can track your projects in this window, and also keep track of all the files and resources in your project. It'll give you quick access.
Down below where you see Problems, Javadoc etc, that's your multi-purpose output window. You can view warnings or errors here, and other message. It can also be used to show your program's output, since it is a native Java compiler.
On the left you have the properties window. You will see attributes for your User-Interface objects here. For example, you will see the background color, ID, text, etc of a button on your screen. Remember: You can move any of these windows around, and dock them wherever you like. Now let's take a look at the inner window.
Now, on the top, you have the file tabs. You can switch between different open files in your project easily. On the left ( Form Widgets, Text Fields etc), are the different objects you can use in the drag-and-drop interface. You can use these tools to visually design your app. Note that this is only available if you have a layout XML file open. If you go over to a java file, these will disappear, and you'll see a bunch of code instead.
Another thing of note is the Device Selector. See the Nexus One written on the top? You can change that to another device from the drop-down menu. This tool will let you see how your app will look on a certain device.
While we're on the subject of devices, let me show you the Android Emulator before signing off.
Go to Window on the top, and then click on Android Virtual Device Manager. Now, click on New to create a new test platform.
Now, choose a name for your virtual device as I have done, choose a device, and then choose an API (Android version you want to run). Assign RAM and storage as needed, and then Click on either the Snapshot or the Use Host GPU option. Since the virtual device takes some time loading up, the Snapshot option can help you start it up quickly every time by saving a snapshot of your last AVD position. Hence, this option is recommended.
Now hit Ok, and then Start. Voila! You can now see the Android Emulator start up on your computer after a couple minutes, just like the Android smartphone you (might) have.
We will be using this virtual emulator to test our Android app(s). But that's a topic for another post. Right now, feel free to look around the IDE interface, and familiarize yourself with it. Our next entry will be about creating your first simple "Hello World" Android App. Stay tuned :)
Source : mybloggertricks[dot]com
No comments:
Post a Comment