Android Wear Android wearable device application development platform

Source: Internet
Author: User

Android Wear was released on March 19, 2014 and has Moto 360 and LG Watch two products.

The source code is not open at the moment. However, the developer can download its image and the corresponding development SDK so that the developer can do the pre-development through the simulator.

In fact, Android wear consists of two parts, part of the operating system performed on wearable devices, and part of it is for handheld devices (mobile phones). Tablet) program, the main purpose of the SDK is to provide references and specifications for application development on wearable devices. To guide users in developing applications that can collaborate with small screen devices. The use of "collaborative action" here is that the user-developed program is never executed on a wearable device, it simply defines the UI interface. The Android Wear service will pass the UI information to the wearable device, which can then be displayed by the wearable device using its own UI mechanism.

From this point of view. The role of Android wear is to provide a set of display standards in handheld devices and wearable devices. In this format, cross-device display is possible.

This standard is the Android notification. When a wearable device is connected to a handheld device, notifications from the handheld device are delivered to the wearable device. The wearable device then displays the notification in a manner that is appropriate for its own operation. Of course, in order to have a better display on the wearable device, developers need to make a few changes, this is the role of the SDK.

There's not enough information on Android Wear right now. The next few days on the Google IO Conference (6.25-6.27). Android wear will be a hot topic, releasing a lot of other information.


Android Wear Launch reason

We know. Android has been born since. has been to guide users a program at the same time to support the application of different screen devices, which is the Res folder has layout, Layout-land, layout-portrait, layout-sw600 folders, such as the reason, This is to allow different devices to use different layout to achieve device compatibility. So why is Android required to have a separate SDK for wearable devices? This is due to the fact that devices such as wearable devices and mobile phones are too different.

Detailed body now.

1) The screen is too small. The old display mode no longer fits

The wearable device (watch) screen is not small, but particularly small, compared to mobile phones and tablets. So on this screen, the application is basically not showing a few view, so the original complex layout file determines the mechanism of the program display framework is too complex. Also not used.

2) Input problem

We know that from the PC cut to the phone, we learned to switch from the external keyboard into the soft keyboard, and enjoy the. What about the wearable device? Pop up an input keyboard on a small poor device such as a watch. The user is expected to enter with a magnifying glass.

3) Non-independence of equipment

We know. Wearable devices are small in size. Natural hardware is not strong enough and there are fewer accessories (cameras, Internet modules, etc.). Naturally, it is not easy to do complex operations, so wearable devices often need to use handheld devices to help them complete tasks, such as taking pictures and surfing the internet.


Android wear key module analysis
Display:

The screen is small. As a result, the elements of the UI interface are minimized, only important content is displayed, and user interaction is as easy as possible. From this perspective, the WINDOW8 system is visionary, and the card-based UI presents a display device that is inherently suitable for arbitrary resolution. In particular, the Metro Desktop program dynamic message display, very suitable for wearable devices. It was mentioned at the very beginning. Wearable device display is mainly through the display of notifications to achieve, using the notification mechanism itself to avoid some of the above shortcomings, to show the focus of the purpose, because the Android notification itself is relatively simple, but also suitable for small screen operation. In addition to this, there are some other changes. For example, Android Wear expands and adds some notification objects. For example, the action, paginated display.

Generic Android Device Notification object Notificationcompat.builder Notificationbuilder = new Notificationcompat.builder (mcont EXT). Setcontenttitle ("New mail from" + sender.tostring ()). Setcontenttext (subject). Setsmallicon (R. Drawable.new_mail);//notification with action, the action on the wearable device is displayed on a separate page//, the user can slide left to enter the action page, This is the following interactive notificationcompat.builder we want to mention Notificationbuilder = new Notificationcompat.builder (this). Setsmal Licon (r.drawable.ic_event). Setcontenttitle (EventTitle). Setcontenttext (eventlocation). setContentInt ENT (viewpendingintent). Addaction (R.drawable.ic_map, getString (R.string.map), mappendingintent);//Below Wearablenotifications is the focus, this is a new//class of notification specifically for wearable devices, such notification agree to have multiple display pages.        Users swipe left and right//To browse a lot of other content very naturally notification notification = new Wearablenotifications.builder (notificationbuilder) . Sethinthideicon (True). Build ();//The following notification send logic is the same as for a normal device notification NotificationmaNagercompat Notificationmanager = Notificationmanagercompat.from (this); Notificationmanager.notify (NotificationId, notification);

When this notification is sent out. The wear interface will have a display such as the following:

Interaction:

The screen is small and the natural UI does not provide much choice for the user to do. There is no space to enter in the form of a soft keyboard.

