Android Question Generate JSON File

Hirogens

Active Member
Licensed User
Longtime User
Hello, someone can help me, I would like to create a JSON file for my server and I don't know how to do that ...
Thanks
 

OliverA

Expert
Licensed User
Longtime User
Upvote 0

Hirogens

Active Member
Licensed User
Longtime User
Upvote 0

Hirogens

Active Member
Licensed User
Longtime User
B4X:
Sub Create_JSON_File
    Dim JSONGenerator As JSONGenerator
     Dim json_str As String
    Dim data As List
    data.Initialize

    json_str = "os_name :Ios"
    data.Add(json_str)
    json_str = "os_version: 6.4.64"
    data.Add(json_str)

    JSONGenerator.Initialize2(data)
    Msgbox(JSONGenerator.ToPrettyString(2), "")
End Sub
I try this only for checking if it work
 
Upvote 0

Hirogens

Active Member
Licensed User
Longtime User
I have this
B4X:
[
  "os_name :Ios",
  "os_version: 6.4.64",
]
and I would like this
B4X:
[
  "os_name" :"Ios",
  "os_version": 6.4.64,
]
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…