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
Developer
rakesh86shankar
Posts: 1,005
Registered: ‎05-22-2009
My Device: Not Specified

Hoow To get the Platform or OS version

Hi Guys,i want to know how to get the platform or os version in the simulator.I got know abt the deviceInfo class,but at the sametime ,it's not working in the simulator,By Using this OS Version,i  have to select the method to retrieve the icon images of the application.

 

 

Before 4.7 OS it supports .getIcon() method.But from 4.7 it supports getEncodedIcon(),By Checking the OS Version,i can call these methods.So i need to know how to get the OS versions?

 

 

Regards

 

Rakesh Shankar.P

 

Developer
sannyo
Posts: 148
Registered: ‎11-16-2009
My Device: Not Specified

Re: Hoow To get the Platform or OS version

hi

next time try to use the search in the forum or the KB articles.

 

String version = "";
        ApplicationDescriptor[] ad = ApplicationManager.getApplicationManager().getVisibleApplications();
        for ( int i = 0; i < ad.length; i++ )
        {
            if ( ad[i].getModuleName().trim().equalsIgnoreCase("net_rim_bb_ribbon_app") )
            {
                version = ad[i].getVersion();
                break;
            }
        }
        ad = null;

 With DeviceInfo.getPlatformVersion() you will get an empty string on the emulator.

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Hoow To get the Platform or OS version

 

CodeModuleManager.getModuleVersion((CodeModuleManager.getModuleHandleForObject("")));