Nesrin
Nesrin
İstanbul-II (Anadolu)
20/10/2015 tarihinden beri üye
50 GY Puanı
55K GY Sırası

Kişisel Sayfaları

İlgi Alanları

2 Rozet
1 Sertifika
1 Soru Sordu
1 Cevap Verdi
0 Blog Yazısı
0 Etiket Takibi

Hakkında

İş Tecrubesi

Kullanıcıya ait İş tecrübesi bilgisi bulunmamaktadır.

Eğitim Geçmişi

Fırat Üniversitesi
| Aralık 2020 - Aralık 2020

Sertifikalar & Başarılar

GY Sertifikaları (1)
Android 101 Sertifikası
Veriliş Tarihi: Mayıs 2017
Diğer Sertifikaları (0)
Kullanıcıya ait sertifika bulunmamaktadır.
Test Sonuçları (0)

Kullanıcıya ait test sonucu bulunmamaktadır.

Dil Becerileri

Son Forum Aktiviteleri

2
Tümünü Gör

Android Harita Location Manager Hatası

Merhaba Arkadaşlar,

harita üzerinde konum bulma üzerine çaışıyorum. ancak requestLocationUpdates (LocationManager.GPS_PROVIDER, , , ) kodunda sürekli hata alıyorum.

bütün izinlerimide verdim. Bu konuda yardımcı olabilirmisiniz?

 

public class MapsActivity extends FragmentActivity {
    public boolean isGPSEnabled = false;
    public boolean isNetworkEnabled = false;
    private static final long MINIMUM_TIME_BETWEEN_UPDATES = 10000;
    private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10000;  @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.

        LocationManager konumYönetici = (LocationManager) this.getSystemService(LOCATION_SERVICE);
        isGPSEnabled = konumYönetici.isProviderEnabled(LocationManager.GPS_PROVIDER);
        isNetworkEnabled = konumYönetici.isProviderEnabled(LocationManager.NETWORK_PROVIDER);


        String locationProvider = LocationManager.GPS_PROVIDER;

            LocationListener konumDinle = new LocationListener() {

            @Override
            public void onLocationChanged(Location location) {
                Toast.makeText(getBaseContext(),
                        "Latitude: " + location.getLatitude() +
                                " Longitude: " + location.getLongitude(),
                        Toast.LENGTH_SHORT).show();}   @Override
            public void onStatusChanged(String provider, int status, Bundle extras) {}
            @Override
            public void onProviderEnabled(String provider) {}
            @Override
            public void onProviderDisabled(String provider) {}};
   konumYönetici.requestLocationUpdates(LocationManager.GPS_PROVIDER, MINIMUM_TIME_BETWEEN_UPDATES, 0, konumDinle);

aldığım hata  

            Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException` less... (Ctrl+F1)

This inspection looks at Android API calls and ensures that the correct type of resource is passed to an int-parameter expecting resources of a given type; it checks that APIs which expect an RGB color integer are passed actual colors rather than color resources; it checks that APIs which require a certain permission have the permission declared in the manifest; it checks that parameters expected to fall within a given range actually do; it checks that results of certain method calls are looked at by the caller, and so on.     

8 yıl 4 ay önce yanıtladın

Buton ile GPS açma kapama

basla.setOnClickListener(new OnClickListener() {
   
   @Override
   public void onClick(View v) {
    Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
          intent.putExtra("enabled", true);
          sendBroadcast(intent);    
   }
  });     

butona basıldığı zaman GPS açılıyor.