Android Question B4A How to convert an object to strings?

MicroDrie

Well-Known Member
Licensed User
Longtime User
I search the forum for two days, bud I can't find the answer how I convert an object to a string format. The result of the following code gives an object:
B4X:
Shared = rp.GetAllSafeDirsExternal("")
    Log(Shared)
This result in the log is: [Ljava.lang.String;@b87a6f1
How can I both string representing the Phone and the SDcard into two different variables?
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
dim folders as list = rp.GetAllSafeDirsExternal("")
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Works like a charm, thanxs
 
Upvote 0

thetahsk

Active Member
Licensed User
Longtime User
The result of a 50 sec. search
B4X:
Dim rp As RuntimePermissions
For Each s As String In rp.GetAllSafeDirsExternal("")
Log(s)
Next
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Yes thetahsk that was also my fist and easy step. The point is that I want to test if there is, and if so, to use or create a sub directory on a SDcard. Therefore I need sure about the correct name in the second string option in the object. Your solution gives the sub directories of the phone memory. Every phone or tablet has a different name for the SDcard.
 
Upvote 0

emexes

Expert
Licensed User
I search the forum for two days, bud I can't find the answer

1/ I'm hoping that "two days" is overstatement for effect :)

2/ Another useful place to get information is within the IDE itself, which tells us that GetAllSafeDirsExternal returns a String Array (which cast reasonably well to Lists, per Manfred's prompt answer):

upload_2019-9-7_1-52-29.png
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Yes there is so much information on this site. I read a lot in those two days. In addition to studying the instructional videos, I have also read many interesting things that are often casually reported in answering questions from forum users. And I probably would never have read it if I had written an object "out-of-the-blue" in one go to a list ;). Thanks to everyone for the help offered :cool:.
 
Upvote 0
Top