Problem with Arduino 101 BLE UUID update

Hi All,
New to the Arduino and trying to make a simple service on my Arduino 101 device, and access it with my android-written app.

When trying to work with the given examples for BLE, and write my own code I get to the same issue.
When I connect with my android from some BLE scanner, all I see is 2 services with UUIDs that I am not able to remove/change to my own. The services are:
00001800-0000-1000-8000-00805f9b34fb(GAP)
00001801-0000-1000-8000-00805f9b34fb(GATT)

I am trying to add my newly created service this way:

#define DEVICE_NAME "ARD101"
BLEPeripheral currentDevice;
BLEService mainBleService("19B10000-E8F2-537E-4F6C-D104768A1214");
void setup() {

currentDevice.setLocalName(DEVICE_NAME);
currentDevice.setAdvertisedServiceUuid(mainBleService.uuid());

currentDevice.addAttribute(mainBleService);

currentDevice.begin();
}

But I don`t see changes after connecting to my Arduino, the same services are keeps appearing.
I have tried numerous examples, and even in the basic ones no change...

UPDATE:

I am however able to see my newly added service when i look through the nRF Master Control APP. Is there any way to get that information to my android application?

Hope to find my answer here,
Thanks!

If you can see it in the nordic app then the code in the other android app is at fault, not the Arduino 101 code.

Are you using Android studio? Look at the example code in bluetooth le gatt sample app.

I have created a custom service and characteristic and I can see them on my phone using that example app as a base.

I have tried several examples with no success.. I use Android Studio and have experience in BLE apps on android using GATT.. And still dont undertsand why its not working.

Can you please provide me a link to this example app?

Thanks.

Follow the first part of the procedure in this link, but don't edit anything - the app as it is should set you up to be able to discover the services iirc.

Posting from a phone now so can't check that 100%

Hopefully you already have android studio setup and can download apps to your phone... It can take a while to work through various things to get to that point!!

If it doesn't work for you I can look at my version of that... but it will be mid next week. I do recall adding my service and characteristic in place of the example hrm service in that that app, but I can't recall if that was essential or not.

After some testing I got it working almost as I wanted.

DaveOR - Thanks for you response, I have reviewed the code in the link and it was example that I did tried before.
Please notice that they use really "upper layer" API for BLE app there(Intent and etc), there is another approach that gives you more "control" from the Android BLE API.

To the matter itself:

I havent found yet the reason for this strange behavior, but today morning I burned it again and it just started working. When I tried to add another characteristic to my service, it didnt do it.

Seems like there is some problem with updating the GATT information of my Arduino.
Never the less I have managed to do what I wanted, again, with no real solution to this strange problem.

I hope someone can look deeper in to this issue and try and address it.

Thanks.

Not sure if this is relevant to Android, but I know the iPhone handles ble connections in such a way that it remembers something about gatt services & characteristics from previous connections and it will not always update correctly on future connections. I forget the exact work-around I used, but it was either to shut off and then turn back on bluetooth or restart the phone. Maybe android does something similar?

I was having issues where my app told me the arduino was still advertising the heartbeat service after I had switched to the led callback example... it was quite frustrating for some time until i figured it out. It could be that your phone forgot whatever info it had stored about the connection overnight, which is why it seemed to work fine in the morning.

Yes many central devices cache ble info. This can cause frustration when debugging code.

I have arduino 101 (curie) , when I try bluetooth sample sketch (batterymonitor) , arduino 101 hangs,I do not see even messages printed to Serial port using serial.println,this is first satement after serial.begin statement

I have tried on MAC OS X (arduino IDE 1.6.8) ,windows 8(64 bit,arduino IDE 1.6.7) same result (hang)

Well,
DaveOR, chartle02 - I know the issue well, from the Android side Ive had my share of debugging and wripping hear off for not finding the problem untill Ive restarted my bluetooth and discovered this cache "feature". Any way, I have tried restarting my phone again, and tried diffrent phones. But no luck. I will give it another shot today because I need to change my ble implementation on my Arduino.

akmishra_99 - Are the other things working ok(e.g. led example)? have you connected something to your arduino?
Anyway please open another thread because this one is not related.

I`ll keep updating,
Thanks.