0 votes
by (290 points)
recategorized by

Hi there!
This is a "double" question:
Is it possible within an application to figure out, if it is in kiosk mode?
Is it possible to shut down Pico G2 4K, from inside an application?

My goal is to have alternative options, so
When my app will be in kiosk mode, I will have a "Shut Down" option.
and when my app will be in normal mode, I will have an "Exit" option instead.

Thank you

1 Answer

0 votes
by (44.1k points)

Hello, what method did you use to replace the launcher? Is it the method 2.1 or 2.2 in the document below:
https://sdk.picovr.com/docs/KioskMode/chapter_two.html

by (290 points)

It is the 2.2 method (from the menu) but I am familiar ad have used method 2.1 in the past, if this is of some importance.

either way, I can adjust.
Forgot to mention that we are developing our application in Unity.

by (44.1k points)

Hello, you can read the config.txt file from the

/storage/emulated/0/pre_resource/feature

path through the Unity engine to check whether the home_pkg name of the current Launcher is your application package name.enter image description here
If the home_pkg name matches the package name of your application, then your application is in kiosK mode.

by (290 points)

Thank you very much for this answer.
I will check it and post the solution after I verify it.

One more thing in the second question:

Is there any method in unity SDK to "Shut Down" the Pico device?

Thanks again.

by (44.1k points)

You can use the following interface to implement Shut Down.
Mentioned in the link below:
https://sdk.picovr.com/docs/UnitySDK/en/chapter_seven.html#upvr-controlsetdeviceaction

Please check sample scene TobService.unity and script “PvrToBService.cs” about how to initialize ToBService before using the interface. “PvrToBService.cs” can be directly attached to developing scene for binding service. Detailed description of interface usage is as follow:
https://sdk.picovr.com/docs/UnitySDK/en/chapter_seven.html#system-related

Note: To secure system steadiness and user experiences, application which uses following interfaces are not allowed to publish on Pico Store. It’s required to add the label to AndroidManifest as below to use these interfaces:

<meta-data android:name="pico_advance_interface" android:value="0"/>
...