Skip to main content

java.awt.Frame and System.currentTimeMillis()

11 replies [Last post]
Anonymous

Hi,

I have put new b86 builds of pMEA on my website
http://www.cs.kuleuven.be/~davy/phoneme/downloads.htm

I have changed the way how AWT Frames are created. They are now always full
screen without covering the top system bar. I actually ignore the size of the
frame that the user may have set. I could also cover the top system bar so
that you can no longer access the application menu or an application
switcher. I did not do this because if your application does not close
properly, you may have no other choice then to reset the PDA to terminate the
application. I also removed the decoration of the AWT Frame to save some
space and be more consistent with other native Windows Mobile applications.
Of course, this also means that for a WinCE platform with an 800x600 display,
the full screen would be used for any AWT application.

I changed the implementation of currentTimeMillis by relying both on the
GetSystemTime and GetTickCount to get a finer granularity than seconds. The
current implementation should be able to compute the time correctly after a
suspend and resume. Like I stated in a previous mail, the current time in
milliseconds is based on the GetTickCount value which returns the number of
msecs since device startup. To get the number of msecs since 1/1/70 I have to
add a delta. This delta remains fixed as long as you do not suspend and
resume a running application. If after a suspend and resume the difference
with the system time is more than 1 second, I recompute the delta.

I also received several reports of people that experienced an exception (error
code c0000005) when using a virtual keyboard and filling in an AWT text
field. It appears to only occur on Windows Mobile 6 platforms and I have been
able to trigger the exception with builds of a more than a year old. I
currently have no fix for this problem yet as I do not know what is causing
this behavior. Nonetheless, those who reported on the java.awt.Frame and
System.currentTimeMillis issues are free to test the new builds and provide
feedback on the forum.

Cheers,
Davy

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nordenberg
Offline
Joined: 2004-09-25
Points: 0

I can confirm that the System.currentTimeMillis() now works as expected! :-)
Thanks!

/Mikael

jldominguez
Offline
Joined: 2008-01-02
Points: 0

And I can confirm that the java.awt.Frame is now full-screen :-D We're testing personal profile b86 right now...

Thanks!
Lucas

jldominguez
Offline
Joined: 2008-01-02
Points: 0

Hello. I have also experienced the error when instantiating a java.awt.Frame on a DELL AXIM X51v with Windows Mobile 5. Here is the stack trace :

Exception c0000005 occured
Exception: STATUS_ACCESS_VIOLATION
Exception occurred during event dispatching:
java.lang.NullPointerException: disposed component
at sun.awt.pocketpc.PPCGraphics.createFromComponent(Nati
at sun.awt.pocketpc.PPCGraphics.(Unknown Source)
at sun.awt.pocketpc.PPCComponentPeer.getGraphics(Unknown
at java.awt.Component.getGraphics(Unknown Source)
at sun.awt.pocketpc.PPCComponentPeer.handleEvent(Unknown
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventQueueProxy.dispatchEvent(Unknown Source
at java.awt.EventDispatchThread.pumpOneEvent(Unknown Sou
at java.awt.EventDispatchThread.pumpEvents(Unknown Sourc
at java.awt.EventDispatchThread.pumpEvents(Unknown Sourc
at java.awt.EventDispatchThread.run(Unknown Source)
at java.lang.Thread.startup(Unknown Source)

Thanks!
Lucas

Davy Preuveneers

On Tuesday 16 September 2008 17:00:26 phonemeadvanced@mobileandembedded.org
wrote:
> Hello. I have also experienced the error when instantiating a
> java.awt.Frame on a DELL AXIM X51v with Windows Mobile 5. Here is the stack
> trace :
>
> Exception c0000005 occured
> Exception: STATUS_ACCESS_VIOLATION
> Exception occurred during event dispatching:
> java.lang.NullPointerException: disposed component
> at sun.awt.pocketpc.PPCGraphics.createFromComponent(Nati
> at sun.awt.pocketpc.PPCGraphics.(Unknown Source)
> at sun.awt.pocketpc.PPCComponentPeer.getGraphics(Unknown
> at java.awt.Component.getGraphics(Unknown Source)
> at sun.awt.pocketpc.PPCComponentPeer.handleEvent(Unknown
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventQueueProxy.dispatchEvent(Unknown Source
> at java.awt.EventDispatchThread.pumpOneEvent(Unknown Sou
> at java.awt.EventDispatchThread.pumpEvents(Unknown Sourc
> at java.awt.EventDispatchThread.pumpEvents(Unknown Sourc
> at java.awt.EventDispatchThread.run(Unknown Source)
> at java.lang.Thread.startup(Unknown Source)
>
> Thanks!
> Lucas

Lucas,

Thanks for feedback. I thought the problem only occured on WM6, but now it
appears WM5 has the exception too.

Davy

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

jldominguez
Offline
Joined: 2008-01-02
Points: 0

Just a little issue with java.awt.Dialog: the setUndecorated(boolean) method is ignored. I always get a top bar even if I say setUndecorated(true). I used a Window instead as a workaround.

Thanks for that great job!
Lucas

davyp
Offline
Joined: 2007-01-03
Points: 0

Hi Lucas,

The setUndecorated(boolean) for Dialogs should now work too in the latest
builds (b93). The Frame decoration is disabled by default (i.e. when you
are not calling this method in the constructor) and enabled for a Dialog.

Davy

jldominguez
Offline
Joined: 2008-01-02
Points: 0

Thanks, I'll test it tomorrow morning. By the way, if you use "davyp" instead of "Davy Preuveneers", we can 'watch' your posts :-D

Cheers,
Lucas

davyp
Offline
Joined: 2007-01-03
Points: 0

Thanks for testing,

Sorry for the inconvenience of posting under two different usernames :-)
I prefer to use my regular mail client to post on this forum as it is quicker
to push the reply button compared to going to the forum, logging in, etc.
That is why you see my posts appear as "Davy Preuveneers". Lately I
have been using the web interface, because the bridge between the forum
and the email backend systems is unreliable. These posts appear as "davyp".

Davy

newcgen
Offline
Joined: 2009-02-08
Points: 0

Greetings!

I use Windows CE 5.0 on Symbol MC3090. After suspend I receive an error: Application cvm.exe has performed an illegal operation and will be shut down....
Program: cvm.exe
Exeption: 0xC0000005
Address: 0162D170

It occurs ONLY after suspend, when i touch interface units. I use SWT and phoneME 17059.
On JVM j9 5.7.2 all OK.

davyp
Offline
Joined: 2007-01-03
Points: 0

0xC0000005 usually means that an illegal memory access has occurred. This
error is difficult to debug, and without the hardware I am afraid I cannot
reproduce the error.

Davy

newcgen
Offline
Joined: 2009-02-08
Points: 0

Many thanks for wonderful port phoneME on Windows CE!

The bug is an especial behaviour of my Windows CE.
If to place libraries SWT on a SD-card after suspend there are errors. If to place in \Windpws, all OK.