Android streaming¶
Streaming Plugin implements Android streaming with a separate application. In addition to the content rendered by Kanzi, Android Streaming Application can capture content that the Android system renders, such as the notification drawer, which is not possible with a Kanzi plugin. You can find the Android Streaming Application APKs at <Kanzi VR Package>\plugins-streaming\applications\android-streaming\bin
.
Android Streaming Application offers these methods for injecting input from the receiver to the Android system:
Kanzi Injector Service, which uses the Android accessibility service API to inject input. This is the recommended option. See Setting up Android Streaming Application with Kanzi Injector Service.
Restricted APIs, which require you to sign the application with the platform key of your system image. Use this option when the Android accessibility service API is not available. See Setting up Android Streaming Application with platform signature.
Setting up Android Streaming Application with Kanzi Injector Service¶
Kanzi Injector Service is the recommended input injection method for Android Streaming Application. You can set up Kanzi Injector Service on a device where you do not have access to the platform signing key.
To set up Android Streaming Application with Kanzi Injector Service:
Install Android Streaming Application using
adb
:adb install -r kanzi-streaming-signed-release.apk
On your Android device go to Settings > Accessibility and in the list of downloaded apps tap Kanzi Injector Service.
Enable Kanzi Injector Service. You can also enable a shortcut to toggle Kanzi Injector Service on and off.
Setting up Android Streaming Application with platform signature¶
Android Streaming Application requires signature-level permissions to inject input using restricted APIs. For this reason you must sign the application with the platform key of your system image. In the Android documentation see Signing Build for Release.
To sign and install the streaming application:
Install the required tools:
Install Android Studio. See https://developer.android.com/studio.
In Android Studio, select Tools > SDK Manager, select the SDK Tools tab, and install the the Android SDK Build-Tools and Android SDK Platform Tools.
In the SDK Manager look up the Android SDK Location.
Sign an APK with your platform keys using apksigner. See https://developer.android.com/studio/command-line/apksigner.
If apksigner is not in your
PATH
, you can find it in the<Android SDK Location>/build-tools/<version>/
directory.If you are using a pre-built AOSP image, you can skip signing and use a pre-signed APK
kanzi-streaming-signed-[release/debug].apk
.To sign an APK:
If you are using a keystore, run:
apksigner sign --ks <keystore> --out kanzi-streaming-release.apk kanzi-streaming-unsigned-release.apk
If you are using a key and a certificate, run:
apksigner sign --key <key>.pk8 --cert <cert>.x509.pem --out kanzi-streaming-release.apk kanzi-streaming-unsigned-release.apk
Connect your device and install the signed application with adb. See https://developer.android.com/studio/command-line/adb#Enabling and https://developer.android.com/studio/command-line/adb.
If adb is not in your
PATH
, you can find it in the<Android SDK Location>/platform-tools/
directory.To install the signed APK:
adb install -r kanzi-streaming-release.apk
Starting and configuring an Android stream¶
This section covers how to start and configure an Android stream.
To start and configure an Android stream:
Open the application on your Android device and tap Start Stream.
When the application asks for permission to record the screen, tap Start Now.
Verify that the injection method is correct.
To forward input from receivers to the Android device, Android Streaming Application requires a valid input method.
Connect a receiver to the stream using the IP address and port that you can see in the application UI. You can use any Stream ID for an Android stream. For methods on how to configure a receiver, see Configuring virtual environments.
If you cannot use the configured port of the stream, in the application set the port in the Port, and tap Update Port.