10-13-2012 05:17 PM
LabVIEW can see the file system on traditional external hard drives, because they show up like this:
D:\MyDrive\some_folder
However, my Android's file system shows up like this:
Computer\SPH-D710\Phone
How do I get LabVIEW to comprehend that path? The attached pic will describe exactly what is happening.
Solved! Go to Solution.
10-14-2012 04:54 AM - edited 10-14-2012 04:59 AM
Welcome to the virtual file system in Windows Explorer. Windows Explorer adds a virtual view on top of the file system that is not part of the Windows File I/O API but an implementation of the Windows Shell, that was at some point tacked on top of Windows with duct tape, nails and some super glue. As such the Windwos File I/O system is a limited subsystem of the Windows shell view, which added many virtual subsystems like control panels, network, desktop (which is actually stored in a hidden place on the real File I/O subsystem, and IO devices like cameras, printers and external filessytems.This virtual shell view is unfortunately based on a COM API that Microsoft hasn't documented for a long time until they got forced by antitrust legal cases, and since it got multiple times revised and parts obsoleted, so that you can not at all speak about a stable API that third party applications like LabVIEW could rely upon. As such LabVIEW and most other applications still limit access to the File IO API that is part of the Win32 API specification, which is stable and proven, and don't even bother about trying to support the much less stable (and in fact for a long time rather crude) Shell filesystem API. Even nowadays chances are very high that any implementation that would use this API at this point will very likely run into serious usability trouble when moving to Windows 8 or at least when using the Metro interface on Windows 8.
The way to get your Android phone to show up as a flash disk in the File I/O space of Windows is to go into your phone settings and under Wireless and Network->USB Settings change the mode from Kies or Media Player to Mass Storage. This will make Android announce to the connected host a USB mass storage class device and Windows will mount that into the Computer space under a new drive letter and then you can access it in LabVIEW and any other software that allows file IO access. Basically it is a lack of feature from the Android device driver to not mount the disk drives into the File IO subsystem as disk drives, but I also feel there is a debate about it possible if it is a smart idea to automount such devices since drive letters in Windows are a very limited resource.
10-14-2012 08:23 AM
Whoa, that was a lot of very useful info, thanks!
My Android phone does not have the Wireless and Network->USB Settings of which you speak. Poking around in that area, the only USB-related thing is here: Wireless and Network->Tethering->USB tethering, and it appeared to turn "on" vs "off". LabVIEW on my Win 7 box still cannot see it though.
10-14-2012 08:26 AM - edited 10-14-2012 08:28 AM
I guess the selection as I can see it is then a Samsung specific feature, as also indicated by the presence of (the IMHO horrible) Kies. Also it could be an Android version specific feature, what Android are you looking at?
USB tethering certainly is not what you are looking for, that is the ability to enable your phone to work as a data modem over the USB port for your computer, something many network operators do not allow on their network specific phone firmware.
10-14-2012 09:06 AM
Yeah, these menu differences are likely a Samsung specific feature. Too bad LabVIEW can't see inside ANY Android phone, since they are getting more and more popular.
I have an Android Galaxy S II bought in January 2012:
Model Number: SPH-D710
Android Version: 4.0.4
10-15-2012 12:46 AM
It changed in Android 4.0 for my phone. I have a GSII. Go to settings, Wirleass and Network, More.., USB Utilities.
There's a button to press to set the phone to USB mass storage mode. After a few seconds, it will tell you to connect the USB cable. It does not appear to be a permanent change, so you would have to go and do this everytime you want to connect.
10-15-2012 01:50 AM
@bmihura wrote:
LabVIEW can see the file system on traditional external hard drives, because they show up like this:
D:\MyDrive\some_folder
However, my Android's file system shows up like this:
Computer\SPH-D710\Phone
How do I get LabVIEW to comprehend that path? The attached pic will describe exactly what is happening.
You can also use the commandline interface in LabVIEW and execute "ADB push" command.
First you must enable debbuging in your phone and install the android deceloper tools from Google.
http://developer.android.com/tools/help/adb.html
Br,
/Roger
10-16-2012 12:03 AM
Thanks; that worked. More details if anybody else tries:
1. Install the developer tools.
2. Open the newly-installed "SDK Manager" as Adminstrator, then install "Android SDK Platform-tools".
3. Find adb.exe, and either go to that directory or put it on your path.
4. Run "adb shell" to browse around your Linux file system. Here's the command that copied foo.mp3 to my phone; your directories may vary:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb push C:\temp\foo.mp3 /sdcard/music/
10-16-2012 12:14 AM
@bmihura wrote:
Thanks; that worked. More details if anybody else tries:
1. Install the developer tools.
2. Open the newly-installed "SDK Manager" as Adminstrator, then install "Android SDK Platform-tools".
3. Find adb.exe, and either go to that directory or put it on your path.
4. Run "adb shell" to browse around your Linux file system. Here's the command that copied foo.mp3 to my phone; your directories may vary:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb push C:\temp\foo.mp3 /sdcard/music/
Thanks..
Is it possible that you put the ADB.exe (and state the .exe version) as an attachement to this thread?
I could do it myself, but I don't have the platform-tools installed.
Also if time permits, include a VI on how to call it. Would be perfect for people working with Android and LabVIEW.
That would be great for your fellow LabVIEW brothers and sisters.
Br,
/Roger
01-17-2014 01:44 AM
Hi everybody,
I want to copy files from android to windows using bluetooth. Please can you help my, how in this case is possible read Android directory structure in Labview?
Thanks you very much.