Android#
Deploy to Android Studio#
MLange supports both for Kotlin and Java implementations.
Deploy your own On-device AI Android application easily.
There are only two steps are needed.
Add module dependency in your library
Initialize
ZeticMLangeModel
with your Model Key / Personal Key and run
Prerequisite#
Step-by-step Guideline#
1. Add ZeitcMLange
dependency#
You can choose
Groovy
build orKotlin DSL
buildbuild.gradle (Groovy)
android { ... packagingOptions { jniLibs { useLegacyPackaging true } } } dependencies { implementation 'com.zeticai.mlange:mlange:+' }
build.gradle.kts (Kotlin DSL)
android { ... packaging { jniLibs { useLegacyPackaging = true } } } dependencies { implementation("com.zeticai.mlange:mlange:+") }
2. Initialize and run ZeticMLangeModel
model with Model Key#
MLange supports both Kotlin and Java implementation
Zetic MLange model running (Java)
// 1. Zetic MLange model running // (1) Load Zetic MLange model ZeticMLangeModel model = new ZeticMLangeModel(CONTEXT, $PERSONAL_KEY, $MODEL_NAME); // (2) Prepare model inputs Tensor[] inputs = // Prepare your inputs; // (3) Run and get output buffers of the model Tensor[] outputs = model.run(inputs);
Zetic MLange model running (Kotlin)
// 1. Zetic MLange Model Running // (1) Load Zetic MLange model val model = ZeticMLangeModel(CONTEXT, $PERSONAL_KEY, $MODEL_NAME) // (2) Prepare model inputs val inputs: Array<Tensor> = // Prepare your inputs // (3) Run and get output tensors of the model val outputs = model.run(inputs)
ZETIC.MLange Android Sample App#
Please refer ZETIC MLange Apps for more details