04-20-2010 01:10 PM
Is there a way to give warning to user at installation time, say incompatible OS?
04-20-2010 03:33 PM
I don't think so. You could include compatible OS versions in the description of the app, and I believe you can use the preprocessor to determine the OS level of the device and react accordingly. Neither of these options will work at install time, however.
Hope that helps,
~Dom
04-20-2010 03:40 PM
How is the app being installed? BB DEsktop won't allow the non-compatible app to be downloaded to the device.
For OTA installations, we inspect the User-Agent header to locate the device model and OS level, then either direct the browser to the correct build, or display an error page if there is no compatible version of the app available.
04-20-2010 03:45 PM
this is for OTA but currently server dont have the capability to detect and redirect.
that should be the proper solution.
but for quick solution can there be something like as user launches the app there i detect that this api being used is not available and alert the user and exit the app. problem here is blackberry detects the module dont present in OS and report it as exception. Any ideas what can be done?
04-20-2010 03:47 PM - edited 04-20-2010 03:49 PM
No, you'll probably need to implement the version checking server-side.
One "work-around" might be to write a downloader for the app, using the lowest OS level.
The downloader can then detect the OS level on the device when it starts, and launch the broswer to the appropriate build.
Of course, if there is no apropriate build, display an error message.
04-20-2010 03:58 PM
Well, on application start, check for DeviceInfo.getOSVersion (), and compare it to a list of compatible versions. Something like the following perhaps:
class MyClass
{
boolean _compatible = false;
public static void main (string [] args)
{
string OS = DeviceInfo.getOSVersion ();
string [] OSSplit = { OS.substring (0, 1),
OS.substring (2, 1) };
if (OSSplit [0].equals ("4"))
{
if (OSSplit [1].equals ("6") || OSSplit [1].equals ("7")
{
_compatible = true;
}
}
else if (OSSplit [0].equals ("5"))
{
if (OSSplit [1].equals ("0")
{
_compatible = true;
}
}
//The above application would only be compatible with OS 4.6, 4.7, and 5.0
if (!_compatible)
{
return;
}
//rest of application
}
}
Not exactly elegant, but functional in a sense. (Until OS 10.x comes out, anyway)
Hope that helps,
~Dom
04-20-2010 07:10 PM
The problem, is, Dom, that you won't get this far if you are running (for example) 4.7 code on a 4.2.1 Curve.
04-21-2010 12:47 AM
completely in agreement in RexDoug that when you open the app there itself it sees that 4.7 api not available currently and throws the exception.
04-21-2010 09:25 AM
Fair enough. I've haven't had to deal with this particular issue yet. I thought the problem arose when it tried to use the unsupported API, not when the application started.
Good luck,
~Dom