PC (java program) and Android communication over USB - java

I need to develop android application that will communicate with PC over USB. The PC software will send some data and android app need to display received data.
I already did this communication over sockets (pc server, android client), but i need to cover situation if there is no internet connection. What is the best way to do this?

Related

PC to Android communication over USB cable

I need to make communication between PC software (written in java) and android app over usb cable. The PC software will send some data (Strings) to Android app witch will accept those strings and do some action depending on the message received.
What is the best way to do this?
I am looking all over the internet and can't find any solution to this. If someone has example of this communication i would be very grateful.
I already done this communication over sockets, put i need to cover situation if there is no router or internet connection.
Thank you
Check following article. I guess similar question to your on SO.
If you want to communicate between Android USB device and some USB host you need to use the accessory mode (https://developer.android.com/guide/topics/connectivity/usb/). But this mode requires special driver support on the USB host side (which is your PC).

PC to Android USB streaming data using OTG USB - How?

I am trying to accomplish communication between PC Java Application and an Android Application as shown in the diagram.
I want to be able to send streams of Strings from PC JAVA app to Android Application (Android studio).
How can this be accomplished using OTG USB and direct communication (COM port) (I know it can be done over TCP and also using ADB protocol, but I am looking for something else, directly using USB/OTG).
Any suggestions/references ?
you have use this application
https://play.google.com/store/apps/details?id=info.dvkr.screenstream&hl=en_IN
this application code also avelable on Github
https://github.com/dkrivoruchko/ScreenStream

biometric authentication java aplication. how to build the connection between an smartphone and application

I have to develop an biometric authentication application.
The application will be written in java and it will be an desktop app, I want to use my smartphone for the fingerprint sensor, but I don`t know how to build this connection betwenn application and phone.
The main application will be installed on a computer without web.
I would be grateful if you have any idea or examples how to do this. Thank you!
You should have an app on your smartphone which uses the fingerprint authentication API.
If you are looking to use an android phone, you can refer this
https://developer.android.com/about/versions/marshmallow/android-6.0#fingerprint-authentication
You can create a simple APP using this API.
When user authenticates, then you can send message to your desktop java application from this App.
By 'without web' if you mean without internet, but can be connected to a local network, then you can send message via TCP/UDP.
Or if you wont be able to connect to any network, then you can try bluetooth.
If bluetooth is also not available, then you can connect your phone to your computer via a USB cable and communicate using Serial communication. There are a few external libraries available for this.

2 Way Communication with Android Phone and PC via Internet

I am trying to control a Remote Control Car with an Andriod Phone from my PC (over 3g internet)
I'm planning on using a ioio (Which is just a board that I can plug into a andriod phone via USB)
The part I am working on now is the communication from my PC to my Andriod App. I've never made Andriod apps before and I'm a amateur C# developer.
At the moment I am planning on communicating via UDP as I can create a UDP server/client in Java easy enough. (http://systembash.com/content/a-simple-java-udp-server-and-udp-client/)
However I think this may require a public IP address? Which I will not have either on my client or server.
So for simplicty sake, How would you commucicate over the internet between 2 JAVA applications. If you need to stream video from a camera and simple commands.
You don't necessarily need a public IP, you just need some sort of IP with which one device can send packets to the other. For example, you could connect the phone to your home wifi network, and use the private IPs (typically 192.168.1.x) of the two devices.
If you need the phone to be on 3G, and your PC is behind a NAT router (which is typical), then you'll need to forward a port to your PC — this is a configuration setting on the router — and then have the phone connect to that port on your router's public IP.

Android app and native desktop app comunication

I have a native application written in C++. I would like to write an Android application that would be able to comunicate with my native application when user is in connected to the same WiFi network as my PC.
How this things are done. I mean what technologies are used behind it. Maybe you have some samples?
You could use a peer-to-peer library, like AllJoyn from Qualcomm. The idea is that both your PC and the Android device will use TCP/IP to communicate with each other. You still need a protocol above that however that will handle discovery, session establishment and exchange of data.

Categories

Resources