D Derek Jee Active Member Licensed User Longtime User Oct 23, 2014 #1 Hello Can the android_id be found when navigating the device though the settings menu on the device.. I want to get the device id and be able to see the same id on the device somewhere. I got the id in code but cannot correlate it to any ids I see.. I have a Galaxy Tab S.. Thanks, (The idea is to use a unique id for each device in a database to authenticate a user logging in) Derek.
Hello Can the android_id be found when navigating the device though the settings menu on the device.. I want to get the device id and be able to see the same id on the device somewhere. I got the id in code but cannot correlate it to any ids I see.. I have a Galaxy Tab S.. Thanks, (The idea is to use a unique id for each device in a database to authenticate a user logging in) Derek.
D Derek Jee Active Member Licensed User Longtime User Oct 23, 2014 #2 or is there a different ID I can use which I can get through code AND see on the device somewhere? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2014 #3 The problem with these ids is that different devices behave differently. I recommend you to create a random number and store it on the device. You can show the id inside your app. Upvote 0
The problem with these ids is that different devices behave differently. I recommend you to create a random number and store it on the device. You can show the id inside your app.
D Derek Jee Active Member Licensed User Longtime User Oct 23, 2014 #4 It is a problem it seems. Yes I can get an id and show it from the app but would have loved to be able to identify the device without having an app installed first. My client wants to distribute these devices to users. When you suggest store an id are you saying in a text file or db somewhere or is there an area I can store an id in the android architecture? I guess I could use the device name except that can be changed too easily by the user.. I suppose on install I can generate a unique id in my db, show it to the installer user and then they can register the device in the main database.. Just thinking aloud.. Thanks Erel.. Derek. Upvote 0
It is a problem it seems. Yes I can get an id and show it from the app but would have loved to be able to identify the device without having an app installed first. My client wants to distribute these devices to users. When you suggest store an id are you saying in a text file or db somewhere or is there an area I can store an id in the android architecture? I guess I could use the device name except that can be changed too easily by the user.. I suppose on install I can generate a unique id in my db, show it to the installer user and then they can register the device in the main database.. Just thinking aloud.. Thanks Erel.. Derek.
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2014 #5 I meant that on the first run you can create a text file with the random id: Code: Copy Sub GetId As Int If File.Exists(File.DirInternal, "id.txt") Then Return File.ReadString(File.DirInternal, "id.txt") Else Dim id As Int = Rnd(1, 2147483647) File.WriteString(File.DirInternal, "id.txt") Return id End If End Sub Upvote 0
I meant that on the first run you can create a text file with the random id: Code: Copy Sub GetId As Int If File.Exists(File.DirInternal, "id.txt") Then Return File.ReadString(File.DirInternal, "id.txt") Else Dim id As Int = Rnd(1, 2147483647) File.WriteString(File.DirInternal, "id.txt") Return id End If End Sub
D Derek Jee Active Member Licensed User Longtime User Oct 23, 2014 #6 Thanks Erel.. I just tweaked that idea and wanted to store on my local db.. I like both ideas.. Derek.. Upvote 0
Thanks Erel.. I just tweaked that idea and wanted to store on my local db.. I like both ideas.. Derek..
pjetson Member Licensed User Longtime User Oct 24, 2014 #7 If your devices have phone capabilities, you can get the IMEI using this code: Code: Copy Dim pid As PhoneId Dim x As String x = pid.GetDeviceId The IMEI should be unique. Upvote 0
If your devices have phone capabilities, you can get the IMEI using this code: Code: Copy Dim pid As PhoneId Dim x As String x = pid.GetDeviceId The IMEI should be unique.
DonManfred Expert Licensed User Longtime User Oct 24, 2014 #8 Derek Jee said: My client wants to distribute these devices to users. Click to expand... Then your customer has the phone and can write down the IMEI from them and store in DB before distributing to users... I´m doing the same in my Databasebridge (php-script which do the databasequery and result back json to the app) using the IMEI to identify a device. imei is linked to useraccount to the script knows which user is accessing the db through this php-script. pjetson said: The IMEI should be unique. Click to expand... IMEI is a good way and it´s unique as far as i know. Please remember that a user may have more than one Device he want to use the app on... You database should be designed to store multiple IMEIs for one customer. Last edited: Oct 24, 2014 Upvote 0
Derek Jee said: My client wants to distribute these devices to users. Click to expand... Then your customer has the phone and can write down the IMEI from them and store in DB before distributing to users... I´m doing the same in my Databasebridge (php-script which do the databasequery and result back json to the app) using the IMEI to identify a device. imei is linked to useraccount to the script knows which user is accessing the db through this php-script. pjetson said: The IMEI should be unique. Click to expand... IMEI is a good way and it´s unique as far as i know. Please remember that a user may have more than one Device he want to use the app on... You database should be designed to store multiple IMEIs for one customer.
Cableguy Expert Licensed User Longtime User Oct 24, 2014 #9 DonManfred said: Then your customer has the phone and can write down the IMEI from them and store in DB before distributing to users... I´m doing the same in my Databasebridge (php-script which do the databasequery and result back json to the app) using the IMEI to identify a device. imei is linked to useraccount to the script knows which user is accessing the db through this php-script. IMEI is a good way and it´s unique as far as i know. Please remember that a user may have more than one Device he want to use the app on... You database should be designed to store multiple IMEIs for one customer. Click to expand... It is a known issue on some custom ROMs to have the IMEI changed to some bizarre number or just disappear... And there are ways, on rooted phones, to change the Imei value this is NOT hardware dependant, as the device serial number is... My best guess would be to get the MAC address of one of the adaptors, as these are in fact unique and impossible to change. Upvote 0
DonManfred said: Then your customer has the phone and can write down the IMEI from them and store in DB before distributing to users... I´m doing the same in my Databasebridge (php-script which do the databasequery and result back json to the app) using the IMEI to identify a device. imei is linked to useraccount to the script knows which user is accessing the db through this php-script. IMEI is a good way and it´s unique as far as i know. Please remember that a user may have more than one Device he want to use the app on... You database should be designed to store multiple IMEIs for one customer. Click to expand... It is a known issue on some custom ROMs to have the IMEI changed to some bizarre number or just disappear... And there are ways, on rooted phones, to change the Imei value this is NOT hardware dependant, as the device serial number is... My best guess would be to get the MAC address of one of the adaptors, as these are in fact unique and impossible to change.
DonManfred Expert Licensed User Longtime User Oct 24, 2014 #10 Cableguy said: It is a known issue on some custom ROMs to have the IMEI changed to some bizarre number or just disappear Click to expand... All devices in our company do show the correct IMEI so it is ok for me in our case. ALL apps i write are for companyintern use and are NOT published on Google Play. But thanx for your answer. Upvote 0
Cableguy said: It is a known issue on some custom ROMs to have the IMEI changed to some bizarre number or just disappear Click to expand... All devices in our company do show the correct IMEI so it is ok for me in our case. ALL apps i write are for companyintern use and are NOT published on Google Play. But thanx for your answer.
pjetson Member Licensed User Longtime User Oct 26, 2014 #11 Cableguy said: My best guess would be to get the MAC address of one of the adaptors, as these are in fact unique and impossible to change. Click to expand... MAC addresses are non-unique on many cheaper devices because the manufacturers don't want to pay for a set of numbers. In fact, I've seen several devices where the whole product run had the same MAC address, and other devices where the MAC address was all zeros. The MAC address can be easily changed on many ethernet devices. Upvote 0
Cableguy said: My best guess would be to get the MAC address of one of the adaptors, as these are in fact unique and impossible to change. Click to expand... MAC addresses are non-unique on many cheaper devices because the manufacturers don't want to pay for a set of numbers. In fact, I've seen several devices where the whole product run had the same MAC address, and other devices where the MAC address was all zeros. The MAC address can be easily changed on many ethernet devices.
Informatix Expert Licensed User Longtime User Oct 26, 2014 #12 pjetson said: MAC addresses are non-unique on many cheaper devices because the manufacturers don't want to pay for a set of numbers. In fact, I've seen several devices where the whole product run had the same MAC address, and other devices where the MAC address was all zeros. The MAC address can be easily changed on many ethernet devices. Click to expand... I tried to use the MAC address in the past, but I quickly realized that on some (all?) devices the value was incorrect when the Wifi was not turned on. A useful link on the subject: http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id Last edited: Oct 26, 2014 Upvote 0
pjetson said: MAC addresses are non-unique on many cheaper devices because the manufacturers don't want to pay for a set of numbers. In fact, I've seen several devices where the whole product run had the same MAC address, and other devices where the MAC address was all zeros. The MAC address can be easily changed on many ethernet devices. Click to expand... I tried to use the MAC address in the past, but I quickly realized that on some (all?) devices the value was incorrect when the Wifi was not turned on. A useful link on the subject: http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id
wonder Expert Licensed User Longtime User Oct 26, 2014 #13 I was reading this thread and I came up with the following logic: How do you identify one person? You have two basic options. Either you test their DNA for a match or you rely on a set of characteristics that will give you a high level of confidence on identifying this person. Characteristics like, full name, address, date of birth, occupation and visual appearance. Of course the only way to know for sure that your friend is not a reptilian alien with all the right answers is to have his DNA tested. How do you identify a device? Androids have no DNA, however we could implement the same kind of logic. Ask the device a few questions and given a high confidence level, proceed to give authorization. Since it's a slow Sunday, I came up with two diagrams. Please forgive my paint skilzzz... Upvote 0
I was reading this thread and I came up with the following logic: How do you identify one person? You have two basic options. Either you test their DNA for a match or you rely on a set of characteristics that will give you a high level of confidence on identifying this person. Characteristics like, full name, address, date of birth, occupation and visual appearance. Of course the only way to know for sure that your friend is not a reptilian alien with all the right answers is to have his DNA tested. How do you identify a device? Androids have no DNA, however we could implement the same kind of logic. Ask the device a few questions and given a high confidence level, proceed to give authorization. Since it's a slow Sunday, I came up with two diagrams. Please forgive my paint skilzzz...
Cableguy Expert Licensed User Longtime User Nov 7, 2014 #14 pjetson said: MAC addresses are non-unique on many cheaper devices because the manufacturers don't want to pay for a set of numbers. In fact, I've seen several devices where the whole product run had the same MAC address, and other devices where the MAC address was all zeros. The MAC address can be easily changed on many ethernet devices. Click to expand... The fact that some devices share the same Mac address may be due to the fact that they "share" the same chip. MAC changing technics are not at reach for the common user I think. Informatix said: I tried to use the MAC address in the past, but I quickly realized that on some (all?) devices the value was incorrect when the Wifi was not turned on. Click to expand... I guess some devices will power off some hardware as battery saving thecnic, an unpowered chip cannot provide info. Upvote 0
pjetson said: MAC addresses are non-unique on many cheaper devices because the manufacturers don't want to pay for a set of numbers. In fact, I've seen several devices where the whole product run had the same MAC address, and other devices where the MAC address was all zeros. The MAC address can be easily changed on many ethernet devices. Click to expand... The fact that some devices share the same Mac address may be due to the fact that they "share" the same chip. MAC changing technics are not at reach for the common user I think. Informatix said: I tried to use the MAC address in the past, but I quickly realized that on some (all?) devices the value was incorrect when the Wifi was not turned on. Click to expand... I guess some devices will power off some hardware as battery saving thecnic, an unpowered chip cannot provide info.