- Jun 6, 2020
- 11,517
- 4,383
This is an old tutorial. It will not work on new versions of Android. You should either generate a random value when the app starts for the first time or use the advertising id:
This tutorial is based on the following blog post:
The standard way to get a unique id is using PhoneId.GetDeviceId. However this method has several disadvantages:
- It requires the "android.permission.READ_PHONE_STATE" permission which is quite a sensitive permission.
- It doesn't work on devices without phone functionality.
- Apparently there is a bug in some devices which return the same id.
Starting from Android 2.3 there is a new field that returns a unique id and should work on all devices (without requiring any permission).
A general solution is to use this...
برای دیدن لینک ها باید ثبت نام کنید
This tutorial is based on the following blog post:
برای دیدن لینک ها باید ثبت نام کنید
The standard way to get a unique id is using PhoneId.GetDeviceId. However this method has several disadvantages:
- It requires the "android.permission.READ_PHONE_STATE" permission which is quite a sensitive permission.
- It doesn't work on devices without phone functionality.
- Apparently there is a bug in some devices which return the same id.
Starting from Android 2.3 there is a new field that returns a unique id and should work on all devices (without requiring any permission).
A general solution is to use this...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید