When I connect my android phone via USB to my PC with Windows 10, it shows up as This PC\SAMSUNG-SM-G925A\Phone in the browser. However, I'm not able to access the directories on the device with that string. Does anyone know what directory should I use? I have Windows based ActivePerl. For starters, is there a drive letter (if so, how can I find out) that points to the root directory on that phone? Thx!
Found a work around by copying the files (manually) to a tmp directory on C: drive and process it from there. Not elegant, but serves the purpose for now.
Related
I'm working with someone who has a 1st generation Kindle Fire to test Amazon's in-app purchasing. According to Amazon's docs, we need to create a response file named /mnt/sdcard/amazon.sdktester.json on the device. My colleague prepared the .json file and tried to transfer it to the device via a USB connection. However, when he connects his device to his Mac, the root folder of the mounted device does not have a /mnt folder. He also tried mounting it on a virtual Windows machine on his Mac, with the same result.
I'm assuming that for some reason the Kindle Fire is mounted in a way that does not provide access to the root folder of the device. Can anyone recommend a way around this, or some other way to put a file into /mnt/sdcard/ on my colleague's Kindle Fire?
If there's a way to directly type in the file on his Kindle Fire, that would be acceptable; it's just a few lines of text. All suggestions are welcome.
When you say "transfer via USB connection", do you mean that you mount the device like an external drive, or are you accessing it via ADB? You will need to access the device via adb to get to the root folders.
So we figured it out. The problem, as Nick Davis pointed out, is that the root folder is only visible when connecting through adb. My colleague does not have a development environment and does not want to install it.
Instead, he installed the Text Edit app on his device, mailed the text to himself, copied it into a new document and saved the file directly to /sdcard/android.sdktester.json (which is an alias for /mnt/sdcard/android.sdktester.json).
This was practical only because there wasn't a lot of text involved. For large files, I suppose he could have copied them to a different folder through the USB connection and used a file manager like #ssantos suggested in a comment to move it to the right folder.
I am looking for a solution which uses Android API to transfer a text file from an Android powered device to a computer through USB cable. I have found USB host but I cannot use this because the computer can not act as a device for the Android host.
Do you have any suggestions how I can achieve this?
I have solved this problem by using adb status-window to continuously check for device status, and when a new device is connected, the required files are transferred to the computer using adb pull command.
In order to achieve a portable solution (i.e. to run independently of Android platform), I just copied the files 'adb.exe' and 'AdbWinApi.dll' into my application and used the adb from there.
Had similar problem where a software installed in PC needed to be able to access file inside the android phone through USB. After long research here is what worked for me (not sure if this is the best solution but it worked). Windows has Windows Portable Device(WPD) API which can be used to enumerate contents of a device through USB (and copy files between client and device).
There are few implementations in java
http://code.google.com/p/jmtp/ (works well but doesnt support copy function from device to pc though there is some support available to do this with source code)
another one is jusbpmp (available in google repository)
(if somebody finds a well documented and maintained implementation do share)
but since jmtp didnt work for me (copy function source compilation(for 64bit OS) failed), wrote C# program from scratch to copy files from device to PC. here is a nice tutorial
https://github.com/geersch/WPD/blob/master/src/part-3/README.md
You can write an app which will use http to contact your pc and send (POST) data to a known endpoint.
Keep in mind that the app will only have access to the data belonging to the app. You will not be able to access an arbitrary file from the file system
I'm trying to view the files and folders at root level on an android device using USB Debugging mode and windows. Is this possible? Phone is rooted.
I've downloaded a file explorer app which allows me to view it on the phone itself.
My main goal is to copy the mmssms.db from the phone.
Droid Explorer
http://de.codeplex.com/releases/view/612392
Window Apps:
Explorer:
SQLite Manager:
I was looking long and hard for a solution to this problem and the best I found was a root FTP server on the phone that you connect to on Windows with an FTP client like FileZilla, on the same WiFi network of course.
The root FTP server app I ended up using is FTP Droid. I tried a lot of other FTP apps with bigger download numbers but none of them worked for me for whatever reason. So install this app and set a user with home as / or wherever you want.
2021 EDIT: FTP Droid isn't being updated and doesn't work on modern Android versions, now I use primitive FTPd which is open source on Github
Then make note of the phone IP and connect with FileZilla and you should have access to the root of the phone. The biggest benefit I found is I can download entire folders and FTP will just queue it up and take care of it. So I downloaded all of my /data/data/ folder when I was looking for an app and could search on my PC. Very handy.
You can use Eclipse DDMS perspective to see connected devices and browse through files, you can also pull and push files to the device. You can also do a bunch of stuff using DDMS, this link explains a little bit more of DDMS uses.
EDIT:
If you just want to copy a database you can locate the database on eclipse DDMS file explorer, select it and then pull the database from the device to your computer.
If you have android, you can install free app on phone (Wifi file Transfer) and enable ssl, port and other options for access and send data in both directions just start application and write in pc browser phone ip and port. enjoy!
Obviously, you'll need a rooted android device. Then set up an FTP server and transfer the files.
I am writing a C++ program (MFC) that is to automatically transfer file between a desktop and a tablet. However, the tablet I am using is recognized as an MTP device and is not assigned a drive letter; therefore I'm unable to access the internal folder from C++ (unless there is a way, but I couldn't find one).
Is there a way to run adb through C++ to automate the file transfer. Or maybe through a VB Script?
I'm just trying to find anyway to transfer the files automatically.
Thanks,
adb push is an obvious way, running adb from system() or ::CreateProcess().
You fail to get the MTP assignment when you have debugging enabled by default. You can manually navigate the menu in the device and select to connect mass storage, (at which time you should see the stroage appear with it's respective drive letter), or disable debugging and choose to connect mass storage as the default when usb is connected, (and it will always connect and show the drive letter). Once the device is in the correct mode you should have no trouble connecting to the onboard storage.
I would like to have an application sync itself with some files on a host computer.. Anyone know if this is possible? Eg: When you connect an Android phone to a computer i would like an application on the android system to read some allowed folders on the connected computer. Making it so the user doesn't have to sync files itself.
I ask possible, because i assume it isn't.. for security.
You won't be able to do it solely from the Android end, because Windows doesn't make the local drives available through the USB port like that (unless you have some custom driver on the Windows side).
Your Android device will probably show up to windows as a USB drive. If you have an SD card plugged in, you may see a second drive from the Windows side.
To do something like this, you'd probably need to have software running on the Windows side that did the syncing, and then copy the data from the /sdcard directory on the Android device to wherever you ultimately need it to be.