In addition, I am having wsdd5.0 and ive-2.2, and I compile with jclMax.
This is a discussion on How to read a registry value on Windows Mobile 5.0 - Websphere ; Hi all, I am writing a mobile application in java, and need to read a value from the PPC windows registry... Could anyone, please, give me an example of how I can read from my code a particular registry value? ...
Hi all,
I am writing a mobile application in java, and need to read a value from the PPC windows registry...
Could anyone, please, give me an example of how I can read from my code a particular registry value?
I have already tried with
COMPUTER_WINDOWS_CAR_FOLDER =
"reg query \"HKLM\\System\\StorageManager\\Profiles\\SDMemory\" /v Folder";
Process process = Runtime.getRuntime().exec(
COMPUTER_WINDOWS_CAR_FOLDER);
but I receive an IOException Unable to start Program.
I have also tried with JavaRegisrtyWrapper, which is published in
Google Projects: http://code.google.com/p/javaregistr...r.jar&can=2&q=
As long as I test on the PC Windows XP, everything works fine, but on the PPC with Windows CE 5.0, I receive a NoClassDefFoundError.
It seems to me that j9 JVM doesn't have all of the classes needed.
Does anyone have a clue?
Any help, example or advice would be appreciated.
Thanks in advance
In addition, I am having wsdd5.0 and ive-2.2, and I compile with jclMax.
SWT native library for ppc-arm contains registry functions. So you can use SWT OS.class for accessing registry from Java. Here is what I did:
- I downloaded swt-3.4-win32-wce_ppc-arm-j2se.zip from http://www.eclipse.org/swt/ downloads
- then I put swt-win32-3448.dll to my \J9\bin directory
- and swt.jar to my \J9\lib\jclFoundation11\ext directory
- then I wrote a simple test:
{code}
import org.eclipse.swt.internal.win32.*;
public class ReadRegistry {
public static void main(String[] args) {
int[] hkey = new int[1];
TCHAR SDMemory = new TCHAR( 0, "System\\StorageManager\\Profiles\\SDMemory", true);
TCHAR Folder = new TCHAR( 0, "Folder", true );
int[] cb = new int[1];
OS.RegOpenKeyEx( OS.HKEY_LOCAL_MACHINE, SDMemory, 0, OS.KEY_QUERY_VALUE, hkey );
OS.RegQueryValueEx( hkey[0], Folder, 0, null, (TCHAR)null, cb );
TCHAR buf = new TCHAR( 0, cb[0] );
OS.RegQueryValueEx( hkey[0], Folder, 0, null, buf, cb );
System.out.println( buf.toString().trim() );
}
}
{code}
- and run it from \J9\examples directory using
{code}
57#\J9\bin\j9.exe -jcl:foun11 -cp \J9\examples ReadRegistry
{code}
- on Fujitsu-Siemens Pocket LOOX N560 with WM 5.0 I got: SD-MMCard
Hi Ladya,
I tried the code that you posted. It works by me too. I guess I know nothing about windows programming, but one constantly learns.
*Thank you very much for your help!*
Best regards!
Hi Saintveni,
you are welcome