I have been trying to write an app that generates a personal WiFi hotspot from an android device, that funnels webpage and file download requests through the host's mobile data connection. I have managed to request and download the files, but they are being stored under the phone, on the sdcard\toSendOverWifi\ folder I created.
Quick list of activities done:
Recieving device sends webpage/file HTML address request to host
Host downloads file over 3g/4g/LTE data connection
Host saves file(s) to sdcard\toSendOverWifi\
(not done) host sends file out to recieving device (only connection)
Ihave not found a class and/or method to send the downloaded files over WiFi to other devices.
What class/method do I need to accomplish this? And is it compatible with non-rooted devices?
You need to use TCP/IP sockets as usual.
Related
I'm trying to send data from android to a computer via USB,
I found the USB Accessory introduction, http://developer.android.com/guide/topics/connectivity/usb/accessory.html (Basically I want to send a few bytes to a programm on the computer) So, am i right on using the accessory on android? What would i use for the pc programm, and can I/ Do i have to create a socket connection from my application to the programm
You will need access to the USB device plugged in to the PC which lets you send USB Control Request and Bulk Transfer requests.
If you are using linux, you could try libusb - which is pretty straight forward to use. For windows am not sure though.
I have been working on a desktop app using AppJS (HTML5, JQUERY). In my application, I ask user to input a folder path of his/her local machine (where application is running) and store that info in my database on the server.
I have to push a file to that folder (on the user's machine) whenever the file gets updated on the server. how can I achieve this? how I can keep client and the server in sync so that server can push that file to local machine.
I have written the scheduler app for the server which will push the file down to client. But, I am not getting how to push that file to specific client. what parameters I need to push the file to client like client's machine MAC Address or something else.
how dropbox does sync?
Please help!!!
If you are able to run nodejs on the server then you can use socket.io to communicate between client and server. Think of it like a chatroom like msn or skype. As users open the appjs application it can connect to the server.
When you have a file to push send a message like "updatedFile" and then list the url. Clients can then download the file and save to the local disk.
This way all connected clients can download updates and no need to poll all of the time - just have websocket open.
When a client connects it could send a message changesSince timestamp and receive a list of all files changed on server since that time which it can then download and save to local disk one by one.
You can try using tools like rsync which can directly help you achieve this.
http://en.wikipedia.org/wiki/Rsync
I'm now writing a project on android and my program must able to transfer / replace a file to my computer with certain address to sync my app with my app on my computer and reverse (from PC to device) only by pressing a single button in my program.
Use http://developer.android.com/tools/help/adb.html#forwardports to forward a TCP/IP connection over the USB cable. Your app on the phone can act as a TCP server and receive arbitrary commands.
The downside of this solution is that you have to bundle the adb executable with your program and the user must have the proper drivers installed (that means mass-storage connection is not enough). The sources for adb are available, if you want.
I am creating an app that will connect to a device via Bluetooth depending on a particular UUID, and i am successful in that.
Now my next task is as soon as I connect to that device it should download a file automatically once I am paired with the device. The other device just has to accept my connection.
how can I achieve this?
FTP or GOEP (over OBEX) profile?
It's not clear from your post but I'm going to assume you have control on both devices.
Have one device act as the FTP server and put the file to be downloaded in a designated FTP directory on that device.
The other device can then connect and download that file using the FTP profile over Bluetooth.
I have two devices that connect to each other with bluetooth.
Now I have made a socket connection between the two and I want to send a file/upload to the ip address but not to the device.
Not just a file but an Index.html file, so you can actually view the file from your desktop's browser.
In a source, i saw that this is possible on the WiFi IP adress with the port. But I can't find how they exactly do it.
So if you go to e.g. http://192.168.1.xxx:10130 in your browser you could actually see the index.html file as a normal webpage. Is this possible, and how would you achieve this, toghether with sending images.
This is something I really need.