Skip to main content

Blackberry implementation

78 replies [Last post]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thorsten_s
Offline
Joined: 2008-08-15

There is a strange problem on (at least) BB OS 4.6 where native edit dialogs would not be painted until the user triggers a repaint caused by input events. This seems to happen only when the base class is a MIDlet and not a CLDC app. Has anyone run into this before or know what this is about?

cknappe
Offline
Joined: 2008-08-28

Now I tried out your BBScreenImplementation class - this is great work. I just could not get it from the repository. I am thinking about switching to an other client for my eclipse - could you give me an advice.

My application works fine with your implementation. Just on one Form of my application I have a problem. On this form I do not use a menu. But it seems as it is shown in the form? Do you know what I can do? If I use the lwuit implementation I don't have this effect.

Thanks - and again - great ;-)

Christian

thorsten_s
Offline
Joined: 2008-08-15

> My application works fine with your implementation.
> Just on one Form of my application I have a problem.
> On this form I do not use a menu. But it seems as it
> is shown in the form? Do you know what I can do? If I
> use the lwuit implementation I don't have this
> effect.

I am not sure if I understand, but I would guess that you are using the latest LWUIT binary drop and should switch and use the subversion sources.

cknappe
Offline
Joined: 2008-08-28

Ok - my english is not the best so - a picture says more than thousand words.

http://projects.innascor.com/gaia/dev/

There are some minor differences for the button styles too - but thats ok. Do you see the blue line under the green status line? This is what I mean.

thorsten_s
Offline
Joined: 2008-08-15

Ah, I see. I have no explanation for that currently but will look into that.
Thanks,
Thorsten.

achie3xis
Offline
Joined: 2008-08-26

Hi Thorsten,

i already test u'r blackberry implementation with jde 4.5.0 and jde 4.6.0 with no problem.
in jde 4.50 i use bb 8310,8800 with no problem.
But when i try it in bb 8703e i get a bug there.,my menu doesn't show when i press trackwheel..

regards,

[b]Asri Dwitiya[/b]

thorsten_s
Offline
Joined: 2008-08-15

Hello Asri,

thanks for the information. I made some changes to listen for trackwheel events. But they are not complete because I don't really know how the trackwheel navigation is supposed to work. What to do if we have a focused element and the trackwheel is pressed?

Right now I don't have the time to fiddle with this. If anyone want's to play around with this stuff: You can open the menu from the BB implementation class by simulating a menu press using these calls:

eventTransport.addEvent(new int[]{
EventTransport.KEY_PRESS, BB_IMPL_KEY_MENU
});
eventTransport.addEvent(new int[]{
EventTransport.KEY_RELEASE, BB_IMPL_KEY_MENU
});

achie3xis
Offline
Joined: 2008-08-26

> Hello Asri,

Hello Thorsten,
>
> thanks for the information. I made some changes to
> listen for trackwheel events. But they are not
> complete because I don't really know how the
> trackwheel navigation is supposed to work. What to
> do if we have a focused element and the trackwheel is
> pressed?

Maybe..when we pressed the trackwheel we must detect "focused element or the form in case" have menu or not.,if true menu show,...

>
> Right now I don't have the time to fiddle with this.
> If anyone want's to play around with this stuff:
> You can open the menu from the BB implementation
> class by simulating a menu press using these calls:
>
> eventTransport.addEvent(new int[]{
> EventTransport.KEY_PRESS,
> BB_IMPL_KEY_MENU
> });
> vent(new int[]{
> EventTransport.KEY_RELEASE,
> BB_IMPL_KEY_MENU
> });

ok..i'll try this..

Regards,

[b]Asri Dwitiya[/b]

cknappe
Offline
Joined: 2008-08-28

Uhh..

can anybody help me with this message.

