I need a Unique ID or Number all time, If device formate or flash.
Asked
Active
Viewed 417 times
1
-
1Does this answer your question? [Is there an equivalent to iOS' identifierForVendor for android?](https://stackoverflow.com/questions/14657977/is-there-an-equivalent-to-ios-identifierforvendor-for-android) – sleepystar96 Feb 23 '23 at 07:17
-
1Nothing can help you.! after factory reset. – J.K Feb 23 '23 at 09:11
-
@J.K Is there any possibility to get unique values of device ID or IMEI or any ... after flash OR factory reset ? – Gprakash Feb 23 '23 at 10:16
2 Answers
0
For Android development, you can use a universally unique identifier (UUID) to generate a unique ID that can persist even if the device is formatted or flashed.
import java.util.UUID;
UUID uuid = UUID.randomUUID();
String uniqueId = uuid.toString();

Masum
- 1,037
- 15
- 32
-
I don't think this answers the question. OP wants an identifier that survives factory reset of a device. – sleepystar96 Feb 23 '23 at 07:16
-
If device factory reset UUID change every time. My requirement is no need to change even factory reset or flash device. – Gprakash Feb 23 '23 at 07:25
-
Then You may use IMEI. However, I should clarify that the permanent identification that you are looking for is not currently available on Android devices. – Masum Feb 23 '23 at 17:21
0
Try using Mac address of the device

Ramakrishnan
- 9
- 2
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 01 '23 at 12:07