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: 37
Registered: ‎05-30-2009
My Device: Not Specified
Accepted Solution

OS Detection during OTA install?

I have setup an OTA installation of my app which should only be installed by devices with a certain OS level. Is there a way to enforce this (i.e .jad file property) or equivalent? Basically I want to prevent users with incompatible devices to try to install the app over the air.

 

I am using eclipse with the BB plugin.

 

Thanks for yor help.

 

 

Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: OS Detection during OTA install?

I'm not sure if this is possible but maybe you can implement a script in your OTA site where it checks the user-agent of the requesting device. from there you can have a logic on whether to allow it to download or not. Smiley Happy 

Developer
Posts: 37
Registered: ‎05-30-2009
My Device: Not Specified

Re: OS Detection during OTA install?

Thanks for you reply. That was going to be my contingency plan but I was hoping the device installer had something built-in that would key off of an attribute in the .jad file.
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: OS Detection during OTA install?

Well, if you compile it with the proper jde, i think the JVM is smart enough to detect if there are incompatibilities between the application and the OS.Smiley Happy
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: OS Detection during OTA install?

As johnbibs says, the place to do this is in server-side in you OTA landing page. You can inspect the BB User-Agent header and extract the device model and OS Level, then redirect the browser to the correct JAD.

 

In my experience, the app loader on the device doesn't catch these issues very well. Futhermore, you may have a 4.7 version and a 4.2 version: the 4.2 version is perfectly valid for the 4.7 device, but you would much rather that the customer have the 4.7 version.

 

 

Developer
Posts: 37
Registered: ‎05-30-2009
My Device: Not Specified

Re: OS Detection during OTA install?

Thank you very much for both of your replies.
New Developer
Posts: 14
Registered: ‎07-18-2008
My Device: Not Specified

Re: OS Detection during OTA install?

A word of caution here - checking the user agent can produce inconsistent results - it only works if the user leaves their browser identification option set to 'BlackBerry'. If they change this then the user agent will emulate MSIE, Firefox, etc.

 

The safer method is to check for the "profile" http header and if that's not present then the "x-wap-profile" http header. These headers are the only source of reliable device & OS data across WAP, BIS, BES & Hotspot browsers.

 

Having said that, it's still impossible to successfully detect a BlackBerry emulating MSIE or Firefox via WAP or Hotpost browsers, since there's no BlackBerry infrastructure involved to add the headers above - but at least you've caught 90%.

 

The only 100% guaranteed way to ensure correct OTA delivery is via App World.

 

James

CTO | DevelopIQ
www.developiq.com