otak info official Logo   
OTAK.INFO
Personal Blog

Hariyanto Lim

정길상 / 鄭吉祥
Home   Last Posts  
 
Please login to see more topics and discussion categories.
 
goto main category list >> Software programming >> Android

Title : How to migrate Android project from Eclipse to Android Studio
Total Reply : 6
Total View : 2618


Harry
Harry
Total thread: 131
Total reply: 50

Post #154
How to migrate Android project from Eclipse to Android Studio
As of 2nd April 2015, current Android Studio version is V1.1.0

I have been migrating a few of my Android eclipse projects to Android Studio, it is actually very simple and straight forward, Please see the following steps:

1. Welcome page of Android Studio -> Choose "Import Project (Eclipse ADT, Gradle, etc.)"
2. Choose the folder of our Eclipse project
** Make sure the project is compile-able in Eclipse (including its referenced projects if any)

In this case, the project name is "Shocking Deal-Android" but it has referenced on PhotoMovieReviewLibrary (please see the screen shot)

How to migrate Android project from Eclipse to Android Studio
Falling in love with the world

Write : 2015-04-02 15:04:47

Harry
Harry
Total thread: 131
Total reply: 50

Post #155
Migration step 2 (select destination folder)
Reply #1
We need to select a destination folder to save this new Android Studio project.

In my case, I have a separated workspace folder for Eclipse and Android Studio (it is a good habit to have a separate folder management), so naturally I will select a new folder in Android Studio (if the folder is NOT exist then Android Studio will create it automatically)

Migration step 2 (select destination folder)
Falling in love with the world

Write : 2015-04-02 15:07:56

Harry
Harry
Total thread: 131
Total reply: 50

Post #156
Migration step 3 (waiting for the Android Studio to finish)
Reply #2
Android Studio will take some time to complete the project creation (analysing folders, copying files, creating gradle script, etc.)

In my Mac Pro (Intel i7 + 16GB ram + 256GB SSD) only takes less than 30 seconds.

Migration step 3 (waiting for the Android Studio to finish)
Falling in love with the world

Write : 2015-04-02 15:11:11
Last edit : 2015-04-02 15:12:31

Harry
Harry
Total thread: 131
Total reply: 50

Post #157
Migration step 4 (verifying the result)
Reply #3
At this time, the project is already created successfully, we need to verify the project detail.

The screen shot will show 2 modules (shockingDeals & photoMovieReviewLibrary), note that all modules name started with lower case alphabets.

Migration step 4 (verifying the result)
Falling in love with the world

Write : 2015-04-02 15:14:57

Harry
Harry
Total thread: 131
Total reply: 50

Post #158
Migration step 5 (analyst the result project folder structure)
Reply #4
The folder will have 2 modules.

Migration step 5 (analyst the result project folder structure)
Falling in love with the world

Write : 2015-04-02 15:16:37

Harry
Harry
Total thread: 131
Total reply: 50

Post #159
Migration step 6
Reply #5
Make sure to check the project property ("structure"), see that the "main" module "shockingDeals" has dependency on "photoMoViewReviewLibrary" (on the most top)

Migration step 6
Falling in love with the world

Write : 2015-04-02 15:39:55

Harry
Harry
Total thread: 131
Total reply: 50

Post #160
Migration step 7
Reply #6
At this point, we are ready to run the project.

There may be so many compile error, Eclipse may be more forgiving to skip the error in our code, resource images and even in our xml layout design, but Android Studio is very strict and may shows a few error which we have to fix before we can compile and run the project.

In my experiences, after completing the project migration then I normally tweak the gradle script a little bit, such as defining proper library version to use, etc.

NOTE: by default, Android Studio with Gradle need INTERNET connection to work properly for synch library to get latest version (eg: android-support-v4, etc.). But fortunately we can make Gradle to work offline (tell Gradle to not connect to Internet to get latest library version) and compile faster.

Migration step 7
Falling in love with the world

Write : 2015-04-02 15:47:13

If you want to create a new reply then please login first.



www.OTAK.INFO
Since 19 January 2007
Page hit : 937,072

Code update 24th June 2013
Brain is a very capable to solve big problems
but requires constant reminders about how to.
peace bird