How to use DFM

DFM (Dynamic Function Module) is a modular functionality extension system that enables AnamWallet to flexibly support various blockchain networks. Through DFM, users can easily add new blockchain networks as needed. Below is a brief guide on how to use DFM.

AndroidManifest.xml

To develop a module using DFM, you need to write the AndroidManifest.xml as follows.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dist="http://schemas.android.com/apk/distribution">
    <dist:module
        dist:instant="false"
        dist:title="@string/title_ethereum">
        <dist:delivery>
            <dist:install-time />
        </dist:delivery>
        <dist:fusing dist:include="true" />
    </dist:module>

</manifest>

You need to specify the items within dist:module. Each item has the following meanings:

  1. dist:instant

This is an item that specifies whether the module is an instant module. It must be set to false.

  1. dist:title

This is the part where the module's name is specified.

  1. dist:delivery

This is the part where the module's delivery method (install-time, on-demand) is specified. If it is not a pre-included module (e.g., Bitcoin, Ethereum), it must be set to on-demand.

  1. dist:fusing

This specifies whether the module is supported in previous versions. For detailed information, please refer to the Android documentation.

CoinModule Impl

The developer of the module must implement the CoinModule interface. The CoinModule interface defines the essential methods that the module developer must code.

Etc.

Additional code or functionality can be implemented at the developer's discretion.

Last updated