Complete Reference for Android Development

using Eclipse with SVN plug-in

Contents

Chapter No. Name Page No.
1. Download and Install Eclipse 02

2. Installing the ADT Plug-in 05

3. Configuring SDK for Android 10

4. Installing Subclipse Plug-in 17

5. Eclipse Helios 25

5.1 Create an Android project 25

5.2 Create an Android Emulator 34

5.3 Build and run Android Project 40

5.4 Locate APK file 44

5.5 Accessing Logcat 46

5.6 Take screenshot 48

6. SVN Check-in 49

6.1 Initial SVN Commit 49

6.2 Check-in 53

6.3 Check-out 55

6.4 Check-out based on Commit Version 58

CHAPTER 1
DOWNLOAD AND INSTALL ECLIPSE HELIOS

Download and Install Eclipse Helios from the below link based on your system
configuration:

http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliossr2

Note: This is not a Setup file, its direct executable one. Just download the ZIP file,
extract and execute eclipse.

This is the welcome screen. .

CHAPTER 2 INSTALLING ANDROID DEVELOPMENT TOOLS (ADT) PLUG-IN Go to: Help → Install New Software.. .

1.0.google..Click on “Add.zip .com/android/ADT-10..” and fill the fields: Name: “ADT Plugin” Location: http://dl.

Click “OK” Select Developer Tools and click Next .

Click on Finish.There are the plug-ins being installed. .

After restart we see android image as shown above.After completing installation restart Eclipse. . Click Yes to restart.

CHAPTER 3 CONFIGURING SDK FOR ANDROID Download SDK for MAC OS from: http://dl.com/android/android-sdk_r11-linux_x86.google.tgz Download SDK for Windows from: http://dl.google.com/android/android-sdk_r11-windows.zip Download SDK for Linux from: http://dl.com/android/android-sdk_r11-mac_x86.zip For iMac: Select: Eclipse → Preferences → Android For Linux or Windows: Select: Window → Preferences → Android .google.

. Select the extracted SDK which you have downloaded and click OK.On clicking on browse we get the below screen.

click on Apply and you get this screen because you have not yet installed any SDK Platform Tools. Click OK on this verification window and close the preferences window by clicking OK. After you have selected the SDK. .

. Expand the Android Repositories and select all the available Repositories and Install.Select Window → Android SDK and AVD Manager → Available Packages.

.Now select “Accept All” and click on “Install”.

After installation is completed close this window and go to preferences to check all the SDK Platforms. .

.For iMac: Select: Eclipse → Preferences → Android For Linux or Windows: Select: Window → Preferences → Android Now we see all the installed SDK Platforms which have been selected to download.

. . CHAPTER 4 INSTALLING SUBCLIPSE PLUG-IN Go to: Help → Install New Software.

x” .Click on “Add.x (Eclipse 3.6.tigris.6.2+)” Location: “http://subclipse.” and fill the fields: Name: “Subclipse 1.org/update_1...

Click “OK” .

.Tick all and click Next.

Click Next. .

. Then click on Finish.Read the License Agreements and click on accept.

Wait till the installation is completed. . After completing installation restart Eclipse. we see the Progress of installation in the right bottom corner of Eclipse.On clicking finish. Click “Restart Now” to restart. Click on the icon as showed to enlarge.

. Click OK if you like to receive anonymous usage statistics for the Eclipse instance. After restarting Eclipse goto: Window → Open Perspective → Other You should be able to view “SVN Repository Exploring” option if its installed successfully as shown below. Recommended: Click OK.

CHAPTER 5 ECLIPSE HELIOS 5.1) Creating an Android Project: Select File → New → Other → Android → Android Project and you get the window as shown below: Click Next .

.We should fill the required fields to create an Android Project.

Give a project name and select “Create new project in workspace” from Contents .

Select the Build Target of Android as per your requirement. .

Package name.Enter an Application name. . and Activity name.

.Once done with filling all the details click on Finish for creating New Android Project.

.Here we get the new project Demo created in the workspace.

This is the complete project file structure. .

it will be shown here in the Problems window. If any warnings or errors exists in the project. Select Window → Show View → Other → General → Problems . If you are unable to view this window.

