- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Getting started
To easily get started with RIA-DigiDoc-Android v3 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 config-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 libdigidoc-lib, crypto-lib and config-lib modules, example setup libdigidocpp as follows:
   @Singleton
class LibrarySetup
    @Inject
    constructor(
        private val initialization: Initialization,
        private val cryptoInitialization: CryptoInitialization,
        private val configurationLoader: ConfigurationLoader,
        private val dataStore: DataStore,
    ) {
        private val logTag = "LibrarySetup"
        suspend fun setupLibraries(
            context: Context,
            isLoggingEnabled: Boolean,
        ) {
            cryptoInitialization.init(isLoggingEnabled)
            try {
                TSLUtil.setupTSLFiles(context)
                configurationLoader.initConfiguration(
                    context,
                    dataStore.getProxySetting(),
                    dataStore.getManualProxySettings(),
                )
            } catch (ex: Exception) {
                
            }
            try {
                initialization.init(context, isLoggingEnabled)
            } catch (e: Exception) {
                
            }
        }
    }