sabato 16 gennaio 2016

Implementing bluetooh LE on android

Intro

Recently I found myself working on this really simple application while testing bluetooth le implementation on android for a particular and obscure device. Only after I've already started to work on the application I've found out that the device I was trying to communicate with was actually using bluetooth 2.0, because of this you will find the code to actually handle both LE and 2.0 bluetooth technology.
Of course all the information you need is available on android developers webpage, but you can find here an already working example (even tough it's incomplete, I only had few hours to work on this).

Code

Here the code of the main activity, useful info can be found in the comments.