Motorola flipout cannot access SD card while USB connected - android

I have a Motorola flipout with Android 2.1. and the USB my driver is the following:
http://developer.motorola.com/docstools/USB_Drivers/Handset_USB_Driver_64/
Whenever I connect the USB cord to the cellphone I can access the SD card from the computer and I no longer can access it from the cellphone. That means that any software on the phone that needs to access the SD card can't do so, therefore I can't debug anything that needs file access. Is there any way to connect the USB cord yet at the same time not mount the SD card file system onto the computer filesystem?

The SD card can only be mounted by one device at a time. It sounds like the default setting upon USB connection is to basically mount the SD card to your computer so it can browse/edit the files. Use blindstuff's method to disable USB storage mode. your phone will still be connected via USB allowing you to use adb to debug applications.

Blindstuff called it. The reason you cannot is because the SD card is in use by the computer (depending on how you've connected of course). While the SD card is in use by the computer, it's not available to the device.
I strongly suspect that's an artifact of SD cards, not Android (or iPhone, or anything else).

Related

Activate OTG on non-otg Android phone

I have an old LG K120 that by default doesn't have OTG. So I did what was needed (root the phone and installed a software that now tells me OTG is active) however when I try to plug a usb pen or card reader, it doesn't detect it. I hope I don't have to install a custom rom or whatever it's called risking to ruin everything. I just need to read a microSD without having to open the cover all the time.
For running SD cards on the mobile you can use some of the pocket Wi-Fis which support SD card inside them,like some of the JioFis (check before you purchase any,if you). Then connect it to your mobile using Wi-Fi(Password protected or open) and run it.
And for running pendrives(only) you can use the SanDisk Wireless Stick pendrives, which run on Wi-Fi.
Edit: USB can also be used for radiation free transfer with laptop computers.(Credit goes to blackapps).

How to read/write external USB storage on Android?

I am currently making an app that needs to be able to read from and write to a USB flash drive connected via a USB OTG adapter. Is there an easy way to access this storage via standard Java.io.File APIs? This app is only going to be run on a rooted Motorola Xoom running Android 4.2.2. Any suggestions would be appreciated.
USB Drives get mounted to your device just like an SDCard does essentially*.
The mount path usually resides at:
/storage/usb0/
I have not used this on many devices other then my Droid running CyanogenMod, your device may very. You can smiply use a file manager to explore this path. The directories will still exist even if there is no mount path, so you will be able to determine the path.

How to access USB Path in android?

I am connected android device and PC via USB cable. My Internal SD Card location Path as /mnt/sdcard. But my External USB device path as /mnt/userdata1. I am try to use this code to find only the Internal SD Card Path Environment.getExternalStorageDirectory(). I am using this code to access only in the internal SD Card path. How to access the external USB Path.
For example Screenshot is here...
Example
In this example contains Internal Memory, External SD card and USB Storage. How to find this path ( Internal Memory, External SD card and USB Storage) programmatically. In this code Environment.getExternalStorageDirectory() is viewed files from all Internal Memory Files only. So how to access others path ( External SD card and USB Storage ) Please guide me with code. Thanks..
If I understand correctly, what you are calling "external" USB path is actually the mount point for your SD card on your computer. Most likely, your SD card has label userdata1. Therefore when it's mounted on the computer, it gets /mnt/userdata1 mount point. However this is not strictly necessary and it can be any mount point at all. In fact, if you connect it to another computer, it can easily be another mount point.
Because this path is determined by the computer operating system, you'll need to find this path on your computer (note that this can be different every time you connect your phone to your PC, so you'll need to do it every time).
From your question and path structure (/mnt/userdata1) I'm guessing you're using linux or some other unix version. Therefore you could run mount on your PC to see the list of the mounted devices. For example, here's the output on my mac:
$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk1s1 on /Volumes/ALEKS540 (msdos, local, nodev, nosuid, noowners)
Note the last line in the output - this is my connected android phone with the SD card mounted to the computer. On macs, the mount points are created under /Volumes instead of /mnt. Other than than, ALEKS540 is the label of my SD card, hence it's mounted this way.
Internally on the phone, it's still mounted as /mnt/sdcard.
From the point of view of Android, there may be three storage types:
Internal memory it's always mounted under / on the device and contains everything except the SD card and USB storage below.
SD card - this is referred to as "external storage" and is usually mounted as /mnt/sd, but not always. Environment.getExternalStorageDirectory() will return the path of SD card mount point.
USB storage - this is only supported on very few devices (those that support USB host mode for external storage). This will be mounted somewhere under /mnt, but the exact location will vary. You will need to use Android NDK to interrogate and iterate mounted devices to find the one you're after.

HTC wildfire, application crashes if phone is connected to logcat and app tries to access the sd card

I have an HTC Wildfire and I'm using it for testing my applications. I want to have to phone always connected with the usb to the pc so I can see the logs in LogCat or use a debugger.
The problem starts when i try to access the SD card from the app.
Although the phone is in "HTC Sync" mode and I can see the logs... when the app tries to access the SD card then the app crashes. So I have to remove the usb every time I want to test and replug it (and waiiiiiit ) to redeploy the app.
Any suggestions?
You can still see logcat if the device is not mounted as a filesystem just as long as it's connected to the USB.
When the device is mounted as an external file system on USB, your pc has control over your SD card, so you can't access it from your app. You need to handle this case and not access the SD card in this case.
See this post for additional info.
Ok I found the solution. Although I had downloaded recently the HTC, looks like there was a new version. It installed the latest driver and now it works pretty fine. Thanks a lot.

Android - inconsistent ringtone behavior

I am trying to add ringtones to the media/ringtones folder from my application. If the phone is connected via USB to a computer or mounted on my Mac, the ringtones do not show up in the SD Card, nor in the Ringtone settings.
But if I run the application with the USB unplugged, the ringtones appear ok. This is not a problem with Ringdroid which does the same thing.
Can someone please tell me what could be wrong.
Did you check the setting for usb mass storage? It should be off if you want to access the content of the sd card from the phone.
If you mount the SDCard on your Mac, your Phone canĀ“t acces it.
So, if you want to use the SDCard on your phone, it has to be mounted there (and nowhere else).

Categories

Resources