Android Question Android IMEI - Device ID

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Hi,
using

Code:
Dim pi AsPhoneId
ed.Text = pi.GetDeviceId

on Acer device I get the IMEI number, and this is perfect.
But on Samsung device I get a series of number that I don't know what they mean.

How can I get the Samsung device, S/N (or IMEI information)?
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
I didn't say that it is not unique.
I cannot find the same S/N number that I find in the settings of the tablet.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi Simone,

I did try the code on a Samsung 10" tablet (GT-P5100 model) and the value returned is exactly the IMEI code as reported on the back of the device.
On the same sticker there's a serial number (R31C..).

Note: the IMEI value returned doesn't contain the slashes printed on that same sticker.

Umberto
 
Upvote 0

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User

Hi Umberto,
I tried on my Samung Galaxy Tab 2 7.0 and the value returned isnt' the same as reported on the back of the device.
Can you please post your code?
 
Upvote 0

udg

Expert
Licensed User
Longtime User
I simply copied the code you posted in message #1 in the Activity.Create of a new project.
Here it it is the whole stuff:

B4X:
#Region  Project Attributes
   #ApplicationLabel: B4A Example
   #VersionCode: 1
   #VersionName:
   'SupportedOrientations possible values: unspecified, landscape or portrait.
   #SupportedOrientations: unspecified
   #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
   #FullScreen: False
   #IncludeTitle: True
#End Region

Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   'Activity.LoadLayout("Layout1")
Dim pi As PhoneId
Log(pi.GetDeviceId)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

May i suggest to check values showed in option "Device Info"-"Status" (italian: "Info sul dispositivo- Stato") of the Android "Settings" (it: Impostazioni)?
There you can read an IMEI value and maybe discover that the sticker is wrong..!

Umberto
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…