In this section, you will run the Qwen model in action using a demo application using a Android Package Kit (APK).
A fork of the upstream MNN repository is set up to enable building the app as an Android Studio project.
Run the following commands to clone the repository and checkout the source tree:
cd $HOME
git clone https://github.com/HenryDen/MNN.git
cd MNN
git checkout origin/llm_android_demo
You can use Android Studio to build the app and create an APK.
Open Android Studio.
Go to File > Open.
Navigate to the cloned MNN repository, expand the transformers/llm/engine/
directories, select the android
directory, and click Open
.
This triggers a build of the project, and you should see output similar to the following on completion:
BUILD SUCCESSFUL in 1m 42s
Navigate to Build > Generate App Bundles or APKs. Select Generate APKs.
The build will be executed, and then the app will be copied and installed on the Android device.
After opening the app, you will see the splash screen:
Finally, you can use the UI to chat with the app. Try uploading an image and ask a question on it.
The final step is to examine how KleidiAI can improve the performance of the model. Continue to the next section to find out.