9
Setup ChTt Development Workspace Android Studio and Eclipse Trn Kim Hiếu - May 6, 2014 ChTt Mobile Developer [email protected] 1 SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Setup Android Workspace

Embed Size (px)

Citation preview

Page 1: Setup Android Workspace

Setup Chợ Tốt Development Workspace Android Studio and Eclipse!!Trần Kim Hiếu - May 6, 2014 Chợ Tốt Mobile Developer [email protected]

�1SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Page 2: Setup Android Workspace

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 specifications 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

�2SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Page 3: Setup Android Workspace

Clone Project from Gitlab!At first, 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#

!!!

�3SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Page 4: Setup Android Workspace

And you need go to this repository to clone code http://gitlab.chotot.com/hieu/chotot-master-project-android#!git clone [email protected]:hieu/chotot-master-project-android.gitcd chotot-master-project-androidgit submodule update --init —recursive!When finish, 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#!!

�4SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Page 5: Setup Android Workspace

# And now press OK.#4. Exclude test folder from source code.#

�5SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Page 6: Setup Android Workspace

5. Run Android Project#

!!!!!!!!

�6SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Page 7: Setup Android Workspace

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 Profile#

!

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

Page 8: Setup Android Workspace

# #6. Choose Eclipse JUnit Launcher#

7. And press OK#!If you see error like bellow#

�8SETUP ANDROID DEVELOPMENT - TRAN KIM HIEU - CHO TOT - V1

Page 9: Setup Android Workspace

Please change Run Config

�9SETUP 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 file. Need to be update in build.gradle file.#!We have plan to convert source code into Android Studio Project