Emre
Emre
Ankara
28/11/2013 tarihinden beri üye
275 GY Puanı
28K GY Sırası

Kişisel Sayfaları

İlgi Alanları

2 Rozet
3 Sertifika
1 Soru Sordu
4 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

Selçuk Üniversitesi
| Aralık 2020 - Aralık 2020

Sertifikalar & Başarılar

GY Sertifikaları (3)
Android 301 Sertifikası
Veriliş Tarihi: Aralık 2014
Android 201 Sertifikası
Veriliş Tarihi: Ekim 2014
Android 101 Sertifikası
Veriliş Tarihi: Ekim 2014
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

5
Tümünü Gör

Android Google map v2 de gps mavi nokta yavaş gelme sorunu

Merhaba Arkadaşlar

Bir turist rehber uygulaması için uygulama geliştiriyorum ancak google map dahilinde olan kendi konumunu gösterme butonuna tıkladığımda bir önceki konumundan yeni konuma mavi nokta yavaş yavaş geliyor neden bu durumla karılaşıyorum bilen var mı?. Yardımcı olursanız sevinirim şimdiden teşekkürler.

Google Map Markers Ekleme Sorunu

23 Mart 2015 tarihinde cevaplandı

Kodu tekrar  kod sekmeleri arasına alıp atarsan görünürlük biraz karışık

Hata alıyomusun belki ekliyodur uzaklaştırma ya da yakılaştırma yapmayı deneyebilirsinn
 

Android Google map v2 de gps mavi nokta yavaş gelme sorunu

[code]

public class MainActivity extends FragmentActivity {

    private GoogleMap mGoogleMap;
    Spinner mSprPlaceType;

    String[] mPlaceType = null;
    String[] mPlaceTypeName = null;

    double mLatitude = 0;
    double mLongitude = 0;
    SupportMapFragment fragment;
    Location loc;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mPlaceType = getResources().getStringArray(R.array.place_type);
        mPlaceTypeName = getResources().getStringArray(R.array.place_type_name);
        mSprPlaceType = (Spinner) findViewById(R.id.spr_place_type);
        ArrayList<Mekan> mekan = new ArrayList<Mekan>();
        for (String i : mPlaceTypeName) {
            mekan.add(new Mekan(i));

        }
        // <--Burada ayarlar ekranından gelen arama yarıçapıdeğeri alınır-->
        Intent i = getIntent();
        final int km = i.getIntExtra("newkm", 32);
        Log.d("----", "-----" + km);

        ArrayAdapter<Mekan> adapter = new ArrayAdapter<Mekan>(this,
                android.R.layout.simple_spinner_item, mekan);

        mSprPlaceType.setAdapter(adapter);

        Button btnFind = (Button) findViewById(R.id.btn_find);

        int status = GooglePlayServicesUtil
                .isGooglePlayServicesAvailable(getBaseContext());

        if (status != ConnectionResult.SUCCESS) { // Google Play Services are
                                                    // not available

            int requestCode = 10;
            Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this,
                    requestCode);
            dialog.show();

        } else {
            // Getting reference to the SupportMapFragment
            fragment = (SupportMapFragment) getSupportFragmentManager()
                    .findFragmentById(R.id.map);

            // Getting Google Map
            mGoogleMap = fragment.getMap();

            // Enabling MyLocation in Google Map
            mGoogleMap.setMyLocationEnabled(true);
            mGoogleMap.moveCamera(CameraUpdateFactory.zoomTo(13));

            mGoogleMap.getUiSettings().setMyLocationButtonEnabled(true);
            mGoogleMap.getUiSettings().setZoomControlsEnabled(true);
            mGoogleMap.getUiSettings().setMapToolbarEnabled(true);

            konumal();
             LatLng yeniKoordinat = new LatLng(mLatitude, mLongitude);
            
             if (yeniKoordinat != null) {
             mGoogleMap.moveCamera(CameraUpdateFactory
             .newLatLng(yeniKoordinat));
            // Toast.makeText(
            // this,
            // "" + yeniKoordinat.latitude + "\n"
            // + yeniKoordinat.longitude, Toast.LENGTH_SHORT)
            // .show();

             }

}

public void konumal() {
        gpsIzleyici yeniGpsIzleyici = new gpsIzleyici(MainActivity.this);
        if (yeniGpsIzleyici.canGetLocation()) {
            mLatitude = yeniGpsIzleyici.getLatitude();
            mLongitude = yeniGpsIzleyici.getLongitude();
            Log.d("-------------------" + mLongitude, "--------------------"
                    + mLatitude);

            if (mLatitude == 0.0 && mLongitude == 0.0) {
                Toast.makeText(getApplicationContext(), "GPS KAPALI",
                        Toast.LENGTH_LONG).show();
                yeniGpsIzleyici.showSettingsAlert();

            } else {
                LatLng yeniKoordinat = new LatLng(mLatitude, mLongitude);
                mGoogleMap.moveCamera(CameraUpdateFactory
                        .newLatLng(yeniKoordinat));
                Toast.makeText(
                        getApplicationContext(),
                        "Sizin konumunuz:\n\tLat: " + mLatitude + "\n\tLong: "
                                + mLongitude, Toast.LENGTH_LONG).show();
            }
        } else {
            // konum veris alınamazsa
            // GPS ya da network açıkde değilse
            // etkinleştimek için ayarlara giit
            yeniGpsIzleyici.showSettingsAlert();
        }
    }

