Java App for Mirroring Windows Screen to Anycast Device - java

I recently used AirMyPC as a paid software for having a mirroring windows screen (laptop) to my real TV.
B'coz my TV already plugged with this Anycast (hardware below) device so this software work smoothly.
I wonder if i could make the same app using java programming.
I completely followed the java socket tutorial nicely until connecting two laptop for a chat purpose. And found out for making the similar mirroring feature is using the same concept as usual java socket. Because java socket is a communication between two port client & server,
So how about this anycast device?
Which port is opened once my laptop already connected to its device IP?
CMIIW. Is it possible to achieve this?

Use OpenTV Player SDK by Google. They have both an android and java version of the SDK. Honestly, I have not used it. But that is where I would start.

Related

How to make a device available for a Bluetooth connection in Windows

I am developing an application that involves creating a Bluetooth connection between an Android device and a Windows 10/11 device. Getting the Android section working was pretty straight forward thanks to the detailed documentation, but not so much on desktop.
I want to get the local Bluetooth MAC address of my Windows device and then make it available from connection by the Android device which will use that MAC address to connect directly without needing to go through the discovery process.
I would like to use Java for the Windows application if possible. All I can find is from Oracle explaining it using the core Bluetooth API, but this seems to be removed from current versions of Java as the javax.bluetooth package isn't found. I'm using OpenJDK 17.0.2. Any similar stackoverflow questions I could find are extremely old and mention using this javax.bluetooth package which no longer exists.
Can anyone explain how we work with Bluetooth in Java in 2022? Are there any other languages that it is much easier to work with in you would reccommend over Java?

Sending data via bluetooth between Android phone and laptop running OS X

It seems like a relatively mundane task to make an app that can send data via bluetooth but I've been banging my head on this for the past few days so I'm looking for any ideas. I'm running OS X 10.10 and using a Nexus 5 Android device. Here's what I've tried so far:
I need a server program running on my laptop and I need a client-side android app running on my phone. However, (correct me if I'm wrong) the server program running on my computer needs to be able to access the Android Bluetooth API because I need to use the BluetoothServerSocket (based on the server-side code provided in Google's Android Bluetooth tutorial).
Since it's server-side code, I need to run it on a server so I built a Java Servlet which I ran from inside Eclipse but I didn't know how to access the Android API from inside a dynamic web application.
So I started following this approach where the Bluecove library made that possible: http://luugiathuy.com/2011/02/android-java-bluetooth/
I tried getting Bluecove to work with OS X but there are a whole host of issues involved with that. I found some workarounds and then got an error dealing with the IOBluetoothLocalDeviceReadSupportedFeatures device that Apple removed in its later OS versions (but Bluecove depended on it).
I found a fix here that installed the old IOBluetooth library and changed the DYLD_LIBRARY_PATH to point to it. Unfortunately, this had no effect (I don't know if I changed the library path properly...I followed the instructions from Solution 1 in the answer from this post).
In any event, I feel like I'm overcomplicating this task and am looking for any guidance - in terms of overall approach or a specific thing I missed. The primary issue is accessing the Android Bluetooth API inside the server program intended to run on my laptop.
I eventually ended up using WiFi to send data since there was better software support for that.
But if someone wants to pursue the Bluetooth path, one possibility is to run OS X Lion (which had the IOBluetooth library) as a VM and run the server-side Bluecove code on the VM. This would require a separate Bluetooth USB dongle to be attached because the VM can't access the bluetooth hardware of its host machine - there may be a way but by default it can't access the in-built bluetooth hardware.
Not an ideal solution but I don't know if there is much choice until Bluecove releases a version that is supported on recent OS versions.

connect my local PC to ANDROID device using Wi-Fi

I am working on one android app. I want to connect my local PC to ANDROID device using Wi-Fi(Local).
just like this APP.
I am new to network programming.
Anyone help me to do this some architecture or example or code.
You could use the Server-Client architecture. Depending on what you want to do you could either set up a server in the phone and have a client on the computer that will connect to the phone. Or the other way around, server on the computer and let the phone connect to it.
Here is another thread that have some example code (there is a lot of other examples and tutorials):
Android - Server Socket
There's no way around this except by hard work. You are expected to read the documentation and work through the examples. There are heaps of tutorials on Programming on Android on the 'Net. Use them.

Java Bluetooth API

I want to implement bluetooth communication on my final bachelor project, but I'm having a lot of doubts.
One of the requisites of this project is to have a Java application that can talk to the micro via Bluetooth. After a lot of research, I've found one that I think it's very good with a SPP profile, but I still have a lot of questions about it:
All the bluetooth on a PC implements the SPP profile stack?
If you need to develop a Java application that runs on every PC that implements the SPP stack, how would you do it?
We started by trying to use BlueCove and JavaBluetooth.org API, the first one runs great but I don't know if it's just on my PC and the second one sends an error (Stack not initialized). Which one would you use, and why?
My main goal with the project it's having some kind of software that runs on every PC with bluetooth (inside or as an external device) and running JVM, but I'm not sure if this APIs are the way.
Thanks
All the bluetooth on a PC implements the SPP profile stack?
Yes - Windows / Linux and Mac does.
If you need to develop a Java
application that runs on every PC that
implements the SPP stack, how would
you do it?
As you are trying you can use a Java bluetooth api library like Bluecove or alternatively natively try and open serial port on these platforms and thus have different versions of the application one for each platform.
We started by trying to use BlueCove
and JavaBluetooth.org API, the first
one runs great but I don't know if
it's just on my PC and the second one
sends an error (Stack not
initialized). Which one would you use,
and why?
JavaBluetooth seems to be a full stack and based on very old 1.1 version of bluetooth spec.
Bluecove is just a Java library for bluetooth running over the native bluetooth implementations on Mac, Linux and PC.
I think Bluecove is probably the right way to go.

Control a desktop application using an android phone

I want to build an application where an android phone would control a desktop application.
I only need to send coordinates from the phone to the desktop when user's finger is on the phone screen.
But I am kinda confused on the networking side if i should use bluetooth, usb, or wifi (intranet).
I did some research on bluetooth, doing bluetooth socket programming on an android phone shouldn't be a problem, but on the desktop side there are only a few free SDK/library. any suggestion on what to use?
If I were to use USB/cable, What API on the android side I need to use?
I am actually more familiar with general socket programming (wifi), but I think it's going to be slow (correct me if Im wrong) so this would be my last option.
PS: I am using Java for the desktop application too
any suggestions on what method to use? or even maybe I should use .net on the desktop side?
Thanks
You might find the open source RemoteDroid app to be useful in creating your app. It may even do everything that you want.
The source code is here. You may need an svn client like TortoiseSVN in order to download it.
Wifi is probably the most supportable.
Bluetooth requires hardware and drivers on the PC side
USB would ordinarily seem like the most sensible if the wire isn't a problem, but the catch is that it requires that the user enable "USB debugging" on the phone, and have either the android SDK or equivalent functionality to the adb forward command installed, plus a compatible USB driver for the phone. If all that were the case, you'd just forward a port from the PC to the phone and have a pc program connect to that port on the loopback interface which will be forwarded to a service running on the phone.
It's possible you could do something piggybacked on the USB tethering capability of more recent releases to get you a network-over-usb that you could use to connect programs on the PC and phone, but you'd need modified PC drivers so that you don't actually push the PC's internet traffic through the phone (unless you mean to tether as well).

Categories

Resources