apk-side code for inference service