-
Notifications
You must be signed in to change notification settings - Fork 11
DeviceHelper
Get PUI version of the device.
Returns:
PUI version, e.g. 3.4.0.
Get type of the device.
Returns:
the device type, e.g. Pico G2.
Get serial number of the device.
Returns:
the serial number, e.g. PA7940MGD4120145B.
Install the application without user interaction.
Parameters:
apkpath - the path of the APK you want to install;
packagename - the package name of your current application, not the package name of the application being installed.
Uninstall the application without user interaction.
Parameters:
packagename - package name of the application you want to uninstall.
Use callback for silentInstall and silentUninstall:
1. Create a game object in your scene named "installer".
2. Mount a script on the "installer" object.
3. Write two functions in the script:
public void InstallCallback (string s){
//This function will be invoked after the installation completed.
//s equals "success" if installation success.
//s contains failed reason if the installation failed.
}
public void UninstallCallback (string s){
//This function will be invoked after the uninstallation completed.
//s equals "1" if uninstallation success.
//s equals "-1" if uninstallation failed.
}
Kill the application.
Parameters:
pkgName - package name of the application to kill.
Call specified browser to open the link.
Parameters:
browser -
0: PUI built-in browser.
1: WebVR browser.
2: Firefox VR browser.
link - the link to open.
Call specified browser to open the link in the file.
Parameters:
browser -
0: PUI built-in browser.
1: WebVR browser.
2: Firefox VR browser.
filePath - the config file path.
Start an application.
Parameters:
packagename - package name of the application you want to open.
Launch Android 2D application.
2D applications that are launched using this interface have higher resolution than 2D applications that are normally launched, and can also use VR input methods.
Parameters:
way=0, launch with ComponentName, args is an array of length 2 consisting of PackageName and ClassName;
way=1, launch with PackageName, args is an array of length 1 consisting of PackageName;
way=2, launch with Action, args is an array of length 1 consisting of Action.
sample:
Open controller setting
deviceHelper.Call("startVRShell", 2, new string[] { "pui.settings.action.CONTROLLER_SETTINGS" });
Get a list of installed applications in JSON format.
Returns:
list of installed applications. See return sample.
Register the receiver for Home event broadcast.
Unregister the receiver for Home event broadcast.
Adjust startup calibration application.
Install the application.
Unlike silentInstall
interface, installApp
will call up Android installation UI,
Click "Install" button to complete the installation.
Parameters:
apkpath - the path of the APK you want to install.
Set specified system property. Available system properties can be found here.
Parameters:
key - the key of property.
value - the attribute for this property.
Returns:
return true if set it successfully, return false otherwise.
Get specific system property. Available system properties can be found here.
Parameters:
key - The key of property.
defaultValue - The value to return if get the prop failed.
Returns:
the value of the specified key.
- getPUIVersion
- getDeviceType
- getSN (*)
- silentInstall (*)
- silentUninstall (*)
- killApp
- launchBrowser
- launchBrowserWithLinkInFile
- goToApp
- startVRShell
- getAppsString
- registerHomeReceiver
- unregisterHomeReceiver
- openRecenterApp
- installApp
- setSystemProp
- getSystemProp