FNCY Chain
FNCY 2.0.2 (ENG)
FNCY 2.0.2 (ENG)
  • Introduction
  • Getting Started
  • Design
    • Structure
    • Three Main Sets of Participants
    • PoSA Consensus
    • Governance
    • Staking
    • Mining Reward
    • Gas Fee
    • Runtime Upgrade
    • Cross-Chain Bridge
    • Security
  • Build On FNCY Chain
    • RPC Endpoints
    • Testnet Faucet
    • Block Explorer
      • Token Listing
    • BEP20 Token
    • NFT
    • Validator Requirements
    • NFT Market
      • FNCY Marketplace
  • For Developers
    • JSON-RPC
    • FNCY Chain API
      • Wallet API
      • Transaction API
      • Blockchain API
    • Wallet
      • FNCY Wallet
      • Use MetaMask for FNCY Chain
      • SDK
        • Android
          • Install
          • Guide
            • Initialize
            • Create/Restore Wallet
            • Wallet Search
            • Execute SendCoin/Contract
            • Transaction Search
            • Other Features
          • Methods
          • Domain
          • ETC
        • iOS
          • Install
          • Guide
            • Initialize
            • Create/Restore Wallet
            • Wallet Search
            • Execute SendCoin/Contract
            • Transaction Search
            • Other Features
          • Methods
          • Domain
          • ETC
    • Smart Contract
      • Deployment
        • Truffle
        • Hardhat
        • Remix IDE
      • Verify Your Contract on FncyScan
    • Gasless Transaction
    • with FNCY
      • FNCY Login
      • GAME AUTH Login
  • Tokenomics
  • Ecosystem Partner
  • FNCY Governance Partner
Powered by GitBook
On this page
  • Obtaining Fncy AuthToken
  • Declaring Initialization in the Application Class
  • Create FncyWallet Object
  • Usding FncyWallet
  1. For Developers
  2. Wallet
  3. SDK
  4. Android
  5. Guide

Initialize

This document describes the initialization steps for using Android SDK in your project.

PreviousGuideNextCreate/Restore Wallet

Obtaining Fncy AuthToken

  • Link for instructions on how to get your .

Declaring Initialization in the Application Class

class FncyApplication : Application() {

    override fun onCreate() {
        super.onCreate()
        FncyWalletSDK.initSDK(
            environment = Environment.Testnet // Testnet or Mainnet
        )
    }
}
  • application: application context

Create FncyWallet Object

val fncyWallet = FncyWalletSDK(token)

Usding FncyWallet

class FncyViewModel() : ViewModel() {

    fun getWallet() {
        viewModelScope.launch {
            val fncyWallet = FncyWalletSDK("token")
            val result = fncyWallet.getWallet()
            result
                .onSuccess { wallet ->
                    // Handling Success
                }.onFailure { throwable ->
                    // Handling Fail
                }
        }
    }

} 
class FncyViewModel() : ViewModel() {

    fun getAssetList() {
        viewModelScope.launch {
            val wallet = FncyWalletSDK("token")
            val result = wallet.getAssetList(wid)
            result.onSuccess { it ->
                it.data // Result Data
                it.paging // Paging Data
            }.onFailure {
                ...
            }
        }
    }

} 

with

AuthToken
Paging