get running desktop apps with java? [duplicate] - java

This question already has answers here:
Windows running application list using Java
(4 answers)
Is there a Java library to access the native Windows API?
(6 answers)
Closed 4 years ago.
I´m trying to get the running programs with graphic interfaz that I have running and iterate over them to give them focus. Is there a way to do this with java (or any other language)?
Searching the web I only find things for Android. Any help is appreciated
Example: I have my calculator open, and my app made with javafx. My app shows me a list with all the programs running in my computer, in this example, it shows me that the calculator is open. There is a button next to each item of the list, and if I click on them, I can give the calculator focus and start using it.

You could use ps on the Linux and tasklist on the Windows. Java allows you the command line access.

Related

Opening my app when some other app is opened [duplicate]

This question already has answers here:
Android, Detect when other apps are launched
(8 answers)
Detect When other Application opened or Launched
(3 answers)
Closed 23 days ago.
I want to open my app when some other app is opened.
Ex:
I want to open my game launcher when some game is opened and i want to draw over the other app
How can i make this in android studio? If you found any online article or videos attach the link down.
If you want to be notified of the execution of other applications, you must use AccessibilityService, by activating AccessibilityService, your app will be notified whenever a application is executed, this is the simplest and best solution for that.
You can also get permission Appear on top to draw on other apps or start an activity from your app instead of drawing, there is currently no other control solution.

Is it possible to simulate a tap on an android screen? [duplicate]

This question already has an answer here:
How can I reliably simulate touch events on Android without root (like Automate and Tasker)?
(1 answer)
Closed 2 years ago.
Im working on an app, which would contain arrays which will have their intervals and I want to run the array so every interval, the app would run in the background and simulate a tap on the screen
Basically, the question is, if I can simulate the tap, and if yes, how
If you are running this as part of an instrumented test, that is very simple:
(need to add UiAutomator for this)
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
device.click(X,Y)
If you want to click on the screen during a normal app run:
check This SO question

While using dual monitor(extended screen) Application UI comes on wrong screen [duplicate]

This question already has answers here:
Show JFrame in a specific screen in dual monitor configuration
(12 answers)
Closed 8 years ago.
I work on a java application . When I tried to connect an external monitor to my laptop (to use it in extend screen mode) and tried to run the application from the extended monitor it still opens the application on my laptop window and not on the extended window. I am not really sure if I need to add a java code for this or is it something to do with Windows options. Basically everything , the error popups and everything come on the laptop window and not on the extended screen . Is there a way out to ensure the application and its popups come on the correct screen?
The position of windows on the monitors can be set by code.
If you use two monitors with extended desktop, you have to use positions, that match the second monitor.
Simple example:
You have two monitors, each with a resolution of 100x100 (for the sake of demonstration).
If you use the extended desktop, your desktop is of 200x100.
You need to set the windows x coordinate to be above 100 to be on the second monitor.
But be aware: If you switch back to only one monitor, the window will still be places at e.g. 150 and will be offscreen then.

Eclipse can't create new AVD [duplicate]

This question already has answers here:
Cannot create or edit Android Virtual Devices (AVD) from Eclipse, ADT 22.6
(14 answers)
Closed 8 years ago.
Trying to create a new AVD specifically for Android 2.3.3 Gingerbread.
I've cloned a device based on the 3.7" FWVGA slider as indicated by this image
This shows up in the "Device Definitions" tab
When I get to the "Create new Android Virtual Device (AVD)" window, I believe I have properly filled in the form as shown here
However, when I go to click "OK", which is a live button and not grayed out, there is no response at all from Eclipse. The application doesn't freeze or anything it just does not allow me to finish creating the new AVD. These specs were as indicated by my class but any advice that could help rectify the situation would be greatly appreciated while I await a response from my professor.
This is a bug in 22.6. We're preparing a 22.6.1 update that will fix this.
I think you can use the standalone AVD Manager, running tools/android avd from a shell to create one.

how to make a simple launcher in android? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to make a launcher
I want to make a launcher something similar to go launcher which changes all the icons and stuff... Currently I wanna know where should I start from? I need to make a very simple launcher so any sample code will be appreciated. Thanks!
Any helpful codes I should know or any tips?
There is a Launcher sample app included in the SDK samples that has some simple launcher code that you could base your app on. I doubt there's any simpler code available than that one.

Categories