Tuesday, September 8, 2009

How to get Blackberry device information?

String userAgent = "Blackberry" + DeviceInfo.getDeviceName() + "/" + getOsVersion() + " Profile/" + System.getProperty( "microedition.profiles" ) + " Configuration/" + System.getProperty( "microedition.configuration" ) + " VendorID/" + Branding.getVendorId();



public static String getOsVersion()
{ 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;
}
}
return version;
}

No comments: