Anda di halaman 1dari 9

Setup Ch!

T"t Development Workspace


Android Studio and Eclipse

Tr"n Kim Hi#u - May 6, 2014
Ch% T&t Mobile Developer
kimhieu@chotot.vn'
(1 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
Introduction
This document introduce you to setup workspace, prepare for developing Android
App (In this case is Ch! T"t Android Application) with Android Studio and Eclipse.
Some keywords you must know before begin
Android Studio - Android Studio is a new Android development environment based
on IntelliJ IDEA. Similar to Eclipse with the ADT Plugin, Android Studio provides
integrated Android developer tools for development and debugging.
http://developer.android.com/sdk/installing/studio.html
Android Developer Tools - Android Development Tools (ADT) is a plugin for the
Eclipse IDE that is designed to give you a powerful, integrated environment in which to
build Android applications.
http://developer.android.com/tools/help/adt.html
Android Software Development Kit - The Accessory Development Kit (ADK) is a
reference implementation for hardware manufacturers and hobbyists to use as a starting
point for building accessories for Android. Each ADK release is provided with source
code and hardware specications to make the process of developing your own
accessories easier. Creating new and alternative hardware based on the ADK is
encouraged!
http://developer.android.com/sdk/index.html
Gradle Automatic Build (aka Gradle) - Gradle is an advanced build system as well as
an advanced build toolkit allowing to create custom build logic through plugins.
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Introduction
(2 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
Clone Project from Gitlab
At rst, You need clone code from Gitlab server to your local development environment.

We have 5 project but you only need clone master project, 4 remain projects are
submodule and It is cloned automatically.
You need have Developer role for all of them. And this is project git layout of ChoTot-
Master-Project-Android



(3 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
And you need go to this repository to clone code http://gitlab.chotot.com/hieu/chotot-
master-project-android

git clone git@gitlab.chotot.com:hieu/chotot-master-project-android.git
cd chotot-master-project-android
git submodule update --init recursive

When nish, you begin import it into ADT (Eclipse base) or Android Studio (IntelliJ base)
and setup working environment.


Setup Project Working Environment with Eclipse

1. Open ADT and create new workspace.
File/ Switch Workspace/ Other
Enter folder path for new workspace.
Select OK
2. Import projects into workspaces.
File/Import
Choose Android/Existing Android Code into Workspace
Click Next
Browse Root Directory to chotot-master-project-android location.
Have so many projects but you just import follow this list.
1. ActionBarSherlock/actionbarsherlock
2. chotot-android (Main project)
3. facebook701-android/facebook
4. lib701-android
5. showcaselib-android/showcase-library
3. When import is OK, Change Lib701 to Android Lib
1. Go to lib701-android Properties/ Android
2. Scroll down and tick it.
Choose project build target to newest android platform


(4 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
And now press OK.
4. Exclude test folder from source code.
(5 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
5. Run Android Project








(6 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
Import Test Project Into Workspace
And we need import test project into workspace for run Unit Test.
1. Import java project
1. File/Import
2. General/Existing Project into Workspace
3. Select Root Directory to ChoTotAppTest directory.
4. Tick to ChoTotAppTest and press Finish.
5. Run ChoTotAppTest as a JUnit Prole

(7 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

6. Choose Eclipse JUnit Launcher
7. And press OK

If you see error like bellow
(8 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
Please change Run Cong
(9 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1
Warning:
Gradle use with Eclipse is not work well. At this time, ADT (base Eclipse) use Ant to
automatic build. If you need add some project or libs le. Need to be update in
build.gradle le.

We have plan to convert source code into Android Studio Project

Anda mungkin juga menyukai