Saturday, May 25, 2019

usb - What are my options for connecting my Android to Ubuntu?



I have a Samsung Galaxy S2 running rooted Jelly Bean 4.1.2. My computer is running Ubuntu 12.10.


Before, in Android 4.0, I simply plugged the USB in, and a notification would pop up, and I was offered a button to Turn on USB storage, and then my 12GB internal SD card and 16GB external SD card were both mounted as external drives. Nice and easy.


Now, to get the same thing, to connect my Android as a mass storage device, before I connect the USB cable, I have to go to Settings -> More Settings -> USB utilities and press Connect storage to PC, then plug in the cable, then press Turn on USB storage. It's a hassle and a half.


If I don't do it this way, when I connect the USB, it tries to connect with MTP. Which causes this error:


Unable to mount SAMSUNG_Android
Error initializing camera: -60: Could not lock the device

If I switch the connection mode to PTP, I get two devices, both called SAMSUNG_Android, only one of which (12GB internal) actually ever displays the contents. The other hangs.


In either case, MTP or PTP, if I have Banshee running when I connect my Android, it causes Banshee to crash. I use Banshee to sync my music collection.


The short story being that currently, connecting my Android to my computer is either complicated or doesn't work very well.



I've been told that USB mass storage is being deprecated, and MTP is the standard going forward. At the end of the day, I don't care if it's MTP, PTP, or mass storage that's used to connect my device. All I care is that it's as easy as it used to be. Plug it in, press a button, both drives are mounted and usable like any other drive.


How do I get this ease of function when connecting my Android to my USB.



Answer



A developer on the XDA forums provided a script that changes the default behaviour so that connecting by USB mass storage is the default behaviour:


#!/system/bin/sh
setprop persist.sys.usb.config mass_storage,adb

I had to use a file manager app that gave me access to the root directory, I placed the script in /system/etc/init.d/, changed the script's permissions to rwxr-xr-x, and then rebooted the phone.


Now I have the full functionality and ease of use I hoped for. I'll probably eventually have to use to something like MTP or whatever, but hopefully in the meantime while proper support is developed by all relevant parties, I won't have to suffer.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...