JavaSound: Detect device change - java

Folks,
I am working on an applet that captures audio from the local computer and streams it up to the server. I am using a Java applet that currently hooks onto the default device and performs the upstream. Things are running well.
I now want to extend the functionality to allow users to choose the audio input device and to also show a sound level indicator of the chosen device in the web page.
I wrote a multithreaded utility that would do AudioSystem.getMixerInfo(); periodically and look for changes. There is also a thread that reads from the chosen device and displays sound levels.
My problem is that when I run my code and plug in a USB headset, the new device is not detected. However, if I shut down my code, then plug in the USB, the device does show up.
Is this a known and documented limitation of JavaSound that it does not sample the device set once the process is running?
I am using OSX Lion.
Thanks for any insights.
-Raj

Related

How to allow a java app on an android device to send HDMI-CEC command?

In my company, we would like to develop a digital signage app on android TV. We would like to include some features like turning on/off the monitor, or control audio volume.
I don't know how to enable this in java. I saw that there is a system api HdmiControlManager but i suppose i can't use this easily ?
I've tried to send the command "input keyevent" that works with adb to turn off the monitor, but it didn't work in java. It makes the app crash.
Process p = Runtime.getRuntime().exec("input keyevent 26");
p.waitFor();
Is there still a way to control the monitor from an android Tv box with an app ?
For testing purpose i have a nvidia shield with android 11 but it would be great to have this working on other devices if the user grants the right permissions of course.
Thanks

Android App that listens if other apps crash on device

Is it possible to have an App that works in the background and listens to when another app crashes on my device?
I want my app to notify my computer when it detects that the app I'm using on my device crashed or stopped. If so would what it need to listen too?
A very hacky way would be to write a native binary which monitored Logcat, upload the executable to your device using ADB and launch it using the shell account. Note that this is not an App though.
The Android shell user has enough privileges to view Logcat for all processes and perform network operations, so you could just scan Logcat for the tell-tale messages that indicate that an app has crashed, siphon out the stacktrace from Logcat and then send it over the local network to your PC.
This actually sounds like quite a cool idea. Might have a go at it building it myself :-)
I think you want to create Samsung's Smart App Manager . That track the crashes of all application and show notification to uninstall app or remove.
From Android doc : By default, the system assigns each app a unique
Linux user ID (the ID is used only by the system and is unknown to the
app). The system sets permissions for all the files in an app so that
only the user ID assigned to that app can access them.
Each process has its own virtual machine (VM), so an app's code runs
in isolation from other apps.
By default, every app runs in its own Linux process. Android starts
the process when any of the app's components need to be executed, then
shuts down the process when it's no longer needed or when the system
must recover memory for other apps.
Each and every android application runs in isolation from other apps. So any app can't track the crash log of other app.
The question is : How Samsung's Smart App Manager is doing.
I think samsung smart app only works with Samsungs devices. Root Permission is required to perform such type of action. Samsung's Smart App only have root permission in Samsung's devices.
If you are developing app for custom ROM or Rooted android device then you can otherwise you can't do.
When you upload your apk in the android developer console you have any options including errors options, then when the app crashed in some device they can send a report and you will can see it in de console...

How can I know that some devices have been connected with my computer?

I want to monitor whether a device has been attached to my computer. I can monitor it at Control Panel\Hardware and Sound\Devices and Printers. But how can I get this info in my Java code?
The device is been attached with USB port and it's a keyboard and mouse simulator. I use it to remote control other computer
you need some native libraries to do that. try
http://code.google.com/p/javahidapi

Possible to Run a Java GUI on a computer from an Android?

If an Android device were connected to a computer via USB charger, would it be possible to launch a java GUI on the computer from the device (i.e. by pressing a button in an android app)?
Also, would this be a platform dependency nightmare?
Possible yes, not easy though and there may be some platform issues.
You would already need to have something running on the destination computer which detected the message from Android and then launched the GUI.
In fact the simplest way to do that may be to ignore the USB and just do the whole thing over the network.
You can't just run arbitrary code on the computer by plugging the phone in though, if you think about it that would be a massive security hole!

How to interoperate between PC and camera from cell phone

My new project is to build an application to use the cell phone camera as the main camera from my PC.
How can I do this kind of stuff?
I thought of using bluetooth, but how my PC define the cell phone as the main camera?
Best reguards.
Depending on the camera phone and its features, you can do it. For my Bluetooth efforts, I've been using A7 hardware and a .NET library Blue Tools from Franson.
I've been able to:
pair devices in code
send/push images to the phone (probably the reverse would work, but I didn't try)
discover devices automagically
serial comm
network com
install as a network driver
Well on the Bluetooth side of things you might need a program running on you phone to forward the images. Or you might find that there's a Bluetooth program already running and providing that service, for instance the Bluetooth BASIC IMAGING PROFILE (BIP) (1) profile includes the usage scenario: "Use of a mobile phone to control the shutter of a digital still camera and immediately examine the result on the phone’s screen. In the present scenario, any other portable imaging device could play the role of the mobile phone."
So first you need to find if the phone supports BIP. You could for instance use the SdpBrowser sample application in my 32feet.NET .NET Bluetooth library to see what services the phone is advertising. Otherwise perhaps its documentation will tell you. You'd then have to find out whether the BIP service on your phone supports that scenario.
On the PC side you might need some driver level software to allow any application to use the remote camera. You might start by just allowing your own application alone to use the camera.

Categories

Resources