0

is it possible for my app to do one or more of the following: read, write and detect data changes to phone storage while the phone is connected to the pc?

Note: The app is used on Android 4.1 and up

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
belliv
  • 11
  • 1
  • 2

1 Answers1

0

When SD card is connected to your pc your phone cannot read the sd card. So, naturally your app wont b able to read the SD card and detect changes as long as SD card is being read by your pc.

But once you disconnect the SD from your pc, you can detect any change in the SD card by comparing with the previous status of the sd card which u have to save for future comparisons!

Sucho
  • 321
  • 1
  • 14
  • after researching some more i see that MTP supports access to storage by pc and phone simultaneously...would that be correct? – belliv Aug 22 '14 at 13:19
  • I have heard about it, and most probably you have to connect the device as Media Device. But I haven't tried it. Give it a go! – Sucho Aug 22 '14 at 16:57
  • 2
    I did give it a go and it works, kinda. The MTP file system is extremely slow on windows at least. I'm pretty sure the content of the files is also not refreshed. But using adb shell every modification is instantly visible. Good enough. From there on i will use adb pull in my script and that's the end of it for now – belliv Aug 27 '14 at 10:00