I want to use a Unique identifier for my library as multiple app in the same phone can utilise same unique ID. For example Android Phone A - can have 3 apps in the Phone A with same library integrated with all 3 apps, so all 3 must use the same ID to identify this as 1 device, rather than having 3 different IDs. Additionally, this app can be released from 3 different build machines and the app package names might not be known always.
- I have tried using Advertisment ID but it not achievable in all phones, few phones give access where few fail to retrive it.
- IMEI - requires additional permission and not achievable after android 10 as mostly the results achieved are empty string
- I have tried Android ID which is unique but if you have 2 different build machine for different or same apk it will assign 2 different Android ID rather than 1.
- Tried Shared preferance, Broadcast reciver, Content Provider and File R&W approach to create own unique Identifier but all of them fail to achieve.
- As for Broadcast Reciever both app need to be active at the same time to share information
- For Content Provider can only have 1 Content provider with same name and if the particular app created the content provider is deleted than the content provider is also deleted.
- Shared preference need to provide the package name for other application and read mode is not available. It do not work with the library package name, it requires app package name.
- File R&W - Some phone works and some dont, sometimes after deleting the file, it still shows file exist, some manufacture phone do not allow read from public directories.
Devices tested: Samsung - Android 9, 10 and 11 MI - Android 9, 10 and 11 Huawei- Android 9 and 10