当前位置:首页 » 安卓系统 » 如何导入安卓源码

如何导入安卓源码

发布时间: 2022-04-21 06:03:09

㈠ 如何导入与配置从网上下载的android源代码及服务器端源代码

将Android项目导入import进Eclipse。 注意SDK版本是否匹配 。 服务器部署到Tomcat下。 你得在数据库中将这个点菜系统的数据库和表建好,或者导入。在服务器的代码中修改好你的数据库名和密码。

㈡ 如何解决向Eclipse导入安卓代码出现很多报错

第一步:导入安卓源码。把光标放在“Workspace”鼠标右键,点击“Import”。

第二步:在弹出的“Import”对话框中,选择“Existing Android Code Into Workspace”然后点击确定。

第三步:在弹出的“Import Projects ”对话框,点击“Browse”,然后在弹出的“浏览文件夹”对话框中,找到存放安卓源码的文件夹。然后选中文件夹然后点击“Finish”.

第四步:出现报错。

第五步:鼠标点击选中该工程,然后鼠标右键。点击“Android Tools”,然后点击“Fix Properties”。

第六步:如果还存在报错。点击工具栏的“Project ”点击“Clean”然后在弹出的“Clean”对话框中点击“OK”。到此时报错消失。

㈢ Android怎么导入源代码并运行

导入的项目有问题吧,一般情况下,jar包或者library有可能发生错误,你可以重新设置下路径

选中当前项目右击----properties-------Android(左边)-----查看右下部分有没没有library有的话remove再此重新导入

或者:

选中当前项目右击----properties-------java Build Path-----查看右面4个选项卡有没有报错的。。。如果有,同样,removew在add进入

㈣ 如何移植android 源代码到自己的手机上

成功将android2.1移植到手机上,需经过以下几个步骤:
一,准备好android2.1源码编译环境以及手机USB调试环境。
二,将手机上硬件驱动程序以及相关的配置文件通过ADB命令保存好。
三,针对不同的手机机型,制作相应的vendor配置文件。
四,编译源码。
五,通过手机提供的bootloader刷机或者直接以recovery的方式更新ROM。
在以上五个步骤中,其中最难处理的便是第2个步骤,这个步骤需要熟悉每个手机机型的硬件参数,并且能够在手机上找到相关的驱动程序以及了解他们如何配置。而CyanogenMod团队公布的源码当中,己经将相关的工作做好了,

㈤ 如何导入android sdk 的 sample中的源码

Sample代码在SDK安装目录(X:\Android\android-sdk\samples)下。但我在用Eclipse 开发环境导入的时候遇到了一些麻烦。网上看到有人是通过“File -> Import...”或“File -> New->Project -> Create Project From Existing Code”解决的,但我试过,都有点问题。后一种方法可成功导入,但工程没有复制到Eclipse的工作目录(X:\Eclipse\workspace),这样作为练习修改后,影响了原有Sample代码,可能失去了参考,而且还要将原SDK的Sample目录属性由只读改为可写。
一番倒腾后,我发现,Eclipse已经提供了很方便的导入方法。那就是 "File -> New->Project -> Android Simple Project ”。下面是操作截图,一看即明,很简单。
----------------------------
---------------------
选择你需要的Sample版本。
选择你需要研究的Sample类型,ApiDemos是最基本的,很适合初学者。按“Finish”就完成了。
如果已经安装过,你不用担心会误操作。

㈥ 如何向eclipse中导入安卓软件源码

向eclipse中导入安卓软件源码的方法

  • 打开eclipse依次点击 菜单 > file > import,打开导入项目对话框

  • 步骤阅读.2选择 genernal > Existing Projects Into Workspace > 点击next

  • 步骤阅读.3选择Select root directory > browose 去选择安卓源代码的根目录 > 点击确定

  • 步骤阅读.4点击finish软件自动导入安卓项目到你的工作空间

㈦ 如何用 Intellij 导入 Android 源码

针对定制源码或者原生源码来说,这些准备步骤都是必须的,没必要再强调了。
2-2 配置导入及使用
2-2-1 编译源码idegen模块及生成AS配置文件(*.ipr)
在开始编译idegen模块前,你一定知道需要先全局编译出out目录及相关文件吧,这个不再过多说了,我们通过如下命令编译idegen模块:
mmm development/tools/idegen/1

