Jump to content

Send battery info to external application


Recommended Posts

  • Replies 35
  • Created
  • Last Reply

Top Posters In This Topic

4 minutes ago, EmilioBlackBird said:

image.thumb.png.1cc48b0caca9bdf85d529d809cf64d34.png

This is the application created in Csharp, winform and Visual Studio. I want the battery information to be seen in the holes prepared for it. It is an exe application.

I send image of the code.

image.thumb.png.b5f5ea6a835a4c5186980e4ccb0e629a.png

Do you mean your code is able to send information from device to PC?

Link to comment
Share on other sites

Hi @EmilioBlackBird,

For getting battery info, you can get it by using below code,

using Wave.Native;

var battPercentage = Interop.WVR_GetDeviceBatteryPercentage(WVR_DeviceType.WVR_DeviceType_HMD);

For device info such as serial number, I am not able to get it, not sure is it because of permission issue.

I tried getting serial number by

AndroidJavaClass ajc = new AndroidJavaClass("android.os.Build");
string serialno = ajc.CallStatic<string>("getString", "ro.serialno");

But from the log I get

06-25 20:44:03.733  7652  7680 E libc    : Access denied finding property "ro.serialno"

And it returns unknown.

I will need to search online to see how to resolve this issue.

UPDATE: For API level 29 and above, you are not allowed to get serial number.

Link to comment
Share on other sites

The build we are doing is for computer, we don't use the HTC API to make the build for the device. It is an .exe. And the application is external.

The only thing we use is Vive Streaming.

Well we want that battery information to be seen in the external application, created in csharp. But both the application and the build are not for the device.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...