RA layer request failed
svn: PROPFIND request failed on '/source/browse/lwuit-incubator/trunk/thorsten_s'
svn: PROPFIND of '/source/browse/lwuit-incubator/trunk/thorsten_s': 501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API (https://lwuit.dev.java.net)

This one I get if I add the repository location to eclipse.

Regards, Christian

thorsten_s
Offline
Joined: 2008-08-15

You are using WebDAV (PROPFIND) while the server does only accept HTTP1.1 (RFC 2068). Maybe you find a setting somewhere to switch. Don't know much about eclipse and its SVN configuration. Hope that helped.
Regards,
Thorsten.

cknappe
Offline
Joined: 2008-08-28

Mh.. ok - I use Subclipse Plugin for Eclipse. So I have to get the source from the web frontend.

Regards,
Christian

cknappe
Offline
Joined: 2008-08-28

Wow,

this is great - I try this out and give you some help if I can.

Regards, Christian

vrecon
Offline
Joined: 2008-12-29

thorsten,

Is it possible to sent me a sample...
I've tried to work it out from you're MainFile sample but I can not get it too work.
The commands are not shown.

Do you build the .cod files as midlets or as cldc?

thnx

Vrecon

thorsten_s
Offline
Joined: 2008-08-15

Here it is as a midlet, works for me:
[code]

import com.sun.lwuit.Command;
import com.sun.lwuit.Display;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

/**
*
*/
public class TestMidlet extends MIDlet {

protected void startApp() throws MIDletStateChangeException {

com.sun.lwuit.impl.ImplementationFactory.setInstance(
new com.sun.lwuit.impl.bb.BBScreenImplementation.BBImplementationFactory());

Display.init(this);

Form form = new Form();
form.setTitle("myform");
form.addComponent(new Label("content"));
for (int i = 0; i < 10; i++) {
form.addCommand(new Command("abc" + i));
}
form.show();

}

protected void pauseApp() {
}

protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
}
[/code]

And here as CLDC thingy:
[code]
import com.sun.lwuit.Command;
import com.sun.lwuit.Display;
import com.sun.lwuit.Form;
import com.sun.lwuit.Label;

public class TestMidlet extends net.rim.device.api.ui.UiApplication {

public static void main(String[] args) {

final TestMidlet main = new TestMidlet();

com.sun.lwuit.impl.ImplementationFactory.setInstance(
new com.sun.lwuit.impl.bb.BBScreenImplementation.BBImplementationFactory());

Display.init(main);

Form form = new Form();
form.setTitle("myformcldc");
form.addComponent(new Label("content"));
for (int i = 0; i < 10; i++) {
form.addCommand(new Command("abc" + i));
}
form.show();

// event dispatcher entered by implementation,
// following call no longer needed!
//main.enterEventDispatcher();

}
}
[/code]

edit: commented enterEventDispatcher()

Message was edited by: thorsten_s

vrecon
Offline
Joined: 2008-12-29

Thnx, thorsten_s you saved the day.....

vrecon
Offline
Joined: 2008-12-29

Well almost..

Still having the same problem...

Downloaded the Lwuit sources, and the extra blackberry lwuit sources.
Running in eclipse the build.xml, with the following lines.


systemmodule="false" startuptier="7" ribbonposition="6" icon="../res/icon1.png" />

The sources is being compiled, simulator starts, the application starts but still no commands.

The TestMidlet is the same as the one in the post above.

What am I doing wrong?

thorsten_s
Offline
Joined: 2008-08-15

Did you actually press the Blackberry menu button? Because the implementation no longer relies on the 'p' and 'q' keys, so there are no soft buttons any more.

vrecon
Offline
Joined: 2008-12-29

No, the text is not visible. So I do not see abc1 etc..
I also pressed the q qw p and po but nothing happenend.
It occurs with the ide Blackberry 4.5.0 and 4.2.1

What components do you use for your environment?

vrecon
Offline
Joined: 2008-12-29

Sorry you are right...
Pressed the wrong buttons... shame shame shame....

bwei
Offline
Joined: 2006-11-16

Hi Thorsten,

This looks great. I am wondering if you can give us a running example. I could not make it. I mean how to use BB screen.

sawal_xp
Offline
Joined: 2008-02-12

Hi Thorsten

ok i will try this..:D
thx..

larryrau
Offline
Joined: 2004-04-04

When you build for the blackberry do you just rebuild all the lwuit code with the app? Have you tried setting up lwuit as a library that other apps can reference?

myinstinct
Offline
Joined: 2008-10-24

>* problem when clicking the menu button twice, seems to be LWUIT related

I have had this issue on the Instinct as well - have not taken time to chase it down yet

sawal_xp
Offline
Joined: 2008-02-12

hi thorsten_s
can you give the sample main class to implemention your BBimplementaion..
i'm not clearly understand how to implement it..:)

thx;)

