Code Monkey home page Code Monkey logo

android-simplelocation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-simplelocation's Issues

Speed is 0.0 and interval is not decreased

Hi marco! Thanks for your wonderful library.
I came up with two minor issues. First one is that the speed is always zero!
Second one is how can I decrease intervals in locationChangeListener? It always updates with 20 seconds!

Location tracking failed on background

Hi Team, this library simplified lot of works. But in my application i am using background service to update user current location using alarmManager & Service.

1. If user is in online then i send data to server. If not storing into Room Database.
2. Every 5 minutes i updating location details.
3. If i am in travel, after reached new location its not updating new location, when i open my app then . only its updating new location and sending to server

Please help me if i am wrong. Thanks!

`
class AppService : Service() {
var NOTIFICATION_ID = "notification-id"

override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
    super.onStartCommand(intent, flags, startId)

    val context = this
    val location = SimpleLocation(context)

    val address = getAddress(context, location.latitude, location.longitude)

    if (isConnectedOrConnecting(context)) {

        AppUtil.addAttendance(getLatLng(context), address, context)

        val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager

        val notification = getNotification(context, "Hai, sent your location$address")
        val id = intent.getIntExtra(NOTIFICATION_ID, 0)
        notificationManager.notify(id, notification)
        roomDB = Room.databaseBuilder(this, LocationDataBase::class.java, "location_db").allowMainThreadQueries().build()
        val list = roomDB.locationModel().listOfLocation

        sendSavedDataToServer(list, this)
    } `

lat, lng is 0

In many phones its working perfect but in few phones lag lng is zero all the time. any solution?

Lat : 0, Lon : 0

Hi, I followed the instructions in the readme file. But result Lat: 0.0, Lon: 0.0

`package app.meysta;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import im.delight.android.location.SimpleLocation;

public class Splash extends Activity {

private SimpleLocation location;
 double latitude =1;
 double longitude = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.act_splash);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    //setSupportActionBar(toolbar);


    location = new SimpleLocation(Splash.this, true, false, 5 * 1000, true);

    // if we can't access the location yet
    if (!location.hasLocationEnabled()) {
        // ask the user to enable location access
        SimpleLocation.openSettings(Splash.this);
    }

    TextView txt = (TextView)findViewById(R.id.txtt);

    txt.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
             latitude = location.getLatitude();
             longitude = location.getLongitude();

            Log.i("Lokasyon", String.valueOf(latitude)+","+longitude);
            location.beginUpdates();
        }
    });


    location.setListener(new SimpleLocation.Listener() {

        public void onPositionChanged() {
            latitude = location.getLatitude();
            longitude = location.getLongitude();


        }

    });

}



@Override
protected void onResume() {
    super.onResume();

    // make the device update its location
    location.beginUpdates();
    latitude = location.getLatitude();
    longitude = location.getLongitude();
    // ...
}

@Override
protected void onPause() {
    // stop location updates (saves battery)
    location.endUpdates();

    // ...

    super.onPause();
}

}
`

get accuracy

Hi, can you implement de getAccuaracy() :) ๐Ÿ‘

Thxs!

Gradle Compile

Please can you show gradle compile code on home screen.

passiveMode, what does it mean ?

I have tried to read the readme and I have tried to search in the 'issues' section, but I can't find documentation about the difference between passiveMode == true and passiveMode == false

could you please help us to explain about this parameter ?

Lat and Long both are 0.0

