How to get system hardware info?

D

Derek

My company makes a Java application for which we would
like to gather some information about the systems it is
run on, mostly regarding the hardware. The kinds of
things our product folks would like to see include:

System Info
- OS name/version
- system model
- processor type/speed
- total physical memory

Display Info
- adapter name/description
- video RAM
- driver name/version
- color table entries
- screen resolution
- color depth (bits/pixel)

Sound Info
- adapter name/description
- driver name/version

How much of this information can my Java app obtain? It
seems that java.lang.System.getProperty() can get a few
basics, but not much about the hardware.

If my Java app is used mostly on Windows, is there a way
I can use native Windows API calls to gather this info
at least for Window systems?

Any help would be greatly appreciated.

Derek
 
C

Chris Uppal

Derek said:
If my Java app is used mostly on Windows, is there a way
I can use native Windows API calls to gather this info
at least for Window systems?

You could write (or maybe hire someone to write) a small Windows-native program
that recorded that infomation in a .properties file. Run that program at
installation time, and as often thereafter as seems good to you.

-- chris
 
T

Thomas Weidenfeller

Derek said:
My company makes a Java application for which we would
like to gather some information about the systems it is
run on, mostly regarding the hardware.

I hope you ask your users openly (not hidden in some small print in the
EULA) for permission to gather and use the data.
How much of this information can my Java app obtain?

Very few. In addition to the properties the Runtime class can tell you a
little bit about memory allocation for the VM. Maybe you also find some
API in the JMF for iterating over available sound devices, but I didn't
use JMF, so I don;t know.
If my Java app is used mostly on Windows, is there a way
I can use native Windows API calls to gather this info
at least for Window systems?

You have several options:

- Use JNI to call native Windows APIs - if there are APIs which can tell
you what you want (I don't know).

- Use Runtime.exec() to start some external program which can gather the
data

- Use a Java-COM bridge to access some Windows COM/ActiveX (or whatever
is the name of the day) object which can deliver the data (I don't know
if there is such a standard COM object in Windows).

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top