Because the interactions on Android Wear tend to be more focused, it's just one thing for each interface. This simplifies the way you interact. This mode of interaction can be simplified to display notifications. The user responds to this simple process.

The same time the user reply must also be convenient. Try to reduce the user's manual input. Since Android Wear offers two kinds of frequently used, option list and voice input are available. At the same time, Android Wear normalized the mode of this reply. This interaction in Android Wear is called action, and input is just a way of interaction, in Android Wear called remoteinput, the remote word is because often this input is not sent directly, but will be sent first to the handheld device (mobile , tablet), and then the handheld device is actually sent. Detailed code logic such as the following:

Input for pure speech:

Remoteinput remoteinput = new Remoteinput.builder (extra_voice_reply)        . SetLabel (Replylabel)        . Build ();

Input with default text options and voice:

String Replylabel = Getresources (). getString (R.string.reply_label); string[] replychoices = Getresources (). Getstringarray (r.array.reply_choices); Remoteinput remoteinput = new Remoteinput.builder (extra_voice_reply)        . SetLabel (Replylabel)        . Setchoices ( replychoices)        . Build ();

Add an input response to a notification

Notification replynotification =        new Wearablenotifications.builder (Replynotificationbuilder)        . Addremoteinputforcontentintent (Remoteinput)        . Build ();

Multi-Device connection

Because multi-device interconnection, transmission of data, and so on is the system framework and the underlying problem, rather than directly with the user of the device, this will be open after the source code. I will do a separate article to analyze.

You may ask, why not open, in fact, Google is now making up a mistake. It is because Android is too open to cause Android fragmentation. Google has no control over Android, the domestic manufacturers that is even more. Thus. On Android for wearable devices, Google expects to be sure to unify the interface to enhance the consistency of the user experience.


Android Wear Experience Environment setup:
1. Download the SDK

1) Upgrade Android-sdk-tool to 22.6 version number or higher

2) Start the SDK Manager and select the following check box, for example:

Then select and download for example the following tick (focus on androidwear ARM EABI v7a System image and Android support Library two items)

[Email protected]:~/android-sdk-linux/tools$./android

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvsvrszwfrcw==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "Width=" 520 "height=" 520 ">

2. Create/launch Android Wear simulator

This should be very easy. Just choose Androidwearround/square on the simulator interface.

When you're done, click Start to


3. Android Wear Preivew program installed on mobile device

The program is actually a launcher, which is the default launcher on wearable devices.

The program is at the same time another backend service, which is responsible for receiving notifications from the system. It is then displayed on the launcher. For wearable devices. The service can receive notifications from the remote (mobile phone) and then appear on the launcher.

After the installation, press the home key to pop up the selection box and select Android Wear on your phone to enter Android Wear launcher. You then need to turn on the agree to receive notification option.

Because the app is in preview, Google doesn't want to open the app, and since I'm not uploading the app here, it's interesting to be able to experience it on the following page.

Http://developer.android.com/wear/preview/signup.html

Hello Developer,


Thank signing up for the Android Wear Developer Preview.


To Begi N Developing on Android Wear, you'll need the preview support library and the Android Wear Preview app for your mobile Device. Follow these steps:


  • Download The Preview support library and samples.

  • opt-in to become a tester o f the Android Wear Preview app in the Google Play Store. After opt-in, it could take up to $ hours for the Android Wear P review app to being accessible to your in Google Play. Make sure the Opt-in user account was the same user signed in to Google Play.


Refer to the Android Wear developeRGet StartedPAGe for details. Since This was a preview release, please don't publicly distribute apps built with the preview library.Also Note that the APIs is potentially subject to change and you'll need to modify your apps when they is released Out of preview.

When there is a message there will be a display similar to the following, for example:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvsvrszwfrcw==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "width=" "height=" >

4. Connect the phone and the simulator

I just mentioned it. The simulator is displayed by reading the notification on the phone, naturally need to have a communication channel, for the simulator, is through the ADB TCP channel.

Implemented by, for example, the following command:

For real-life scenarios, wearable devices such as smart watches are usually communicated to the phone via Bluetooth or Wifi-direct.

Adb-d forward tcp:5601 tcp:5601

Summary:

Overall, Android Wear has achieved two main points:

1) Establish cross-device display interaction standards.

Notifications are transmitted from handheld devices to wearable devices in accordance with certain standards. The wearable device is then displayed according to the notification information. The user's response is then returned to the handheld device.

2) modified the androidnotification display mechanism. Let notification be the device display standard and agree to the notification to be displayed in a way that fits the wearable device display interaction.


/********************************
* This article from the blog "Love Kick Door"
* Reprint Please indicate the source: Http://blog.csdn.net/itleaks
******************************************/


Android Wear Android wearable device application development platform

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.