这行命令的意思是编译idegen这个模块项目,然后生成idegen.jar文件(不信你自己去查看这个模块的Android.mk的目标吧,不多解释)。运行完以后如果看到如下信息则说明编译OK:
......
#### make completed successfully (7 seconds) ####12

接着执行如下脚本
development/tools/idegen/idegen.sh1

这行命令的意思是在根目录生成对应的android.ipr、android.iml IEDA工程配置文件。等待片刻得到类似如下信息说明OK:
Read excludes: 21ms
Traversed tree: 194799ms12

通过如上操作我们就完成了基本的源码配置工作。
2-2-2 导入Android Studio前的一些客户化操作
大家都知道使用Eclipse倒入源码很慢,Android Studio导入源码时也慢,所以建议修改android.iml文件(将自己不用的代码去掉),然后再导入Studio。
就像下面摘取的android.iml文件1887行开始的这些一样:
<sourceFolder url="file://$MODULE_DIR$/./sdk/testapps/userLibTest/src" isTestSource="true"/>
<sourceFolder url="file://$MODULE_DIR$/./tools/external/fat32lib/src/main/java" isTestSource="false"/>
<excludeFolder url="file://$MODULE_DIR$/out/eclipse"/>
<excludeFolder url="file://$MODULE_DIR$/.repo"/>
<excludeFolder url="file://$MODULE_DIR$/external/bluetooth"/>
<excludeFolder url="file://$MODULE_DIR$/external/chromium"/>
<excludeFolder url="file://$MODULE_DIR$/external/icu4c"/>
<excludeFolder url="file://$MODULE_DIR$/external/webkit"/>
<excludeFolder url="file://$MODULE_DIR$/frameworks/base/docs"/>
<excludeFolder url="file://$MODULE_DIR$/out/host"/>
<excludeFolder url="file://$MODULE_DIR$/out/target/common/docs"/>
<excludeFolder url="file://$MODULE_DIR$/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates"/>
<excludeFolder url="file://$MODULE_DIR$/out/target/proct"/>
<excludeFolder url="file://$MODULE_DIR$/prebuilt"/>1234567891011121314

我们可以仿照上面这段代码的<excludeFolder url="file://$MODULE_DIR$/.repo"/>写法一样过滤掉不需要的内容,这样在导入时就会快很多。
也可以通过Android Studio的Project Stucture 打开左侧Moles,然后将右侧Sources中一些目录Excluded掉。
2-2-3 使用Android Studio导入源码工程
有了如上的这些操作以后,我们打开Android Studio,然后选择打开一个现有的Android Studio项目,然后选择打开源码根目录下的android.ipr文件,然后出现如图一样的索引即可等待导入就行:tu

到目前为止我们就可以方便的使用Android Studio查看源码啦。如下图所示:

吊不屌!!!
2-3 使用技巧
上图我们看见了,可以通过Android Studio搜索整套源码的代码了。但是这时候如果你打开一个Service.java类,然后把鼠标放在其中任意方法的Intent参数上按住CTRL+鼠标左键跳转到Intent类你会发现跳转过去的是一个Intent.class文件,为啥呢?因为他跳转的是你的默认SDK中的jar内部的class文件。既然要修改查看整套源码,这么跳转得多蛋疼啊,所以我们需要配置让其能跳转到Intent.java文件,具体做法如下:
首先删掉依赖中的所有依赖,只保留下图中没被选中的那两个(当然你可以选择保留一些你用到的其他jar),如下:

接着点击加号的JARs or directories将你源码的frameworks及external和你用到的其他跳转目录添加到依赖中,然后apply即可。
这时候我们在像上面一样打开Service.java跳转Intent,你会发现像下图一样直接跳转到你源码路径下的Intent.java文件了,如下:

