Connected a Mobile device (Android) as MTP, Now can we access this device and get Time

StackOverflow https://stackoverflow.com/questions/20284413

  •  06-08-2022
  •  | 
  •  

Вопрос

I am trying to develop an application in which I am connecting my mobile device to a Computer as a MTP. Now I am trying to access this MTP from my java code using some external library.
My requirement is to get time from that device and calculate offset on the Computer.
But I am not able to do the same. Can we do something like this.

I tried doing this using USB tethering and creating two way socket communication but this will require opening of sockets and will make application less secure.

Это было полезно?

Решение

if USB debugging is enabled on that device then you can access device status using ADB command in CMD.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top