How to get GUID in android?

2020-05-29 12:34发布

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
4条回答
叛逆
2楼-- · 2020-05-29 13:07

You will get UUID in Android,

UUID uuid = UUID.randomUUID();
String uuidInString = uuid.toString();
查看更多
Lonely孤独者°
3楼-- · 2020-05-29 13:22

Yes you should use UUID like the following code:

String  uniqueID = UUID.randomUUID().toString(); 
查看更多
我欲成王,谁敢阻挡
4楼-- · 2020-05-29 13:22

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

查看更多
乱世女痞
5楼-- · 2020-05-29 13:28

You can use the java.util.UUID class.

查看更多
登录 后发表回答