The JSON Storage Demo is a powerful and cross-platform application that allows you to save your in-memory Delphi dataset as a JSON formatted file. With this demo, you can quickly and easily learn how to store your data in the most popular format for web and mobile applications. The demo is built using a single codebase and single UI for Android, iOS, macOS, Windows, and Linux platforms, making it easy to use and portable. Additionally, the demo is professional and easy to follow, providing clear instructions on how to correctly store your data in JSON format.
Download the full cross-platform JSON Storage source code on Github.
This demo is part of over 100 cross-platform demos with everything from camera demos to emoji demos and painting demos.
Índice
What is JSON?
JSON, or JavaScript Object Notation, is a text-based format for representing data. JSON is often used in software development as a way to store and exchange data. The JSON format is based on a subset of the JavaScript programming language, and it supports data structures such as objects, arrays, and strings. JSON is a popular format for storing data because it is easy to read and write. JSON can be used with many programming languages, making it a versatile format for exchanging data. When JSON is used in software development, it can help to create more efficient and reliable applications. JSON is an important tool for software developers, and it is likely to continue to be used in the future.
Screenshot
What does the JSON storage demo source code look like?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Aulas, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, System.Rtti, FMX.Rede.Style, Data.Bind.Controls, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, Data.Bind.EngExt, Fmx.Bind.DBEngExt, Fmx.Bind.Rede, System.Bindings.Outputs, Fmx.Bind.Editors, FMX.StdCtrls, FireDAC.Stan.StorageJSON, Data.Bind.Componentes, Data.Bind.Rede, Data.Bind.DBScope, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, FMX.Layouts, Fmx.Bind.Navigator, FMX.ScrollBox, FMX.Rede, FMX.Effects, FMX.Controls.Presentation, System.IOUtils; type TForm1 = classe(TForm) MaterialOxfordBlueSB: TStyleBook; ToolBar1: TToolBar; ShadowEffect4: TShadowEffect; Label1: TLabel; StringGrid1: TStringGrid; BindNavigator1: TBindNavigator; <strong> FDMemTable1: TFDMemTable; BindSourceDB1: TBindSourceDB; BindingsList1: TBindingsList; LinkGridToDataSourceBindSourceDB1: TLinkGridToDataSource; FDStanStorageJSONLink1: TFDStanStorageJSONLink;</strong> Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm1.Button1Click(Sender: TObject); começar <strong>FDMemTable1.SaveToFile(TPath.Combine(TPath.GetDocumentsPath,'file.json'),TFDStorageFormat.sfJSON);</strong> end; end. |
What does the data bindings look like?
Ready to learn how to program cross-platform apps like this?
Sign up for the Coding Boot Camp 2022 to learn to program. Topics include: Games, JavaScript, Web, Python, SQL, Databases, iOS, MacOS, Android, Mobile, Linux, Windows, Desktop, Server, and Arduino.