Easiest way to get information from Android to PC via WIFI? - android

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?

Related

How see data on bluetooth?

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

Server on an android device

I'm creating an android app that should communicate with a PC application.
At first, I wrote the PC application as the server side of the connection (on Python),
but for some reasons I want to change it and to make the android app to the server side.
My problem is that the connection should be over the internet.
As I know, the android device (phone) is inside a private network of the cellular company,
which makes a problem to access the device over the internet.
Is there any way that the android device will be accessed directly from the internet?
Yes. IF you have access to TCP/UDP ports (they are not blocked on your private domain),
give a shot to Java Socket Programming.
Whether the server is mobile or PC is totally up to you.
If you need to learn about socket programming, the best place to start is this tutorial on official Oracle documentation website.
This is yet another learning by example tutorial.

Access/Edit data on android device from pc via internet (different networks)

In the app i'm making, i want the user to be able to access the android phone(not the emulator) from pc via internet (different network connections) (not via usb).
I've been experimenting about this subject since i'm just a beginner in android and in networking.
This question android socket communication through internet is related to what i'm asking, but there, the communication is made between windows and emulator.
Is it possible to make this communication and to be able to edit my contacts for example?
If yes, can someone please provide some code snippet?
Thank you.

sending files to a remote pc (webservices, create a server, internet com..)?

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)

PC server, Android client. UDP. Client does not receive packets from server

I have been able to set up my client/server program so the server runs on the PC and the client on the Android. Either an emulator or a device.
The server receives data from the client, but the client doesn't receive data from the server(all UDP). Eventhough the server is getting the client's address from recvfrom.
I want to make it work in both the Android emulator and the Android device(my phone).
I read that the Android emulator has a virtual router. I tried giving the client the ip 10.0.2.2 when running on the same computer as the server, but that didn't solve it.
There is communication between the client and server, it's just one sided.
Anything I am missing?
I am using Berkley sockets on JNI\C++ for Android, and winsock2 for the PC server.
Edit:
I was able to make it work! So UDP can work on Android both ways!
The issue was that select on winsock2 has the first parameter unused, while on linux\Android it is used and called nfds. Sending NULL to that parameter(like I did in winsock2), basically made select always return 0.
Thanks for the help fge.
I was wondering if you would post a link to source code on the udp packet receiving for android topic, there's a lot of questions with no simple answers regarding it. I myself can't find a simple program for udp packet send from pc to android.

Categories

Resources