Android Question B4A How to convert an object to strings?

MicroDrie

Active Member
Licensed 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?
 

thetahsk

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

MicroDrie

Active Member
Licensed 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.
 

emexes

Well-Known Member
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
 

MicroDrie

Active Member
Licensed 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:.
 
Top