2011-01-08 80 views
0

我正在開發一個應用程序,在該應用程序中,我必須以編程方式檢查gps是否已啓用或未在手機中的位置?我如何找到這個?檢查是否啓用了BlackBerry gps

+0

可能重複[如何知道如果BlackBerry設備具有GPS?](http://stackoverflow.com/questions/4400976/how-to-know-if-blackberry-device-has -全球定位系統) –

回答

-1

所有新的BB都有GPS設備。你只需要確保它被正確設置。

首先請確保您在選項 - >高級選項應用程序中設置GPS數據源==設備GPS。

1
if (!LocationInfo.isLocationOn()) { 
    try { 
     LocationInfo.setLocationOn(); 
    } catch (ControlledAccessException cae) { 
     // You don't have the rights to enable GPS programatically. 
     // You might want to prompt the user for it. 
    } 
} 

你也可能想看看以下功能:

  • LocationInfo.isLocationSourceAvailable(INT模式) - 確定一個特定位置源可提供位置信息。
  • LocationInfo.isLocationSourceSupported(int mode) - 確定設備當前是否支持特定的位置源。

GL

相關問題