Android Wear Develop Preview初体验

   Android Wear系统主要是发送语音命令,要以“Ok Google”开始,然后可以提问问题或者设置命令。该系统还可以统计人的步数和卡路里。

    现在发布的是Preview的,不久后会发布Android Wear SDK。

    现在的Android Wear Develop Preview需要用gmail邮箱申请,申请通过,gmail邮箱会收到一封邮件,里面有Android Wear Develop Preview相关资源的下载地址,相关资源包括:Preview Support library and samples。

    要想用Android Wear,需要用Android SDK Manager更新SDK相关库及模拟器,因为现在使用Android Wear只能使用模拟器。需要更新的SDK内容包括:

  1. Launch Android SDK Manager.

  • From Eclipse, select Window > Android SDK Manager.

  • From Android Studio, select Tools > Android > SDK Manager.

Below Tools, verify that you have Android SDK Tools revision 22.6 or higher.

If your version of Android SDK Tools is lower than 22.6, you must update:

  1. Select Android SDK Tools.

  2. Click Install package.

  3. Accept the license and click Install.

  4. When the installation completes, restart Android SDK Manager.

Below Android 4.4.2, select Android Wear ARM EABI v7a System Image.

Below Extras, ensure that you have the latest version of the Android Support Library. If an update is available, select Android Support Library. If you're using Android Studio, also select Android Support Repository.

Click Install packages.

Accept the license and click Install.

   另外,还需要更新adt到22.6.0版本,现在使用android studio中的help中的自动更新不好使,只能从官网将插件包下载下来使用。下载地址:adt22.6.1,http://developer.android.com/sdk/installing/installing-adt.html

    在启动模拟器的时候,需要重新启动eclipse程序,才可以。配置Android Wear模拟器步骤如下:

  1. Launch the Android Virtual Device Manager.

  • From Eclipse, select Window > Android Virtual Device Manager.

  • From Android Studio, select Tools > Android > AVD Manager.

Click New.

For the AVD Name, enter "AndroidWearSquare" or "AndroidWearRound", depending on whether you want to create an emulator with a square or round display.

For the Device, select Android Wear Square or Android Wear Round.

For the Target, select Android 4.4.2 - API Level 19 (or higher).

For the CPU/ABI, select Android Wear ARM (armeabi-v7a).

For the Skin, select AndroidWearSquare or AndroidWearRound.

Leave all other options set to their defaults and click OK.

Although real Android Wear devices do not provide a keyboard as an input method, you should keepHardware keyboard present selected so you can provide text input on screens where users will instead provide voice input.

In the list of AVDs, select the one you just created and click Start. In the following window, click Launch.

    下图为启动了一个圆形界面的模拟器。

Android Wear Develop Preview初体验_第1张图片

    之后,我们点击邮件中的opt-in连接,成为android wear preview测试人员,然后从google play下载 Android Wear Preview.apk,安装到自己版本大于等于android4.3的手机中。

Android Wear Develop Preview初体验_第2张图片

    如果从google play下载该应用麻烦,就从以下网址下载,这是微博号为水天一线的android开发者上传的:http://pan.baidu.com/s/1mgDgm0K#dir/path=%2FEF%2FAndroid%2FAndroidWearPreview

    在手机或者pad上打开AndroidWearPreview程序,会显示英文:通知未打开,这时通过设置按钮,打开设置,启动Notification access。然后回到首页。

    保证手机通过USB线连接到电脑上。

    保证模拟器正在运行。

   在命令行执行如下命令:

adb -d forward tcp:5601 tcp:5601

   看手机上,已经连接成功了;模拟器上也显示了时间和G图标。表示连接成功了,他们是通过tcp连接的。

    再看模拟器,通知已经发到模拟器了。如下图所示:

Android Wear Develop Preview初体验_第3张图片 在模拟器上向右滑动,出现如下内容。

Android Wear Develop Preview初体验_第4张图片点击该内容,手机上就打开了网易新闻的客户端及相应的页面。




转载于:https://my.oschina.net/tingzi/blog/209643

你可能感兴趣的:(Android Wear Develop Preview初体验)