This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Receiving notifications from Android Phone

Hi all,

I like build a smartwatch-like device that can receive notifications from my android phone. The bluetooth device has a oled screen and displays what notification is received. If there is an incoming sms, the screen shows "SMS", if there is a incoming call, the screen shows "CALL".

I do not know where to start. Can someone provide me with some pointers, links, etc on where to get started and which nrf examples should I look at. I have a NRF 52DK.

Thanks in advance.

  • I guess you want to establish connection between your device and phone, probably with pairing and bonding (to provide at least "some" security). It can be continuous but you will need to find out optimal parameters to achieve reasonable power consumption. Your wearable will then probably be GAP Peripheral + GATT Server while phones will be GAP Central + GATT Client (could be different combinations but this is most widely supported and kind of standard so I assume you don't want to experiment with other schemes on your first project).

    There is BLE Template project which uses as many nRF5 SDK libraries as possible to make your development easier. However life is not ideal so if you want to make your device compatible with thousands of Android devices and other even more obscure things you will need to go deeper under the hood to debug potential problems. When it comes to top level "application" protocol you will probably like Nordic UART Service (NUS) which provides simple and fast transport of serial data over BLE GATT link, there are examples for Central + Client as well as Peripheral + Server roles (you want the latter) and there are Android and iOS app examples by Nordic so you can incorporate that into your mobile apps.

    So then by combining BLE Template + Nordic NUS Peripheral + Server examples on nRF52 DK (PCA10040) and using their stock mobile apps which have Nordic UART Service protocol inside you can arrive to prototype very easily. Then fun starts with months and months of improving, refactoring, debugging with misbehaving phones etc.;)

  • Hi Kian,

    You can implement what Endnode already suggested. Basically you need an app on the phone to detect when the phone is ringing and send the information about the call to the device.

    We have an example that do pretty much what you wanted to do, the Alert Notification Application, please have a look here.

    Another option is to create a ANCS server on Android phone. This way you can use your application on both Android and iOS.

  • Hi Hung Bui,

    Thank you for the reply. I have looked a the Alert Notification Application example and was able to test it out successfully with NRF Connect on my mobile phone.

    I need to write a custom Android application now. What confuses me now is whether the phone is a GAP peripheral + GATT Server or a GAP Central + GATT Client? I know that the alert notification notification is a peripheral. So what should be implemented on the phone?

  • There could be both GATT server and GATT client on the phone. But in your application it will be GAP central + GATT Server. It's mentioned at step 3 in the Testing section.

Related