This is how I am doing but I am always getting Lat and Long values 0.0
```
// construct a new instance of SimpleLocation
location = new SimpleLocation(this);

    // if we can't access the location yet
    if (!location.hasLocationEnabled()) {
        // ask the user to enable location access
        SimpleLocation.openSettings(this);
    }

    findViewById(R.id.someview).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            final double latitude = location.getLatitude();
            final double longitude = location.getLongitude();

            mLatitudeText.setText("Lat " +
                    "" + location.getLatitude());
            mLongitudeText.setText("Long " +
                    "" + location.getLongitude());

        }

    });
    // construct a new instance of SimpleLocation
    location = new SimpleLocation(this);

    // if we can't access the location yet
    if (!location.hasLocationEnabled()) {
        // ask the user to enable location access
        SimpleLocation.openSettings(this);
    }

    findViewById(R.id.someview).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            final double latitude = location.getLatitude();
            final double longitude = location.getLongitude();

            mLatitudeText.setText("Lat " +
                    "" + location.getLatitude());
            mLongitudeText.setText("Long " +
                    "" + location.getLongitude());

        }

    });

I am using Samsung A5 Android lollipop

I've just copy+paste the code but returns 0.0

Sorry for disturbing .. I am trying the code on emulator.
I've just copy+paste the code from Readme file and it returns 0.0 .
Here is my code ;

public class MainActivity extends AppCompatActivity {

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

    final TextEdit tw1 = (TextEdit) findViewById(R.id.textView);
    final TextEdit tw2 = (TextEdit) findViewById(R.id.textView2);
    // construct a new instance of SimpleLocation
    location = new SimpleLocation(this);

    // if we can't access the location yet
    if (!location.hasLocationEnabled()) {
        // ask the user to enable location access
        SimpleLocation.openSettings(this);
    }

    findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            final double latitude = location.getLatitude();
            final double longitude = location.getLongitude();

            tw1.setText("Lat: "+latitude);
            tw2.setText("Lng: "+longitude);

            // TODO
        }

    });
}

@Override
protected void onResume() {
    super.onResume();
    // make the device update its location
    location.beginUpdates();
    // ...
}

@Override
protected void onPause() {
    // stop location updates (saves battery)
    location.endUpdates();
    // ...
    super.onPause();
}

Received first coordinates (not 0, 0), but values did not update afterward.

Hi there!

First of all, I would like to thank you for this awesome library. It does help me with my project, also I'm relatively new to Android programming. However, I'm having a small issue that maybe you could help me with. I've followed the instructions on the README file. Everything is running smoothly but then I realized that the first coordinates I received did not update afterward. It keeps giving the same exact coordinates every 10 seconds even when I go out for running.

Note: I've used a Runnable for this to save the coordinate values every 10 seconds into .csv file until I pressed a button to stop it.

In MainActivity file:

private SimpleLocation mLocation;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d("onCreate", "onCreate");

    if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 123);
    }


    mLocation = new SimpleLocation(this);

    if (!mLocation.hasLocationEnabled()) {
        // ask the user to enable location access
        SimpleLocation.openSettings(this);
    }

   
}

private Runnable mGPSRunnable = new Runnable() {
    @Override
    public void run() {
        final double latitude = mLocation.getLatitude();
        final double longitude = mLocation.getLongitude();            
        Log.d("GPS", "Lat: " + latitude + " Long: " + longitude);
        mHandler.postDelayed(this, 10000);
        saveGPSData(); // saves the values in .csv file
    }
};

The two methods below are assigned to one button each:

public void startGPS() {
    mGPSRunnable.run();
    mLocation.beginUpdates();
}

public void stopGPS() {
    mHandler.removeCallbacks(mGPSRunnable);
    mLocation.endUpdates();
}

Did I forget something here?

My apologies for the long post. I would really appreciate if you can help me with this :)

Location is not giving updated latitude and longitude

When it changes the position it is not updating the latitude and longitude so giving old values instead of giving new latitude and longitude values.

        location.setListener(new SimpleLocation.Listener() {

            public void onPositionChanged() {
                // new location data has been received and can be accessed




                    latitude_user = location.getLatitude();
                    longitude_user = location.getLongitude();

}

Cannot resolve

Error:(34, 13) Failed to resolve: com.github.delight-im:Android-SimpleLocation:v1.0.1

Location not updated in background service

Hi,
I am using this in my background service.It is working perfectly fine when we are in app but when app is in background it work for 3-5 times then it start showing same location again and again.
Please help me as early as possible.

Course location working, but not Fine location

When i set the requireFine parameter of any of the constructors to true, i get 0.0 coordinates, but when i use the single-param constructor(defaulting requireFine to false), i get actual coordinates(i havnt plotted them onto a map so i cant say how accurate they are).

My usage:
-GPS settings enabled on phone, check
-Manifest permissions(course & fine), check
-calling beginUpdates in onResume(calling endUpdates immediately after i get the coordinates), check
-checking if hasLocationEnabled before getting coordinates, check

Only Updating very occasionally, despite update interval being set to 500

Heyo, I'm having an issue where the GPS location is only being updated very occasionally, despite the fact that I have explicitly defined it as 0.5s (500ms).

My Code:

public class MainActivity extends AppCompatActivity {


    public SimpleLocation location;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Context context = this;
        boolean requireFine = false;
        boolean passiveMode = false;
        long updateInterval = 500;
        boolean requireNew = true;
        new SimpleLocation(context, requireFine, passiveMode, updateInterval, requireNew);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        location = new SimpleLocation(this);  // Initialise

        if (!location.hasLocationEnabled()) {
            // ask the user to enable location access
            SimpleLocation.openSettings(this); // Open settings if the user hasn't put in location permissions.
        }

        location.beginUpdates();
        TextView main = (TextView)  findViewById(R.id.multitext);
        main.setText("Epoch_ms, lat, long\n");


        final Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
        @Override
        public void run() {  // Loop forever with 1000ms delay
            handler.postDelayed(this, 1000);

            SimpleLocation.Point position = location.getPosition();
            Log.d("Debug", "Running run");
            main.append(((System.currentTimeMillis()) + "," + String.valueOf(position) + ";" + "\n"));
        }},1000);

    }
}

I'd expect it to output a different value every time it loops (as it should have updated at least twice by then) but it never seems to. It only prints the same value over and over again, however, it is a valid value. I have tried this both in my house, running, as well as in a car, with the same results. It seems if I leave it for a bit, then open the app, it's happy to grab my location, but doesn't update it as I move...
I'm testing it on an OPPO Reno Z (CPH1979) on ColorOS 11.1, and I've confirmed the app has all of the permissions granted, and have tried with both Course and fine, and both with requireNew=true and false.

Many thanks,
GhostDog98

Not working in Android 10 real device

Hi, I implemented everything according to the docs, but it's not working in Google Pixel 3 real device (not emulator)

I've checked :

  • Permission fine & coarse allowed
  • location.hasLocationEnabled is true
  • beginUpdate called correctly
  • Added setListener, but onPositionChanged never triggered
  • The constructor : SimpleLocation(this, true, false, 500, true)
  • Tried to wait for 5 min after call beginUpdate, still gave 0.0 & 0.0

If I compile the same code to API 29 Emulator, everything working well.
The device's GPS sensor is not broken, because any other maps apps are still working fine.

Do you have any idea, what I need to check or fix?

Not getting location when asking a new one

If I use this constructor:

public SimpleLocation(final Context context, final boolean requireFine, final boolean passive, final long interval, final boolean requireNewLocation) {...}

Passing true to requireNewLocation I can't get a location and onLocationChanged is never called.

But using works perfectly:

public SimpleLocation(final Context context, final boolean requireFine, final boolean passive, final long interval) {
    this(context, requireFine, passive, interval, false);
}

EDIT:
Well, not that perfectly in a Samsung Galaxy S4 mini

EDIT 2:
I realized that it's reaching the catch inside this function, but I can't check the error (Maybe I'll have to run the source):

    private Location getCachedPosition() {
        if (mCachedPosition != null) {
            return mCachedPosition;
        }
        else {
            try {
                return mLocationManager.getLastKnownLocation(getProviderName());
            }
            catch (Exception e) {
                return null;
            }
        }
    }

Maybe a bug?
Thanks!

GPS UTC time?

Hello, is there a UTC time in a GPS signal? Can you extract it for using? I work with lon lat and UTC timestamp.

Accuracy

How can i get the Accuracy value of the location?

Works only first time then It does not work

Here is exemple code:

location = new SimpleLocation(this);

    // if we can't access the location yet
if (!location.hasLocationEnabled()) {
        // ask the user to enable location access
        SimpleLocation.openSettings(this);
    }

location.beginUpdates();

location.setListener(new SimpleLocation.Listener() {
        public void onPositionChanged() {
            Log.d("Location", location.getLatitude()+":"+location.getLongitude()+":"+location.getAltitude());
        }
});

When I open emulator and change Latitude or Longitude first time it fires listener but then it does not.

I am get only Location is=0.0,Latitude=0.0 i am using emulator

Hi
thanks for your Java class, After implementing code from your class i get Location is=0.0,Latitude=0.0
my code here
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.distance_find);
if (findComponentID()) {
getToolBar();
getDrawerList();
location = new SimpleLocation(this);
if (!location.hasLocationEnabled()) {
// ask the user to enable location access
SimpleLocation.openSettings(this);
}
imgBtnGetLocation.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
getCurrentLocation();
}
});

    }

}

@OverRide
protected void onResume() {
super.onResume();
location.beginUpdates();
}

@Override
protected void onPause() {
    location.endUpdates();
    super.onPause();
}

private void getCurrentLocation() {

    final double latitude = location.getLatitude();
    final double longitude = location.getLongitude();
    Log.d("Testing", "Location is=" + "Latitude=" + latitude + "Longitude=" + longitude);
    txtViwMyLocation.setText("Latitude=" + latitude + "\n" + "Longitude=" + longitude);


}

Getting latitude and longitude 0.0

If the location is previously on while running the application first time, it's picking the latitude and longitude.Then if I close the app and turn off the location, while opening the app for the second time its navigating to settings to turn on location but after location is on it is unable to pick the latitude and longitude. I am getting 0.0 for both.

When I am not connected to Internet , this library provide me past location

Hello All,

Your library is very good but in this I have found one issue and if possible please fix it as soon as possible .

Problem Statement : when I am connected to internet , it give me right location but when I am not offline (i.e not connected to Internet) then this library return me some past location which is random .

Please follow the steps to re-generate the issue :

1.) Connect to internet from one location and get lat & long
2.) Now Disconnect your internet from same position , now you will get some past location i.e lat & long .

So please check it and let me know , if you get some thing .

Thanks

Location not working

I have incorporated the same code as given in the documentation. It is working perfectly fine in most of the android versions, however it isn't working in android IcecreamSandwich. I am using mobile micromax A210. Please help!

Cannot resolve method 'getTimestampInMilliseconds()'

Hi. I am getting the error Cannot resolve method 'getTimestampInMilliseconds() when trying to call that method. The same error occurred for the getElapsedTimeInNanoseconds() method. Any idea? getSpeed(), getPosition(), and other methods work fine.


import im.delight.android.location.SimpleLocation;

public class MainActivity extends AppCompatActivity {

    private SimpleLocation mLocation;

    @Override
    protected void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        mLocation = new SimpleLocation(this);
        mLocation.setBlurRadius(5000);

        if (!mLocation.hasLocationEnabled()) {
            SimpleLocation.openSettings(this);
        }

        final long timestampInMilliseconds = mLocation.getTimestampInMilliseconds();
        final long elapsedTimeInNanoseconds = mLocation.getElapsedTimeInNanoseconds();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mLocation.beginUpdates();
    }

    @Override
    protected void onPause() {
        mLocation.endUpdates();
        super.onPause();
    }
}

Fatal Exception: java.lang.RuntimeException Unable to start activity ComponentInfo{de.tobin.anlagenstammblatt/de.tobin.anlagenstammblatt.MainActivity}: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

Crashlytics - plaintext stacktrace downloaded by Tobin Rosenau at Tue, 02 May 2017 05:45:24 GMT # URL: https://fabric.io/haus3/android/apps/de.tobin.anlagenstammblatt/issues/590747a9be077a4dcc2888d5?time=last-seven-days/sessions/590747B4037400010F8653C5570F7C73_52bfc8ecdb384600aa61cac7290dd8e8_0_v1 # Organization: Haus # Platform: android # Application: Anlagenstammblatt # Version: N/A # Bundle Identifier: de.tobin.anlagenstammblatt # Issue #: 11 # Issue ID: 590747a9be077a4dcc2888d5 # Session ID: 590747B4037400010F8653C5570F7C73_52bfc8ecdb384600aa61cac7290dd8e8_0_v1 # Date: 2017-05-01T14:35:33Z # OS Version: 5.0.2 # Device: P023 # RAM Free: 52.3% # Disk Free: 20.5% #0. Crashed: main: 0 0 0x0000000000000000 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2321) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) -- Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{de.tobin.anlagenstammblatt/de.tobin.anlagenstammblatt.MainActivity}: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2321) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) Caused by android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? at android.app.ContextImpl.startActivity(ContextImpl.java:1305) at android.app.ContextImpl.startActivity(ContextImpl.java:1292) at android.content.ContextWrapper.startActivity(ContextWrapper.java:329) at im.delight.android.location.SimpleLocation.openSettings(SimpleLocation.java:481) at de.tobin.anlagenstammblatt.MainActivity.onCreate(MainActivity.java:174) at android.app.Activity.performCreate(Activity.java:5975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2274) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) #0. Crashed: main: 0 0 0x0000000000000000 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2321) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2381) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1286) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5260) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678) #1. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #2. pool-3-thread-1 at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:410) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #3. FinalizerWatchdogDaemon at java.lang.Thread.sleep(Thread.java) at java.lang.Thread.sleep(Thread.java:1031) at java.lang.Thread.sleep(Thread.java:985) at java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor(Daemons.java:257) at java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:268) at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:216) at java.lang.Thread.run(Thread.java:818) #4. HeapTrimmerDaemon at dalvik.system.VMRuntime.trimHeap(VMRuntime.java) at java.lang.Daemons$HeapTrimmerDaemon.run(Daemons.java:312) at java.lang.Thread.run(Thread.java:818) #5. main at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197) at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:397) at java.util.concurrent.FutureTask.get(FutureTask.java:174) at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:41) at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:285) at com.crashlytics.android.core.CrashlyticsController$5.onUncaughtException(CrashlyticsController.java:269) at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:30) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690) #6. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #7. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #8. Crashlytics Exception Handler1 at dalvik.system.VMStack.getThreadStackTrace(VMStack.java) at java.lang.Thread.getStackTrace(Thread.java:580) at java.lang.Thread.getAllStackTraces(Thread.java:522) at com.crashlytics.android.core.CrashlyticsController.writeSessionEvent(CrashlyticsController.java:1114) at com.crashlytics.android.core.CrashlyticsController.writeFatal(CrashlyticsController.java:852) at com.crashlytics.android.core.CrashlyticsController.access$400(CrashlyticsController.java:59) at com.crashlytics.android.core.CrashlyticsController$6.call(CrashlyticsController.java:292) at com.crashlytics.android.core.CrashlyticsController$6.call(CrashlyticsController.java:285) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75) at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30) at java.lang.Thread.run(Thread.java:818) #9. Crashlytics Report Uploader at java.lang.Thread.sleep(Thread.java) at java.lang.Thread.sleep(Thread.java:1031) at java.lang.Thread.sleep(Thread.java:985) at com.crashlytics.android.core.ReportUploader$Worker.attemptUploadWithRetry(ReportUploader.java:188) at com.crashlytics.android.core.ReportUploader$Worker.onRun(ReportUploader.java:173) at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30) at java.lang.Thread.run(Thread.java:818) #10. GCDaemon at java.lang.Object.wait(Object.java) at java.lang.Daemons$GCDaemon.run(Daemons.java:341) at java.lang.Thread.run(Thread.java:818) #11. FinalizerDaemon at java.lang.Object.wait(Object.java) at java.lang.Object.wait(Object.java:422) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:101) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:72) at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173) at java.lang.Thread.run(Thread.java:818) #12. Answers Events Handler1 at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1048) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:776) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75) at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30) at java.lang.Thread.run(Thread.java:818) #13. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) #14. ReferenceQueueDaemon at java.lang.Object.wait(Object.java) at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:133) at java.lang.Thread.run(Thread.java:818) #15. Queue at java.lang.Object.wait(Object.java) at java.lang.Thread.parkFor(Thread.java:1220) at sun.misc.Unsafe.park(Unsafe.java:299) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016) at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65) at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

dependecy not found

i'm trying to install on android studio,
i've put it on build.gradle,

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "veeklab.desg"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.google.android.gms:play-services-appindexing:8.1.0'
    compile 'com.github.delight-im:Android-SimpleLocation:v1.0.1'
}

after i ran the build, this error shown

Error:(26, 13) Failed to resolve: com.github.delight-im:Android-SimpleLocation:v1.0.1
<a href="openFile:/home/vickydasta/research/mobile/Desg/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

Always updating the last known location rather than the current one.

Hello mwaclawek,
I am very grateful that you have made this wonderful library available to everyone and it is pretty awesome.

But currently im facing some issues with getting the current location, as the old known location is only getting updated most of the times... And in many devices im only getting (0,0) coordinates...

Is there any way I can correct it and make it update the location to the current one every-time asked for and eliminate the (0,0) coordinate results?...

I really need your help and I shall always be grateful to you for the same... Please help...

auto select network or gps ?

I am developing an app where the location must be invisible to the user.
The idea is that if the user has GPS enabled, the coordinates go with FINE, and if only network enabled, the coordinates are sent with COARSE, is there any way to achieve that?
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.