https://github.com/crossmint/androidsdk
https://github.com/crossmint/androidsdk
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/crossmint/androidsdk
- Owner: Crossmint
- Created: 2023-01-11T22:47:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-14T17:26:54.000Z (over 3 years ago)
- Last Synced: 2024-12-31T04:42:40.325Z (over 1 year ago)
- Language: Kotlin
- Size: 138 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crossmint Android SDK
## Installation
The package is available on Maven Central, simply add:
```groovy
implementation "io.github.crossmint:AndroidSDK:0.0.4"
```
to the `dependencies` section of your `build.gradle` file, and you're good to go!
## Usage
For exmple usage, clone this repository locally and check out the app provided.
Included in the demo is a real-world code example to fetch NFTs from an API and display their contents in-app.
#### `NFTDeserializer`
The structure of an NFT takes different form depending on which blockchain the NFT is deployed on.
In order to simplify working with APIs that provide NFTs in different forms, we've supplied a chain-agnostic `NFTDeserializer`.
You can easily introduce this into GSON using the following code:
```
import com.crossmint.android.utils.NFTDeserializer
val gson = GsonBuilder().apply {
registerTypeAdapter(NFT::class.java, NFTDeserializer())
}.create()
val nfts = gson.fromJson(json, Array::class.java)
```