2011-09-26 5 views
1

Blackberry 응용 프로그램에서 GPS로부터 현재 위치를 얻는 방법. 나는 Locationmanager method에서 작업을 잘하려고했지만 내 장치 (폭풍 2는 wifi를 사용함)에서 현재의 lat를 오랫동안 얻을 수 없다.Blackberry 응용 프로그램에서 GPS의 현재 위치를 얻으십시오.

나는 폭풍 문제를보고 처음에 이걸 발견

private class LocationListenerImpl implements LocationListener { 
    public void locationUpdated(LocationProvider provider, Location location) { 
     if (location.isValid()) { 
      heading = location.getCourse(); 
      longitude = location.getQualifiedCoordinates().getLongitude(); 
      latitude = location.getQualifiedCoordinates().getLatitude(); 
      altitude = location.getQualifiedCoordinates().getAltitude(); 
      speed = location.getSpeed(); 

      // This is to get the Number of Satellites 
      String NMEA_MIME = "application/X-jsr179-location-nmea"; 
      satCountStr = location.getExtraInfo("satellites"); 
      if (satCountStr == null) { 
       satCountStr = location.getExtraInfo(NMEA_MIME); 
      } 

      // this is to get the accuracy of the GPS Cords 
      QualifiedCoordinates qc = location.getQualifiedCoordinates(); 
      accuracy = qc.getHorizontalAccuracy(); 
     } 
    } 

    public void providerStateChanged(LocationProvider provider, int newState) { 
     // no-op 
    } 
} 
+0

정보가 충분하지 않음 -이 GPS가 켜져? 코드가 블랙 베리 방식을 따르고 있습니까? 요청하지 않은 응용 프로그램에 필요한 사용 권한이 있습니까? – KevinDTimm

+0

GPS를 사용할 수 있습니다. 네 코드는 블랙 베리 방식으로 GPS 시스템에서 오랫동안 송신 한 후 시뮬레이터에서 작동합니다. 세 번째는 허가에 관한 것입니까? 나는 네가 말하는 것을 허락 할 수 있을지 모르겠다. – Hitarth

+0

당신이 어떤 생각인지 알고 싶다면 – Hitarth

답변

1

내 코드 : 문제에 대한 If you run the above code on your BlackBerry device (for instance a Storm), you will get a "GPS not allowed" LocationProvider exception. You need to get your code signed if you want to use the BlackBerry Storm with GPS in your app. To do this, you need to buy a $20 certificate from RIM.

+0

내 코드가 이미 노래입니다. 구멍 응용 프로그램은 장치에서 잘 작동합니다. 내 응용 프로그램은 하나의 버튼 이름을 "현재 위치 사용"이 버튼 클릭 이벤트에서 현재 위치를 가져오고 응용 프로그램을 위해 진행하지만, 장치가있을 때마다 나는 위도가 0.0이됩니다. i는 sim 카드없이 폭풍이 있습니다. 구멍 응용 프로그램을 사용하고 있습니다. 와이파이 사용. – Hitarth

+0

내 문제는 그 문제를 해결하기 위해 서쪽 일이지만 솔루션을 얻을 수 없다 .. 데모 또는 suggetion에 관해서는 나를 도와주세요. – Hitarth

+0

당신은 http://stackoverflow.com/questions/2235660/setlocationlistener-not-working을 보셨습니까? -in-blackberry-gps-programming – KevinDTimm

관련 문제