How to use custom fields with the FMS 2.0? 06/18/2018

Custom fields

The feature allows you to display five custom fields related to your business use case from one of the application.

We provide a library (FamocoCustomFieldsLib.aar) allowing 1 application to add fields (key: value) on FMS for your devices.

Library source: famococustomfieldslib on Stash

Pre-requisite: Famoco Layer version 1.27

How to import Library into an existing project :

* Drop the famocoCustomFieldsLib.aar inside the libs folder of the project app module.
* Edit app’s module’s build.gradle to include and compile the library with the project.


allprojects {

repositories {


flatDir {

dirs ‘libs’




dependencies {

compile(name:’famocoCustomFieldsLib’, ext:’aar’)


* Clean and rebuild.

How to use?

Inside Activity

  1. Initial Setup:


FamocoFieldsEditor mFamocoFieldsEditor;

mFamocoFieldsEditor =


  1. Register Callback :



void onStart() {


mFamocoFieldsEditor.registerForUpdate(this);  // registerForUpdate(Context context)



void onPause() {


mFamocoFieldsEditor.unRegisterUpdate(this); // unRegisterUpdate(Context context)



  1. AddKeyValue and SyncWithFMS


// add key to the sync list

mFamocoFieldsEditor.addKeyValue(key,value);   // addKeyValue(String, String)

mFamocoFieldsEditor.removeKey(key);              // removeKey(String) //

set your own request_id, and ask for a sync when you are done adding all your Key-Value

mFamocoFieldsEditor.syncWithFMS(this,MY_REQUEST_CODE);   // syncWithFMS(Context, Int request_id)

  1. Response via IFMSCallback interface:


public class ActivityTest extends Activity implements IFMSCallback {



public void FMSOpsOk() {




public void FMSOpsFailed() {





Need any help using this feature? Contact our lovely support team by email ( or directly by chat from your FMS account.

Subscribe to our NEWSLETTER !

Do NOT follow this link or you will be banned from the site! et, id, felis venenatis, efficitur. amet, luctus mattis nunc libero Lorem sed