有沒有什麼辦法在您的PC上運行的C#.NET Windows應用程序中將android手機(Samsung Galaxy SIII specificaly)的電池狀態連接到PC? 在此先感謝。windows應用程序獲取連接的Android手機的電池狀態
我認爲我們必須爲此採取三星手機驅動程序的幫助。
有沒有什麼辦法在您的PC上運行的C#.NET Windows應用程序中將android手機(Samsung Galaxy SIII specificaly)的電池狀態連接到PC? 在此先感謝。windows應用程序獲取連接的Android手機的電池狀態
我認爲我們必須爲此採取三星手機驅動程序的幫助。
看看AndroidLib.dll庫。丹有一個類,將處理設備的電池水平報告在正常開機啓動裝置(即普通ROM啓動時)
爲AndroidLib
http://forum.xda-developers.com/showthread.php?t=1512685
主線程約AndroidLib
http://www.regawmod.com/software/windows/androidlib/current/documentation/index.html有關文檔
//使用AndroidLib.dll的示例代碼
private void button1_Clicked(object sender, EventArgs e)
{
string serial;
android = AndroidController.Instance;
android.UpdateDeviceList();
serial = android.ConnectedDevices[0];
device = android.GetConnectedDevice(serial);
// this will give the label lblsomelabel the Value of the device battery level.
lblsomelabel.Text = device.Battery.Level.ToString();
lblsomelabel.Text += "%";
}
使用了名爲Button1 按鈕形式和標籤命名lblsomelabel
您將得到連接的設備的序列,然後將其與設備關聯。
然後可以調用該庫來按照指示拉動電池電量。
希望這會有所幫助。 Dan的Github提供了他使用的代碼示例,並且您可以查看git hub來更好地瞭解他的調用。