tags:

views:

34

answers:

1

Hi All,

I am developing an app for BB having GPS capability. But the problem is the GPS criteria varies as per the carriers and Devices. So does any one knows the different set criteria which can be used? I tried to use the different links BB support forums but I not getting any assured way which should work for every case. Thanks in Advance..

Thanks; nil

A: 

EDIT: Sorry Just noticed your question was regarding Criteria by carrier... So this isn't exactly the answer.

I'm no expert on Blackberry GPS criteria and my answer is based on using it a few times Ive used it.

In my experience the GPS criteria is based on set of requirements(accuracy, power consumption, cost), and you feed these into the criteria object. For example here is some code I got off the internet.

 /**
     * assisted: Use this mode to get location information from satellites using a PDE. This mode allows a BlackBerry device
     * application to retrieve location information faster than the autonomous mode and more accurately than the cell site mode.
     * To use this mode requires wireless network coverage, and the BlackBerry device and the wireless service provider must
     * support this mode.
     */
    private Criteria getAssistedCriteria(int powerConsumption) {
        Criteria criteria = new Criteria();
        criteria.setHorizontalAccuracy(100);
        criteria.setVerticalAccuracy(100);
        criteria.setCostAllowed(true);
        criteria.setPreferredPowerConsumption(powerConsumption);
        return criteria;
    }


    /**
     * autonomous: Use this mode to get location information from the GPS receiver on the BlackBerry device without assistance
     * from the wireless network. This mode allows a BlackBerry device application to retrieve location information that has highaccuracy,
     * and does not require assistance from the wireless network. However, the speed at which this mode retrieves
     * location information is slower than the other modes.
     */
    private Criteria getAutonomousPosCriteria() {
        Criteria criteria = new Criteria();
        criteria.setCostAllowed(false);
        return criteria;
    }

    /**
     * cell site: Use this mode to get location information from cell site towers. This mode allows a BlackBerry device application
     * retrieve location information faster than the assisted and autonomous modes. However, the accuracy of the location
     * information is low-level and does not provide tracking information such as speed or route information. Using this mode
     * requires wireless network coverage and that both the BlackBerry device and the wireless service provider support this mode.
     */
    private Criteria getCellSiteCriteria() {
        Criteria criteria = new Criteria();
        criteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT);
        criteria.setVerticalAccuracy(Criteria.NO_REQUIREMENT);
        criteria.setCostAllowed(true);
        criteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);
        return criteria;
    }

The full File is located at: http://blackberry.svn.wordpress.org/trunk/src/com/wordpress/location/Gps.java

Have a look at the tables in this JavaDoc: http://www.blackberry.com/developers/docs/6.0.0api/javax/microedition/location/Criteria.html

eSniff