Welcome!

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

Reply
New Developer
davekakati
Posts: 7
Registered: ‎09-18-2008
My Device: Not Specified

converting ESN to Bar code and displaying in the screen

Hi All,

 

I ve a problem where I ve to convert the ESN to Bar Code and display the bar code in the screen. Can Anybody give me a light about how to go for it. Im not using any SDK for bar code now.

 

with thanks

 

Dev

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: converting ESN to Bar code and displaying in the screen

What is ESN?
Please use plain text.
New Developer
davekakati
Posts: 7
Registered: ‎09-18-2008
My Device: Not Specified

Re: converting ESN to Bar code and displaying in the screen

Electronic Serial Number, Thats is unique for each device. We can Identify the device either through PIN or ESN.

 

 

with thanks

 

Dev

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: converting ESN to Bar code and displaying in the screen

You first need to determine what kind of barcode you need to display and then either (most likely) purchase a library for that format or roll your own.
Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: converting ESN to Bar code and displaying in the screen

Can you add Fonts to a BlackBerry.  Not sure, just done a quick search and didn't find anything, this Thread suggests not.

 

http://supportforums.blackberry.com/rim/board/message?board.id=BlackBerryDeviceSoftware&message.id=1...

 

So you might be stuck with having to draw them yourself?

 

I guess one way would be to make a little png for each letter (may be only need the numbers since you only want the ESN), and then just draw them adjacent to each other.

 

However I'm guessing you want to this, and then scan the result from the screen using a barcode reader?  If so, be careful what scanner you use, most that I have tried will not work off a screen - I believe they need their laser reflected and it doesn't work too well off an LCD.

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: converting ESN to Bar code and displaying in the screen

Right, this is how true type fonts have been implemented before.  It's not the greatest way of rendering as it fixes your font size, but w/o access to something like FreeType it's about as good as one can hope for.

 

In any event, depending on the format it shouldn't be too hard to create a barcode library from scratch.  I doubt the OP needs anything like QR codes to encode something as simple as an ESN or IMEI.

Please use plain text.