Skip to content

Getting Started

The intent library communicates with the NIMMSTA Android App by using Android intents.

Communication

Requirements

  • NIMMSTA Android App Version 6.0 or above
  • If you use NIMMSTA App 7.0.5 or older: Make sure NIMMSTA App is installed before your app, otherwise the permissions are not set correctly.

Maven Repository

Next add the NIMMSTA Maven Repository to the settings.

repositories {
  /* ... */
  google()
  mavenCentral()
  maven {
    url 'https://maven.goma-cms.org/repository/nimmsta-public-release/'
    metadataSources {
      mavenPom()
      artifact()
    }
  }
}
/* ... */
repositories {
  /* ... */
  google()
  mavenCentral()
  maven {
    url = uri("https://maven.goma-cms.org/repository/nimmsta-public-release/")
    metadataSources {
      mavenPom()
      artifact()
    }
  }
}
/* ... */

Integrate Intent Library

To get started with the NIMMSTA Intent Library, you have to add the library as a dependency to your Android Project and have access to the NIMMSTA Maven Repo.

implementation 'com.nimmsta:intent_library:7.0.+@aar'

Initialize library

To initialize the communication between your app and the NIMMSTA App you have to bind to NIMMSTAIntentConnection.

NIMMSTAIntentConnection.bindServiceToActivity(this).onComplete {
  connection = it.result
  manager = it.result.manager
}
// optional: adapt Package name when using your own package name:
NIMMSTAService.serviceName = ComponentName("com.nimmsta.custom", "com.nimmsta.core.android.intents.NIMMSTAIntentService")
NIMMSTAIntentConnection.Companion.bindServiceToActivity(this).onComplete((task) -> {
  NIMMSTAIntentConnection connection = task.getResult();
  NIMMSTAManager manager = connection.getManager();
  return null;
});

Remember to cancel all connection attempts and to close the connection to the NIMMSTA App. You can do this in the onDestroy method of an activity for example

override fun onDestroy() {
  manager.cancelAllConnect()
  connection.close()
  super.onDestroy()
}
@Override
public void onDestroy() {
  manager.cancelAllConnect();
  connection.close();
  super.onDestroy();
}

To learn more about what you can do with the NimmstaManager or the NimmstaDevice head to the dedicated pages for them.