Code Monkey home page Code Monkey logo

remote-config's Introduction

Android Remote Config Library

Language grade: Java Build Status Total alerts API GitHub code size in bytes

A cool alternative for Google firebase remote-config library! Remote config the variables, appearance and the behavior of your app without publishing an app update. The library is based on Google Volley library.

Android View Animations in Java

Library retrieves the JSON file from https://github.com/gayanvoice/android-remote-config-library/blob/master/remote-config.json. To configure the data in the JSON file, you can fork the library and change the data in the JSON file.

Get

Gradle

  1. Add this to build.gradle of project gradle dependency
allprojects {
	repositories {
		...
 		maven { url 'https://jitpack.io' }
	}
}
  1. Add this to build.gradle of app gradle dependency
dependencies {
	implementation 'com.github.gayanvoice:android-remote-config-library-firebase:1.0.3'
}

Or

Maven

  1. Add this to build.gradle of project gradle dependency
<repositories>
	<repository>
		<id>jitpack.io</id>
	    	<url>https://jitpack.io</url>
	</repository>
</repositories>
  1. Add this to build.gradle of module gradle dependency
<dependency>
	<groupId>com.github.gayanvoice</groupId>
	<artifactId>remote-config</artifactId>
	<version>1.0.3</version>
</dependency>

Usage

Set internet permission

<uses-permission android:name="android.permission.INTERNET" />

Java

Import remote config library

import com.remoteconfig.library.*;

Set request

// set request
RequestQueue queue = FetchRemote.newRequestQueue(MainActivity.this);

// url of the json file
String url ="https://raw.githubusercontent.com/gayanvoice/remote-config/master/remote-config.json";

// request the json file
RemoteConfig remoteConfig = new RemoteConfig(MainActivity.this, url,
	new Response.Listener<String>() {
		@Override
		public void onComplete() {
			// json file retrieved
			
			// declare remote param
			RemoteParams remoteParams = new RemoteParams(MainActivity.this);
			
			// get String value
			String stringValue = remoteParams.getString("short_text", "default_text");
			
			// get int values
			int intValue = remoteParams.getInt("number", 200);
			
			// get JSON Object
			JSONObject jsonObject = remoteParams.getJSONObject("json_object");
			
			// get JSON Array
			JSONArray jsonArray = remoteParams.getJSONArray("json_array");
			
			// get boolean value
			boolean booleanValue = remoteParams.getBoolean("boolean", false);
		}
	},
	new Response.ErrorListener() {
		@Override
		public void onError(RemoteError error) {
			// json file retrieve error
		}
	}
);

// clear cache
remoteConfig.setShouldCache(false);
queue.add(remoteConfig);

Kotlin

Import remote config library

import com.remoteconfig.library.*

Set request

// set request
val queue = FetchRemote.newRequestQueue(this@MainActivity)

// url of the json file
val url = "https://raw.githubusercontent.com/gayanvoice/remote-config/master/remote-config.json"

// request the json file
val remoteConfig = RemoteConfig(this@MainActivity, url,
	Response.Listener<String> {
		// json file retrieved

		// declare remote param
		val remoteParams = RemoteParams(this@MainActivity)

		// get String value
		val stringValue = remoteParams.getString("short_text", "default_text")

		// get int values
		val intValue = remoteParams.getInt("number", 200)

		// get JSON Object
		val jsonObject = remoteParams.getJSONObject("json_object")

		// get JSON Array
		val jsonArray = remoteParams.getJSONArray("json_array")

		// get boolean value
		val booleanValue = remoteParams.getBoolean("boolean", false)
		},
		Response.ErrorListener {
		    // json file retrieve error
	}
)

// clear cache
remoteConfig.setShouldCache(false)
queue.add(remoteConfig)

Develop the library

  1. Select Git from Check out project from Version Control in your Android Studio
  2. Paste the repository url and click Clone button
  3. Click Yes to open the repository
  4. Build using the latest Gradle version

Go to https://github.com/gayanvoice/android-vpn-client-ics-openvpn#develop see the steps

remote-config's People

Contributors

example123 avatar gayanvoice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

remote-config's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.