Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Access local files

CodingTheories edited this page Mar 21, 2021 · 1 revision

Introduction

There are two local files settings.json and UIDescription.json that are accessible via Gson library. Here we will cover how to read/write data from these two files in the application.

Reading from local files

Sample code on reading data.

UIDescriptionAdaptor buttonsInformation = new UIDescriptionAdaptor();
UIDescriptionObject obj = (UIDescriptionObject) buttonsInformation.getData().getObject();
obj.getImplication().getSymbol().getApplied();

Write into local files

Sample code on writing/saving data

UIDescriptionAdaptor buttonsInformation = new UIDescriptionAdaptor();
UIDescriptionObject obj = (UIDescriptionObject) buttonsInformation.getData().getObject();
obj.getImplication().getSymbol().setApplied(obj.getImplication().getSymbol().getAllSymbols().get(2));
buttonsInformation.update(obj);
Clone this wiki locally