lihao2014 发表于 2014-12-24 15:50:11

android开发使用控件--开发环境搭建。CAD控件

软件名称(,梦,,想。CAD,控件)

1、 环境搭建: 3
1.1、 安装Eclipse 3
1.2、 下载JDK 3
1.3、 下载Android SDK 5
1.4、 给Eclipse 安装ADT插件8
1.5、 运行Eclipse设置Android ADT插件10
1.6、 NDK安装 12
1.7、 安装Cygwin 13
1.8、 创建虚拟机15
1.9、 编译并运行控件安卓例子 16


1、 环境搭建:
注意:文章有些下载地址,比如安卓开发网站需要设置代理才能访问
1.1、 安装Eclipse
下载地址:
如下
:http://img.blog.csdn.net/20141224095745949?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

下载后,我们把它解压到C:\Android\Eclipse如下:
http://img.blog.csdn.net/20141224095849004?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

1.2、 下载JDK
下载地址:
http://img.blog.csdn.net/20141224095942390?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

点击下面连接下载安装程序
http://img.blog.csdn.net/20141224100025693?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

安装后的目录,和文件,注意现在最新的JDK安装不支持winxp,建议使用win7系统:
http://img.blog.csdn.net/20141224100038142?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
我们安装在C:\Android\JDK
之后需要通过"我的电脑"->"属性"->"高级"->"环境变量",来新建一个JAVA_HOME的环境变量,指向JDK的目录,如下http://img.blog.csdn.net/20141224100045661?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


1.3、 下载Android SDK

这是官方网址,进入后跟着流程走,选择适合于自己平台(这里是Windows)的SDK包下载。
http://img.blog.csdn.net/20141224100057455?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


我们不使用Android Studio,点击Stand-alone SDK Tools继续:
http://img.blog.csdn.net/20141224100317200?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


下载后直接解压就可以使用了。
我们把它解压放到C:\Android\adt目录。
http://img.blog.csdn.net/20141224100424935?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

为了在DOS控制台中直接使用SDK的工具,可以将SDK的目录添加到Windows的path环境变量中:在桌面上右击“我的电脑”,依次点击【属性】>【高级】>【环境变量】。双击【系统变量】里面的Path项,将Android SDK中tools目录的完整路径添加到这里
http://img.blog.csdn.net/20141224100500940?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


创建 C:\Android\Eclipse\eclipse.exe快捷方式到桌面,如下:
http://img.blog.csdn.net/20141224100607162?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

如图:
http://img.blog.csdn.net/20141224100629265?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

1.4、 给Eclipse 安装ADT插件
运行Eclipse.exe
A. 选择Help > Install New Software.
http://img.blog.csdn.net/20141224100725911?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

B. 点击Add按钮
在弹出的对话框,输入网址:

http://img.blog.csdn.net/20141224100731765?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
点OK按钮

C. 选择所有,点击Next进行安装
http://img.blog.csdn.net/20141224100746098?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

安装过程:
http://img.blog.csdn.net/20141224100755177?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

1.5、 运行Eclipse设置Android ADT插件
重启Eclipse,进行Android SDK设置:
选择【Windows】 > 【Preferences…】打开编辑属性窗口
选择Android属性面板
加入Android SDK的目录(点击【Browse…】进行选择,这里是“android-sdk”所在的目录)
如下图:
http://img.blog.csdn.net/20141224101007995?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

运行SDK Manager.exe,安装Android开发用的相关文件。
http://img.blog.csdn.net/20141224101014890?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

选择如下,然后点击“Install”
http://img.blog.csdn.net/20141224104635540?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
1.6、 NDK安装
控件使用的android-ndk-r6-crystax-2,从我们官网上下载,地址:
地址:
http://img.blog.csdn.net/20141224101045000?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
Crystax官网:


如果不能下载,请搜索官网与我们 联系
把NDK解压到C:\Android\OdaNdk
如下图:
http://img.blog.csdn.net/20141224103852079?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


1.7、 安装Cygwin
由于NDK开发大都涉及到C/C++在GCC环境下编译、运行,所以在Windows环境下,需要模拟Linux模拟编译环境,下载地址:

下载setup.exe文件。(使用64位系统,下载x86_64)
http://img.blog.csdn.net/20141224103902734?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
运行setup-x86.exe,安装在C:\Android\cygwin:
http://img.blog.csdn.net/20141224103913576?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
http://img.blog.csdn.net/20141224103924215?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

修改
C:\Android\cygwin\etc\profile
设置路径变量

设置windows路径变量,方便能找到cygwin,如下:
http://img.blog.csdn.net/20141224105231564?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center



1.8、 创建虚拟机
运行【Windows】=>【Android Virtual Device Manager】,
在界面上,新建一个虚拟机,设置如下:

http://img.blog.csdn.net/20141224105351858?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
1.9、 编译并运行控件安卓例子
控件例子下载地址:

http://img.blog.csdn.net/20141224105440779?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


解压控件的试用),我们把它解压到C:\MxDrawInstall\,如下:
http://img.blog.csdn.net/20141224105519436?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
切换Eeclipse工作空间,把工作空间切换在控件安装位置: C:\MxDrawInstall\MxDraw60Android\SRC\MxDraw6.0\AndroidSample\MxDrawSupportDwg
命令如下抓图:
http://img.blog.csdn.net/20141224105658218?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


导入控件例子,如下:
【File】->【Import…】
http://img.blog.csdn.net/20141224105727000?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

如下图,选择,“Existing Android Code Into Workspace”导入C:\MxDrawInstall\MxDraw60Android\SRC\MxDraw6.0\AndroidSample\MxDrawSupportDwg\MxDrawTestActivity 例子
http://img.blog.csdn.net/20141224105834296?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


设置NDK目录,【窗口】=>【首选项】

http://img.blog.csdn.net/20141224105916796?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

对该工程增加C++支持,在工程名上右键,在右键菜单上,选择: 【Androids Tools】=>【Add Native Support…】如下:
http://img.blog.csdn.net/20141224105955031?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
点击后会弹出一个简单的设置界面,Lib填写:mxdrawjin

http://img.blog.csdn.net/20141224110108734?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
禁用C++的语法分析功能,发现分析出一堆错误,但实际并不是错误,所以要禁用。
如下:
http://img.blog.csdn.net/20141224110147906?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center


编译工程,【Project】->【Bulid All】,这时应该能成功编译工程。
http://img.blog.csdn.net/20141224110230824?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

增加运行配制,点击:
http://img.blog.csdn.net/20141224110307281?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

出来界面设置如下:
http://img.blog.csdn.net/20141224110348621?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center



点击”运行”效果如下:

http://img.blog.csdn.net/20141224110415781?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
http://img.blog.csdn.net/20141224110429790?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzcyNTAwMQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

到目前,安卓的开发环境已经搭建完成。

chenhaijunsjy 发表于 2014-12-24 15:50:11

年终岁末,非常辛勤劳动!!谢谢

87737352 发表于 2014-12-24 15:50:11

看了介绍,很有用处。

whng 发表于 2014-12-24 15:50:11

谢谢楼主分享的资料

lihao2014 发表于 2014-12-24 15:50:11

chenhaijunsjy 发表于 2014-12-24 16:39
年终岁末,非常辛勤劳动!!谢谢

不客气,希望对您有用

lihao2014 发表于 2014-12-24 15:50:11

87737352 发表于 2015-11-10 08:11
看了介绍,很有用处。

谢谢肯定,欢迎使用
页: [1]
查看完整版本: android开发使用控件--开发环境搭建。CAD控件