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

How to embed an URL in the bluetooth packet?

Hey,

I have a requirement to launch google play store/ installed app in an Android/ IOS mobile upon pairing of the nrf51822 with a mobile.

So can anyone help me out in letting me know:

  1. What are the things do be done in the bluetooth device (nrf51822, configuration/ settings)?
  2. What kind of bluetooth packet needs to be sent to launch play store if my app is not installed?

Basically I want to understand how to embed URL's in a bluetooth packet.

I am working with SDK 6 and S110 7.1.0

Thank you!

Parents
  • If I understand it correctly, you want to create an android/iOS app that launches Google Play/App-store when the phone bonds with your nrf51822-device?

    You can modify the ble_app_uart example to achieve this. Simply have the nrf51822 send a notification to the phone with the link, and have the app open the link. There are several ways you can do this. Sending a long URL in a single packet is not possible, since only 20 bytes can be sent at a time. You can either divide the URL into several packets and send them individually (more discussion about this here: link ).

    Another way could be to shorten the URL you want to send, using for example goo.gl. This way, you only have to send 6 bytes across the BLE link to transmit a URL (the 6 last characters of the goo.gl link)

    The android and iOS source code for the UART app can be downloaded from nordicsemi.com, and should be pretty easy to modify to create what you want.

    1. You can not simply send packets to a phone to make it do things. It would be very dangerous if you could. Instead, you need an app or a service in the operating system that can communicate with your device, and that will open app store for you.
  • Thanks for your quick response! regarding 1. I shall try the method suggested by you and post again. Regarding point 2, I agree with you that it would be dangerous to do these things directly from the bluetooth packet. At the same time I would like to know if you know how to invoke/ request OS to generate a pop up on pairing that can then take me to play store. I checked a couple of BLE devices that are already doing this (with no additional apps installed in the mobile). But I am not sure how this is done. again any idea how this can be done (using some service provided by Android OS)? Thanks again!

Reply
  • Thanks for your quick response! regarding 1. I shall try the method suggested by you and post again. Regarding point 2, I agree with you that it would be dangerous to do these things directly from the bluetooth packet. At the same time I would like to know if you know how to invoke/ request OS to generate a pop up on pairing that can then take me to play store. I checked a couple of BLE devices that are already doing this (with no additional apps installed in the mobile). But I am not sure how this is done. again any idea how this can be done (using some service provided by Android OS)? Thanks again!

Children
No Data
Related