How to get GUID in android?

Android

Android Problem Overview


we are developing the application using the .Net webservice(soap protocal) for that i need Pass GUID from android class.

in .Net we have statement like below Guid myGuid1 = new Guid();

i need the similar functionality in Android , is there any way to make this kind of functionality in android code?

Regards, Jeyavel N

Android Solutions


Solution 1 - Android

Yes you should use UUID like the following code:

String  uniqueID = UUID.randomUUID().toString(); 

Solution 2 - Android

You can use the java.util.UUID class.

Solution 3 - Android

We can use

String uniqueID = UUID.randomUUID().toString();

An Instance ID or a GUID is scoped to the app that creates it, which prevents it from being used to track users across apps.For more information and significance please refer this link here

Solution 4 - Android

You will get UUID in Android,

UUID uuid = UUID.randomUUID();
String uuidInString = uuid.toString();

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJeyavelView Question on Stackoverflow
Solution 1 - AndroidBehnam BagheriView Answer on Stackoverflow
Solution 2 - AndroidCommonsWareView Answer on Stackoverflow
Solution 3 - AndroidVinod PattanshettiView Answer on Stackoverflow
Solution 4 - AndroidParth PandyaView Answer on Stackoverflow