How to access the state of other computer processes in Java? [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am beginning to write a basic "study-buddy" program as a side project. One important feature I want to implement is that the program can access the state of other programs running to prevent you from accessing them / yell at you. For instance, if you had Chrome open to Facebook, or if you launched a video game.
First off, is this even possible/reasonable to accomplish in Java? Second, specifically with Chrome, how can I access the programs state from another program that I am writing? More generally, how can I access ALL programs running on the computer and check to see whether anything violates "study-permissible" programs?

I would put this as a comment, but my reputation point is not enough.
One way is using the commands the operating system provides. You can run a command with
Runtime.getRuntime().exec("<command name>");
This will give you the related process and you can get the output of that process just as manually running the process. Then, you can utilize the output.
Basically if the OS provides you that information manually, you should be able to get the information within Java.

Related

java program that make hard for os to format the removable disk [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Is there any way to create a java program that can executes itself while in a removable disk and cannot let any windows utilities or some third party software format that drive.
Short answer: no.
Long answer: the idea doesn't make sense in the first place. You see, any Java program would sit atop of any operating system. So, if your operating system decides to do something; how could something that runs atop of your OS (and that doesn't control your OS) prevent your OS from doing that?
If somebody has physical control over that drive; then there is nothing that you can do to prevent that person from erasing, formatting, ... that drive.
There might certain "workarounds"; such as hiding partitions; but the bitter truth is: unless you are able to some "hardware-based" write protection (that can't be disabled without destroying the drive), there is nothing you can do (see here for a similar question .. receiving similar answers).

Checking System requirements for the application in java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am building an application using java and oracle database. I want to confirm all the required software is installed and working properly on each time the user open the application and show the missing software/configuration error to the user and option to close the application.Is there any way.
You probably can't from a pure Java perspective, nor should you. That is really a job for your installation process. Every native platform you deploy to is going to have a different way of installing software and a different place to put it. If you really want to do this because you are doing your instillation with Java (and love writing more complicated code) you will need to leverage something like JNI or JNA to ask the underlying operating system what is installed. This is fairly simple on Windows and OS X, however, it's going to be next to impossible on most Linux's due to the differences in each package manager.

Will I experience problems making a java program on Windows computer but then running it on a linux vps? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
So I am currently working on designing a game that will be multiplayer and to prepare for this I have begun looking at hosting options. Besides hosting from my house on a dedicated server, the best and cheapest option I found was the use of VPS, more specifically Dotblock. Now dotblock has both linux based and windows based VPS but the windows one is a lot more expensive and so my question is whether or not I will run into problems if I code my server program in java on my Windows computer but then eventually host it on a linux based VPS?
As far as I know there should be no problems but if there will be, what are they, and if there are no problems what limitations will I have while coding? I understand I cannot reference anything Windows specific but will things such as time and tracking the mouse using LWJGL should change?
Thank you in advance and I hope you guys can help me out!
Overall it's relatively straightforward- that's one of the advantages of using java over other languages. I will offer you this advice; make sure you handle file paths in an environment-agnostic way. I've seen more than one error log on linux complaining that it can't reach 'c:\some\weird\path'.

How to put normal java code into a website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
is there any way to put normal java code into a website? i have made a game with DrJava and i would like to put that somehow onto a website, is there a way to do such a thing? like would I have to convert java to javascript or what? this is not an applet and is just written in normal java, and i am no expert in coding. please help
You could always run the Java program from an applet. You might need to sign the applet and take care of permissions if you need filesystem or socket access.
Java has applets. However, like SLaks said Java's not meant for the browser Sun tried early on to make Java the programming language of choice for the web client-side and failed.

java/android - Can I edit phone mechanics with java instead of just apps? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I've been wondering, since you can make apps and such using the ADK and JDK, is there a way to change certain mechanics on the phone itself aswell?? like themes, actions when starting apps, calls, the browser, etc?
You cannot. Most of the actions you describe are executed as "root" user, which has access to EVERYTHING on your phone, while (normal) apps are executed as user, which lacks those rights. There are exceptions to this in the form of apps that run as "root", but these require you to go through a process that is aptly named "rooting your phone". This however is not recommended unless you know what you're doing.
What you describe is the creation of a custom ROM. Taking the original source code, modifying it, and then packaging it so it can be installed on another phone.
This is a very difficult and complex task, especially when you want your modification to be available on different phones. They all have unique specificities and most likely will need specific versions of your mod.

Categories

Resources