How to create UUID from string in android

android, bluetooth-lowenergy, uuid

Solution

Using the class UUID

An example like this:

 UUID.randomUUID().toString()

Problem

In my app, I scan low energy Bluetooth for specific service uuid `2415`. To convert the string 2415 into uuid I am using `UUID serviceUUID = UUID.fromString("2415");` but at this line exception arises IllegalArgumentException: Invalid UUID 2415. Please help me in this respect I would b very thankful to in this regard. Thanks in advance.

Original source