So my problem is I want to make an app that can connect to the desktop and communicate with the device in a real production app.... not through usb debugging. In short an app that will connect to a pc and communicate with it either through usb or bluetooth or websocket ports. But I want to do this in a production app, where the user won't enable usb debugging. Kinda like iot
Is there any way i can do so
Related
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.
In order to learn how other applications connect to internet services I would like to monitor the traffic via Wireshark on my Linux PC. I know there are Wireshark tools for Android, but these require that the phone is rooted which mine isn't.
I have read several places that if the phone and the pc running wireshark use the same wifi connection, it is possible to monitor the traffic from Wireshark on the pc if it is running in promiscous mode.
I have tried that but I can't see any traffic except this:
77 4.638965 ZygateCo_4f:70:27 Htc_b7:a4:78 LLC I, N(R)=0, N(S)=92; DSAP 0xe2 Individual, SSAP 0x36 Response
Apart from these lines (which I have no clue what means) there is no traffic from the phone to see in Wireshark.
Are the further steps to perform in order to have this setup working?
Alternatively, are there other ways to intercept the traffic on a un-rooted phone?
(One way is to setup the pc as an access point and then connect the phone to it, but I have not succeeded in setting up my linux pc (Debian) as an AP)
WireShark monitors only netwrok card on your computer. However, you can monitor the traffic from your phone by using hub. Follow these steps to do this:
Connect your ethernet cable (internet) to the uplink port of the hub.
Connect ur computer that runs wireshark to one of the port on the hub.
Use another port on the hub and connect it to a router that has wifi.
Connect your phone to the wireless router.
run wireshark!
The reason of using hub is because a hub does forward traffic to all ports.
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 have an app developed and deployed on my HTC mobile phone. I am able to debug this in Eclipse with the USB driver SDK. The mobile phone appears now in the hardware manager ADB interface.
I would now be able to send data through this USB connection to the mobile phone which my app is able to handle. I know some tethering software which does this, therefore there must be a way to communicate with user data and with my app.