Forum >[Android] retaining BLE connection
Bluno General Arduino

[Android] retaining BLE connection

userHead pokemon10034 2016-09-29 11:57:54 1809 Views0 Replies
Hi everyone , I am new to arudino and android programming.

I used the bluno demo apk source code to build my first android app to control some servos and leds.
The first thing i did is to establish the connection between my phone and bluno using the 'scan' button.
The blue led lights up
I have no problem moving the servo and switching on the led on the MainActivity.class

The problem comes in when i created a 2nd Activity.
When I tried to access the 2nd Activity from the MainActivity , the bluetooth connection broke off(blue led light turn off). It works again if I add in the scan button to establish the connection , there's gonna be a better way around it rather than connecting it again and again for every activity

I did some google and the solution seems to be implementing services/fragment so as to maintain the bluetooth connection.

Anyone have any experience in this and care to shed some light?