3. Operating Instructions

  1. Download jar file

    You can download jar file at

    https://github.com/picoxr/pico-power-manager/blob/master/resource/powermanager.jar.

    Copy the powermanager.jar” package to the directory “Plugins/Android” in Unity project.

    If the “androidLockScreen” interface is needed, please also copy the lock.xml script, which is under path pico-power-manager/app/res/xml, to “Plugins/Android/res/xml/” folder (create one if not exist) in Unity project.

  2. Modify the “AndroidManifest.xml” script.

1)Add sharedUserId

For calling the interfaces with “Need the system signature” description, please add sharedUserId as below:

android:sharedUserId="android.uid.system"
_images/3.3.png

2)Modify main activity name

com.picovr.picovrpowermanager.PicoVRPowerManagerActivity

Take the following picture for reference:

_images/3.2.png

3)Add permissions (if none)

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DEVICE_POWER"/>
<uses-permission android:name="android.permission.SHUTDOWN" />
<uses-permission android:name="android.permission.REBOOT"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
  1. Copy the “PicoUnityActivity.cs” script in resource(https://github.com/picoxr/pico-power-manager/tree/master/resource) folder to Unity project.
  2. Call Android interface in C# script. (Method set out above)

Note:

1.If you want to modify and build your own jar file, the source code of Android project and jar file could be found at https://github.com/picoxr/pico-power-manager.

2.The Bundle Identifier in Unity PlayerSetting must be consistent with that in the Android project.