views:

13

answers:

1

I'm trying to use Location services for the BB, but I need backwards support to OS 4.5xx.

In 4.5 API doc: Locator.geocode(AddressInfo address, Coordinates startCoords) returns an Enumeration. http://www.blackberry.com/developers/docs/4.6.0api/net/rim/device/api/lbs/Locator.html

In 5.0 API doc: Locator.geocode(AddressInfo address, Coordinates startCoords) returns a Landmark array. http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/lbs/Locator.html

Any ideas on how to support both versions? Based on the current OS?

A: 

In my point of view, you could either use precompiler statements to build 2 completely different versions of your app, handling the Enumeration for 4.6 (Locator class is since 4.6) os devices and another one for handling the array of Landmarks.

BUT I am a bit confused... Just looked at the two api docs and they both (5.0 and 4.6, not 4.5!) seem to return arrays of landmarks.

The 4.6 API (Locator class introduced) does only have Locator.geocode(String freeformString, Coordinates startCoords), no AddressInfo param like in the 5.0.

To use the same functionality on 4.5 os devices you need to use e.g. some webservice to geocode location strings.

endevour
A webservice does seem like an alternative, build a different app targeting an OS sounds aweful. What about runtime class loading based on the OS?
Valchris