Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 558
Registered: ‎11-25-2008
My Device: Not Specified
Accepted Solution

Best set of APIs to use.....I need some help

I really don't care about the portability issue as most APIs are fairly easy to exchange between one phone and another and since the big player outside of BB is the iphone and there are no similarities, portability really isn't much of an issue.....except maybe for the Android.....TBD.


From conversations I've had on a previous question, I came to the conclusion that one should try to use the javax APIs and only when necessary go with the blackberry API's. However, I notice that there are no Control Field equivalents, except for maybe Forms.


What it really seems to boil down to is what you prefer to use. I am thinking that I must use the Blackberry MainScreen type approach and I have the choice of using the mainscreen as a Bitmap (use getGraphics()) and draw, or I can even Create a Bitmap Field and call Graphics.create(bitmap) to get a graphics context into which I can draw, and here I can even combine my little bitmap with regular Control Fields......this seems to be the most adaptable.


So, when switching from applets to midlets, I'm thinking that Apps using screens are far more flexible.


It seems like I can use a midlet with lcdui and a canvas, which is OK for games but useless if you want to use buttons gauges, and stuff like that. The alternative is what I said above, and this seems much more flexible.


Any comments? Am I right?


I'm at a junction point where I'm about to be really productive, and I just need to know which way to go. I'll be churning code once I know which way to go.....so I kinda need to be told which to go with. If I'm right above, then if I need any controls I'll go with the blackberry app.

If it's just a game or something with a canvas, then I can just go with the midlet approach.


I just need someone who has produced more commercial software to let me know if I'm correct or not.


Thanks folks.


Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Best set of APIs to use.....I need some help

I am developing only with the BB APIs. We have some pasttime experience with j2me-polish and a few tries at standard j2me, but the restrictions are just a lot worse and you don't have access to many BB-related functionalities.

That said, the native BB UI is nearly as ugly as j2me. Android and IPhone are miles ahead and you can see RIM trying to come up at least with some basics, like rounded corners etc.
Give your first app a good share of overtime and think out of the box. You will have to develop quite some components that have to be re-usable and allow you to have a generic application good looking in a small amount of time.
This starts with bitmap-buttonfields, coloured labelfields and the like, proceeds to custom layout managers with certain border features and objectlistfields with integrated processing logic up to framesets that use a fixed navigation bar and only change part of the screen.

Usually you want to advance the looks of your application the next time - be sure to have a concept ready for your library or you end up with incompatible versions for your older projects.
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Posts: 558
Registered: ‎11-25-2008
My Device: Not Specified

Re: Best set of APIs to use.....I need some help

Thats kind of what I was coming to the conclusion of. Note that I don't think much of the iphone. They can't even do background threads, and Objective C???? Talk about opening the door for hackers?

I thought the Android was just using regular old J2ME.


I was reading that you can do touch based interfaces using standard J2ME as there are already APIs for some of that. However, I don't want to fight the software.


So far, I've been really pleased with the blackberry stuff.


I think, based on what you said that I'm going to go with the Blackberry APIs. I have a blank app that serves as my startup, but it basically is the standard pushscreen app.


You can then use Fields to implement any of the built-in components, and even create a "to your size" bitmap, get it a drawing context using Graphics g = Graphics.create(bitmap), and then use BitmapField bf = new BitmapField(bf) and you can have handlers just like any of the built-in fields.


So, that is quite powerful and flexible at the same time.


So, I'll procede from that standpoint.


I think using older J2ME canvas approaches can work for Games. I've found some games tutorials online and a few books I was able to drag off the web related to games.......not that most of what I want to do is games. So, if I want to convert something, using the canvas approach can be easier.


Thanks for the tips.