Android Tutorial - Getting Started with android & Eclipse

Hi everyone, here is my first Android tutorial, and maybe also your's first.

I'm gonna show you how to install "Android plugin" in Eclipse IDE and how to set up your first Android project.
First of all, if you haven't downloaded Eclipse yet you can do it with this link. Standart download should be enough.

Then open eclipse (and set your workspace, a popup windows will appear every time that you start the program) click help>Install New Software, afterward click on add button and fill the boxes:

  • On name box write "ADT plugin", or android, or whatever you want.
  • An on URL box write: https://dl-ssl.google.com/android/eclipse/

Click ok, and in the dialog at the center will appear two packages (Developer tools and NDK plugins), select both and click next. Then read and accept the licenses. All the packages will be installed now. When installation completes, restart Eclipse.

Finally It's necesary to specify where the "Android SDK" is installed, if nothing appears click Window>Preferences. In my case: "C:\Users\Bardo91\AppData\Local\Android\android-sdk":
And that's everything! Android SDK plugin and developer tools is installed and ready to be used.

If you can't see the icons that are circled in red, click windows>Customize Perspective and click "Command Groups Availability" label. There check the checkboxes called: "Android Lint, Android Refactoring, Android SDK and AVD Manager and Android Wizards.

So... Let's start with our first project! To make a new application click File>New>Other, in the dialog search for the Android folder and select "Android Application Project". Press Next, and in the new dialog we'll set the basics information about the project:

  • Application Name: That will be the name that is going to appear when it's installed.
  • Project Name: This is the name of our project inside Eclipse.
  • Package Name: "Folders" where our project is organized.
  • Minimum Required SDK, Target SDK: I think that are obvious (Related to the android version)
  • Compile with: is the version that will use Eclipse to compile the project
  • Theme: Themes, are only available since Android version 4.0, with earlier versions will be set to "None
In the new windows it's possible to choose if Eclipse will create some basic objects like the icon of our application (It can be changed later son don't worry about it), and the main activity. Followings dialog are the configuration of those objects. Click Next until Finish.

At this point, this will be you screen:

  1. The sources: The files which contains the java code.
  2. The resources: Multimedia files and XML files that codifies values, objects and the graphical part of our application.


You might be thinking how to put your application on your smartphone. Well, there are two ways:

  • There's a file with the extension ".apk" located in the "bin" folder of your application (for example C:\Users\Bardo91\workspace\HelloWorld\bin\HelloWorld.apk). Execute that file on your smartphone and it will be installed (Be sure that you set your mobile to accept "foreign application", if not android will redirect you to that option).
  • The other way is to connect the mobile directly to the computer by USB, then if you click "run button" (Seems a green play button) or "debug button" Eclipse install the application and execute it. To take this option two things are needed.
      1. Activate the "developer option" on your mobile phone.
      2. Install the "USB addon" for eclipse. To do that, start the SDK manager and install the addon:



I hope you learned and enjoyed with this tutorial.
Don't be shy for asking for any doubt, comment!

See you soon! And thanks for reading!



No hay comentarios:

Publicar un comentario