-
Notifications
You must be signed in to change notification settings - Fork 18
Getting started
Marten Rebane edited this page Jun 4, 2021
·
1 revision
To easily get started with MOPP-Android project, check out Building source code with Android Studio
Modules can also be imported manually.
You can find the source code under releases. Just download "Source code (zip or tar.gz)", unpack it and you're ready to go!
- Download latest version of the source code if you haven't done so yet, and unpack it.
- In Android Studio, choose File -> New -> Import Module...
- Choose the directory where the unpacked source code is
- Import modules as needed
- After importing, build project
Default configuration fetching and packaging is described in configuration-lib
You're almost done. In order for library to work with containers, it needs to prepare a few things first. For that you need to call setup method. We recommend you to do this at earliest opportunity. Setup will take some time, so you need to make sure it finishes first before starting any container actions.
If you have imported SignLib and configuration-lib modules, example setup libdigidocpp as follows:
public class ConfigurationProviderReceiver extends ResultReceiver {
private static ConfigurationProvider configurationProvider;
private static String tsaUrl = "http://dd-at.ria.ee/tsa";
ConfigurationProviderReceiver(Handler handler) {
super(handler);
}
@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
configurationProvider = resultData.getParcelable(ConfigurationConstants.CONFIGURATION_PROVIDER);
if (resultCode == ConfigurationManagerService.NEW_CONFIGURATION_LOADED) {
SignLib.init(this, tsaUrl, configurationProvider, "MyUserAgent");
}
}
}