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

