|
|
|
|
|
- Overview
- Special case: Google Glass
- Implementing a dialog with a connected object
- Principle
- Implementation
Connected devices: Android Wear
Android Wear is the version of the Android operating system dedicated to connected objects: watches, bracelets, rings, ... This version is suitable for smaller devices (screen size, battery power) devoid of keyboard.  Displaying a message and Proposing a response |
From version 20, the WINDEV Mobile applications can display messages, images, questions and they can propose responses on the Android Wear devices. This dialog is performed via rich notifications. For example: - the end user can receive an alert on his watch and he can choose the action to perform by clicking the choices proposed on his watch.
- an end user can receive a message on his watch and he can dictate (verbally!) his response to the watch. The phone will directly receive the answer in text form.
Remarks: - The management of connected objects is available from Android 4.4.
- If several objects are connected to the same phone, the notifications will be displayed on all the connected objects (except for Google Glass).
Special case: Google Glass The Google Glass are a connected object. You have the ability to send notifications with actions via the phone to the glasses. Note: If the phone has a connection to a watch AND Google Glass, the notification cannot go to both. The glasses have priority. Implementing a dialog with a connected object Principle To use an Android application on a connected object (a watch in most cases), the object must be connected to the Android phone. The object becomes a deported screen for the application that is run on the phone. Therefore, a notification sent to the phone is also displayed on the watch. When the notification is read on the phone, it disappears from the connected object (and conversely, a notification read on the connected object disappears from the phone). If the notification triggers an action, the application will be started on the phone (if necessary) and the procedure associated with the action will be run. If the notification expects a response: - with the system of preset responses, all you have to do is select the response on the connected object.
- with the system of free responses, the user will dictate the response to the connected object and the response will be typed on the phone.
Implementation To implement a dialog with a connected object, all you have to do is use the notification system (local notifications or Push notifications). To implement a local notification: - Create a Notification variable.
- Define the different properties of the notification.
- Use NotifAdd to add the notification.
Example: Procedure used to send a notification regarding the health of an animal: PROCEDURE AjouteNotif(rTemp is real, rPoids is real)
MaNotif is Notification
MaNotif.Title = "Mon animal"
rPoids = Round(rPoids)
MaNotif.Message = StringBuild("Mon animal pèse %1kg (- 12 kg) " + ...
" et sa température est de %2°c", rPoids, rTemp)
MaNotif.DisplayLED = True
MaNotif.ColorLED = RGB(255, 255, 255)
MaNotif.Sound = notifDefaultSound
MaNotif.Vibration = True
MaNotif.ActivateApplication = True
MaNotif.Format.Type = notifImageFormat
MaNotif.Format.Content = "animal.jpg"
MaNotif.AdditionalAction[1].ActionLabel = "Soigner l'animal"
MaNotif.AdditionalAction[1].Icon = "icon_notif.png"
MaNotif.AdditionalAction[1].ActionClick = CallbackNotif
MaNotif.AdditionalAction[1].QuestionLabel = "Que souhaitez-vous lui donner ?"
MaNotif.AdditionalAction[1].ResponseChoice = "Sirop" + CR + "Comprimé" + CR + "Piqûre"
NotifAdd(MaNotif)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|