-1

I want to develop an Android application which act as a beacon and advertise some data and have services and characteristics to read and write some data. Other devices should be able to scan the advertisement data of my phone and can connect to my gatt, discover my services and can read and write to it's characteristics.

I already have some information about BLE scanning advertisement, reading n writing to characteristics but I want to create my own BLE service where other BLE devices can read and write data.

How to create services. How to create characteristics. How to create callbacks from where I can get that some other ble device connected with me and read or written some data.

Im unable to find a solid guide for this requirement, also tell me if it is not possible and what hacks can I use to make it possible.

Bilal Rabbani
  • 1,288
  • 14
  • 24

1 Answers1

0

Google has good documentation for its Android Bluetooth LE APIs here. The goal in the question is very broad. While it is certainly possible to do what is described with Android 5+ devices (version 5 is needed to BLE advertising), doing this requires learning pretty much everything these APIs can do. This will take time.

A few tips:

  1. Start learning the APIs slowly. Don't try to build everything described all at once.

  2. You will need two Android devices to do everything described, one to advertise a service, and the other to consume that service.

  3. Focus on advertising GATT services first and don't worry about beacons. Beacons are just specialized Bluetooth LE advertisement transmitters and are often simpler than devices offering full GATT services.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204