Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class JsonUrlRemoteConfigProvider

  1. Object
  2. JsonUrlRemoteConfigProvider

ImplementsRemoteConfigProvider

A RemoteConfigProvider that reads a flat JSON object from a URL, for self-hosted configuration. Nested objects and arrays become JSON text.

{"welcome_text": "Hello", "new_checkout": true, "max_items": 20}

Constructors

public JsonUrlRemoteConfigProvider(String url)Creates a provider.

Methods

public void setTransport(CloudHttpTransport transport)Replaces the HTTP transport.
public String getId()
public AsyncResource<Map<String, String>> fetch()Fetches the current values.

Inherited methods

Constructor details

JsonUrlRemoteConfigProvider

public JsonUrlRemoteConfigProvider(String url)
Creates a provider.

Parameters

url String
the URL of the JSON document

Method details

setTransport

public void setTransport(CloudHttpTransport transport)
Replaces the HTTP transport.

Parameters

transport CloudHttpTransport
the transport

getId

public String getId()

Returns

a short stable ID that keeps this provider’s cache apart from others

fetch

public AsyncResource<Map<String, String>> fetch()
Fetches the current values.

Returns

a resource that completes with keys to string values