Library documentation: JSON - v1.10 Other JsonTree - Tool to help with JSON parsing (B4A / B4J) - Erel    Apr 24, 2022   (42 reactions)   tags: JsonTree, Online http://www.b4x.com/basic4android/images/SS-2013-12-23_10.11.49.png JsonTree is a tool that helps developers to parse and understand JSON strings. It shows the data structure in a TreeView and... that variables in the generated code are based on the JSON fields. It may produce invalid identifiers... can be downloaded here: www.b4x.com/b4j/files/JsonTree.jar An online version of this tool is available here: http://basic4ppc.com:51042/json/index.html The source code is attached. Updated project... B4A Tutorial Android JSON tutorial - Erel    Feb 7, 2021   (13 reactions)   tags: Json JSON format is a a format similar to XML but usually it is shorter and easier to parse. Many web services now work with JSON. JSON official site: JSON Using the new JSON library, you can parse and generate JSON strings easily. As an example we will parse a the following JSON string: {"menu...()"} ] } }} This example was taken from json.org/examples. Curl brackets represent an object... of objects, and print the values of the "value" element. After parsing the string, JSON... B4J Library [B4X] BalConverter - Convert the layouts files to JSON (and vice versa) - Erel    Jan 17, 2019   (26 reactions)   tags: Eshe, files, convert, bal, layouts BalConverter is a B4J app (desktop app) that converts between the designer layout files and JSON format. This allows you to edit the layout with a text editor. Note that the format is not so simple... are not deleted. It filters the files based on the extension (bal or bal.json). http://www.b4x.com/basic4android/images/SS-2014-06-01_17.03.59.png The JSON format is made of three main elements: http... encoded. This means that it can be modified in the json file. - Layout recreated with the internal... B4J Tutorial [Server] Online Json Tree Example - Erel    Jul 6, 2023   (4 reactions) This example is a port of the following desktop example: http://www.b4x.com/android/forum/threads/jsontree-tool-to-help-with-json-parsing-b4a-b4j.35963/ http://www.b4x.com/basic4android/images/SS-2014-03-20_11.43.42.png You can try it online: https://b4x.com:51041/json/index.html The server parses the JSON string and returns the tree representation and also the B4A / B4J code you need in order to parse it. The code is similar to the desktop solution code. The main difference... B4A Tutorial Convert collections to json and vice versa - Erel    Mar 27, 2022   (30 reactions) The JSON libraries, which are internal libraries, were updated. The new version is 1.20. There is a new JSON type which is used to convert maps or lists to json strings and vice versa, using the new... it as "JSON" and then convert it to a string or a collection. It looks like this: Dim m As Map = CreateMap("asdasd": Array(1, 2, 3, 4)) Dim s As String = m.As(JSON).ToString 'equivalent to: Dim jg As JsonGenerator jg.Initialize(m) Dim s As String = jg.ToPrettyString(4... B4J Question How to know if string is parseable as JSON "list" or "Map" - jmon    Oct 5, 2022 Hi, I would like to be able to determine if a JSON string will be parseable as a LIST or as a MAP before processing it. Am I missing something, or is the only way to know is to test the first character? ""{" = MAP Dim json As JSONParser json.Initialize(StdOut) If json.IsInitialized Then If StdOut.StartsWith(" For Each Program As Map In json.NextArray 'processing as a list of map Next Else Dim Program As Map = json... Games [XUI2D] Example Pack - Erel    Oct 2, 2022   (33 reactions)   tags: example games, XUI2D Games .mapeditor.org/ Most of the examples use a tiled json file to define the objects. In the Mario and Tiles... Editor - File - Import and find the objecttypes.json that is included in the zip file. Please start... B4R Code Snippet JSON Parsing - Erel    Jul 7, 2019   (13 reactions) Two methods to help parse JSON strings: Sub Process_Globals Public Serial1 As Serial Private... GetTextValueFromKey (json() As Byte, Key() As Byte, StartIndex As Int, ResultBuffer() As Byte..., quotearray)) Dim i As Int = bc.IndexOf2(json, qkey, StartIndex) If i = -1 Then bc.ArrayCopy(Array As Byte(), ResultBuffer) Return End If Dim i1 As Int = bc.IndexOf2(json, quotearray, i + qkey.Length + 1) Dim i2 As Int = bc.IndexOf2(json, quotearray, i1 + 1) bc... B4A Question Lost in ChatGPT JSON - JackKirk    Mar 11, 2023 JSON is a weak suit of mine. I have a JSON string: {"id":"chatcmpl-6t2JQdgU1ypn0ayhONAkE6bAEoGkz","object":"chat.completion","created":1678574948,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":25,"completion_tokens":110,"total_tokens":135},"choices":} How do I parse this to extract the message content starting with "Ahoy matey..." and ending with "... B4J Library JSON Formatter and validator - stevel05    Aug 7, 2023   (11 reactions) I am working on an app that needs to be able to manipulate JSON strings. They are stored in a compact format then prettified for display and editing. The main problem I have found is that if the json is invalid, it can't be prettified with the existing JSON lib. I found this project on github... methods to compact the string and validate the JSON. The FormatJSON method should be able to be used with B4a feel free to copy it over. I don't know if the JSON libraries are compatible to... Page: 1   2   3   4   5   6   7   |