Android Question Problems with shared preferences

corvo

Member
Licensed User
Longtime User
Hi, i'm trying to access to shared preferences, but i don't find any good example, plz someone can share something?

Thank u
 

corvo

Member
Licensed User
Longtime User
Thank u Erel, but i need to read a value of a software, how i can get this value? ( i know the name of this value) There is a get string?
 
Upvote 0

corvo

Member
Licensed User
Longtime User
Yes Erel, i want to read a value of another app, i olked whit the programmer and he told to me to serach a value of a sharedpreference
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The preferences are stored by default under:
/data/data/YOUR_PACKAGE_NAME/shared_prefs/YOUR_PACKAGE_NAME_preferences.xml

Try to read the other app file with File.ReadString. If it works then you will be able to extract the value with an XML parser.

However by default your app will not have access permission to this file.
 
Upvote 0

corvo

Member
Licensed User
Longtime User
Thank u Erel, i tryed it whit this code


Dim
gugu AsString

gugu=
"/data/data/com.app name/shared_prefs/"

File.Copy(gugu,"com.app name_preferences.xml",File.DirDefaultExternal,"com.app name_preferences.xml")

but i got an error "Access Denied" maybe i can do this
 
Upvote 0
Top