Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
0.0.6
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ricardobrg authored Dec 30, 2022
2 parents 077bf23 + 037b4bb commit 38995b0
Show file tree
Hide file tree
Showing 81 changed files with 1,598 additions and 788 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
### [🍍 Console](https://console.mytiki.com)    [📚 Docs](https://docs.mytiki.com)
### [🍍 Console](https://console.mytiki.com)    [📚 Docs](https://docs.mytiki.com)

# TIKI SDK [Android] —build the new data economy

A package for adding TIKI's decentralized infrastructure to **Android** projects. Add tokenized data ownership, consent, and rewards to your app in minutes.
A package for adding TIKI's decentralized infrastructure to **Android** projects. Add tokenized data
ownership, consent, and rewards to your app in minutes.

### [🎬 How to get started ➝](https://docs.mytiki.com/docs/tiki-sdk-flutter-getting-started)

- **[API Reference ➝](https://docs.mytiki.com/reference/tiki-sdk-flutter-tiki-sdk-flutter-builder)**
- **[Kotlin Docs ➝](https://tiki-sdk-android.docs.mytiki.com)**

#### Basic Architecture

This SDK exposes Android native (Kotlin) APIs for the TIKI SDK by:

1. The [tiki-sdk-dart](https://github.com/tiki/tiki-sdk-dart) project is [compiled](https://dart.dev/overview) to platform native machine code.
1. The [tiki-sdk-dart](https://github.com/tiki/tiki-sdk-dart) project
is [compiled](https://dart.dev/overview) to platform native machine code.

2. Using the [Flutter Engine](https://github.com/flutter/engine) a bidirectional [MethodChannel](https://api.flutter.dev/flutter/services/MethodChannel-class.html) is created to handle communication between the Android application and the SDK.
2. Using the [Flutter Engine](https://github.com/flutter/engine) a
bidirectional [MethodChannel](https://api.flutter.dev/flutter/services/MethodChannel-class.html)
is created to handle communication between the Android application and the SDK.
26 changes: 12 additions & 14 deletions app/add-dll.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
import org.apache.commons.io.FileUtils

import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
import java.util.zip.ZipEntry
import java.util.zip.ZipFile

static void clean(String rootDir){
static void clean(String rootDir) {
FileUtils.deleteDirectory(new File("$rootDir/app/build/tmp/dlls"))
FileUtils.deleteDirectory(new File("$rootDir/app/src/debug/jniLibs"))
FileUtils.deleteDirectory(new File("$rootDir/app/src/main/jniLibs"))
}

static void fetch(String url, String tmp){
static void fetch(String url, String tmp) {
makeDir(tmp)
File zip = download(url, tmp)
unzipFiles(tmp, zip)
}

static void load(String src, String dest){
static void load(String src, String dest) {
File out = new File(dest)
makeDir(out.getParent())
out.bytes = new File(src).bytes
}

private static def makeDir(String path){
File directory = new File(path);
if (! directory.exists()){
directory.mkdirs();
private static def makeDir(String path) {
File directory = new File(path)
if (!directory.exists()) {
directory.mkdirs()
}
}

private static File download(path, tmp){
private static File download(path, tmp) {
URL url = new URL(path)
String filename = path.substring(path.lastIndexOf('/') + 1, path.lastIndexOf('.'))
File file = new File("$tmp/${filename}.zip")
Expand All @@ -52,7 +50,7 @@ private static void unzipFiles(String dir, File src) {
}
}

static void listFiles(File f, List<File> files){
static void listFiles(File f, List<File> files) {
f.listFiles().each {
if (it.isDirectory())
return listFiles(it, files)
Expand All @@ -61,7 +59,7 @@ static void listFiles(File f, List<File> files){
}
}

static void flutter(String rootDir, String flutterEngine){
static void flutter(String rootDir, String flutterEngine) {
String flutterBucket = 'https://storage.googleapis.com/download.flutter.io/io/flutter'
fetch(
"$flutterBucket/arm64_v8a_debug/$flutterEngine/arm64_v8a_debug-${flutterEngine}.jar",
Expand Down Expand Up @@ -121,7 +119,7 @@ static void flutter(String rootDir, String flutterEngine){
)
}

static void sqlite(String rootDir){
static void sqlite(String rootDir) {
String url = 'https://www.sqlite.org/2022/sqlite-android-3400000.aar'
fetch(url, "$rootDir/app/build/tmp/dlls/sqlite")
load(
Expand Down
25 changes: 19 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.flutterEngine = "1.0.0-8f2221fbef28b478debb78dd233f5250b220ca99"
ext.sdkVersion = "0.0.23"
ext.flutterEngine = "1.0.0-c08d7d5efc9aa6eb3c30cfb3be6dc09bca5e7631"
ext.sdkVersion = "0.0.24"
repositories {
mavenCentral()
}
Expand All @@ -20,8 +20,8 @@ android {
compileSdk 33
defaultConfig {
minSdk 21
versionCode 2
versionName "0.0.5"
versionCode 3
versionName "0.0.6"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -50,16 +50,30 @@ android {

apply plugin: 'com.kezong.fat-aar'
apply plugin: 'kotlin-kapt'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.core:core-ktx:1.9.0'
implementation("com.squareup.moshi:moshi-kotlin:1.14.0")
implementation "com.squareup.moshi:moshi-kotlin:1.14.0"
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.14.0'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'

testImplementation 'org.mockito:mockito-core:4.11.0'
androidTestImplementation 'org.mockito:mockito-android:4.11.0'

debugEmbed "com.squareup.moshi:moshi-kotlin:1.14.0"
releaseEmbed "com.squareup.moshi:moshi-kotlin:1.14.0"

debugEmbed "com.squareup.moshi:moshi:1.14.0"
releaseEmbed "com.squareup.moshi:moshi:1.14.0"

debugEmbed "com.squareup.okio:okio:2.10.0"
releaseEmbed "com.squareup.okio:okio:2.10.0"

debugEmbed "io.flutter:flutter_embedding_debug:$flutterEngine"
releaseEmbed "io.flutter:flutter_embedding_release:$flutterEngine"

Expand Down Expand Up @@ -88,7 +102,6 @@ addDll.clean(rootDir.toString())
addDll.flutter(rootDir.toString(), flutterEngine)
addDll.sqlite(rootDir.toString())


apply plugin: 'maven-publish'
apply plugin: 'signing'

Expand Down
Loading

0 comments on commit 38995b0

Please sign in to comment.