Messages by sdgiant

One topic, 6 messages
Kuix technical support » Create the sample application in Blackberry JDE4.2.1

Hey Suresh,

 

I had the same problem.  The problem seems to stem from an issue with the Blackberry implementation of the J2ME file system, I don't have exact info on the why's and how's.

Anyway, I was able to move forward by changing my file structure from:

\src

\res

\res\css

to:

\src

\src\css

And you need to load the source from the new location as well

        Kuix.loadCss("/src/css/myscreen.css");

I also abstracted the PATH to a constant, since I have a lot of images and XML I will need to move the path for other platforms, so you may want to consider something like this.  It's a dataprovider, so I can access not only the CONSTANTS in the code, but also abstact the paths in my XML.

public class GlobalDataProvider extends DataProvider {
   
    public static final String CSS_SRC                    = "/src/";
    public static final String XML_SRC                    = "/src/xml/";
    public static final String IMAGE_SRC                = "/src/img/";
   

    public Object getUserDefinedValue(String property) {
        if ("IMAGE_SRC".equals(property)) {
            return IMAGE_SRC;
        }
        if ("XML_SRC".equals(property)) {
            return XML_SRC;
        }
        return null;
    }
}

Then add that dataProvider on all the screens you want to abstract

    protected FriendDataProvider friendData = new FriendDataProvider();
    protected GlobalDataProvider globalData = new GlobalDataProvider();
   
    public void onAdded() {
        friendData.addSlave(globalData);

    }

So now you can have abstract paths in your code:


        Kuix.loadCss(GlobalDataProvider.CSS_SRC + "myscreen.css");

and your XML:


            <picture src="${IMAGE_SRC}image.png" />

The only area this does NOT abstract is the CSS file itself.  I don't think there is a way to make those paths abstract :-(

So you still have this:


       bg-image: url(/src/img/image.png);

Hope that helps!

Bill

Kuix technical support » Should textarea work correctly inside a scrollcontainer ?

It looks like this has changed maybe?  Not sure if it's a bug, but I tried

        <scrollPane usemarkers="true">
            <textarea id="field" class="description">@{dynamicText}</textarea>
          </scrollPane>

And got an IllegalArgumentException.   setAttribute() of ScrollPane is not currently looking for usemarkers as an attribute.

Also, it doesn't seem like this attribute is set to true by default:


    private boolean useMarkers = false;

I'd like get a scoll bar working around my textare.  What would be the correct context to do this now?

Kuix technical support » How do you make a FocusableWidget?

extending the instructions in the custom widget tutorial, how would you then get the widget to intercept pointer events.  I tried this simple version, but the neither event processor is being called when clicking the screen in the emulator.  Seems like I must be missing something simple, but looking at existing Widgets I can't see how to get started.


public class MyWidget extends FocusableWidget {

    public void paint(Graphics g) {
        super.paint(g);
        if (isFocused()) {   
            g.setColor(0xFF0000);
            g.drawArc(0, 0, 20, 20, 0, 360);
        }
    }
   
    public boolean processPointerEvent(byte type, int x, int y) {

        return super.processPointerEvent(type, x, y);
    }
    public boolean processFocusEvent(byte type) {
       
        return super.processFocusEvent(type);
    }

}

Thanks!
Bill

Kuix technical support » screen.setCurrent() from a 2nd thread

Excellent question, I was just contemplating a similar issue.  I have a listener we created that gets me to the callback.

Some of our callbacks should open new pages, which will hopefully work as expected, for example:

            Kuix.getFrameHandler().pushFrame(new HomeScreenFrame());
            Kuix.getFrameHandler().removeFrame(this);

but some will need to refresh the canvas.  We will even need to have listeners sitting on unanticipated messages from the server (like an IM from another user) so I will be running into the same issue very soon.

It would be great to get some feedback on this.

Kuix technical support » HelloWorld => java.lang.ClassNotFoundException

I had the same issue as oldshoe running the HelloWorld demo from the site.  I tried switching the JRE as SyRenity (tried js2dk 1.4.2_19 as EclipseME recommends), but without success.  Moved to Eclipse 3.3.2 with the same EclipseMe and Sun WTK and had no problem.  Not a problem for me to use 3.3.2 (so far), but posting the details for anyone else having issues...

Problem came while running the following development:

Eclipse 3.4.1

EclipseMe 1.7.9

Sun WTK 2.5.2_01

Console Output:

Running with storage root C:\...\DefaultColorPhone
Running with locale: English_United States.1252
Running in the identified_third_party security domain
java.lang.ClassNotFoundException: org/kalmeo/tutorial/HelloWorld
    at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
    at com.sun.midp.midlet.Scheduler.schedule(+52)
    at com.sun.midp.main.Main.runLocalClass(+28)
    at com.sun.midp.main.Main.main(+80)
Execution completed.
3335802 bytecodes executed
19 thread switches
1667 classes in the system (including system classes)
17251 dynamic objects allocated (514636 bytes)
1 garbage collections (0 bytes collected)

Kuix technical support » HelloWorld => java.lang.ClassNotFoundException

I had the same issue as oldshoe running the HelloWorld demo from the site.  I tried switching the JRE as SyRenity (tried js2dk 1.4.2_19 as EclipseME recommends), but without success.  Moved to Eclipse 3.3.2 with the same EclipseMe and Sun WTK and had no problem.  Not a problem for me to use 3.3.2 (so far), but posting the details for anyone else having issues...

Problem came while running the following development:

Eclipse 3.4.1

EclipseMe 1.7.9

Sun WTK 2.5.2_01

Console Output:

Running with storage root C:\...\DefaultColorPhone
Running with locale: English_United States.1252
Running in the identified_third_party security domain
java.lang.ClassNotFoundException: org/kalmeo/tutorial/HelloWorld
    at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
    at com.sun.midp.midlet.Scheduler.schedule(+52)
    at com.sun.midp.main.Main.runLocalClass(+28)
    at com.sun.midp.main.Main.main(+80)
Execution completed.
3335802 bytecodes executed
19 thread switches
1667 classes in the system (including system classes)
17251 dynamic objects allocated (514636 bytes)
1 garbage collections (0 bytes collected)