@Override
    protected void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
        fragment.onDestroy();

    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        fragment.onResume();
    }

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        fragment.onPause();
    }

    @Override
    public void onLowMemory() {
        // TODO Auto-generated method stub
        super.onLowMemory();
        fragment.onLowMemory();
    }

[/code]

[code]

package com.example.gezi;

import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.IBinder;
import android.provider.Settings;
import android.util.Log;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.model.LatLng;

public class gpsIzleyici extends Service implements LocationListener {

    private final Context mContext;

    // gps durumu için
    boolean isGPSEnabled = false;

    // network durumu için
    boolean isNetworkEnabled = false;
    boolean canGetLocation = false;

    Location loc1;
    double lat;
    double lng;

    // güncelleme mesafesi
    private static final long min_guncelleme_mesafesi = 10;

    // min güncelleme süresi

    private static final long min_guncelleme_ms = 1000 * 60 * 1;

    protected LocationManager locationManager;

    public gpsIzleyici(Context context) {
        mContext = context;
        locationAl();
    }

    public Location locationAl() {
        try {
            locationManager = (LocationManager) mContext
                    .getSystemService(LOCATION_SERVICE);

            isGPSEnabled = locationManager
                    .isProviderEnabled(LocationManager.GPS_PROVIDER);

            isNetworkEnabled = locationManager
                    .isProviderEnabled(LocationManager.NETWORK_PROVIDER);

            if (!isGPSEnabled && !isNetworkEnabled) {

            } else {

                canGetLocation = true;
                if (isNetworkEnabled) {
                    locationManager.requestLocationUpdates(
                            LocationManager.NETWORK_PROVIDER,
                            min_guncelleme_ms, min_guncelleme_mesafesi, this);

                    Log.d("Network", "Network");
                    if (locationManager != null) {
                        loc1 = locationManager
                                .getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
                        if (loc1 != null) {
                            lat = loc1.getLatitude();
                            lng = loc1.getLongitude();
                        }

                    }
                }

                if (isGPSEnabled) {
                    if (loc1 == null) {
                        locationManager.requestLocationUpdates(
                                LocationManager.GPS_PROVIDER,
                                min_guncelleme_ms, min_guncelleme_mesafesi,
                                this);
                        Log.d("GPS YETKİLİ", "GPS YETKİLİ ");
                        if (locationManager != null) {
                            loc1 = locationManager
                                    .getLastKnownLocation(LocationManager.GPS_PROVIDER);
                            if (loc1 != null) {
                                lat = loc1.getLatitude();
                                lng = loc1.getLongitude();
                            }

                        }

                    }
                }

            }

        } catch (Exception e) {
            // TODO: handle exception
        }
        return loc1;

    }

    public void gpsDurdur() {
        if (locationManager != null) {
            locationManager.removeUpdates(gpsIzleyici.this);
        }
    }

    public double getLatitude() {
        if (loc1 != null) {
            lat = loc1.getLatitude();
        }
        return lat;
    }

    public double getLongitude() {
        if (loc1 != null) {
            lng = loc1.getLongitude();
        }
        return lng;
    }

    public boolean canGetLocation() {

        return canGetLocation;
    }

    public void showSettingsAlert() {
        AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);

        // Setting Dialog Title
        alertDialog.setTitle("GPS AYARLAR");

        // Setting Dialog Message
        alertDialog
                .setMessage("GPS açık değil.Gps'i açmak için ayarlar menüsüne gitmek ister misiniz?");

        // On pressing Settings button
        alertDialog.setPositiveButton("Settings",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        Intent intent = new Intent(
                                Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                        mContext.startActivity(intent);
                    }
                });

        // on pressing cancel button
        alertDialog.setNegativeButton("Cancel",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.cancel();
                    }
                });

        // Showing Alert Message
        alertDialog.show();
    }

    @Override
    public void onLocationChanged(Location location) {
//        lat = location.getLatitude();
//        lng = location.getLongitude();
//        LatLng latLng = new LatLng(lat, lng);

    }

    @Override
    public void onProviderDisabled(String provider) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onProviderEnabled(String provider) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
        // TODO Auto-generated method stub

    }

    @Override
    public IBinder onBind(Intent intent) {
        // TODO Auto-generated method stub
        return null;
    }

}

 

[/code]

Android Google map v2 de gps mavi nokta yavaş gelme sorunu

[code]mGoogleMap.setMyLocationEnabled(true);[/code] yazdığım activty ekranına yazıyorum

dediklerinizi ama sizin kodunuzdaki mapview dan sonrakileri çiziyor

Android API sorunu

21 Mart 2015 tarihinde cevaplandı

Android manifest kısmında yer alan targetSdkversion'  22 olarak güncellediniz mi acaba?