[FREE] UUID - generate /retrieve a unique id of your device

VERSION 4

why this extension

Since we are not able to get DeviceId, get Imei, get Meid, get SimSerialNumber, get SubscriberId and get Serial from Android 10 and higher devices,
the most practical way is to generate a random string and save it on sdcard, and retrieve the string back from the file when needed.

This is what this extension is doing.

This can be done by build-in components, but I think this extension will save time for you.

blocks

2021-09-19_224033

known issue

  1. if the file is deleted from sdcard and the app was re-installed (same time), the uuid will change.
  2. not working in Screen.Initialized event, use a clock in stead
  3. not working on Redmi k20 pro (android 10)

download link:

v4: https://community.kodular.io/uploads/short-url/jl5iI5JibX4BAoGX7L6ZfYSdqil.aix

donate

if you think this extension is useful to you, you may donate to here

13 Likes

Nice extension @Kevinkun very useful,
:upside_down_face: :heart:

Hi,

It’s a good idea.
I have a little doubt. It stores the file in sd card. What if user don’t have sd card in his/her device? Will it store it in device internal storage?

3 Likes

I think so

good question

by sdcard, i mean external storage. nowadays, there are seldom phones with no external storage, right?

infact, this extension store uuid in internal and external both.

Anyway, it’s better to check this before storing.

For Android 10 +, where will the file be stored?
image

/storage/emulated/0 or ASD ?

and will this work when targeting API 30

2 Likes

It will be stored in /sdcard/emulated/0/. That is why WRITE_EXTERNAL_STORAGE permission needed.

It’s working on my phone Android 11.

Welcome for any feedback.

OK, I will test it out :slight_smile:

on new version, not work:) http://ai2-test.appinventor.mit.edu/

1 Like

A lot of famous app using this method. Connect your phone with computer by Usb, on sdcard you will find some small - sized hidden file which name start with a dot, and inside which there is a ramdom string.

How? Did it asked permission? Did you grant permission? In companion? Or apk? Android version?

If your app targets API 30 then you can’t write in external storage/phone storage.

Thanks, I was about to come back with that one :smiley:

you may read-write only Download folder

Tested by compiling on AI2 test server. No uuid file created, cannot ask for Write permission / not granted. Extension needs to save to ASD for Android 11 / target API 30.

Yes you can.
But it would be beneficial to save data in ASD instead.

Thanks @TimAi2 ,
so it’s working on my phone (android11) only for now, is because Kodular is still target api 29?

but if save data in ASD, it will be deleted after app uninstall. The best way is to save to public download folder

That’s right.

Sure.

After reinstall not access to old files!

Thanks and noted that not working on ai2-test server.