【问题标题】:What is the correct way to import or open the Android Source Code into Eclipse or Android studio将Android源代码导入或打开到Eclipse或Android Studio的正确方法是什么
【发布时间】:2014-08-08 10:06:07
【问题描述】:

我使用的是 Ubuntu 14.04,我已经按照 Android 官方网站的说明获取了最后一个 Android 源代码:http://source.android.com/source/downloading.html

我还按照说明安装了构建 Android 源代码所需的其他程序:http://source.android.com/source/building.html

要构建 Android 源代码,我按照 http://source.android.com/source/building-running.html 的说明进行操作。

没有安装一些额外的程序,构建没有成功完成,我通过论坛询问为什么没有成功构建 Android 源代码。

out/target/produkt/generic/system.img创建成功镜像后,我在终端中写了“emulator”命令打开了模拟器。

我的问题是将 Android 源代码导入或打开到 Eclipse 或 Android Studio 以开始工作的正确方法是什么,因为当我在 Eclipse 中导入 Android 源代码项目时。我对这种方式有错误:

  1. 创建一个空的 java 项目。 Properties>Java Build Path>Source>Link Source>Android 文件夹路径。
  2. 文件>新建>java项目>位置:Android文件夹路径。
  3. Import>Android>Existing Android Code into Workspace>根目录:Android 文件夹。

【问题讨论】:

    标签: java android eclipse android-studio android-source


    【解决方案1】:

    file>new>Project...>来自现有代码的 Android 项目。

    【讨论】:

    • 我尝试过这种方式,但大多数项目在eclipse中都有错误,因为你可以看到更多的照片。大多数项目都有错误,因为使用了在项目中找不到的包。 photo1photo2
    【解决方案2】:

    我建议您从终端窗口获取 aosp 构建工作。我在 aosp 4.0.3 fork 上工作。 Ubuntu 10.04 是首选。它很旧,但您不必更改 AOSP 文件即可构建。 据我所知,从 Eclipse 构建 aosp 不是一种选择。

    请查看Using eclipse to browse/edit/debug aosp tutorial

    【讨论】:

    • 非常感谢您的帮助,目前我通过 gedit 应用程序手动修改源代码并从终端窗口构建它。要在 aosp 中添加项目应用程序,请点击此链接:How to add App in Android as Basic App
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多