PC communication with android through USB - android

I need some guidance..
I have an application (.net) on my PC (windows) that needs to send some data or file (JSON format) through USB to android tablet (4.4.2). I want to design a new app which could accept this data.
I did some research over internet and found some options to implement this but still all of it is not so clear for me:
My first option to do this is – port forwarding by adb shell. My PC need to have adb installed and some drivers. Is it right? Is it possible that .net exe will use this way on pc side?
Second option – my PC should be "USB host" and android tablet should be "USB accessory". Is it better way? And again, is it possible that .net application will implement it?
Last option is use WPD api.. https://github.com/geersch/WPD/blob/master/src/part-3/README.md
Which one is better?
I'll be glad to hear some clarifications on this subject or any recommendations or if there is some other way to do this.
Thanks a lot

Related

USB Type C as TCP/IP?

Let's say I connect my Android phone to Windows PC using USB Type C. Is it possible to access TCP/IP services in the PC from my Android phone ? For example, connect to SQL Database in my Windows PC.
Thanks!
EDIT:
Why the downvote? I know this is obviously not the normal way. Therefore, I am asking for possibility.

USB communication between Android and PC without ADB

I just want to know is there a way to communicate between PC and Android device without the need of ADB.
Something like the Android device will become USB Host and read the data that PC send thought USB port.
Is it possible?
BTW I also want to ask is there any information in the latency when doing something like that. I need the latency lower than 15 ms.
Thank

How to connect an Android app with a c++ program on pc via USB

Require a method of connecting an android app with a C++ program on PC via USB, which would allow the android app to send a constant stream of real time data (mostly integer values) to a c++ program on PC via USB and carry out actions accordingly. I know it is easier to do this by wifi or bluetooth, but I want to carry out the connection using USB.
I have searched the net alot for similar questions, and tried many code, but non of them have worked for me. I would greatly appreciate an example code for the c++ portion, and it's android counterpart that allow for this to be done easily.
You could use the USB Tethering option on the phone. This should work with Android 4.4 and the most popular Linux Distributions out of the box. Then you are able use TCP/IP between Android and the PC. You could use an UDP multicast based protocol for service discovery (e.g. Multicast DNS, NSD or SSDP) if you need to avoid entering IP addresses on one side.
One way of doing this is to setup your pc application to talk to the android device as an android accessory. http://developer.android.com/guide/topics/connectivity/usb/accessory.html
This will allow both applications to send whatever data they want over usb, Google do provide source code for doing this with the accessory development kit http://developer.android.com/tools/adk/index.html
I don't have any example source code but there might be some out there if you search.
You can use ADB and call custom commands on your Android device. This commands should just type integers to stdout. As an option, you can use standard shell commands like cat and make your Android app write output integers to files in some directory where ADB can read it.
You can have Android behave like a USB device with a USB CDC (ACM) interface, which is seen as a serial port on the PC (COMx on Windows, /dev/ttyXXX on Linux). On C++ (PC) side, this would be "regular" serial port handling, while on Android there are several libraries for such purposes, though I never used one so I can't recommend any.

How can I use my android device to control PC by using USB

I am wonder to use my android device to control Pc by USB like a Joystick,but i have no idea about it.Is there any suggestions to do this ?
Thanks!
First, you need to make a Socket connection between you android device and you PC.
ADB is a find choice, send your command to your pc Clinet.Parse it, and deal with it.

Desktop PC and Android interface

I'm thinking to develop a PC desktop program to get application setting from android phone, install/uninstall apk application, sync photos/videos/music and display a web content.
Initial thought is to use .Net to write desktop program and shell ADB tool to do installation and file copy on android phone. However seems like advanced feature of ADB only works on a rooted android phone.
Is there an communication interface between windows and android system? Based on an app called "Android Manager" by Mobile Action, it seems that it can pull out what apps are installed on the phone but seems like this cannot be done by ADB alone without root access.
I would like to do the transfer of information using USB cable. Any thoughts where to research on? Thanks much
If you want to use the USB cable you can only use ADB, but you can use ADB to set up a socket between your pc and the mobile device. Both sides can then connect to this socket and use it to transmit data.

Categories

Resources