在Eclipse中构建Android源代码应用程序 [英] Building Android Source apps In Eclipse

查看:179
本文介绍了在Eclipse中构建Android源代码应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将这个来源下载到了这里的备件。

I downloaded the source to spareparts here

https://android.googlesource.com/platform/development/+/gingerbread-release/apps/SpareParts

它包括 Android.mk AndroidManifest.xml 通知 res src 文件夹。

It includes Android.mk, AndroidManifest.xml, Notice, res and src folders.

我的问题是如何在Eclipse中编译这个源代码?我看到有一个make文件( Android.mk ),我猜想我需要使用,但我无法弄清楚如何将这个东西导入到Eclipse没有500多个错误。

My question is how can I compile this source code in Eclipse? I see there is a make file (Android.mk) which I'm guessing I need to use but I can't figure out what to do to get this thing imported into Eclipse without having 500+ errors.

推荐答案

暴力总是有效:)


  • 在Eclipse中创建一个名为SpareParts的新的android项目

  • 使用资源管理器替换工作区/ SpareParts中的src /和res /下载表单git

  • 点击Eclipse中项目树中SpareParts条目上的右侧按钮 - >刷新

  • 享受

  • Create a new android project in Eclipse named SpareParts
  • Use the explorer to replace both the src/ and res/ folders inside workspace/SpareParts with the ones downloaded form git
  • Click with the right button on the SpareParts entry in the project tree in Eclipse -> Refresh
  • enjoy

我研究了这些文件,似乎没有使用任何外部库。
如果您尝试自行构建,由于这三个不在android.jar中的类,您仍然会遇到问题:

I looked into the files and it does not seem that it uses any external library. If you try to build it by itself, you will still have problems due to these three classes that are not in android.jar:

import android.app.ActivityManagerNative; //cannot be resolved
import android.os.ServiceManager; //cannot be resolved
import android.view.IWindowManager; //cannot be resolved

这篇关于在Eclipse中构建Android源代码应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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