thorsten_s
Offline
Joined: 2008-08-15

sure:

[code]
import com.sun.lwuit.Display;
import com.sun.lwuit.impl.ImplementationFactory;
import com.sun.lwuit.impl.bb.BBScreenImplementationTouch;

public class MainFile extends net.rim.device.api.ui.UiApplication {

public static void main(String[] args) {
ImplementationFactory.setInstance(
new BBScreenImplementationTouch.BBImplementationTouchFactory());

final MainFile main = new MainFile();

new Thread(new Runnable() {
public void run() {
Display.init(main);

// create and show gui here.

}
}).start();

main.enterEventDispatcher();
}
}
[/code]

I guess you can do it all in one thread, but this is the structure that I use. Note that this requires the LWUIT sources from a relatively recent SVN version. There have been quite a few LWUIT changes yesterday, I hope that did not break things. Did not have time to check, yet.

Kind regards,
Thorsten Schemm.

bwei
Offline
Joined: 2006-11-16

Hi Thorsten,

This looks great. I am wondering if you can give us a running example. I could make it.

Shai Almog

Hi Thorsten,
great job! That is the type of stuff we were looking for when open
sourcing LWUIT ;-)

I already implemented an official LWUIT BlackBerry port on top of the
BB API, however we are still waiting for both management approval and
testing of this port (its problematic since we don't have a working
device).

I took a very similar approach to yours with my implementation the
things that are implemented in our port are:
* Rotation
* Touch
* Hover/click touch support
* Multi-touch support
* System fonts
* Media - Partial we are experiencing some issues with the BB media
implementation.
* In place native text editing

Menu etc. also works as expected in our port. However, since we don't
have a device we can only confirm this on the simulator.

Regards,
Shai.

> To whom it may concern,
>
> I have been working on a Blackberry implementation that could be
> used as an alternative to the default MIDP GameCanvas
> implementation. I know that the default implementation does work
> fine on a Blackberry. Unfortunately it does not give an option to
> make use of the Blackberry keys such as the Menu key and the Back
> (Escape) key. To address this you would have to use of the
> Blackberry UI classes which in turn requires to write a Blackberry
> CLDC application instead of a MIDlet. While this requires you to
> build more than one jar, this does have a few advantages, too.
> Anyway, it's good to have the choice.
>
> The sources are provided AS IS, they are not complete and are not
> completely working, yet! You are invited to help out here. I am
> new to the Blackberry API and probably a few things could/should
> have been approached differently. The header of each file contains
> some implementation and usage notes. Note that Blackberry OS >=
> 4.2 is required for the BBScreenImplementation class and OS>= 4.7
> for the BBScreenImplementationTouch class.
>
> Things that still need work:
> * touch gestures
> * system font stuff
> * play media
> * lifecycle
> * making use of filters for input sensitivity configuration?
> * screen rotation/resizing
> * character input for textfield (not textarea) completely untested
> * problem when clicking the menu button twice, seems to be LWUIT
> related.
> * probably a lot more
>
>
> http://www.pader-sync.com/bbimpl/BBScreenImplementation.java
> http://www.pader-sync.com/bbimpl/BBScreenImplementationTouch.java
> [Message sent by forum member 'thorsten_s' (thorsten_s)]
>
> http://forums.java.net/jive/thread.jspa?messageID=321694
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

thorsten_s
Offline
Joined: 2008-08-15

Nice, looking forward to it :)