【问题标题】:Blackberry GPS Criteria黑莓 GPS 标准
【发布时间】:2010-10-01 05:14:07
【问题描述】:

我正在为具有 GPS 功能的 BB 开发应用程序。但问题是 GPS 标准因运营商和设备而异。那么有谁知道可以使用的不同设置标准吗?我尝试使用不同的链接 BB 支持论坛,但我没有得到任何适用于每种情况的可靠方法。在此先感谢..

谢谢; 无

【问题讨论】:

标签: blackberry


【解决方案1】:

编辑:抱歉刚刚注意到您的问题是关于承运人的标准......所以这不是答案。

我不是黑莓 GPS 标准方面的专家,我的回答是基于我使用过几次。

根据我的经验,GPS 标准基于一组要求(精度、功耗、成本),您将这些要求输入标准对象。例如,这是我从互联网上下载的一些代码。

 /**
     * 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;
    }

完整文件位于:http://blackberry.svn.wordpress.org/trunk/src/com/wordpress/location/Gps.java

查看此 JavaDoc 中的表格:http://www.blackberry.com/developers/docs/6.0.0api/javax/microedition/location/Criteria.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多