Giter VIP home page Giter VIP logo

location_updates-background_foreground's Introduction

Location_Updates-Background_Foreground

Today(20/03/2019).

After 2 months of searching I found a best code for Oreo and above devices.

Feature of this Code

1. This code works very well, here you can update a location when app is in background or in foreground.

2. It is also work when you device will lock.

3. It will work when user offline.

I am searching a this type of code which will works in Oreo and Pie devices very well.

So I can say this is the best code for location updates and fullfil all my requirements.

Note

I founded this code in location sample code of Google.

Code Provided By a Google

Need Help I want to turn on or turn off feature of location with help of toggle button instead of buttons

location_updates-background_foreground's People

Contributors

blackblind567 avatar

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

Watchers

 avatar  avatar

location_updates-background_foreground's Issues

When set to NotificationManager.IMPORTANCE_DEFAULT sound to loud

hi when i set to new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_DEFAULT); it will produce notification with sound which are interrupt user and so annoying. As result, i found another way which is change from NotificationManager.IMPORTANCE_DEFAULT to NotificationManager.IMPORTANCE_LOW the sound disappear. However, it may cause notification gone in foreground when android (honor 8 pro) detect power intensive. So what is good suggestion so that notification not force to close and sound notification is not appear. Thank

How to get value distance on background process since service will stop in background process

private void onNewLocation(Location location) {
Log.d(TAG, "New location: " + location);

    mLocation = location;

    // Notify anyone listening for broadcasts about the new location.
    Intent intent = new Intent(ACTION_BROADCAST);
    intent.putExtra(EXTRA_LOCATION, location);
    LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);

    // Update notification content if running as a foreground service.
    if (serviceIsRunningInForeground(this)) {
        mNotificationManager.notify(NOTIFICATION_ID, getNotification());

        // Getting location when notification was call.
        latitude = location.getLatitude();
        longitude = location.getLongitude();

        // Here using to call Save to serverMethod
        SavetoServer();

    }
}

could u explain how to get value when the apps in background process?

Hi can you scaledown api 21

Hi i am hafiz, i come back to u page. Can u reduce api to 21 instead of 22 because currently, my apps run in playstore with minimum 21 (lolipop) please.

Not working in Idle mode

Tracking not working If app in background and devices is in Idle Mode. Please suggest How can handle this case?

service killed by phone in huawei y7

First of all, thanks for your well done code about LocationUpdate in background foreground in android, but still some problems remain. I run your code on my huawei Y7 but after about 10 minutes, LocationUpdateService stopped and there is no running service even in Developer Option.

Please help to solve this problem. It's very crucial for me to receive location update frequently and send them to server. I download your code totally and run on my phone.

Thanks in Advance.

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.