Android Question How to code on android like IOS pp.KeyChainPut

cambol

Active Member
Licensed User
How to code on android like IOS

B4X:
pp.KeyChainPut("uid",ac.GetDeviceUID)

pp.KeyChainGet("uid")
 

walterf25

Expert
Licensed User
Longtime User
How to code on android like IOS

B4X:
pp.KeyChainPut("uid",ac.GetDeviceUID)

pp.KeyChainGet("uid")
Use a Map object.

B4X:
Dim pp as Map
pp.Initiallize
pp.Put("uid", ac.GetDeviceUID)

dim uid as String = pp.Get("uid")

Walter
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
There is no identical feature in Android. Do you need it to store data that is not deleted when the app is uninstalled?
Did I misunderstand the question?
 
Upvote 0

cambol

Active Member
Licensed User
after restart app .
pp.Get("uid") get NULL

I need it to store data that is not deleted when the app is uninstalled .
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You can store the data in a file on dirrootexternal and when your app starts you check the existence of this file and load it.
 
Upvote 0

cambol

Active Member
Licensed User
Dear DonManFred :
I know this way store for file , But I want a permanent key for this app like IOS pp.KeyChainPut("uid",ac.GetDeviceUID)
 
Upvote 0

cambol

Active Member
Licensed User
Erel :

Is there any way to get or set a key for app and not be deleted after uninstall in SDKtargetVersion 29 ?

ps File.DirRootExternal is not avaiiable for targetVersion 29 .
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
ps File.DirRootExternal is not avaiiable for targetVersion 29 .
not true.
If the device HAS an external sdcard then you need to use usbstorage class.
DirRootExternal points to the secondary storage which is an internal SDKCard. You can access it using runtimepermission.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are changes in targetSdkVersion 29 however you will be able to opt out of these changes with the requestLegacyExternalStorage property, at least in the next year or so.
You will also be able to access it with ExternalStorage though it will be more cumbersome.
There isn't any other local place that you can store data that will not be deleted.
 
Upvote 0
Top