|
Replies:
3
-
Last Post:
Mar 19, 2009 1:36 AM
by: Shai Almog
|
|
|
|
|
|
|
Switch between LCDUI-LWUIT
Posted:
Mar 12, 2009 9:20 PM
|
|
|
|
|
Hi all,
Although this was mentioned in some Threads I didn't find any clear explanation / statements from the LWUIT team how to approach this. I need this in order to get reliable Media capturing, since this just does not really work with LWUIT currently on quite a few devices (S60 above all).
So let alone this discussion: how to switch between from to lcdui. I do it like this. It works in the WTK emulator, but not in my S60 device. There it my lcdui screen only flikers shortly then comes back the lwuit screen. I tried a lot of variations, setting current form to invisible and playing with invoke and block, invoking it in the edt , but nothing worked, always comes back to lwuit.
Can anyone tell me how to achieve this?
Rgds Ben
Lwuit -> lcdui:
curDisplayable=javax.microedition.lcdui.Display.getDisplay(this).getCurr ent(); Display.getInstance().getCurrent().setVisible(false); new Thread(new Runnable(){ . }).start();
Lcdui -> lwuit:
javax.microedition.lcdui.Display.getDisplay(NuuxMain.INSTANCE).setCurren t(curDisplayable); Display.getInstance().callSerially(new Runnable(){
public void run() { .. } });
------------------------------------------------------------------------ --------- Benjamin Walther, Flexbit GmbH www.flexbit.com mail: ben@flexbit.com phone: +41 76 586 10 30 ------------------------------------------------------------------------ ---------
[att1.html]
|
|
|
|
|
|
|
Re: Switch between LCDUI-LWUIT
Posted:
Mar 15, 2009 10:00 PM
in response to: saturon
|
|
|
|
|
Hi Ben, we made some comments but obviously nothing "official" since we can't guarantee a cross device future proof way to do this properly. Event the native text input which is essentially that is something we struggled with quite a bit and surrounded with some "ugly hacks".
E.g.: What happens when a background thread tries to show a dialog when the native form is in place? How do you handle MIDP's asynchronous setCurrent()?
These are not trivial and still pose problems in some devices when going into and out of the native UI that are even applicable in the native text edit. You can look at that code to see what we did although its not an "endorsement" of that approach...
We use media capture on S60 and other devices so I'm not exactly clear on why this won't work for you, I recall that you and Chen had a discussion about exposing the MediaComponent video control. Would this solve the problem? Do you have a test case that works for MIDP and fails on LWUIT?
On Mar 13, 2009, at 6:20 AM, saturon wrote:
> Hi all, > > Although this was mentioned in some Threads I didn't find any clear > explanation / statements from the LWUIT team how to approach > this. I need this in order to get reliable Media capturing, since > this just does not really work with LWUIT currently on quite a few > devices (S60 above all). > > So let alone this discussion: how to switch between from to lcdui. > I do it like this. It works in the WTK emulator, but not in my S60 > device. There it my lcdui screen only flikers shortly then comes > back the lwuit screen. I tried a lot of variations, setting current > form to invisible and playing with invoke and block, invoking it in > the edt , but nothing worked, always comes back to lwuit. > > Can anyone tell me how to achieve this? > > Rgds Ben > > Lwuit -> lcdui: > > curDisplayable=javax.microedition.lcdui.Display.getDisplay > (this).getCurrent(); > Display.getInstance().getCurrent().setVisible(false); > new Thread(new Runnable(){ … > }).start(); > > > Lcdui -> lwuit: > > javax.microedition.lcdui.Display.getDisplay > (NuuxMain.INSTANCE).setCurrent(curDisplayable); > Display.getInstance().callSerially(new Runnable(){ > > public void run() { > …. > } > }); > > ---------------------------------------------------------------------- > ----------- > Benjamin Walther, Flexbit GmbH > www.flexbit.com > mail: ben@flexbit.com > phone: +41 76 586 10 30 > ---------------------------------------------------------------------- > ----------- >
Shai Almog http://lwuit.blogspot.com/ https://lwuit.dev.java.net/faq.html
[att1.html]
|
|
|
|
|
|
|
|
RE: Switch between LCDUI-LWUIT
Posted:
Mar 16, 2009 4:54 AM
in response to: Shai Almog
|
|
|
|
|
Hi Shai, Thanks for your Answer. Actually i finally found a hack how to operate MediaComponent. This was a long long way for me, and i can confirm that i crashed several S60 phones down in espoo (for the ones that know what i mean.. ) startCapture(); javax.microedition.lcdui.Displayable d = javax.microedition.lcdui.Display.getDisplay(NuuxMain.INSTANCE).getCurren t(); javax.microedition.lcdui.Display.getDisplay(NuuxMain.INSTANCE).setCurren t(new DummyCanvas()); javax.microedition.lcdui.Display.getDisplay(NuuxMain.INSTANCE).setCurren t(d); works finally and the freezing time is over. Yes i need the videocontrol exposed, but for now i just changed the lwuit source. rgds Ben
-----Original Message----- From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM] Sent: Montag, 16. März 2009 06:00 To: users@lwuit.dev.java.net Subject: Re: Switch between LCDUI-LWUIT
Hi Ben, we made some comments but obviously nothing "official" since we can't guarantee a cross device future proof way to do this properly. Event the native text input which is essentially that is something we struggled with quite a bit and surrounded with some "ugly hacks".
E.g.: What happens when a background thread tries to show a dialog when the native form is in place? How do you handle MIDP's asynchronous setCurrent()?
These are not trivial and still pose problems in some devices when going into and out of the native UI that are even applicable in the native text edit. You can look at that code to see what we did although its not an "endorsement" of that approach...
We use media capture on S60 and other devices so I'm not exactly clear on why this won't work for you, I recall that you and Chen had a discussion about exposing the MediaComponent video control. Would this solve the problem? Do you have a test case that works for MIDP and fails on LWUIT?
On Mar 13, 2009, at 6:20 AM, saturon wrote:
Hi all,
Although this was mentioned in some Threads I didn't find any clear explanation / statements from the LWUIT team how to approach this. I need this in order to get reliable Media capturing, since this just does not really work with LWUIT currently on quite a few devices (S60 above all).
So let alone this discussion: how to switch between from to lcdui. I do it like this. It works in the WTK emulator, but not in my S60 device. There it my lcdui screen only flikers shortly then comes back the lwuit screen. I tried a lot of variations, setting current form to invisible and playing with invoke and block, invoking it in the edt , but nothing worked, always comes back to lwuit.
Can anyone tell me how to achieve this?
Rgds Ben
Lwuit -> lcdui:
curDisplayable=javax.microedition.lcdui.Display.getDisplay(this).getCurr ent(); Display.getInstance().getCurrent().setVisible(false); new Thread(new Runnable(){ Â… }).start();
Lcdui -> lwuit:
javax.microedition.lcdui.Display.getDisplay(NuuxMain.INSTANCE).setCurren t(curDisplayable); Display.getInstance().callSerially(new Runnable(){
public void run() { Â…. } });
------------------------------------------------------------------------ --------- Benjamin Walther, Flexbit GmbH <file:// www.flexbit.com mail: ben@flexbit.com phone: +41 76 586 10 30 ------------------------------------------------------------------------ ---------
Shai Almog http://lwuit.blogspot.com/ https://lwuit.dev.java.net/faq.html
[att1.html]
|
|
|
|
|
|
|
|
Re: Switch between LCDUI-LWUIT
Posted:
Mar 19, 2009 1:36 AM
in response to: saturon
|
|
|
|
|
Hi Ben, Chen seems to be preoccupied so I'll try to add the video control change for the next commit myself. However, my commit will take some time due to the infrastructure work I am doing.
> Hi Shai, > > Thanks for your Answer. Actually i finally found a hack how to > operate MediaComponent. This was a long long way for me, and i can > confirm that i crashed several S60 phones down in espoo (for the > ones that know what i mean.. ) > > > startCapture(); > javax.microedition.lcdui.Displayable d = > javax.microedition.lcdui.Display.getDisplay > (NuuxMain.INSTANCE).getCurrent(); > javax.microedition.lcdui.Display.getDisplay > (NuuxMain.INSTANCE).setCurrent(new DummyCanvas()); > javax.microedition.lcdui.Display.getDisplay > (NuuxMain.INSTANCE).setCurrent(d); > > works finally and the freezing time is over. > > Yes i need the videocontrol exposed, but for now i just changed the > lwuit source. > > rgds Ben > -----Original Message----- > From: Shai.Almog@Sun.COM [mailto:Shai.Almog@Sun.COM] > Sent: Montag, 16. März 2009 06:00 > To: users@lwuit.dev.java.net > Subject: Re: Switch between LCDUI-LWUIT > > Hi Ben, > we made some comments but obviously nothing "official" since we > can't guarantee a cross device future proof way to do this > properly. Event the native text input which is essentially that is > something we struggled with quite a bit and surrounded with some > "ugly hacks". > > E.g.: What happens when a background thread tries to show a dialog > when the native form is in place? > How do you handle MIDP's asynchronous setCurrent()? > > These are not trivial and still pose problems in some devices when > going into and out of the native UI that are even applicable in the > native text edit. You can look at that code to see what we did > although its not an "endorsement" of that approach... > > We use media capture on S60 and other devices so I'm not exactly > clear on why this won't work for you, I recall that you and Chen > had a discussion about exposing the MediaComponent video control. > Would this solve the problem? > Do you have a test case that works for MIDP and fails on LWUIT? > > On Mar 13, 2009, at 6:20 AM, saturon wrote: > >> Hi all, >> >> Although this was mentioned in some Threads I didn't find any >> clear explanation / statements from the LWUIT team how to >> approach this. I need this in order to get reliable Media >> capturing, since this just does not really work with LWUIT >> currently on quite a few devices (S60 above all). >> >> So let alone this discussion: how to switch between from to lcdui. >> I do it like this. It works in the WTK emulator, but not in my S60 >> device. There it my lcdui screen only flikers shortly then comes >> back the lwuit screen. I tried a lot of variations, setting >> current form to invisible and playing with invoke and block, >> invoking it in the edt , but nothing worked, always comes back to >> lwuit. >> >> Can anyone tell me how to achieve this? >> >> Rgds Ben >> >> Lwuit -> lcdui: >> >> curDisplayable=javax.microedition.lcdui.Display.getDisplay >> (this).getCurrent(); >> Display.getInstance().getCurrent().setVisible(false); >> new Thread(new Runnable(){ … >> }).start(); >> >> >> Lcdui -> lwuit: >> >> javax.microedition.lcdui.Display.getDisplay >> (NuuxMain.INSTANCE).setCurrent(curDisplayable); >> Display.getInstance().callSerially(new Runnable(){ >> >> public void run() { >> …. >> } >> }); >> >> --------------------------------------------------------------------- >> ------------ >> Benjamin Walther, Flexbit GmbH >> www.flexbit.com >> mail: ben@flexbit.com >> phone: +41 76 586 10 30 >> --------------------------------------------------------------------- >> ------------ >> > > Shai Almog > http://lwuit.blogspot.com/ > https://lwuit.dev.java.net/faq.html >
Shai Almog http://lwuit.blogspot.com/ https://lwuit.dev.java.net/faq.html
[att1.html]
|
|
|
|
|