Help getting IMEI number


With this arrangement the text comes out blank

Hy, just to say that moving the call to GetDeviceId to a procedure down the app solves the problem.

But I realize I need the DeviceId at app start in order to compose the SQL Select statement.
The problem seems to be calling GetDeviceId from when the screen initializes.
I tried the following but it still does not work:


IMEILabel still prints the initialized devid value.

unfortunatly you did not understand, how asynchronous methods work…
you do not get the result immediately, therefore the GotDeviceId event exists to get it…
also as it seems to be, your device does not return a device id…

the correct sequence would be (for devices, which return the id)

in the Initialize event
GetDeviceID

in the GotDeviceID event
assign the received id to the label (in your case the device unfortunately does not return it) and run the query

for the not working extension you might want to ask the extension developer for help or search in the extension directory for alternatives

Taifun

1 Like

Dear Taifun, thanks for the feedback.
The Extension works if GetDeviceId is not called from inside Screen initialization.
Please check the code below. It is fully working and returnind the deviceid but as I said I would like to have it in time to compose my SQL request.
The reason I bring this problem here is because there was already a discussion about it.
Do you believe it is a problem with the extension or could it be some other mistake from my side?
The place I put the label is not important as long as it is after the my variable devid is loaded with the value of deviceid captured by the extencion and also that it is only an aid to diagnose the reason for the problem and will be removed as soon as the app works.
See that both the call to GetDeviceId and the label are now located at the procedure procData and it works perfectly.

Thanks

this
Unbenannt
will be your default device id

if you need the device id before running the query, then use a clock component in Screen.Initailize to get the device id a little bit later (try 1000 ms) like this
disable the clock in the designer
in Screen.Initialize event
set timer enabled to true
in the Clock.Timer event
set timer enabled to false and call GetDeviceId

Taifun

All of this seems obsolete since Android 10.

https://developer.android.com/about/versions/10/privacy/changes

1 Like

Dear Taifun, thanks for the guidance.
I tried that but still have the problem.
I simplified the App to only have what matters for this problem.
testDevId.aia (7.4 KB)
If you have the time please take a look on the included .aia
Thanks
Paulo

Dear bodymindpower, thanks for your contribution.
The GetDeviceId extension does not ask any permission when the app starts for the first time.
My test device is Android9.
Will it change when it upgrades to Android10?
Thanks
Paulo

I’m interested to know if anyone has run into problems with this? My app pulled IMEI number for device identification (My company assigns devices to our field techs, but they all use the same google sign in). Hopefully, I don’t need to find another way of identifying the devices.

sorry, I do not have time

If you are asking for help, I recommend you to make it as easy for others to be able to help you …
You probably will get more feedback then…

which means in your case post a screenshot of your relevant blocks…

To download the aia file, upload it to Kodular, open it, do some bug hunting for you, etc… this takes time, and most people will not do that…
Thank you.

Taifun

OK, sorry for sending the .aia, I thought it would be more convenient.
I just did what I would prefer others to do if I had the experience to help once I could run the app and see it working.

But here is the screen shot.


In this layout the label prints the initialized devid value.

Later I tried something a little different ( moved the label to GotDeviceID):


This one works and the label is loaded with my device ID.

It looks a little strange to me but what I am thinking is to put my call to RunQuery where the set label is now and it seems it will solve my problem.

Thanks for your contribution
Paulo

Hi Gary, I was intending to use IMEI but learned the user has to allow the app to read it and the Google Play service may require that one writes terms to inform potential users about privacy, I don’t need these problems and thus decided to use deviceid that has no privacy issues.
Regards

Yes of course… and this is not strange at all… First get the device id, receive it in the GotDeviceId event and run your query
Taifun

1 Like

Oh, I understand. My app is bypassing the Play Store and is only installed on specific devices the company owns, so I’m not as worried about permissions. I’m worried that new tablets we buy with Android 10 won’t let me submit IMEI with the data so I know which specific tablet submitted the data.

2 Likes

This post was flagged by the community and is temporarily hidden.

HEY this is darwin bark team …
TO get device id or imei no …you need to ask for fone status permission when screen initialize …and then you can use collintree imei extension to store it any other extension you want

blocks (7)


blocks (8)

Use This Blocks. You Will Get Deviece Utilities Component On Utilities Section

It’s working with Android 10???

2 Likes

Why don’t you Try Yourself…

1 Like

it was working but when i change my android to 10 it’s stoped work well