2 Create an Android Emulator: Click on the above shown icon to launch Android Virtual Device (AVD) Manager.5. . Select New to create an AVD.

Now we need to fill the required details as shown below. .

Fill the following details as shown above: 1) Give proper name 2) Select the required target 3) If needed specify SD Card size 4) Select HVGA under “Skin → Buit-in” to get a correct size of the emulator Once this is done. . click on “Create AVD”.

select it and click “Start” .Now our AVD is created.

Click on “Launch” to launch the AVD. .If needed we can change the display size by marking “Scale display to real size” and input the fields.

This is the Android Virtual Device launched successfully. .

Open Console to view the process while running the Android Project. Select Window → Show View → Other → General → Console Select Console and click OK.3) Build and run Android Project: To run any project. .5. Select Project → Build Automatically Here tick this option (Recommended). build is compulsory to keep the project error free.

If there is no AVD available then the AVD Manager gets launched and we need to create an AVD. Now right click on the project and select Run As → Android Application. Look at Console view for the progress. Here we get the console view. If the emulator (AVD) is on. the Android Project runs in that emulator else it will launch the matching configuration emulator if exists. .

If we need to run the Android Project in an particular AVD then Right Click on the project and Select → Run As → Run Configurations → Target → Manual Click on “Apply” and then click on “Close” or “Run” .Note: We can create several AVD's.

. From here we can select an Running AVD or can Launch an new AVD. we get the below shown window when we try to run the Android Project.Once this target selection settings is made to Manual.

4) Locate APK File: Right click on the project and select “Properties” Here under Resource option we have Location of our project. Go to the Location as shown and open “bin” folder.5. .

.Here we have the APK file.

Logs from various applications and portions of the system are collected in a series of circular buffers.5. which then can be viewed and filtered by the logcat command. Select Window → Show View → Other → Android → Logcat Select “LogCat” and Click OK This is the logcat window being displayed at the bottom of Eclipse Window.5) Access Logcat: The Android logging system provides a mechanism for collecting and viewing system debug output. .

Since the log printed in the logcat view are specific to devices. we need to select the devices. . So to select the required device: Select Window → Show View → Other → Android → Devices Select Devices and click OK This is the devices window being displayed at the bottom of Eclipse Window.

i) Download any Screen shot application from Android Market. To download an easy and better screenshot application for Android click here to download. its the button to take screen shot of the device which is selected. 5.If there are devices connected to the PC or any emulator which is launched.6) Take Screen shot: i) Select Window → Show View → Other → Android → Devices As marked in the above screen shot. we can see it in devices view as shown below: Click the device whose logcat you want to view and then open LogCat view. .

. CHAPTER 6 SVN CHECK-IN 6.1) Initial SVN Commit: Right click on the project you want to check-in and select: Team->Share Project Select SVN and click Next.

Paste the Repository url from the Repositories tab of your respective projects from the
Unfuddle account and click Next.

Click on Next.

If needed, edit the comment and Click Finish to complete the SVN Commit.

2) Check-in: Now for second time onwards for that particular project we get the Commit option directly as shown below.6. .

When clicked on commit we get this screen. De-select the bin folder which is not needed and give proper comments. . Click OK to commit.

6. .3) Check-out: Goto File->New->Other Select SVN->Checkout Projects from SVN and click Next.

Select the Repository Location and click Next. .

Select the project folder and click Finish. .

4) Check-out based on Commit Version: Select File → Other → SVN → Checkout Projects from SVN Click Next .6.

.Select Create a new repository location if this is the first time else you can use existing repository location and click Next.

Paste the URL of the repository in the field as shown above and click Next. .

.Select the folder to be checked out from SVN and click Next.

.

uncheck the “Check out HEAD revision” and click on Select. .Now select the appropriate options: 1) Tick “Check out as a project in the workspace” option 2) If needed then change the Project name 3) If you want to check out based on the commit version.

Here we have the window to customize the check out. We can see the revision number i.e.. . Comment. the commit version. Author. Select the revision number and click OK and then Finish. Date.

. Date.Beside the Project we can see the Commit version. Time and Author as shown below under the workspace of Eclipse as shown below.