到此对于平时只是查看源码的人来说已经够用了。
3 总结
俗话说工欲善其事必先利其器,你会发现使用Android Studio比Eclipse和Source Insight都好很多(当然了,SubText还是很强大的),无论是代码提示还是跳转、还是Python Shell等插件支持等都很强大,慢慢体验吧。
顺带说一句,Google的野心真的很大,看来Android Studio即将要被他们打造为全能IDE了。
4 附加README
附上原版的英文README文档,英语高手直接看这里就行:
IDEGen automatically generates Android IDE configurations for IntelliJ IDEA
and Eclipse. Your IDE should be able to compile everything in a reasonable
amount of time with no errors.
If you’re using IntelliJ…
If this is your first time using IDEGen...

IDEA needs a lot of memory. Add "-Xms748m -Xmx748m" to your VM options
in "IDEA_HOME/bin/idea.vmoptions" on Linux or
"IntelliJ IDEA.app/Contents/Info.plist" on OS X.

Create a JDK configuration named "1.6 (No Libraries)" by adding a new
JDK like you normally would and then removing all of the jar entries
under the "Classpath" tab. This will ensure that you only get access to
Android's core libraries and not those from your desktop VM.

From the project's root directory...

Repeat these steps after each sync...

1) make (to proce generated .java source)
2) development/tools/idegen/idegen.sh
3) Open android.ipr in IntelliJ. If you already have the project open,
hit the sync button in IntelliJ, and it will automatically detect the
updated configuration.

If you get unexpected compilation errors from IntelliJ, try running
"Build -> Rebuild Project". Sometimes IntelliJ gets confused after the
project changes significantly.

If you’re using Eclipse…
If this is your first time using IDEGen...

Edit eclipse.ini ("Eclipse.app/Contents/MacOS/eclipse.ini" on OS X) and
add "-Xms748m -Xmx748m" to your VM options.

Configure a JRE named "1.5 (No Libraries)" under "Preferences -> Java ->
Installed JREs". Remove all of the jar entries underneath "JRE system
libraries". Eclipse will not let you save your configuration unless at
least one jar is present, so include a random jar that won't get in the
way.

From the project's root directory...

Repeat these steps after each sync...

1) make (to proce generated .java source)
2) development/tools/idegen/idegen.sh
3) Import the project root directory into your Eclipse workspace. If you
already have the project open, simply refresh it (F5).

Excluding source roots and jars
IDEGen keeps an exclusion list in the "excluded-paths" file. This file
has one regular expression per line that matches paths (relative to the
project root) that should be excluded from the IDE configuration. We
use Java's regular expression parser (see java.util.regex.Parser).

You can create your own additional exclusion list by creating an
"excluded-paths" file in the project's root directory. For example, you
might exclude all apps except the Browser in your IDE configuration with
this regular expression: "^packages/apps/(?!Browser)".

Controlling source root ordering (Eclipse)
You may want some source roots to come before others in Eclipse. Simply
create a file named "path-precedence" in your project's root directory.
Each line in the file is a regular expression that matches a source root
path (relative to the project's root directory). If a given source root's
path matches a regular expression that comes earlier in the file, that
source root will come earlier in the generated configuration. If a source
root doesn't match any of the expressions in the file, it will come last,
so you effectively have an implicit ".*" rule at the end of the file.

For example, if you want your applications's source root to come first,
you might add an expression like "^packages/apps/MyApp/src$" to the top
of the "path-precedence" file. To make source roots under ./out come last,
add "^(?!out/)" (which matches all paths that don't start with "out/").

热点内容
奥迪存储卡格式不正确请格式化存储卡 发布:2024-05-06 09:01:31 浏览:34
个人信用数据库 发布:2024-05-06 09:00:34 浏览:417
最新解压缩 发布:2024-05-06 09:00:28 浏览:983
童编程 发布:2024-05-06 08:44:01 浏览:246
java路径配置文件 发布:2024-05-06 08:43:47 浏览:904
什么软件可以编程 发布:2024-05-06 08:37:37 浏览:46
java字符串转换 发布:2024-05-06 08:37:25 浏览:885
字符串在内存中的存储 发布:2024-05-06 08:33:29 浏览:393
安卓投影仪安装什么点歌软件 发布:2024-05-06 08:33:22 浏览:545
java开源大全 发布:2024-05-06 08:32:26 浏览:33