I am currently developing the android application in which I have to upload a file (any normal document) from my android device to any other PC/laptop. But this should be done only with the use of any common WiFi network. (Use of Internet connection or WiFi-Direct functionality is not allowed.)
So my question is how to share files from android device to PC/laptop by using only common WiFi network ?
I think xender does the same thing for android to android device.
But I have to do it for android device to PC/laptop.
You can use a Socket for it. The PC can be server, and the phone can be client. Then connect them. After that, you can send the thing you want by sending byte[] in android socket.
By the way, if you can use a USB line to connect PC with phone, you can try LocalSocket in android and adb forward in PC.
Related
I am trying to make an android application that will stream live sensor data (e.g. accelerometer, etc) from my android device to my desktop computer.
My android device is connected to a WiFi network and my desktop computer is connected to a network with an Ethernet cable.
There are android applications available that send data from an android device to a PC via WiFi, but both devices must be connected to the same network.
Is there a way to transfer data if the two devices are connected to different networks?
Thank you!
Due to the fact that nearly every network sits behind a firewall (in most cases your home router/nat-device) you need to implement port-forwarding to access network 2 from network 1.
Another aproach would be to set up a VPN (f.i. with SSH) between the 2 hosts.
If your PC is directly connected to the internet, and has a public ip (that means, if you have NOT a RFC 1918 Adress), then you are able to directly connect to that ip by just entering that ip. If not, you need to implement something to get behind the firewall.
Simple answer; to stream data between a PC and an Android device each residing on different networks you need an intermediate server to pass the data through.
Now, if this just a small app that you are doing for your own purpose I suggest using the free version of Firebase (see https://www.firebase.com/). Their sample application that you'll find there, a simple chat service, does pretty much exactly what you need. Simply let the application on your PC (preferably a web app) read the "messages" that you send from your Android device.
i have an android device that has an app that i wrote installed on it. i wanted to send files from it to a windows pc by using bluetooth, and by adding code only to the app on the android phone.
the documentation on the android developers website says that one of the devices must be set up as a server to receive the request for a connection from the client side of the bluetooth connection.
if i try to initiate the connection from the android app side then that side will be the client, and the windows desktop pc will be the server side. is this possible if i am not writing any code for the windows pc and only using it's built in software that is made to handle the bluetooth hardware?
that would mean that the the included software on the windows pc is set in server mode alwasys waiting for a connection attempt from a bluetooth client, is this true?
Visit these links. Hope these help
http://www.forward.com.au/pfod/serialBluetoothConnections/index.html
http://blackmarketserver.com/blog/2010/11/23/bluetooth-file-transfer-between-android-2-2-and-windows-7
It is a possible duplicate of this question.
Please have a look
access of files on windows pc from android device, bluetooth?
Is there a way ( protocol ?) to share & exchange files between pc with Windows os and a mobile phone with Android os over WiFi ?
For an Ad Hoc Android to PC connection (Per the source below):
Connect your computer with virtual hotspot created by Android device.
Install any FTP Server app on Android device. It'll NOT give you IP of device for sure.
In your computer, find IP of Default Gateway of Wi-Fi network of Step 1 (In Windows, you can use ipconfig cmd command). Its the IP of your device.
Use any FTP Client software on computer. Use ftp://IP:Port (Port is generally configurable in FTP server app). Enter username & password configured in FTP Server app. Done!
Then they said "After some testing with different settings I got it to work flawlessly, thank you very much. For anyone else looking to do this: I used Android Wifi Tether to start the network using Softap mode, connected to it with the computer, started an FTP server (some server apps might need you to enable 3G mode, even though 3G data isn't actually used, you can turn data connections off if you're paranoid."
Source
For Internet Based Connections:
You may simply want to transfer the files to a hosted server with push notifications to "pull" down the files to the various devices.
Scope this out: http://www.eckstreme.net/
The coder of that app may be willing to help you get off to a better start, email him.
Here are the steps:
Connect your pc and android device to the same Wifi Network. This can be an ad-hoc network created on the android device or your home/work wifi network.
To create an ad-hoc network on your device go to Settings->More (under wireless networks)->Tethering & portable hotspot and tick the portable wifi hostspot option.
Install a FTP server app like https://play.google.com/store/apps/details?id=com.medhaapps.wififtpserver from android marketplace.
Start the app on the device and connect to the URL provided by the app from PC.
Transfer files to/from device from/to PC
I am using USB and connect it to the android device and Pc..can I send message from Pc to device and Device to pc?
Please help me
Thanks
The most straightforward way to communicate between an android device and a PC is either to use an Internet service, or to connect the android device to the same wifi access point as the PC and use normal TCP networking methods.
If USB debugging is enabled on the android device and it is connected to a pc with the ADB tool from the sdk, then you can set up an ADB port forward. This will allow the PC to make a TCP connection to the android device, and then bidirectional traffic can flow. However, the port forward does not itself allow the android device to initiate a connection to the PC, though you can accomplish this by setting up tunneling (potential with ssh or some other solution).
Some implementations of tethering (use the android device to provide Internet to the PC) have the side effect of establishing a general network connection between the android device and the PC, at which point either side could potentially initiate a connection. However, it would take some customization to keep the PC from trying to do its networking through the android device, potentially using up your mobile service plan unnecessarily.
Is there a method to tether (USB wired) the GPS data from and Android phone to PC? I am using a GPSTether app currently that is based on the gpsd project.
I am loooking for alternatives that give more control and is less buggy than that app. Also, is there another method of doing this without using any third party apps?
I am working on a location aware software project and want to read the GPS data periodically. The GPSTether app does exactly that on a TCP port over telnet.
The ideal situation here would be to have a serial port over USB connection between your Android phone and your PC, and to stream NMEA across it from the phone. Unfortunately Android doesn't support USB in such a way natively.
GPSTether is a "hack" using the adb forwarding debug bridge in order to create the link between phone and PC, and then reads the NMEA from the location manager and sends it over the TCP/IP link created by adb forwarding.
If you are finding GPSTether too buggy, you really only have two choices either a) implement a version of GPSTether yourself, or b) come up with a different method for doing this. Both will involve quite a bit of coding.
For b), you might want to consider - writing NMEA to a file on the phone while it is connected to the PC as a USB Mass Storage device, and reading updates to the file from the PC regularly.
Or perhaps you could get a bluetooth dongle for your PC and "tether" the phone to the PC over bluetooth, by creating a bluetooth COM port connection for the GPS using something like the Android app BlueNMEA.
Or you could copy an FTP client program, and write the file to an FTP server on your PC over a WiFi connection (which would allow you to have the phone on the other side of the world from the PC).
This can be done using ShareGPS App available in Google Play Market and Franson GPSgate Client. You will have to redirect the android GPS NMEA signal to COM ports using these tools. In addition you will require to download AndroidSDK manager.
For detailed instruction see link below.:
http://sharedroid.jillybunch.com/user.html
Use Blue-NMEA http://max.kellermann.name/projects/blue-nmea/ on your android to send GPS NMEA data on bluetooth or on a local tcp server which can be accessed on PC by usb tethering or on WI-FI connection.
use VSPE (virtual serial port emulator) by eterlogic http://www.eterlogic.com/Products.VSPE.html (look for ur version of windows) and redirect data from tcp port to a com port of your choice and u r done with the settings. now configure 'google earth' ,'see you', 'GPSdata logger' or any other soft to listen to this com port which oftenly they will do by themselves.
http://max.kellermann.name/projects/blue-nmea/
sends nmea via bt com port or on a tcp port. make sure you read the readme to avoid common obstacles.
This is really late, but I have an old LG-P350 and on device manager it shows an NMEA interface. I don't really know how to use it though.