配置Eclipse使用自己的Andr​​oid SDK(framework.jar) [英] Configure eclipse to use my own Android SDK (framework.jar)

查看:197
本文介绍了配置Eclipse使用自己的Andr​​oid SDK(framework.jar)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个自定义的framework.jar我的设备。这种新的架构包括一个新的API,我想在我的应用程序使用。不幸的是,除了我包含在Java构建路径我自己framework.jar,日食没看到我的新的API,并抛出编译时错误。 如何配置Eclipse来在Android SDK中使用的jar我的自定义framework.jar呢?

I made a custom framework.jar for my device. This new framework include a new API which I'd like to use in my apps. Unfortunately, besides I included my own framework.jar in java build path, eclipse didn't see my new API and throw compiling time errors. How can I configure eclipse to use my custom framework.jar instead of the jar within android SDK?

根据在@Yuri的回答和其他一些见解,我创建了一个工具(实际上它是一个shell脚本)创建于Android SDK中一个新的平台和合并的jar文件到它。它在XDA论坛提供下载,以及说明使用:的http://论坛.xda-developers.com / showthread.php?T = 2619775

Based in @Yuri 's answer and some other insights, I created a tool (actually it is a shell script) to create a new platform in android SDK and merge jar files into it. It's available in XDA forums to download as well the instructions to use: http://forum.xda-developers.com/showthread.php?t=2619775

推荐答案

要建立SDK,您应该运行下面的命令:

To build SDK you should run the following commands:

make update-api
make sdk

由于Android的API已经被修改命令进行更新-API 添加了新的API。该命令使SDK 创建S​​DK出文件夹。

Since the API of Android has been modified the command make update-api adds new API. The command make sdk creates SDK in out folder.

然后开始使用新的SDK,你应该把这个新的SDK在Eclipse中开发应用程序。有以下两种方式来做到这一点。第一个是从书嵌入式Android的。我只是复制在这里:

Then to start develop your applications in Eclipse using new SDK you should add this new SDK. There are 2 possibilities to do this. The first one is from the book "Embedded Android". I'll just copy it here:

假设你已经配置Eclipse进行Android开发   使用指示进行操作,在 http://developer.android.com ,你需要   开展两个额外的步骤来使用新建的SDK。第一,   你需要告诉Eclipse新的SDK的位置。要做到这一点,去   到Window→preferences→Android的,在进入的路径,新的SDK   SDK位置框中,然后单击确定。另外,其原因是不   完全清楚,笔者在写这篇文章的时候,你也   需要到窗口→Android SDK中管理中心,取消选择所有项目   可能被选中,除了头两下的工具,然后点击   安装2包......一旦做到这一点,你就可以创建   使用新的SDK和访问任何新的API的新项目会暴露在   它。如果你不这样做,第二个步骤,你就可以创建新的   Android的项目,但他们没有将解决Java库   正确和意志,因此,从来没有建立。

Assuming you had already configured Eclipse for Android development using the in‐ structions at http://developer.android.com, you’ll need to carry out two additional steps to use your newly-built SDK. First, you’ll need to tell Eclipse the location of the new SDK. To do so, go to Window→Preferences→Android, enter the path to the new SDK in the "SDK Location" box, and click OK. Also, for reasons that aren’t entirely clear to the author at the time of this writing, you also need to go to Window→"Android SDK Man‐ ager", deselect all the items that might be selected except the first two under "Tools" and click on "Install 2 packages..." Once that is done, you’ll be able to create new projects using the new SDK and access any new APIs you expose in it. If you don’t do that second step, you’ll be able to create new Android projects, but none of them will resolve Java libraries properly and will, therefore, never build.

对于这里的第二个是:

  1. 找到你的新版本SDK的压缩(用于Linux它的驾驶室在这里找到 输出/主机/ Linux的-86 / SDK /
  2. 解压缩这个包放到一个文件夹
  3. 在此文件夹中可以找到这就是所谓的目录 平台/ Android的2.3.3
  4. 重新命名文件夹的Andr​​oid 2.3.3 < your_name>
  5. 在这个文件夹复制到安装的以下位置 你的SDK管理器: Android的SDK-Linux的/平台
  6. 在该文件夹中文件中找到 build.prop 并分配到属性 ro.build.version.sdk 任何负数: ro.build.version.sdk = -10
  7. 现在,运行SDK管理器,你会发现,你的新SDK加入。 简单地创建新的Eclipse项目,选择这个SDK为目标。
  1. Find you new build sdk zip (for Linux it cab be found here out/host/linux-x86/sdk/)
  2. Unzip this pack into a folder
  3. Inside this folder you can find the directory which is called platforms/android-2.3.3
  4. Rename folder android-2.3.3 to <your_name>
  5. Copy this folder into the following location of the installation of your SDK Manager: android-sdk-linux/platforms
  6. Find inside this folder file build.prop and assign to the property ro.build.version.sdk any negative number: ro.build.version.sdk=-10
  7. Now run SDK Manager and you'll notice that you new sdk is added. Simply create new Eclipse project and select this sdk as a target.

这篇关于配置Eclipse使用自己的Andr​​oid SDK(framework.jar)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