如何导入并查看android商品购买案例官方案例

09:47 提问
网上找到的示例程序如何导入Android Studio并正常运行
因为网站上只给了很少一部分信息,加上对android studio的gradle不太熟悉,所以不知道如何运行
比如说下面这个网站上的代码,我如何正确导入android studio并运行。
按赞数排序
我平时使用Eclipse开发,遇到你说的情况,一般是下载示例程序,新建一个Android工程,将示例程序中的src、res、lib、AndroidManifest.xml等文件拷贝到新建的工程,解决相关的错误,然后运行。至于Android Studio,我使用的很少,也不熟悉,需要好好熟悉gradle相关的东西,毕竟Android Studio是目前官方推荐的IDE,并且已经面世挺久了。
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐博客分类:
Android上的3D目前还是很少有人涉足的领域,虽然感觉效率上要差那么一些,但相信不久以后会有很大改观的,至少我觉得从它直接支持的是opengl,而不是令人诟病的j3d看来,还是很有前景的~~~
今天做了一下Android导入3D场景,过程还算顺利,就说下具体步骤:
首先当然是有场景文件,3DMax做场景还是相当不错的,导出为.obj格式,网上也有说导出.ase格式的,不过.obj似乎更主流一些,所以也就随大流了;
然后是在程序中读取,这个有点小麻烦,反正google上找了好久才找到这样一个可以转换.obj文件的,具体里面的东西上传到了附件中,唯一要注意的是里面的.obj文件是放在assets文件夹下的,要用new InputStreamReader(this.context.getAssets().open(fileName))这种方式打开,别的就没什么要修改的地方了~~~
最后就是效率问题了,这个目前完全不清楚,它加载一个小小的茶壶都花了好长时间,我的场景文件可是2+M啊,是用读取多少加载多少还是什么别的方法,暂时还不明了~~~
另外说下如果要加载人物动画,好像我所能了解到的方法就是在3dmax中导出为.md2格式,需要一个插件,如下,3
DMax中直接运行.mx脚本就可以了,虽然网上上说md2已经过时了,不过没找到别的什么可以用的格式,也希望有人能够指点一下,我很虚心的,呵呵~~~
(553.3 KB)
下载次数: 875
下载次数: 506
浏览 10338
&& LZ 给个那个包的下载地址吧,就是你没改之前的。。。这个就很抱歉了,好久好久没弄过了,google搜下吧,我一直都翻了墙的,不知道那些网站有没有被封掉~~~
写道clearskychan 写道 写道太不给力了吧,
兴高采烈的下载下来,结果程序还报错。
大的框架可以用的,改下那个filename的读取方式,反正我的可以显示一个cube~ 但是我想问楼主能给个google code 原版的下载链接吗
不用了发了,我的也可以了,但是那个scene加载失败,你的好着吗
程序报错很正常啊,各种环境问题,版本问题,我当时兴高采烈运行成功了,然后就发了~~~
写道clearskychan 写道 写道太不给力了吧,兴高采烈的下载下来,结果程序还报错。大的框架可以用的,改下那个filename的读取方式,反正我的可以显示一个cube~ 但是我想问楼主能给个google code 原版的下载链接吗不用了发了,我的也可以了,但是那个scene加载失败,你的好着吗scene很大啊,一加载就卡住了,而且那个scene格式貌似不对。
clearskychan 写道 写道太不给力了吧,兴高采烈的下载下来,结果程序还报错。大的框架可以用的,改下那个filename的读取方式,反正我的可以显示一个cube~ 但是我想问楼主能给个google code 原版的下载链接吗不用了发了,我的也可以了,但是那个scene加载失败,你的好着吗
写道太不给力了吧,兴高采烈的下载下来,结果程序还报错。大的框架可以用的,改下那个filename的读取方式,反正我的可以显示一个cube~ 但是我想问楼主能给个google code 原版的下载链接吗麻烦把你的完整代码发给我一下吧,我刚开始学这个,比较着急用。邮箱谢谢!!
太不给力了吧,兴高采烈的下载下来,结果程序还报错。大的框架可以用的,改下那个filename的读取方式,反正我的可以显示一个cube~ 但是我想问楼主能给个google code 原版的下载链接吗
楼主.包运行不了.少个模型.能否共享下.
噢,不好意思啊,我可能改了一些里面的代码~~~
这个包google code里可以很容易找到的~~~
后来发现载入模型的速度太慢了,就没弄了~~~
以前在PSP上试验过一个md2格式模型的读取渲染
速度很快的 当时还不知道md2可以用3Dmax导出来
在我的空间有PSP的源码 不过都是网上下的 我加了注释
恩,我做过读取md2格式的,也还蛮快的,就是obj读取比较慢
lovehui0228
浏览: 85495 次
来自: 上海
谢谢分享辛苦咯
已经验证,可以使用
楼主你好,我用的这种方法,总报找不到文件错误,请问是怎么回事啊 ...
楼主,/sdcard/windmill.obj这个文件给下行不 ...
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'posts - 222,&
comments - 183,&
trackbacks - 0
一.基础知识点学习
&&1.Android体系结构
如图所示,android 架构分为三层:
(1)最底层是linux内核,主要是各种硬件的驱动,如相机驱动(Camera Driver),闪存驱动(Flash Memory Driver),wifi驱动(Wifi Driver)等
(2)中间一层是库包(libraries)和android运行环境(android runtime),其中库包主要包括一些协议和浏览器内核(webkit)等,android运行环境主要包括核心库包和Dalvik虚拟机
(3)最上面一层是应用层,应用层主要是跟用户直接打交道的各种应用了,如联系人,浏览器,电话等.
这里重点要注意的是dalvik虚拟机,这里简单的和JVM做个比较:
两者区别:(1)编译后文件格式:
&jvm: .java-&.class-&.jar
dalvik vm: &.java-&.class-&.dex-&.odex
(2)基于的架构
&jvm:基于栈的架构
dalvik vm:基于寄存器的架构
注:基于寄存器的虚拟机对于更大的程序来说,在它们编译的时候,花费的时间更短。&
(3)字节码格式
&jvm:零字节地址格式
dalvik vm:&二/三地址的混合形式 & & &
&注:二/三地址的混合形式执行的效率要高些,但操作需要更多的load/store指令(指令分配次数和内存访问次数),二/三地址占内存多些,但操作更少,访问内存执行数度是一个瓶颈.dalvik vm在编译时优化代码,而不是在运行时,将多个文件整合成一个,整体减少文件个数i/o操作,常量池的引入,提高类查询的速度
&2.配置filter
&intent-filter&
&action android:name="android.intent.action.MAIN" /&
&category android:name="android.intent.category.LAUNCHER" /&
&/intent-filter&
这里对应在手机界面中生成程序图标,对生成程序图标这一事件进行监听.
二.如何导入已有android项目(以apidemos为例)
1.ctrl+n==&选择Android Sample Project
2.选择要导入的Android sdk sample,这里选择2.2
3.选择具体的sample,这里选择ApiDemos.
4.点击Finish后,出现下图所示sample
5.然后ctrl+F11运行到模拟器上.
注:如果启动过程中出现如下类似错误,那么查看项目下一个依赖包&Android&Dependencies,在eclipse中右键这个文件夹,在Build&Path选项中选择&remove&it&from&build&path,然后ctrl+F11运行到模拟器上.
[ 00:53:19 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[ 00:53:19 - HelloWorld] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
与导入sample非常类似,导入其他项目,选择Android Project form Existing Code==&项目路径==&next===&finish即可.如下图所示:
&二、案例 android下的电话拨号器
新建一个名称为and的android项目,以android 2.2 sdk为底包进行开发
然后一直Next直至finish
1、效果截图
1)初始界面:
2).输入110,点击拨打
3)通话记录
2、代码分析
/and/res/layout/activity_main.xml
&RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" &
android:id="@+id/et_dial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:phoneNumber="true"
android:singleLine="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="54dp"
android:hint="@string/hint"
android:ems="10" &
&requestFocus /&
&/EditText&
&!-- 方法四 --&
android:id="@+id/bt_dial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/et_dial"
android:layout_below="@+id/et_dial"
android:onClick="dial"
android:text="拨
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/et_dial"
android:layout_alignParentTop="true"
android:layout_marginTop="32dp"
android:clickable="true"
android:onClick="info"
android:text="@string/info" /&
&/RelativeLayout&
注:LinearLayout (线性布局)、AbsoluteLayout(绝对布局)、RelativeLayout(相对布局)、TableLayout(表格布局)、FrameLayout(帧布局),这里采用的是相对布局.
android:onClick="xxx" ,这里xxx对应的是MainActivity.java中的xxx方法,当点击时触发此方法.
/and/res/values/strings.xml
&?xml version="1.0" encoding="utf-8"?&
&resources&
&string name="app_name"&and&/string&
&string name="action_settings"&Settings&/string&
&string name="hello_world"&Hello world!&/string&
&string name="hint"&在这里输入手机号码&/string&
&string name="info"&请输入要拨打的手机号码:&/string&
&/resources&
注:这里主要用来配置一些常量,供其它程序调用.
/and/AndroidManifest.xml
&?xml version="1.0" encoding="utf-8"?&
&manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amos.and"
android:versionCode="1"
android:versionName="1.0" &
android:minSdkVersion="8"
android:targetSdkVersion="8" /&
&uses-permission android:name="android.permission.CALL_PHONE"/&
&application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" &
android:name="com.amos.and.MainActivity"
android:label="@string/app_name" &
&intent-filter&
&action android:name="android.intent.action.MAIN" /&
&category android:name="android.intent.category.LAUNCHER" /&
&/intent-filter&
&/activity&
&/application&
&/manifest&
&注:注意权限分配问题
&/and/src/com/amos/and/MainActivity.java
package com.amos.
import android.app.A
import android.content.I
import android.net.U
import android.os.B
import android.util.L
import android.view.M
import android.view.V
import android.view.View.OnClickL
import android.widget.B
import android.widget.EditT
* @ClassName: MainActivity
* @Description: android开发实例,自定义实现电话拨号器
* @author: amosli
* @date 日 下午6:53:29
public class MainActivity extends Activity implements OnClickListener{
public static String tag = "MainActivity";
//以内部成员变量的方式定义输入框,在加载主界面的时候就把此变量加载到内存中去,避免多次加载
private EditText mEditT
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mEditText = (EditText) MainActivity.this.findViewById(R.id.et_dial);
//得到了activity界面上的button的引用
Button button = (Button) this.findViewById(R.id.bt_dial);
button.setOnClickListener(new OnClickListener() {
//方法二,使用匿名内部类的方式注册一个onClick监听事件
public void onClick(View arg0) {
String phonenum = mEditText.getText().toString();
Log.i(tag, phonenum);// 输出手机号码
Log.e(tag, "error");
Log.d(tag, "debug");
Log.v(tag, "verbose");
Log.w(tag, "warn");
System.out.println("assert:"+Log.ASSERT);
Intent intent = new Intent();// 意图,代表要执行动作的一个意图
// 拨打动作,110代表的是一个data
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"+phonenum));
startActivity(intent);
//方法三:使用全局定义的switch进行事件的监听
button.setOnClickListener(this);
public boolean onCreateOptionsMenu(Menu menu) {
// I this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
//方法三:使用全局定义的switch进行事件的监听,企业中一般常用此方法
public void onClick(View v) {
switch (v.getId()) {
case R.id.bt_dial:
String phonenum = mEditText.getText().toString();
Log.i(tag, phonenum);// 输出手机号码
Log.e(tag, "error");
Log.w(tag, "这是方法三");
Intent intent = new Intent();// 意图,代表要执行动作的一个意图
// 拨打动作,110代表的是一个data
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + phonenum));
startActivity(intent);
public void dial(View v){
String phonenum = mEditText.getText().toString();
Log.i(tag, phonenum);// 输出手机号码
Log.e(tag, "error");
Log.d(tag, "debug");
Log.v(tag, "verbose");
Log.w(tag, "warn");
System.out.println("assert:"+Log.ASSERT);
Intent intent = new Intent();// 意图,代表要执行动作的一个意图
// 拨打动作,110代表的是一个data
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"+phonenum));
startActivity(intent);
public void info(View v){
Log.i(tag, "提示信息被点击了一次!")
//方法一,自定义实现OnclickListener的内部类
private class MyButtonOnClickListner implements OnClickListener {
public void onClick(View v) {
String phonenum = mEditText.getText().toString();
Log.i(tag, phonenum);// 输出手机号码
Log.e(tag, "error");
Log.d(tag, "debug");
Log.v(tag, "verbose");
Log.w(tag, "warn");
System.out.println("assert:"+Log.ASSERT);
Intent intent = new Intent();// 意图,代表要执行动作的一个意图
// 拨打动作,110代表的是一个data
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"+phonenum));
startActivity(intent);
&注:这里主要实现了用户输入号码后,点击拨打按钮后,电话拨出情形.&这里用了四种方法去实现拨打动作,推荐第三次方法,更灵活,维护更方便,具体实现可以参见注释.
3、实现过程中出现的问题及解决办法
&&出现如下所示的提示信息:
02-25 18:03:45.164: E/AndroidRuntime(681): FATAL EXCEPTION: main
02-25 18:03:45.164: E/AndroidRuntime(681): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx-xxx-xxxx cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{4:com.amos.and/10034} (pid=681, uid=10034) requires android.permission.CALL_PHONE
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.os.Parcel.readException(Parcel.java:1322)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.os.Parcel.readException(Parcel.java:1276)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1351)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.app.Activity.startActivityForResult(Activity.java:2827)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.app.Activity.startActivity(Activity.java:2933)
02-25 18:03:45.164: E/AndroidRuntime(681):
at com.amos.and.MainActivity$MyButtonOnClickListner.onClick(MainActivity.java:49)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.view.View.performClick(View.java:2485)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.view.View$PerformClick.run(View.java:9080)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.os.Handler.handleCallback(Handler.java:587)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.os.Handler.dispatchMessage(Handler.java:92)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.os.Looper.loop(Looper.java:123)
02-25 18:03:45.164: E/AndroidRuntime(681):
at android.app.ActivityThread.main(ActivityThread.java:3683)
02-25 18:03:45.164: E/AndroidRuntime(681):
at java.lang.reflect.Method.invokeNative(Native Method)
02-25 18:03:45.164: E/AndroidRuntime(681):
at java.lang.reflect.Method.invoke(Method.java:507)
02-25 18:03:45.164: E/AndroidRuntime(681):
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-25 18:03:45.164: E/AndroidRuntime(681):
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-25 18:03:45.164: E/AndroidRuntime(681):
at dalvik.system.NativeStart.main(Native Method)
02-25 18:03:45.214: W/ActivityManager(97):
Force finishing activity com.amos.and/.MainActivity
02-25 18:03:45.814: W/ActivityManager(97): Activity pause timeout for HistoryRecord{ com.amos.and/.MainActivity}
仔细一看是权限问题,权限是用来保护用户隐私的,当用户安装应用时会提示所需要的权限
解决方法如下图所示:添加一个permission:&&uses-permission android:name="android.permission.CALL_PHONE"/&
&然后保存即可。
4.将开发好apk安装到自己手机上
从项目bin目录下拷贝apk文件,我这里是:&D:\develop\and\bin\and.apk,安装过程中会发现有提示信息说应用会拨打电话。
5.关于调试项目 
选择项目==&鼠标右键,Debug As --&Android Application==&在要调试的地方加上断点,即可.
如果要调试真机,而非模拟器,如果出现不能调试的问题,那么,可以参见下图配置:
AndroidManifest.xml--&Application--&Debuggable--&true&,然后保存即可。
6.本文源码:
阅读(...) 评论()知道+做到=得到
Action speak louder than words.
使用Android Studio导入源码
上路了,准备开始重操那两年的旧业,后悔之前在上家公司做Amlogic和Realtak方案盒子时没有养成写博客的习惯,这算是开篇之作吧,顺带也算是给一个网友的答疑吧。不多说,该篇只是工具讲解而已。
关于Android Studio对于应用层App开发的技巧和配置前面我写过文章分析的,这里不再解释说明,具体查看我的这一片博文。这里我们主要说明的是用它来看源码的相关配置(该实例依据官方源码android-5.1.1_r14进行配置说明)。
以前在上家公司查看修改源码时还是使用的Eclipse导入部分代码的方式,而现在在android源码中发现有一个development/tools/idegen目录,查了一下发现是生成IDE的project文件(主要是intellij的project文件,其实也就是Android Studio的),所以说福利工具就这么来了,欲知详情,请看下文。
2 配置使用过程
2-1 基础准备工作
首先你得安装配置了Android Studio,具体不明白的参考。
接着你得下载好了源码Code,至于如何下载这里不再说明,比较简单,上官网查看就行了。
其次你需要保证源码已经被编译生成了out相关目录文件。
好了,如上就是一些基本准备工作,针对定制源码或者原生源码来说,这些准备步骤都是必须的,没必要再强调了。
2-2 配置导入及使用
2-2-1 编译源码idegen模块及生成AS配置文件(*.ipr)
在开始编译idegen模块前,你一定知道需要先全局编译出out目录及相关文件吧,这个不再过多说了,我们通过如下命令编译idegen模块:
mmm development/tools/idegen/
这行命令的意思是编译idegen这个模块项目,然后生成idegen.jar文件(不信你自己去查看这个模块的Android.mk的目标吧,不多解释)。运行完以后如果看到如下信息则说明编译OK:
#### make completed successfully (7 seconds) ####
接着执行如下脚本:
development/tools/idegen/idegen.sh
这行命令的意思是在根目录生成对应的android.ipr、android.iml IEDA工程配置文件。等待片刻得到类似如下信息说明OK:
Read excludes: 21ms
Traversed tree: 194799ms
通过如上操作我们就完成了基本的源码配置工作。
2-2-2 导入Android Studio前的一些客户化操作
大家都知道使用Eclipse倒入源码很慢,Android Studio导入源码时也慢,所以建议修改android.iml文件(将自己不用的代码去掉),然后再导入Studio。
就像下面摘取的android.iml文件1887行开始的这些一样:
url="file://$MODULE_DIR$/./sdk/testapps/userLibTest/src" isTestSource="true"/&
url="file://$MODULE_DIR$/./tools/external/fat32lib/src/main/java" isTestSource="false"/&
url="file://$MODULE_DIR$/out/eclipse"/&
url="file://$MODULE_DIR$/.repo"/&
url="file://$MODULE_DIR$/external/bluetooth"/&
url="file://$MODULE_DIR$/external/chromium"/&
url="file://$MODULE_DIR$/external/icu4c"/&
url="file://$MODULE_DIR$/external/webkit"/&
url="file://$MODULE_DIR$/frameworks/base/docs"/&
url="file://$MODULE_DIR$/out/host"/&
url="file://$MODULE_DIR$/out/target/common/docs"/&
url="file://$MODULE_DIR$/out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates"/&
url="file://$MODULE_DIR$/out/target/product"/&
url="file://$MODULE_DIR$/prebuilt"/&
我们可以仿照上面这段代码的&excludeFolder url="file://$MODULE_DIR$/.repo"/&写法一样过滤掉不需要的内容,这样在导入时就会快很多。
也可以通过Android Studio的Project Stucture 打开左侧Modules,然后将右侧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文件了,如下:
到此对于平时只是查看源码的人来说已经够用了。
俗话说工欲善其事必先利其器,你会发现使用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 produce 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
From the project's root directory...
Repeat these steps after each sync...
1) make (to produce 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/").
使用Android Studio打开Android源码
分享几个开源的android项目的源码,基本上用androidstudio都可以编译成功
使用Android Studio导入安卓源码
Android Studio导入整个Android系统源码
Android Studio关联source源码
使用Android Studio阅读整个Android源码
【工具使用】Android Studio如何导入Android系统源代码
没有更多推荐了,}

我要回帖

更多关于 2018android开发行情 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信