zoukankan      html  css  js  c++  java
  • win7搭建android开发环境

    (1) java JDK下载:

      进入该网页: http://java.sun.com/javase/downloads/index.jsp (

    选择 Download JDK 只下载JDK,无需下载jre.

    (2)eclipse下载

       进入该网页: http://www.eclipse.org/downloads/ (或者直接点击下载:BT下载    HTTP下载) 。

    (3)下载Android SDK

        我们下载windowss平台下的sdk。http://developer.android.com/sdk/index.html

    (4)sdk安装

         我们第3步下载的sdk只是启动程序软件包,从android2.0器,android sdk被分为2部分,sdk启动程序软件包和sdk组件。手肘使用web浏览器获得启动程序软件包。下载后安装到合适目录。  安装到最后时,会运行sdk manager.exe.该程序会显示可用组件列表。也就是android sdk组件。包括文档,平台,附加软件库和usb驱动程序等等,选择自己想要安装的,然后点击install。

         

    文件列表 

    add-ons:一些扩展库,例如 Google APIs Add-On

    docs:API文档等等

    platforms:各个版本的平台组件

    samples:一些实例程序

    tools:各种辅助工具

    usb_driver:windows下的一些usb驱动

    temp:存放下载平台组件过程中的临时文件

      如果遇到消息“Failed to fetch URL…”的错误提示,那么需要将HTTPS方式改为HTTP方式,在“Android SDK and AVD Manager”窗口的左侧选择“Settings”,选中“Force https://...”选项,点击“Save & Apply”,并重新运行SDK Setup.exe。

       下载开发包的速度真是慢啊!搞了2个多小时。可以手动下载,不过比较麻烦,可以 参考:http://www.cnblogs.com/ronli/archive/2012/04/20/2458687.html

     注意:官方tip: For easy access to the SDK tools from a command line, add the location of the SDK's tools/ and platform-tools to your PATH environment variable.

      不要忘了将tools和platform-tools加到path中去。(为了方便命令行使用)

     下载组件包时出现了一个错误:

    Downloading ARM EABI v7a System Image, Android API 16, revision 1
    Download finished with wrong size. Expected 112321946 bytes, got 0 bytes.

    就是ARM EABI 下载失败了。

      说明:一般会在创建avd的时候容易出现Unable to find a ‘userdata.img’ file for ABI .svn to copy into the AVDfolder
    原因是你在SDK Manager中更新Android该创建版本的SDK时 ,没有同时下载该版本的的ARM EABI v7a System Image package。以前2.x版本没有该文件。从4.0开始,创建模拟器需要该文件。 

      想重新下载可就是下不动,看来要手动下载安装了。

    可以参考:

    android SDK Platforms 提取下载http://darkhandz.com/android-sdk-platforms-catch/

    组件下载地址:http://www.hariadi.org/android/manual-download-of-android-sdk-components/

     

    (5)安装eclipse插件ADT

         为了让开发过程轻松,google还编写了一个称为adT(android development toolkist)的eclipse插件.步骤如下:

    1.启动eclipse.选[help]=>[install new software]... ,

    2.在出现的对话框中单击Available software sites链接

    3单击add按钮,输入android开发工具更新站点的位置

    https://dl-ssl.google.com/android/eclipse/

     注意:如果地址有问题,试着将https改为http。

      我的始终连接不上,只有手动安装了。下载ADT安装包, 前三部跟上面的一样,只是add后,我们不输入网址,而是直接Local选项中输入Android Plugin(名字任意),在Archive中找到ADT的压缩包,点击OK,然后在下面勾选Name中的选项即可。

    4安装完成后,重启eclipse

    还要配置ADT 插件。

       选择window->preferencs ->android,然后输入sdk安装目录C:\Program Files\Android\android-sdk ,单击ok按钮。

    (6)创建模拟器AVD

        Windows--》Android SDK and AVD ManageràVirtual device--》New 填写新的avd字段。

    Name:可以随便写,如sdk

    target:Target是模拟器的可用平台;

    SD Card是记忆卡,也就是手机的内存卡

    Skin是模拟器显示的屏幕大小,具体参数为:

    WVGA:800*480

    QVGA:320*240

    VGA:640*480

    HVGA:480*320

    WQVGA400:240*400

    WQVGA432:240*432

    WVGA800:800*480

    WVGA854:854*480

     或者也可以选择Resolution,自由设置模拟器屏幕大小。HardwareAVD所需要的特殊设备)中的值:Abstracted LCD density(分辨率)其值是由选择的Skin自动设置的等等。

        到这里基本上就完成android环境的搭建了。

    参考:

    http://developer.android.com/sdk/installing/index.html

     http://www.cnblogs.com/ok-lanyan/archive/2011/10/14/2207339.html

    2014.9.14安装安卓开发环境:

    下载的是:Download the stand-alone Android SDK Tools for Windows

    If you already have an IDE you want to use for Android app development, setting up a new SDK requires that you download the SDK Tools, then select additional Android SDK packages to install (such as the Android platform and system image). If you'll be using an existing version of Eclipse, then you can add the ADT plugin to it.

    这个sdk文档是这么描述的:

    Welcome to the Android SDK!

    The Android SDK archive initially contains only the basic SDK tools. It does
    not contain an Android platform or any third-party libraries. In fact, it
    doesn't even have all the tools you need to develop an application.

    In order to start developing applications, you must install the Platform-tools
    and at least one version of the Android platform, using the SDK Manager.

    Platform-tools contains build tools that are periodically updated to support new
    features in the Android platform (which is why they are separate from basic
    SDK tools), including adb, dexdump, and others.

    To install Platform-tools, Android platforms and other add-ons, you must
    have an Internet connection, so if you plan to use the SDK while
    offline, please make sure to download the necessary components while online.

    To start the SDK Manager, please execute the program "SDK Manager.exe".

    From the command-line you can also directly trigger an update by
    executing:
    tools\android.bat update sdk --no-ui

    Tip: use --help to see the various command-line options.


    For more information, please consult the Android web site at
    http://developer.android.com/sdk/

    SDK安装完成,启动Android SDK Manager。

    2)安装Platform

    仅仅SDK Tools是不够的,我们至少还需要一个Android平台和最新的SDK 平台工具。

    启动Android SDK Manager,如下图,勾选Android SDK Platform-tools和Android SDK Build-tools,Android 4.2.2文件夹,Extras下的Android Support Library。

    (说明,我安装是4.4.2)

    以上 安装下载太慢了,使用离线安装:

    方法看:http://www.cnblogs.com/zuike/p/3330939.html

    http://blog.csdn.net/gyming/article/details/8168166

    更多:http://www.sd173.com/html/1631.html

    http://www.open-open.com/lib/view/open1386252535564.html

    最后下了个eclipse ADT-Bundle绑定工具。

    With a single download, the Eclipse ADT bundle includes everything you need to begin developing apps:

    • Eclipse + ADT plugin
    • Android S
    • DK Tools
    • Android Platform-tools
    • A version of the Android platform
    • A version of the Android system image for the emulator

    ADT-Bundle for Windows 是由Google Android官方提供的集成式IDE,已经包含了Eclipse,你无需再去下载Eclipse,并且里面已集成了插件,它解决了大部分新手通过eclipse来配置Android开发环境的复杂问题。

    启动Eclipse。

    然后从Windows->Android Virtual Device Manger打开AVD管理器。

    Android AVD出现"No system images installed for this target"

      原因在于一个组件“ARM EABI v7a System Image”没有安装,如图2所示。

    如果安装了"Inter x86 Atom System Image",则CPU/ABI列表选项更加丰富。

    AVD创建:http://www.crifan.com/create_avd_android_virtual_device/

    第一次创建工程:

    http://my.oschina.net/dbeenlee/blog/181872

    http://doomshadow.com/proxy/index.php?q=aHR0cDovL2RldmVsb3Blci5hbmRyb2lkLmNvbS9wcmV2aWV3L2luZGV4Lmh0bWw%3D

  • 相关阅读:
    使用Xshell为xftp开ssh通道代理
    linux下查找svn的相关目录的命令
    linux服务器A远程连接服务器B的mysql及1045错误
    怎样下载带权限认证的文件?
    Vue项目打包部署总结
    Vue项目打包压缩:让页面更快响应
    axios请求失败自动重发
    可用的后台管理系统
    vue组件间方式总结
    非脚手架创建vue项目,并使用webpack打包
  • 原文地址:https://www.cnblogs.com/youxin/p/2586681.html
Copyright © 2011-2022 走看看