Preview only show first 10 pages with watermark. For full document please download

Developing For Android Wear

   EMBED


Share

Transcript

Developing for Android Wear By : Devavrata Sharma Agenda : - Introduction Walkthrough with Android wear Setup the environment Development for Android wear Packaging of the app for publishing Do’s and Don’ts What all new in Android wear 2.0 Q&A Introduction - Emerging market of wear technology and devices with $8 billion and more Concentrated traffic from Notifications Helps you to do better time management. Major players are Motorola, LG, Samsung, Sony, Fossil, Asus and Tag Heuer Walkthrough with Android wear - Android wear design Majors - How the wear app gets installed on you the device. -How to interact with Android wear device -Swipe gestures -Voice commands Android wear design majors : - Suggest - context stream Android wear design majors : - Demand - The Cue cards Setup the Environment -Update your SDK tools to version 23.0.0 or higher - Update your SDK with Android 4.4W.2 (API 20) or higher - Setup an Android wear virtual device or Android wear device - Download Android wear app from Play store on your phone - Command to connect phone with Android wear virtual device adb -d forward tcp:5601 tcp:5601 App development for Android wear - Showing notifications Extending actions only for wearable Android wear specific app Notifications : final int notificationId = 1; final NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle("Hello Wearable!") .setContentText("Sample text"); NotificationManagerCompat.from(context).notify(notificationId,notificationBuilder.build()); Notifications : Notification with wearable functionalities : - Wearable only actions - Voice Commands - Extra pages Wearable only actions: final NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender(); wearableExtender.addAction(new NotificationCompat.Action(R.drawable. ic_navigation,"Nearest Shop", navigationIntent)); notificationBuilder.extend(wearableExtender); Voice Commands: final RemoteInput remoteInput = new RemoteInput.Builder (EXTRA_VOICE_REPLY).setLabel("Pls give feedback").setChoices(this. getResources().getStringArray(R.array.reply_choices)).build(); notificationBuilder.extend(new NotificationCompat.WearableExtender(). addAction(new NotificationCompat.Action.Builder(R.drawable. ic_voice_search,"Reply", navigationIntent).addRemoteInput(remoteInput). build())); Extra Pages : - Create notifications and add them to wearableExtender. Packaging of the App for Publishing ● ● You need to package wearable app inside handheld app You should give dependency of wearable app inside mobile’s app build.gradle file ● ● ● dependencies { MyFirstWearApp project(':wearable') } -Include all the permission declared in the wearable manifest file to mobile module manifest file. - Ensure common version number and package name for both modules. Do’s - - Design for big gestures Design it in a way, so that user should not take more than 5 seconds to use. Otherwise you should reconsider the design. Do one thing at a time. Keep the long running logic on your mobile side. Dont’s - Do not overload operation for wear apps Do not demand unnecessary data from handheld devices Stay careful about interactive and ambient mode Android Wear 2.0 preview - System UI Standalone Apps Real Time walking, bicycling and Running recognition. System UI: - Material design for wearable Darker UI Watch hardware button works like a back button You can reply by voice, emojis and keyboard Standalone Apps : - Tethered + Untethered Apps run on watch even when your phone is not with you Doze Handle notifications completely from wearable device. Direct download from play store Real Time walking, bicycling and Running recognition. Here you can find more : DevBytes : https://www.youtube.com/watch?v=o5cne6vKeo&index=9&list=PLWz5rJ2EKKc-kIrPiq098QH9dOle-fLef https://developer.android.com/training/wearables/apps/creating.html Q&A Thank you. @DevavrataSharma [email protected]