Skip to main content

Can't load resouce file in my target board

7 replies [Last post]
bertlin
Offline
Joined: 2009-09-11

Hi,
I tried to run the HelloWorld_LWUIT demo program in my target board.
Yes. It can be loaded and executed.
And the CVM doesn't prompt any error messages.
But it looks abnormal.
Please see this picture:

http://img301.imageshack.us/img301/8157/img3272s.jpg

It looks like the program doesn't load the resource file successfully.
I put the javaTheme.res and the HelloWorld_LWUIT.jar together.
and type the following command:

cvm -cp HelloWorld_LWUIT.jar:CDCPort.jar HelloWorld

Any ideas?
Sorry for my silly problems.

Bert

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tamir
Offline
Joined: 2006-08-29

Hi Bert,

A LWUIT app doesn't necessarily need a theme, it can be loaded with a default L&F.
What is your PBP implementation version? Which CVM?
Maybe the LWUIT port, for Sun PBP, is not compatible with your CVM implementation?

Regards,
Tamir
https://javatv-developers.dev.java.net

bertlin
Offline
Joined: 2009-09-11

Hi Tamir,
Thx for your rapid reply.

I found that if I mark this row of the HelloWorld_LWUIT.java file:
//UIManager.getInstance().setThemeProps(res.getTheme(res.getThemeResourceNames()[0])); //
The program can be executed and works well. (I can see the context now)
Pls see the picture:
http://twpic.org/uploads2/ab7c830e0e.jpg
But it's not a good solution.

CVM version:

I build both phoneME Advanced MR1(2006) and phoneME Advanced MR2(2008) in my embedded system.

1.
Product: phoneME Advanced (phoneme_advanced_mr2-b97)
Profile: Personal Basis Profile Specification 1.1
JVM: CVM phoneme_advanced_mr2-b97 (mixed mode)

2.
Product: CDC HI/FP/PP (1.1.1-beta-b31)
Profile: Personal Profile Specification 1.1
JVM: CDC HI 1.1.1_01-b31 (mixed mode)

The DemoFrame works well under both CVMs;
(cvm -cp democlasses.jar basis.DemoFrame)

Any sugession?

Bert

tamir
Offline
Joined: 2006-08-29

HI Bert,

Do you packed the theme into the jar?
Are you getting any kind of error, while trying to load the theme file, before calling setThemeProps()?

Regards,
Tamir
https://javatv-developers.dev.java.net

bertlin
Offline
Joined: 2009-09-11

Hi Tamir,

CVM doesn't prompt the error message.

After decompressing the HelloWorld_LWUIT.jar, I got {
javaTheme.res
HelloWorld.class
META-INF
}

I modified this row:
UIManager.getInstance().setThemeProps(res.getTheme(res.getThemeResourceNames()[0]));

as =>
System.out.println("test 1");
String text = res.getThemeResourceNames()[0];
System.out.println("name: " + text);
java.util.Hashtable myhasgtable = res.getTheme(text);
UIManager.getInstance().setThemeProps(myhasgtable);

And I got the text is : Theme 1

CVM Configuration:
Java stack chunk size (stackChunkSize): 2048
Java stack minimum size (stackMinSize): 3072
Java stack maximum size (stackMaxSize): 131072
JIT Configuration:
Interpreter transition cost (icost): 20
Mixed transition cost (mcost): 50
Backwards branch cost (bcost): 4
Compilation threshold (climit): 20000
When to compile (compile): policy
What to inline (inline): virtual+nonvirtual+vhints+ihints
Max Inlining Depth (maxInliningDepth): 12
Max Inlining Code Length (maxInliningCodeLength): 68
Min Inlining Code Length (minInliningCodeLength): 16
Policy Triggered Decompilations (policyTriggeredDecompilations): true
Max Working Memory Size (maxWorkingMemorySize): 1048576
Max Compiled Method Size (maxCompiledMethodSize): 65535
Code Cache Size (codeCacheSize): 524288
Upper Code Cache Threshold (upperCodeCacheThreshold): 95%
Lower Code Cache Threshold (lowerCodeCacheThreshold): 90%
Pass Phi values in registers (XregisterPhis): true
Pass locals in registers between blocks (XregisterLocals): true
Compiling Causes Class Loading (XcompilingCausesClassLoading): false
Trace (trace): none
GC[SS]: Initialized semi-space gen for generational GC
Size of *each* semispace in bytes=1048576
Limits of generation = [0x40226000,0x40426000)
First semispace = [0x40226000,0x40326000)
Second semispace = [0x40326000,0x40426000)
Current semispace = First semispace
GC[MC]: Initialized mark-compact gen for generational GC
Size of the space in bytes=1048576
Limits of generation = [0x40426000,0x40526000)
GC[generational]: Sizes
youngGen = min 1048576 start 1048576 max 1048576
oldGen = min 1048576 start 1048576 max 4194304
overall = min 2097152 start 2097152 max 5242880
GC[generational]: Auxiliary data structures
heapBaseMemoryArea=[0x40226000,0x40826000)
cardTable=[0x40826000,0x40829000)
objectHeaderTable=[0x40829000,0x4082c000)
summaryTable=[0x4082c000,0x40838000)
test 1
name: Theme 1

Happy new year.
Bert

tamir
Offline
Joined: 2006-08-29

Hi Bert,

Few more questions:
1. You are using the CDCPort jar from our SDK, that port uses Ariel font as default. Is your device support this font?
2. Did you try to create by your own a theme file for this app?

To create a new theme please find a theme_creator at
https://javatv-developers.dev.java.net/files/documents/9660/146678/file_...

Regards,
Tamir
https://javatv-developers.dev.java.net

bertlin
Offline
Joined: 2009-09-11

Hi Tamir,
I think you are right.
I deleted all the font fields in the Theme1 and I can see the text now.

Tamir, Thank you.

tamir
Offline
Joined: 2006-08-29