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
Highlighted
Developer
Posts: 111
Registered: ‎10-01-2009
My Device: Not Specified
Accepted Solution

read version from inside app

I'm trying to create a update check for my app. I'm using eclipse and setting the version by going into blackberry project properties and changing the version thereIs there anyway for me to access that info from in the program, or is there a better way for me to set the project version from in the program so i can access it and not have to change it in multiple places?

 

Thanks!

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: read version from inside app

Here is some code, that I use in my 'About' Screens, that I think does what you want.

 

ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor(); int moduleHandle = ad.getModuleHandle(); SimpleDateFormat sdFormat = new SimpleDateFormat("EEE, dd MMM yyyy"); String buildDateString = CodeModuleManager.getModuleVersion(moduleHandle) + "-" + sdFormat.formatLocal(CodeModuleManager.getModuleTimestamp(moduleHandle)); add(new RichTextField(_resources.getString(UI_ABOUT_BUILD) + " " + ad.getVersion() + ", " + buildDateString, Field.READONLY));

 

Developer
Posts: 111
Registered: ‎10-01-2009
My Device: Not Specified

Re: read version from inside app

this is exaclty what im looking for. thank you!