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
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

warning at install time

Is there a way to give warning to user at installation time, say incompatible OS?

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
Developer
Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: warning at install time

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

----------------------------------------------------------------------------
chown -R us ./base
~J!NX
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: warning at install time

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.

 

Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

Re: warning at install time

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?

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: warning at install time

[ Edited ]

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.

 

 

Developer
Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: warning at install time

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

----------------------------------------------------------------------------
chown -R us ./base
~J!NX
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: warning at install time

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.

 

Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

Re: warning at install time

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.

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
Highlighted
Developer
Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: warning at install time

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

----------------------------------------------------------------------------
chown -R us ./base
~J!NX