Now we can get started on the fun stuff. Create a new folder on your C:
Drive (or whatever you use,) and name it android. Open up the Android
SDK zip, and go into the main folder. Copy all of the files from the
Android SDK zip into C:\android.
We've now got to set the all important Path variable. Right click on My Computer and click Advanced, Environmental Variables (or Start -> Settings -> Control Panel -> System -> Advanced -> Environmental Variables.)
In the Environmental Variables window, in the System Variables pane, scroll down to Path. Double click on it to edit it. Scroll all the way to the right side of the value, and add ";c:\android\tools" (or the absolute path to your tools folder,) to the end of it, as shown below.
Click OK in all of the windows, and that's good to go.
Time for Eclipse. Create a new folder on your C: Drive (or whatever you use,) and name it eclipse. Just like before, open up the Eclipse zip, go into the main folder, and copy all of the files into C:\eclipse.
Almost there! Go ahead and make a shortcut to Eclipse on your Desktop (if you want.) Start up Eclipse.
It will prompt you to choose a workspace location.
This is where all of your project files will be stored. Set it where you want, and click OK.
Once Eclipse is started up, we can add the ADT plugin. In the menu, Help -> Software Updates.
Click on the Available Software tab at the top.
Click on Add Site. For the URL, we're going to use http://dl-ssl.google.com/android/eclipse.
Click OK. It may tell you that there was no repository found at https://dl-ssl.google.com/android/eclipse. That's fine, Click OK.
Expand the tree for http://dl-ssl.google.com/android/eclipse (note http, not https.) Click the checkbox next to the tree expander, and it will select all of the tools.
Click Install. Eclipse will go ahead and calculate the installation stuff it needs, and download the files.
Click finish, and it will install them.
Eclipse will prompt you to restart, click Yes. Eclipse will restart, and whalah, you're finished!
To run a quick test and make sure everything is working properly, go to File -> New -> Project. Expand Android, click on Android Project, and click Next.
Now we'll have to fill in our project information. Because this is a test run, we'll call the project testrun. For the package name, we'll use com.android.test. And last but not least, the activity name will be test.
Click Finish.
Eclipse will crunch on that for a second, and open the project in the left pane. Expand the main tree to see the file structure of a default new project. The last thing we need to do before we run our test application is set up a run configuration. In the menu, go to Run -> Run Configurations...
Double click on Android Application and it will create a new configuration. Give the configuration a name, and click browse for the project.
Choose your project, click OK. Now click Apply, then Run.
You'll notice the bottom pane switches over to Console. This will let you know what's going on with the emulator. After a few seconds, the emulator will start up.
Note that the first run will take *much* longer than usual to start up, as it's setting up the Android OS while it starts up for the first time. Depending on the specs of your computer, it can take anywhere from a few minutes to over half an hour.
After awhile, you'll arrive at the starting screen.
Click on Menu to unlock the screen. Usually, you'll get a few errors as things start up and can't be started.
I usually just click wait. In the console, you'll see it install, and then start up your application.
And with that, it's time for you to dive into the code and start making your application.
We've now got to set the all important Path variable. Right click on My Computer and click Advanced, Environmental Variables (or Start -> Settings -> Control Panel -> System -> Advanced -> Environmental Variables.)
In the Environmental Variables window, in the System Variables pane, scroll down to Path. Double click on it to edit it. Scroll all the way to the right side of the value, and add ";c:\android\tools" (or the absolute path to your tools folder,) to the end of it, as shown below.
Click OK in all of the windows, and that's good to go.
Time for Eclipse. Create a new folder on your C: Drive (or whatever you use,) and name it eclipse. Just like before, open up the Eclipse zip, go into the main folder, and copy all of the files into C:\eclipse.
Almost there! Go ahead and make a shortcut to Eclipse on your Desktop (if you want.) Start up Eclipse.
It will prompt you to choose a workspace location.
This is where all of your project files will be stored. Set it where you want, and click OK.
Once Eclipse is started up, we can add the ADT plugin. In the menu, Help -> Software Updates.
Click on the Available Software tab at the top.
Click on Add Site. For the URL, we're going to use http://dl-ssl.google.com/android/eclipse.
Click OK. It may tell you that there was no repository found at https://dl-ssl.google.com/android/eclipse. That's fine, Click OK.
Expand the tree for http://dl-ssl.google.com/android/eclipse (note http, not https.) Click the checkbox next to the tree expander, and it will select all of the tools.
Click Install. Eclipse will go ahead and calculate the installation stuff it needs, and download the files.
Click finish, and it will install them.
Eclipse will prompt you to restart, click Yes. Eclipse will restart, and whalah, you're finished!
To run a quick test and make sure everything is working properly, go to File -> New -> Project. Expand Android, click on Android Project, and click Next.
Now we'll have to fill in our project information. Because this is a test run, we'll call the project testrun. For the package name, we'll use com.android.test. And last but not least, the activity name will be test.
Click Finish.
Eclipse will crunch on that for a second, and open the project in the left pane. Expand the main tree to see the file structure of a default new project. The last thing we need to do before we run our test application is set up a run configuration. In the menu, go to Run -> Run Configurations...
Double click on Android Application and it will create a new configuration. Give the configuration a name, and click browse for the project.
Choose your project, click OK. Now click Apply, then Run.
You'll notice the bottom pane switches over to Console. This will let you know what's going on with the emulator. After a few seconds, the emulator will start up.
Note that the first run will take *much* longer than usual to start up, as it's setting up the Android OS while it starts up for the first time. Depending on the specs of your computer, it can take anywhere from a few minutes to over half an hour.
After awhile, you'll arrive at the starting screen.
Click on Menu to unlock the screen. Usually, you'll get a few errors as things start up and can't be started.
I usually just click wait. In the console, you'll see it install, and then start up your application.
And with that, it's time for you to dive into the code and start making your application.
No comments:
Post a Comment