Android library for displaying data based on JSON configuration fetched from server

Overview

Optimize

API Android Arsenal
Android library for displaying data based on JSON configuration fetched from server.

With this library, you can kiss goodbye to string.xml, dimen.xml, arrays.xml. Keep all your string/integer/array config in one file. The library will automatically fetch the data from the url you provide.

How it works?

Have you ever had to work on an app, make it production ready and upload it to PlayStore. Then there comes a tiny modification where you need to change the text in a screen or the color of a button in another screen? Or perhaps we need to change the number of times a certain background task should run? Or maybe change the time a certain task is executed? Or maybe your case is similar to mine and we need to keep the error messages and the default app messages the same as displayed in the web. Or in the ios version of the app. So there is a single file that all 3 systems can reuse.
For example, all my app messages are kept in string.xml file. Suppose they were kept in a json file in the backend.
And everytime the app is opened the latest data is downloaded and cached locally in the app.

For example, in the sample app, you will see the url that I have given is
https://s3-ap-southeast-1.amazonaws.com/android-optimize/optimize.json
This is used to fetch my data from the backend asynchrously and cache it in app.
Everytime the app is opened the data is fetched and based on the whether the content is changed or not, the data is cached locally.
Note: The library is implemented using the Work Manager API provided by Google.

How to integrate the library in your app?

Gradle Dependecy

dependencies {
        implementation 'com.an.optimize:optimize:0.1.0'
}

Maven Dependecy

<dependency>
  <groupId>com.an.optimizegroupId>
  <artifactId>optimizeartifactId>
  <version>0.1.0version>
  <type>pomtype>
dependency>

Usage

Step 1: Add the internet permission in the Android Manifest file
">
<uses-permission android:name="android.permission.INTERNET" />

Step 2: Add the following code to your Application class or your Main Activity file
");">
Optimize.getInstance().init(getApplicationContext(), "
    
     "
    );

Step 3: All you have to do now to display a value from the json file is to call the below code
", " "); //The same can be applied for Integers: Optimize.getInstance().getIntegerValue(" ", ); //The same can be applied for Double: Double doubleData = Optimize.getInstance().getDoubleValue(" ", 0.00); //The same can be applied for Boolean: Boolean booleanData = Optimize.getInstance().getBooleanValue("boolean_data", false); //The same can be applied for Number: Number floatData = Optimize.getInstance().getNumberValue("float_data", -1.1); //The same can be applied for a List: List listData = Optimize.getInstance().getList("list_data", Collections.emptyList());">
String stringData = Optimize.getInstance().getStringValue("
         
          "
         , "
         
          "
         );

//The same can be applied for Integers:
Optimize.getInstance().getIntegerValue("
         
          "
         , <Default value in case the backend data does not contain this key>);

//The same can be applied for Double:
Double doubleData = Optimize.getInstance().getDoubleValue("
         
          "
         , 0.00);

//The same can be applied for Boolean:
Boolean booleanData = Optimize.getInstance().getBooleanValue("boolean_data", false);

//The same can be applied for Number:
Number floatData = Optimize.getInstance().getNumberValue("float_data", -1.1);

//The same can be applied for a List:
List<String> listData = Optimize.getInstance().getList("list_data", Collections.emptyList());

And that's it! It's super simple.

You might also like...
A Shopping cart library for Android that allows you add to add items to cart and retrieve at ease using JSONObjects.

Carteasy A Shopping cart library for Android that allows you add to add items to cart and retrieve at ease using JSONObjects. Quick Start Add the foll

Android Material Json Form Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular format.
Android Material Json Form Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular format.

Android Json Wizard Android Json Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular f

Pet project using Clean Architecture + MVVM + Reactive Extensions + Android Architecture Components. The data are fetched from LondonTheatreDirect API. 🎭
Pet project using Clean Architecture + MVVM + Reactive Extensions + Android Architecture Components. The data are fetched from LondonTheatreDirect API. 🎭

Theatre Pet project using Clean Architecture + MVVM + Reactive Extensions + Android Architecture Components. The data is fetched from LondonTheatreDir

A music player UI am designing in Jetpack Compose. The data is being fetched from Deezer's API.
A music player UI am designing in Jetpack Compose. The data is being fetched from Deezer's API.

Jetpack-Compose-MusicPlayer-UI 🎡 - Still under development This is a small project I am doing to interact with and explore Jetpack Compose components

This is a Movie API app in which data is fetched online from the TMDB site using API authentication.

Movie-API This is a Movie API app in which data is fetched online from the TMDB site using API authentication. MVVM model is used for Database Managme

SimpleYelp - A basic clone of the restaurant review app, Yelp. This app has just one screen, but the data is fetched from the Yelp API Discover the most popular and top rated movies playing. Movies data fetched using tomdbapi.com API.
Discover the most popular and top rated movies playing. Movies data fetched using tomdbapi.com API.

Movie-App A simple news app build using MVVM architecture. Discover the most popular and top rated movies playing. Movies data fetched using tomdbapi.

FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout
FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

FixedHeaderTableLayout is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells with scrolling and zooming features. FixedHeaderTableLayout is similar in construction and use as to Android's TableLayout

EplFootball - Android application displaying EPL teams and their players using MVVM, Coroutines, Flow, Live Data, Retrofit, View Binding, Data Binding, Hilt e.t.c
A server which delivers client configuration settings to an end-user over http.

RuneTopic HTTP Server A server which delivers client configuration settings to an end-user over http. Setup Guide You can host a http server with Dock

Dynamic-UI-From-JSON - A Sample Android app to show dynamic UI generation from Json
Dynamic-UI-From-JSON - A Sample Android app to show dynamic UI generation from Json

Dynamic UI from JSON Functionality The app's functionality includes: The app gen

 Images grid JSON | Π‘Π΅Ρ‚ΠΊΠ° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΉ JSON
Images grid JSON | Π‘Π΅Ρ‚ΠΊΠ° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΉ JSON

Images grid JSON | Π‘Π΅Ρ‚ΠΊΠ° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΉ JSON Π—Π°Π΄Π°Ρ‡Π° Π Π°Π·Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅: ΠŸΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π΄ΠΎΠ»ΠΆΠ½ΠΎ ΠΏΠΎΠ»ΡƒΡ‡Π°Ρ‚ΡŒ JSON-список ссылок Π½Π° изобраТСния с сСрвСра ΠΏΠΎ Π°Π΄Ρ€

Simple application showing wallets fetched from fake services

LittleWallet Resume Simple application showing wallets fetched from fake services. User can filter wallets by currency types and click to enter a deta

⌨️ A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configuration
⌨️ A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configuration

⌨️ A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configuration

Clean MVVM with eliminating the usage of context from view models by introducing hilt for DI and sealed classes for displaying Errors in views using shared flows (one time event), and Stateflow for data

Clean ViewModel with Sealed Classes Following are the purposes of this repo Showing how you can remove the need of context in ViewModels. I. By using

Clean MVVM with eliminating the usage of context from view models by introducing hilt for DI and sealed classes for displaying Errors in views using shared flows (one time event), and Stateflow for data

Clean ViewModel with Sealed Classes Following are the purposes of this repo Showing how you can remove the need of context in ViewModels. I. By using

This server uses json files to model items, entities and more.
This server uses json files to model items, entities and more.

Design Server | Simple server to design items, entities or more About this project/server: This server uses json files to model items, entities and mo

The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

Owner
Anitaa Murthy
Android Developer/iOS Developer
Anitaa Murthy
A Java serialization/deserialization library to convert Java Objects into JSON and back

Gson Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to a

Google 21.7k Jan 5, 2023
A modern JSON library for Kotlin and Java.

Moshi Moshi is a modern JSON library for Android and Java. It makes it easy to parse JSON into Java objects: String json = ...; Moshi moshi = new Mos

Square 8.7k Jan 2, 2023
Fast JSON parser for java projects

ig-json-parser Fast JSON parser for java projects. Getting started The easiest way to get started is to look at maven-example. For more comprehensive

Instagram 1.3k Dec 29, 2022
A lightweight Kotlin DSL to render DSL style Json to String.

A lightweight Kotlin DSL to render DSL style Json to String.

null 4 May 5, 2021
xls2json - Read in Excel file (.xls, .xlsx, .xlsm) and output JSON

xls2json Read in Excel file (.xls, .xlsx, .xlsm) and output JSON. Evaluates formulas where possible. Preserve type information from Excel via JSON typ

Tammo Ippen 39 Oct 19, 2022
Modern JSON processor with readable Kotlin syntax.

Kq Modern cross-platform JSON processor with readable Kotlin syntax. cat ~/Desktop/bdb.ndjson | kq '.filter{it.bool("muted")}.sortedBy{it.long("size")

Daniel Demidko 6 Jan 25, 2022
Simple CLI app to convert XML retrieved from a configurable URI to JSON and back

XmlToJsonUtility Simple CLI app written in Kotlin (1.5.31) on Java 11, using Spring Boot. Queries a URI (default) as an XML source. Attempts to valida

Darius Washington 2 Oct 20, 2021
ktlint JSON Lines reporter

ktlint JSON Lines reporter Usage Download the jar and run: ktlint --reporter=jsonlines,artifact=ktlint-jsonlines-reporter.jar Download Either downloa

Anton Musichin 1 Nov 24, 2021
Generate a JSON bookmarks document from a GitHub user

Github to bookmarks This little webapp will generate a JSON bookmarks document from a GitHub user. This is intended to be used with bbt. An instance i

Benoit Lubek 2 Nov 8, 2021
Manager of progress using Lottie JSON, compatible for Java and Kotlin.

Progress Lottie IGB Manager of progress using Lottie JSON, compatible for Java and Kotlin. Int Top In Bottom Important Info: To create a raw folder: R

Isaac G. Banda 21 Sep 16, 2022