I'm trying to view the protocol on an app I'm using to see how it works but I can't find any traffic (except netbios traffic) coming from my Android phone (HTC Aria).
I don't have any way of getting any hardware for this and i'm using the phone on my router's wifi and the PC is directly connected to my switch.
you probably want to use something like Charles SSL...point your phone at some kind of Proxy server that captures traffic.
If you connect the phone and your computer w/ Wireshark to the same network via a router (not a switch which won't show you shared traffic), you can use Wireshark to monitor all the traffic to you phone.
I'm not sure how you are attempting to use WireShark in this scenario, but what you should do is use a packet sniffer like Shark for Root on your android phone.
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 am using ubuntu 10.04 LTS and have a android ICS device.
I created a wifi-hotspot in my android device. I am connecting the my ubuntu via the wifi-hotspot created above. I stared capturing the packets from wireshark in my pc.
I am unable to see the traffic generated from the device, rather I can see only the traffic from the pc.
Am I missing something or wrong?
You aren't seeing the traffic from the phone because your computer is only receiving and sending packets intended for the computer.
Maybe this will help? http://www.wireshark.org/faq.html#promiscsniff
It is possible that your wireless interface device either isn't in promiscuous mode or doesn't support it.
If i were you, i would scan for all hosts alive in the subnet.Sure android device acts as a hotspot using NAT or something, i'm sure.But the catch is it's moreover a server to which only your pc or whatever might be connected, i guess it would be your lapton. But android itself uses the external ip like service bsnl or something. So it's not at all a client connected to a router or something.
Still if you run an nmap scan you would surely see the default gateway ip, which is of the hotspot.
So, it's enough said right.
I have an Android device. I need to forward packets arriving at the external IP to an internal IP to which Android is connected to.
I would like to know if I can write an App to enable this forwarding.
Also, if this doesn't what is the conventional way this is done. If I should use some scripts where should I place them??
And oh, can I test this using an android emulator??
Thanks.
It is may be possible to emulate a behavior like port forwarding but not routing for non rooted devices.
Also if you want to forward traffic from the mobile network to the wlan this is so far I know not possible. Android switches the connetion between mobile network and wlan. It is not possible to use both. Except some hot spot use cases.
I'm working on a project to automate some tasks (such as play a song, play a video, receive bluetooth data, etc) on an Android phone from a PC.
Basically the PC will send a notifier to the phone and an app or something on the phone would then process the notifier and do 'something'. The opposite of this really:
http://code.google.com/p/android-notifier/
I've seen some examples showing how to send commands to an Android listener app or service via a network connection, but in this case, I would much rather the transmission be over a physical connection.
USB
Ideally, I'd like the connection to be via the USB port. But I've seen some posts online that suggest that the SDK does not natively support this. (Android apps, communicating with a device plugged in the USB port).
Is there some other SDK/API out there that makes this easier?
I've seen some posts on the ADB, but don't really get it... Would that work?
(http://developer.android.com/guide/developing/tools/adb.html)
Serial over USB
I've also seen some sites that show how to use a breakoutbox to perform bi-directional serial communication, but only with the G1. Is this possible with newer phones?
The Phone
I'm open to really any newish phone. I'm currently looking at the Galaxy S, because it has the video out through the headphone jack. I'm open to rooting if need be.
Implement a HTTP server in your app, then put your phone in USB Tether mode. This will create a local network between your phone and your PC. You should then be able to send HTTP request or create websockets using the phone's ip.
EDIT : I tested it, and it works, see here
What you can do is the phone acting as a server and then use adb to forward ports [1].
In this scenario the pc app would connect to localhost which would be redirected to the app on the phone via the usb cable.
But if you go this way, you might just as well simply connect directly to the phone's ip (without the adb port forwarding)...
[1] http://developer.android.com/guide/developing/tools/adb.html#forwardports
I'm developing client/server software for Android.
While connected to the phone via USB debugging, I'd like to access the webserver I'm running on my developement PC - using the USB connection.
Is that possible and if so, how ?
I stumbled upon the answer after a night sleep.
Enabling USB tethering on my phone (N1, 2.2.1) gives it and the host computer an IP address. The phone can communicate with my web server running on my developement machine!
(Chris, the rumors are right)
Just make sure your web server is listening on that IP address. For apache, use the line
Listen 80
or
Listen x.x.x.x:80
(x.x.x.x being address of your android tunnel)
The easiest way to do it is via wireless. If you don't have wireless, I'd say bite the bullet and get it, it's going to be a necessity for testing anyway :)
Typically the USB only supports connections from the development machine to the phone (via adb port forwards) and not the other way around. Of course once a connection is created data can move bidirectionally. One could use this to build a tunneling proxy web proxy (one connection in from the development machine to a daemon running on the phone, outbound connections from the phone then tunnel through this)
I have heard rumors though that what you want to do - often called reverse tethering - may be supported in some more recent devices.
Kevin's wifi suggestion may be the simplest with a real device.
On the other hand, unlike typical phones, the android emulator can directly access the development machine's loopback interface at an alias address given in the documentation.