How to import android source code(AOSP) into Android studio?
Solution 1:
I know this was already answered, but I wanted to add onto this for anyone else that sees this.
For Android studio:
-
Open terminal (*nix system) call the following:
{AOSP root}/make idegen && development/tools/idegen/idegen.sh
This will generate an
android.ipr
file in the{AOSP root}
directory.- In Android Studio, select 'Open project' and select the generated
android.ipr
file. - Note: this will take a long time to index all the files (~2 hours). Be patient. If a dialog box that says 'Framework detected' appears, select that and hit 'OK'.
Now you have the entire Android framework loaded into Android Studio.
Solution 2:
I found the answer from my colleague, he told me that , use the file in
sourcecode/development/ide/eclipse/.classpath
this file is for eclipse to import android source code . but there is a way to transfer this file into a intellij project import file . sorry , I also don't know how to transfer. but my colleague email me a *.iml file.yeah ,this is the file that can help you crate the intellij module . After you get the file ,copy that *.iml file to the root of your sourcecode,then you can open the intellij,create a empty project ,import module from existing module ,then in the window ,chose the *.iml file ,after that ,the only thing you can do is wait . it takes much time to import it. so ,you can develop the android source code in intellij . enjoy it!
Solution 3:
Follow the steps to Migrate to Android Studio:
Export from Eclipse
- In Eclipse, select File > Export.
- In the window that appears, open Android and select Generate Gradle build files.
- Select the project you want to export for Android Studio and click Finish.
Import to Android Studio
- In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
- Click Import Project.
- Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.
- In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)
That's all you need to do. For more you may refer to official doc.