0

I am making an application on an android tablet that is supposed to act as a file backup application, the tablet is going to be locked down and all applications other than the app I am making are to be disabled, the tablet is then to be shipped to users who will be recording video footage onto a USB flash drive using head-mounted cameras, at the end of each day the users are to plug the flash drives into the tablet, during this time, the application will wake up and allow the users to click the "backup" button, the files are then to be copied from the usb drives and saved on the tablet.

The users are assumed to be technology illiterate so we are not asking them to do anything more than plug the flash drive into the device and click the transfer button.

For testing purposes I have a flash drive, a USB 3.0 to Type-C adapter and a tablet, when I plug it all in the flash drive appears on my Android device, my question is, how do I communicate with the flash drive through code?

I'm using Android Studio, the flash drive is attached to my tablet via USB, my tablet is connected to Android Studio via wireless debugging, Android Studio detects and displays my tablet, however it does not display the USB device inserted into my tablet, which is what I need to communicate with. I would like for the flash drive to appear on Android Studio so I can know the correct file path to put in my code.

(I am aware that communication with external USB devices disallows my app from being published on the app store, this is an internal only app)

Josh Hunter
  • 45
  • 1
  • 10
  • `which is what I need to communicate with.` Why? If you want to copy files from flash drive to your Android device then you can do all on your Android device and do not need a connection from your Android device to some pc. You might better explain what you want i think. – blackapps Nov 03 '22 at 15:00
  • @blackapps I am making a program that is supposed to back up files automatically. The user is supposed to plug the flash drive into the tablet and click "backup" the app then does the rest. – Josh Hunter Nov 03 '22 at 15:08
  • Yes. Ok. Well then read my comment again: to do that you do not need a pc. Only your Android device and the flash. And your app on your Android device. – blackapps Nov 03 '22 at 15:10
  • @blackapps I need to make an application that will allow the user to plug a flash drive into a tablet and click a button that says 'backup', then have the app do the rest. The user is not allowed access to any application other than the backup application, it has to be done automatically, can you please help me with my question rather than suggest alternatives The context does not really matter, all that matters is I need a way to communicate between an application and an external flash drive – Josh Hunter Nov 03 '22 at 15:15
  • Of course the scenario/context matters. And as long as you do not even mention where that app/application should run... and why you need a pc to do what you want .. then i can only say please communicate better. – blackapps Nov 03 '22 at 15:18
  • @blackapps I have updated the first paragraph with more context, however I assume you will have more questions. Just know that I have no control over anything apart from the application and the app is non-commercial – Josh Hunter Nov 03 '22 at 15:28
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/249299/discussion-between-josh-hunter-and-blackapps). – Josh Hunter Nov 03 '22 at 15:33
  • You are still unclear as to why Android Studio should communicate with your tablet. What you want is an app on your tablet that copies files from a flash drive to the storage of the tablet. Should i still ask you a hundred times why you need a pc and or Android studio for it? – blackapps Nov 03 '22 at 15:58
  • @blackapps I have moved this discussion to a chat, please continue here https://chat.stackoverflow.com/rooms/249299/discussion-between-josh-hunter-and-blackapps – Josh Hunter Nov 03 '22 at 16:05
  • No chat. Just answer my questions and remarks. – blackapps Nov 03 '22 at 16:55
  • @blackapps Android Studio is the IDE I am using to make my application, if my IDE cannot see the files, that means my application cannot see the files. What I want is for my application to be able to move the files that are on the USB drive plugged into my tablet, if you can suggest a way to do that without being able to see the files on Android Studio I would appreciate that as well. I would just like a way for either my application or Android Studio to be able to recognize the files on my flash drive which is plugged into my tablet – Josh Hunter Nov 03 '22 at 17:00
  • `if my IDE cannot see the files, that means my application cannot see the files` Nonsense. You are with your tablet in town. You stick a flash in it. Now your Android app on the tablet can copy the stuff. No pc needed. No Android Studio needed at all. If you have a different scenario you should long ago have told such. – blackapps Nov 03 '22 at 17:29
  • @blackapps I stated in my original post that my tablet is connected to my computer over wireless debugging, my coputer can see all other files on my device, I was just curious why it could not see the files on the USB stick. I'm still in the development process so from a debugging perspective it is very useful if my IDE could see the files I am trying to work with. I am still making the app, apologies I thought that was obvious – Josh Hunter Nov 03 '22 at 18:03
  • I knew if course that you were developing an app. But you should have agreed on it that if your app is ready that it does not need a pc or Android Studio as the users are far away from pc's when they copy. `I would like for the flash drive to appear on Android Studio so I can know the correct file path to put in my code.` Even if Android Studio would see the flash you would not know the path. And even if you would know the path it was unusable for your app. I do not understand the whole fuss. Only once your app would let the user choose the flash-drive with ACTION_OPEN_DOCUMENT_TREE. – blackapps Nov 03 '22 at 18:16
  • Then after it your app could copy all files on it. Again and again. I have no idea what you have in mind for the things needed to copy some files. – blackapps Nov 03 '22 at 18:17

0 Answers0