Is it possible to create custom Android Wear notifications? - wear-os

I have been doing lots of research trying to figure out if it is possible to create wear notifications with custom layouts over the past few months, but am struggling to find a solution.
I have tried to implement the following suggestions to no luck:
https://possiblemobile.com/2014/07/create-custom-ongoing-notification-android-wear/
http://android-wear-docs.readthedocs.org/en/latest/sync.html
Custom UI for Android Wear Notifications
Most of what I have read have instructed that in order to do this, I should create an android wear app with a data listener. The idea being the phone would send certain data to the watch (say a string) based on the type of notification it wants to send. I would disable the automatically generated wear notification. In its place, the Android Wear app listener would know what type of notification it is based on the string and display my custom pages for that notification instead.
My first problem I have run into is I have no idea how to debug code like this. Since in Android studio you can only launch the device app or the wear app, but not both at the same time.
The other question I have is, does the Android Wear app run in the background when the Device App is running? Do you have to open the Android Wear App first for the listener to be even working (if so then I guess this is not a solution to custom notifications)?
Is it actually possible to create custom layout android wear notifications?

If you want to use a custom layout for your notifications, you should create the notification on the watch, following Creating Custom Layouts. You can even make the custom notifications clickable, you can add actions that will open activities on the watch, etc.
For that, you can send a message from your phone to your watch and the listener implemented on your watch will receive it and then, create and display the notification using the correct layout corresponding to the message sent, for example.
In this case, the best way is to implement a WearableListenerService on your wearable. Its lifecycle is handled by the system which binds it only when necessary.
To debug, you install the wear app on the wear emulator or your watch, you install the mobile app on your phone and finally you connect the two following this tutorial if you're using the emulator or via bluetooth if you're using a watch (link in the tutorial).
The Android Wear app connects your phone to your watch, whether it is an emulator or not. So, in order for your message to be received, you must have connected wear and mobile via Android Wear. Then, once the connection is established, you don't necessarily need to keep it open. So yes, the Android Wear app runs in background.

Related

Connect bluetooth scanner to Xamarin.Forms App

I want to listen to a bluetooth barcode scanner input events in my Xamarin.Forms app targetted for iOS, Android and UWP.
I found a few GitHub like bluetoothLE, on how to list BLE devices with Xamarin for iOS or Android (it also says it is compatible with UWP), and some hints as to how to register to input, but I couldn't get it to work...
So I was thinking if there was a way to register to ALREADY PAIRED items (which are paired at OS level, before launching the app) and hook up to input events? Does anyone have some suggestions?

Xamarin.Forms Launch or Wake app on bluetoothle button push

I now have a requirement for an iOS/Android app (Xamarin.Forms) to either wake or launch when a paired BluetoothLE button is pressed. The app may be in the background or even closed.
I have a POC app (modeled after Acr.Ble samples) and I'm currently using CoreBluetooth to scan and connect to the device and get services etc... I'm not sure what I need to do to get the app to wake or launch when the button is pressed.
I know Android and iOS may handle these things differently, so a cross-platform solution is not a requirement.
Any help is greatly appreciated!

creating media controls on android wear

I want to create a wear application that has 2 mode : the connected mode and the disconnected mode. The first mode is used when the watch is connected to the bluetooth : you can control a media player and have the basic controls on what's being played on the phone.
The second mode is used when the mobile is not paired to the watch : you can listen to content on the watch with a bluetooth headset.
My question is the following : on the connected mode, I created my own interface with the basic controls (play/pause/next/previous) and I can synchronize the controls with the phone sending messages via the message api.
Is there a better way to do? Like using the Notifications?
If you want to have the basic media controls on your wear device (controlling then playback of your media app on your phone), then you can use the MediaSessionCompat to handle that for you; take a look at the UniversalMusicPlayer for example; basically if your media app is using the MediaSessionCompat (or MediaSession if you are not concerned with earlier versions of Android), then the basic controls should appear on your watch and if you implement MediSessionComapt.Callback in your media app, framework will send the control commands to your app from your watch.

Is it possible to implement dynamic notifications on Apple Watch without a launchable app?

I've designed a custom notification for an app I'm working on for Apple Watch. The notifications look good but because of the current technical limitations I don't want to build a launchable app or glance until I have mic and speaker access. Is it possible to display dynamic notifications without having an app icon on the home screen of the watch or is the watch app mandatory to have a dynamic notification at all?
No, you will need to add a dynamic Notification scene in your Watch app.
If you want to read more information about this I'd refer you to this page:
https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/CustomzingthePushNotificationInterface.html#//apple_ref/doc/uid/TP40014969-CH6-SW1

Windows Phone 7 push notification when the app is not running

I am trying to implement push notifications in windows phone 7.5
I bind the channelUri in App.xaml when the application starts up.
I can then switch my app to background and receive toast notifications based on the Uri.
But this requires me to first go the app and then make it to background.
Can I receive the toast without the app running? That is when the channelUri is not bound.
Is this a default behaviour in Windows phone 7 or whether I am missing a point here?
If this is the behaviour, how can I send some form of notification/ information to the phone when the app is not running?
I did see this Windows Phone 7.5 - Push Notifications when app is tombstoned.
Update:
I know the Channel is active up to 30 days, is it the same when I use only emulator?
App should be associated with a channel so as to receive notification and even when app is not running, if the notification channel is active, then the application will receive the toast
I think you are missing the point. In order to receive toast notifications you don't have to have the app running in the background. Toasts (and Tile notifications) are meant for when the app is not running at all. So, start the app to get a push-uri and then send that to the service. In theory you won't need one again after 30 days. When it comes to the emulator it will be available as long as the emulator is running. Once you shutdown/close the emulator, the push-uri is gone and you would need to re-request one. (Generally speaking, nothing is saved on the emulator and so closing and opening the emulator is like getting a new device everytime.)
Hopefully this helps

Resources