Messaging feature on Android Gear
September 20, 2014 § Leave a comment
Sending messages on Android Gear feels as simple as it was to pass notes back in school. Keep in mind when your companions dependably felt adjacent? That inclination is the reason I cherish staying in contact with loved ones utilizing my gearable.
Your informing application likely as of now deals with Android Gear. With simply a couple of more lines of code you can open straightforward yet compelling gimmicks that let your clients impart significantly all the more smoothly.
Notifications for free
On the off chance that your Android application utilizes warnings to tell the client about new messages, these will work naturally on their Wearable. That is, the point at which you construct notices with the Notificationcompat.builder class, the framework deals with showing them legitimately, whether they show up on a handheld or gearable. Likewise, an “Open on telephone” activity will be included so its simple for the client to answer through the application on their handheld.
Answer like a champ
Messages on Gear get truly energizing when you can answer straightforwardly from the watch with your voice. Notwithstanding being super helpful, this dependably provides for me a Dick Tracy thrill… yet perhaps that is just me. =]
To include this usefulness, its as basic as adding an activity to the notice by means of Gearableextender that incorporates a Remoteinput to your warning. After the client answers, you’ll simply get their voice include as a string from the Remoteinput included in the Intent. You can even incorporate content reactions the client can undoubtedly select from a rundown by passing a cluster of them to the setchoices strategy for the Remoteinput.
See who is messaging
Messages are more genuine when you are associated with the sender. That is the reason we prescribe you incorporate the photograph of the sender as the foundation of the warning. When the client takes advantage of the message, they likewise see who its from, which will make it matter more (or possibly that other thing, contingent upon who it is).
You ought to include a photograph with a determination of no less than 400×400, yet we prescribe 640×400. With the bigger size, the foundation will be given parallax scrolling. In the event that the foundation is to be incorporated in the apk, place it in the res/drawable-nodpi index. At that point call setbackground() on your Gearableextender and add it to your notice.
Essential warnings with answer by voice and a decent foundation picture are the most critical parts to accomplish immediately. Be that as it may why stop there? It’s not difficult to broaden the remarkable parts of your administration to the gearable. A straightforward first step is including a custom activity the way Omlet does. These are simply activities characterized with the Gearableextender that raise an expectation on the handheld.
Custom communication on the gearable, in the same way as the accompanying case from Textme, is clear to actualize. They have what gives off an impression of being a basic warning with an activity that permits the client to choose an emoticon. On the other hand, to demonstrate this emoticon picker, they are really issuing a notice from the gearable. The round excursion looks something like this:
- The handheld gets another message, issues a notice setlocalonly(true), and makes an impression on the gearable utilizing the Data Layer API
- The gearable gets that message utilizing the Gearablelistenerservice and issues a custom notice with a Pendingintent to dispatch an action when the client sees the warning
- That action has a custom format characterized with the Gearable UI Library
- Once the client chooses an emoticon, the gearable communicates something specific over to the handheld
- The handheld gets that message and sends it along to the server.
Happy Reading. Subscribe us for more updates.