Android Question PhoneID empty

nibbo

Active Member
Licensed User
Longtime User
Hi All

I am trying to find a way to allow devices to access our system using something unique about the device...
Ideally the cell number, SIM No or IMEI code, basically anything that would be unique to users device.
The reason I need this is to allow temporary access to our apps without having to set up loads of user accounts for authentication.

Unfortunately PhoneID does not appear to work on my test device (and I assume many modern phones), is there any other way get the cell number or any of the method to uniquely identify a device/user?

Thanks
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
Here is a suggestion that might work, although there is one obvious flaw.

You can generate a random value at installation time. Either save the DateTime.Now value (installation time at millisecond resolution) or generate a code (using a string of only six random upper/lower/numerical characters gives trillions of combinations). Either of these will produce a "key" that should uniquely identify the source device.

The obvious flaw is that, if the user uninstalls and re-installs the app, their unique identity will be lost. But maybe you can live with that.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Test:
Dim p As Phone
IdDevice = p.GetSettings("android_id")

Note:
It works on versions 10 and 11, but I have NOT tested it on many brands of mobile phones or tablets.
 
Last edited:
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
Thanks oparra, that seems to return something that looks like it could be unique...
I will test a few devices and see how we get on. šŸ‘
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I did find that thread but as the sentence in the first post says, this tutorial is no longer relevant I iscounted it.
Reading through it further there does not seem to be an obvious reliable way unless I missed something?

It mentions using an advertising ID - not sure if that is relevant to your project or not or creating your own unique ID on the first ever execution.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User

Update:
Additional changes in Android 10 that are not related to the targetSdkVersion value:
 
Upvote 0
Top