i'm working in an android app for comunication with a wireless sensors network, i save the data that i receive from the network in a record file, and now, i want to send that file (normally .txt) to a computer, kinda "server", by WiFi or 3G.
I already know use sockets communication if the "server" is connected to the same WiFi conexion, but the problem appears if i want maybe to send the file to a pc in other place, connected to other LAN. I've been reading about WEBSERVICES but i have some doubts about the communication with web sites, because i don't have one. Maybe, i should create a server online to have some URL where send the record files. (i don't know how to create ir neither :/)
to sum up, i want to send a file from a device (for example with ip 138.100.XX.XX) to another terminal, a pc (for example with ip 192.21.XX.XX)
¿any good tutorial about this? any advice?? what do you think about??
Thank you very much, also for reading :)
Laura
This link may have some help Android device to PC's socket connection.
(This talks about basic connection to other PC before sending data/files)
Related
I have created an an app on my android, it connect to my PC with bluetooth, this app send data via bluetooth.
How can I see this received data on my pc?
I use dont use a plug module on my pc it's the incorporate bluetooth, so he dont have a serial port
I have try find on google but all speak of transfered file.
Probably the easiest way would be to open up a terminal on the PC that has an open connection to the appropriate COMM port (physical or virtual). If you have this connection open you can then see any data that comes in and accordingly can send data back out.
Basically, on either end you have a bluetooth connection. That is a replacement for a cable in essence. Assuming you are using a serial port profile this will allow bytes of data to be sent back and forth over Bluetooth. I believe you are at that stage.
The port on your PC receives the data but has no means of displaying it. An application such as 'SERIAL' for Mac OS, HyperTerminal or similar for Windows will be what you need to see the data.
Hope this helps. Good luck.
(Another way would be to write an application that interfaces to the serial port on your PC but, I wouldn't think that would be worth your while... the terminal application is what you need) :)
This website has a list of useful applications that will help you.
http://www.usconverters.com/index.php?main_page=page&id=15&zenid=4835fe9edad4ba7966f4cf6533711315
I have no networking background. I would like to apologize if the terms that I used in my question below are incorrect. Your help is appreciated.
1) Recently, I am developing an android app which involves google map api and xampp. I can access database on the phone browser(192.168.x.x:8080/folder/getdetail.php) when my android phone (4.1.2) is connected to my pc and used my pc's internet connection. But after I unplugged the usb from my pc and used wifi, I no longer can access the same link as mentioned above on my phone. May I know what is the problem and what tools or skills that I need to look for?
(2) If the above mentioned problem is solved, I am also looking forward on the way to make xampp to be accessible over the internet. For instance, my pc serves as a server at home and I can connect to the server and retrieve some data from the db when i am elsewhere.
P/S: My pc is using wireless internet connection.
Unfortunately there's too few information on your network and your pc. Let's assume you're using your Windows-PC and Phone on the same Network and you didn't change any web server settings and didn't move the XAMPP folder.
XAMPP is running an apache Server which is listening on TCP Port 80.
First you should check your firewall. Windows is using 3 different Profiles.
if you connect your phone and an additional network is set up with a different profile this could be the reason.
http://www.windows7library.com/blog/wp-content/uploads/2011/06/Network-and-Sharing-Center.jpg
If you want to access your XAMMP from the internet you should forward a TCP port to port 80 on your PCs LAN IP-Address.
http://en.kioskea.net/contents/280-nat-network-address-translation-port-forwarding-and-port-trigg
http: //en.wikipedia.org/wiki/Port_forwarding
But please only do that for testing purpose since outdated webservers/modules/scripts can actually harm your system. Use XAMPP only for development and testing.
My advice if you still want to do it forward some other port >10000 to your local port 80.
To access it you have to add the port to your url like this http: //127.0.0.1:8080/
I need to send an image file from the mobile to the server(where the server will save it to the hard disk). I have wrote both the android mobile part and the server side. I need to test the code before deploying to the server. Will the code work if I connect the mobile to the WI-Fi network through which I can have a LAN connection to the system? Is there any way I can test the code with out using a WI-Fi connection(ie Connecting phone to the system via the usb cable and then forming a LAN or something)? Please voice your valuable opinion in these stuff.
When I was testing my server-side I didn't find any other way rather than connecting via wifi, this way it was working just fine (in your code you need to use ipv4, not localhost, just as reminder). I'm not good with network stuff, but I don't think it's possible using usb to create some kind of LAN.
Have u tried from emulator? How to connect to my http://localhost web server from Android Emulator in Eclipse
What is the easiest way to get information from Andriod to PC via WIFI?
I'm doing an app that receives SMS messages. I want to save the information in a database on a Windows computer, right after the messages have been received.
I've tried:
HttpPost (could not get AsyncTask to work)
JDBC (just does not work)
... and even WebView (could not get findViewById work - seems buggy).
I can start the internal web browser on an external link by code, so it's not a network problem.
If there is a better and easier way please give a simple example.
I hope you have checked the other related questions. You can code a client and server application for your android device and pc. See wireless connection between mobile device and pc for detaield answer.
You can use sockets and listen on a particular port on your PC and then with app you can communicate with it. See how to setup connection between PC and android devices through wifi . These questions would help you to get what you want.
If you have any specific problem with your implementation, you may follow up with code sniplet and your problem. Hope this helps.
Have you tried setting up a TCP server on the device and then sending to the pc with the pc as a client?
I want to connect two phones over 3G or GPRS to send a stream of data continually. One phone will act as client that will send data and the other phone will act as the server to receive and display the same data. Is it possible to stream data without using a server?
No. You will have to use some kind of server definitely.
Not really, I have been working on a similar project using TCP/UDP packets, but the big issue is with finding the other phone.
The best way is to use a system similar to O-Auth to connect with an external server on the internet
and send/recive data through that, but I don't have much experience with that.
My project used UDP to find a server on a wifi network and get its ip, then connect to it through tcp,
but you just as easily use a server on the web to do it over any mobile data connection.
If you wanted I will gladly send you some of my tcp code as a starting point.
Swift
You can't connect two devices directly though the cellular data. You need an intermediate server.
If on the other hand you are going to connect them through wifi, then you can use sockets to connect both of them together.
If the distance between both the devices is less, then you can also try out transfer over bluetooth.