How to get OS version and Device Name of an Android device connected via USB with C#.net (VS2010/4.0+)?

一笑奈何 提交于 2019-12-06 02:24:59

You can use the Android Debug Bridge from the Android SDK to query properties from the connected devices. You can simply launch the adb.exe process from within .NET and use the results.

For example adb.exe shell getprop ro.product.model will give you the model name, and adb.exe shell getprop ro.build.version.release will give you the Android version number. To get a complete list of all available properties for a given device, you can also just run adb.exe shell getprop.

Note that the property names are not really standardized and manufacturers are not required to put in valuable names. It’s common that the product model contains the device’s code name or a product identifier that is not commonly used to identify the product among consumers.

I think we need to make changes into the device setting

1> At your android, go to settings -> applications -> development

2> Check USB Debugging

3> Make sure your device driver is already installed.

Android version 4.2 and above comes with security which wont allow you to fire the ADB commands without making changes in the settings.

Regards, Aryan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!