简体   繁体   中英

How do I use Solana.kt library in Android project?

I'm trying to import Solana.kt library - https://github.com/ajamaica/Solana.kt into my android project, so I could try creating solana wallet/sending tokens. I'm noob, so I can't figure out how do I go exactly adding library into the project and then how to I use it? (For example from my MainActivity I want to click button to create wallet). Library code is like this - 在此处输入图像描述

So my main questions are

  • how to import it properly? (since there is no direct gradle "implement" option)
  • how do I call library method from my MainActivity?

设置.gradle

build.gradle 第 1 部分 build.gradle 第 2 部分 build.gradle 第 3 部分 build.gradle 第 4 部分 Thank you for your insights.

I think it helps to include the local SDK to your own project:

  1. Copy solana folder to your main project folder ( ctrl+c & ctrl+v )
  2. Open settings.gradle file and put this piece of code

include ':app', ':solana'

project(':solana').projectDir = new File(settingsDir, 'solana')

  1. After that open the app build.gradle file and put this:

implementation project(path: ':solana')

If your version of configure files are suitable with sdk files, this should work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM