Programmatically transfer file from Windows to Android phone - IDEs, Libraries, & Programming Tools

Hello Community,
By now, everyone knows Android has dropped support for USB Mass Storage access to its folder. Which means a Windows computer can no longer programmatically copy a file from Windows to a USB-connected Android device.
I have a Windows application that needs to be able to drop a text file from time to time onto an Android phone. I also have an Android app that monitors a certain folder on the device and processes those text files as they come in. In the past, all I had to do on the Windows side was to map a drive pointing to the Android device and my Windows app would then be able to copy the files to that drive. But that doesn't work anymore with more recent versions of Android.
The phone and the computer may be located in an environment where no wifi is available or where both devices are not on the same wifi network. The computer may also not have bluetooth capabilities. In other words, the only thing I can count on with certainty is the USB connexion between the phone and the computer.
I could use a batch file calling ADB, but since different phones may have different ADB drivers, it means I can't provide a generic way for my Windows App to transfer a file to any Android phone. And I have no control over which phone gets connected to which computer. In addition, I can't use a GUI based application to transfer the files: my Windows application needs to run unattended, without having to wait for user action. The same is true of the Android application.
I know there are a number of WebDav/FTP/Bluetooth applications I can install on the Android device so that it can expose a folder to outside computers, but they all rely on over the air connectivity. I tried to find information on writing my own Android Server application that would "publish" a folder to the PC to which the phone is connected via USB, but I can't find anything of use in the Android SDK documentation; the USB stuff all pertains to IoT, not to the actual link that gets established between a PC and a phone. I think what I need to do is to write an app that turns the device into some kind of Samba server that's accessible through the USB connecion, but I have no idea where to start looking for documentation on doing it.
Does anyone have any pointers on how to accomplish this?
PS: please don't start asking questions like "Why do you need to drop a file onto the phone", or "Why don't you just make sure Wifi or bluetooth is always available?". I already explained those restrictions and they are there for very good reasons. So thanks for staying on topic.

Hi,
I am also under the same question of "how to transfer a file from PC to Android Device". The only difference is, I have a GUI which prepare data to be transferred. The user can say "proceed" to copy.
Have found any solution for the above question raised ??

Related

Network Directories (for Music, etc)

Has anyone head of a way to trick the OS into thinking a directory is local when it's on the network?
The idea is to share a directory full of music for example, and be able to play any of the 3500 tracks from the popular music players over a 3G connection. Without having to deal with Orb or webpages or any of that nonsense. The interface is key...would be great to do this at the OS level.
There is no "trick" here.
When a directory is not on your actual hard drive the contents needs to be delivered by some protocol over the network.
This means that:
a) There has to be a server on the machine where the directory actually resides.
b) There has to be a matching client on the receiving device.
Presuming that your cell network does not limit ports and your PC has a static IP you can even use windows file sharing to access the content. Of course this would not be very secure over internet.
You could also use and FTP server.
As for "OS level" Win Mobile has the client for windows shares built in so that is about as native as you can go but like I said it is not something you want to use over the internet (unless you have not concerns what so ever about who is poking around your PC).
Thanks levenum. Any clue how one would map the windows share?
The question was aimed at seeing if anyone might know of a client-server application that existed which did the same or better job than WM natively, using windows shares. FTP rarely supports block-level reads, and I'm fairly certain the clients out there don't either (much less map).
Ports etc. would of course be forwarded, and the system would need to be secured. Or even read-only, it doesn't matter...it could just be a r/o samba share on a hardened box. Security can be a non-issue if done right.
At the moment I only see how I can "open path" from File Explorer. I don't see a way to map it though =/
(WM6)
Good point.
I am not sure about mapping, never tried it but here is what I did manage:
First, in Total Commander (PPC version) you can save links to shares.
Now when I open a share with TC I get two things:
1) The transfer is much faster than with the built in explorer (even though there is no change in the connection, the explorer just seems to pause to "think"
2) When I double click on a file which is associated with a program, say an MP3 TC knows to launch the program and give it access to the file without copying it to device first.
I have never tried opening a network file from "open dialog" of a player directly though.
Ahh, okay. Yeah, problem is when trying to open say, a playlist of files. I could see the possibilities of possibly streaming video this way ad-hoc, but without mapping, playing lots of music is pointless. Thanks though.
I found that Resco Explorer can map a file share. I will try it out when I get home and am able to temporarily open a hole in my firewall.

Mounting the Touch Dual/Nike on Linux?

Hey guys! Good looking forum here..
I have an old Ubuntu box that I would like to be able to "talk" to my HTC Touch Dual. Even if its getting access via a "Mass Storage Device" setting of some kind. The ability to transfer files would be a start.
Problem being that there seems to be know way of doing this! At least not without installing software on the phone... which requires a way of transfering the files themselves.
The reason I'm relying on this ubuntu box is as my windows laptop has damaged USB ports that won't allow me to connect any external devices at all. [Its a hardware fault with physical damage to the ports.]
I have heard about using SynCE - but I'm not sure if what I want to do is actually "sync'ing" as such; so whether this tool will work or not is another question all together!
I'm looking for the basic ability to move files - music, videos and photos etc. For testing purposes - then it would also be very desirable for a connection as I'd like to get the Android build up on it!
Cheers in advance!
try installing active sync via Wine
Access to your phone can be done via 'synce'
See http://www.synce.org/moin/SynceInstallation
With that software you can install cabs, access files, synce data etc

Samsung Fridge with wireless TV

This may seem like a strange request but I have this wireless TV, it just so happens that it is attached to a refridgerator. Its made by Samsung and the TV is called an "I.C.E. Pad" and it runs its own software called Popcon. Being the curious engineer that I am, I found a USB connector on it and decided to plug it in. After connecting I noticed that it's just Windows CE that runs this popcon software at startup. Is there a way that I can interrupt the boot process in one of the .hv files to have this thing come up into explorer instead of the popcon software? In the windows folder there is a user.hv, default.hv and boot.hv files, I was told that these are the registry files and the boot.hv is where they startup is. The reason why I want to do this is because the TV runs on 802.11b wireless and would be nice if I can use this as a tablet when not using the TV and I could just run the popcon software when needed. I am in no way experienced with windows mobile or CE and would like to see if someone could help me. I've been able to dump just about everything of the two partitions onto my computer to play with them, just a few DLL's that won't copy due to sharing violations. Thanks for any help.
you should check out some GPS forums, they have more experience with Windows CE devices since a lot of GPS PNA devices are build on Win CE. There you will be able to find some tools to interrupt the boot process I suppose. A lot of PNA devices can boot custom software by using special files and folders on the storage card, do you have a storage card?
good luck...
VOODOOS!L
There is a connector next to the USB connector but have no idea what is for but a storage card woudn't fit, no matter what kind.
I'll try the GPS forums, thanks.
I ran into similar issues with a post I made about my own WinCE device. The thing about this forum is, there are loads of people who can answer questions about Windows Mobile, which is based on WinCE, but actually a seperate OS, since they share a kernel but much else is different.
Good luck finding some help with your WinCE device, but it seems most people here are only in their comfort area when talking about the Windows Mobile OS, which is only *based on* WinCE and is otherwise a completely different OS.

Bluetooth File Transfer.

I'm looking to enable Blue-tooth file transfer, as I don't want to have to plug in my phone to my laptop everytime I want to exchange files. Is this possible?
Hi,
Yes,
Just open the Bluetooth settings in Settings -> Menu -> All Settings
?
I know how to open a Bluetooth connection, I want to know how to transfer files from my laptop to my phone, and vice versa. Any clue on how to do that?
Right click on file, send to, Bluetooth? Would be a good idea to say what OS you're on.
Heartbreak said:
I know how to open a Bluetooth connection, I want to know how to transfer files from my laptop to my phone, and vice versa. Any clue on how to do that?
Click to expand...
Click to collapse
You'll need to pair the devices first if you haven't already.
What operating system are you using on your laptop? Windows? Mac?
Laptop OS is Windows 7, and T-Mobile USA HD2, the devices are already linked. What would be the next step? Any help is appreciated.
Heartbreak said:
Laptop OS is Windows 7, and T-Mobile USA HD2, the devices are already linked. What would be the next step? Any help is appreciated.
Click to expand...
Click to collapse
Have you connected the phone via ActiveSync using the USB cable yet?
Its not necessary to do so, but it might make things a bit quicker.
When you right-click on a file on your laptop, and hover your mouse pointer over "Send To", do you have "Bluetooth Device" listed?
They are linked, and they recognize each other, but when I right click on a picture and go to "Send to" there is no option for Bluetooth Devices. Are there any options that should be checked on the phone or computer?
Heartbreak said:
They are linked, and they recognize each other, but when I right click on a picture and go to "Send to" there is no option for Bluetooth Devices. Are there any options that should be checked on the phone or computer?
Click to expand...
Click to collapse
Is there a Bluetooth icon down by the clock on the Start/Task bar?
If so, right-click on it and go to Open Settings.
Under "Connections" (about halfway down the window) do you have both tickboxes ticked?
Yea, they are both checked. It tries to install a driver and fails when I attempt to troubleshoot the phone.
Just to bring you my experience. I do not have a BT dongle on my desktop which runs seven x64 yet I prefer to use the usb cable which is always plugged, yet the few times I installed a bt dongle here I could quite easily send files, even if I don't remember the exact path
Anyway, with my ubuntu laptop it's as immediate as choosing "browse files on <devicename>" and it just opens the microsd contents, where you can transfer files to/from, so probably there's something similar in windows that I am forgetting about?
What I know is that as soon as you have BT working on your PC it shoudn't need a driver, the OBEX protocol is a standard so no matter what device you connected, if it offers OBEX, the pc knows how to handle transfers no matter what the device is
ephestione said:
Just to bring you my experience. I do not have a BT dongle on my desktop which runs seven x64 yet I prefer to use the usb cable which is always plugged, yet the few times I installed a bt dongle here I could quite easily send files, even if I don't remember the exact path
Anyway, with my ubuntu laptop it's as immediate as choosing "browse files on <devicename>" and it just opens the microsd contents, where you can transfer files to/from, so probably there's something similar in windows that I am forgetting about?
What I know is that as soon as you have BT working on your PC it shoudn't need a driver, the OBEX protocol is a standard so no matter what device you connected, if it offers OBEX, the pc knows how to handle transfers no matter what the device is
Click to expand...
Click to collapse
What you have with your Ubuntu laptop, is exactly, while it would be awesome to be able to send and recieve files back and forth from the two devices, what would be ideal is the ability to browse through the contents of the device, and MicroSD, wirelessly over BT. I'm wondering if Windows 7 offers something like that or maybe a certain program for 7, might offer that functionality.
Heartbreak said:
What you have with your Ubuntu laptop, is exactly, while it would be awesome to be able to send and recieve files back and forth from the two devices, what would be ideal is the ability to browse through the contents of the device, and MicroSD, wirelessly over BT. I'm wondering if Windows 7 offers something like that or maybe a certain program for 7, might offer that functionality.
Click to expand...
Click to collapse
Windows Mobile Device Center should already be installed and offers that.
Also you have to enable Bluetooth file transfer (object push) in bluetooth settings in order for your phone to receive anything. No idea why this is disabled by default.
Heartbreak said:
I'm looking to enable Blue-tooth file transfer, as I don't want to have to plug in my phone to my laptop everytime I want to exchange files. Is this possible?
Click to expand...
Click to collapse
It works nicely with the right setup in Linux
PCLinuxOS 2010 with Blueman and Nautilus [/smug]
cozzykim said:
It works nicely with the right setup in Linux
PCLinuxOS 2010 with Blueman and Nautilus [/smug]
Click to expand...
Click to collapse
yeah, I agree, yet the OP needs it under Win 7
Probably the input by VidMan is correct, he needs to enable the OBEX on ther HD2 as well, from bluetooth settings

How can I allow Windows programs to access the phone?

I don't just mean Windows Explorer. I mean other programs.
I have 6.0.1 MagMa ROM. Set to MTP and turned on USB debugging. Windows Explorer can read the device contents, but since the phone appears as an actual phone in Explorer and not just a separate drive, I can't get other programs to recognize the phone's existence. Even Android-specific Windows programs don't recognize it. A couple programs seem to know there's a phone connected but tell me to turn on USB debugging even though it's on already.
How can I make the phone appear as just a separate drive or change settings in Android/Windows to make the phone searchable in Windows programs?

Categories

Resources