firebase-jobdispatcher-android | DEPRECATED please see the README.md below for details | Image Editing library
kandi X-RAY | firebase-jobdispatcher-android Summary
kandi X-RAY | firebase-jobdispatcher-android Summary
DEPRECATED please see the README.md below for details.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Handle start command
- Extract the IBinder information from the Bundle
- Decodes the job invocation
- Executes the given job
- Handle the incoming message
- Handle a start execution message
- Handles a stop execution message
- Sends a job finish
- Called when a service is connected
- Called when a job is finished
- Processes the job finished message
- Checks if the given JobInvocation matches the given JobInvocation
- Handle the onUnbind event
- Registers a job
- Handles a stop job request
- Compares this object to another object
- Starts a job
- Stops a job
firebase-jobdispatcher-android Key Features
firebase-jobdispatcher-android Examples and Code Snippets
Community Discussions
Trending Discussions on firebase-jobdispatcher-android
QUESTION
Why do we need the new Android WorkManager if we already have a JobScheduler along with a few nifty backports (AndroidJob and FirebaseJobDispatcher) with the same functionality? Does it have any killer-features or something? Because I don't see anything that makes me want to migrate to the yet another scheduler.
...ANSWER
Answered 2018-May-10 at 23:49WorkManager just seems like Google's answer to Evernote's Android-Job library, but with a few improvements. It uses JobScheduler, Firebase JobDispatcher and AlarmManager just like Android-Job depending on the device's API level. Their usage of tags looks pretty much the same and assigning constraints to jobs/work are similar enough.
The two features that I am excited about are: being able to chain work and the ability to be opportunistic on work with constraints. The first will allow work (jobs) to be broken up and more modular for me. And with more modular work, each piece of work may have fewer constraints improving the chance they will complete earlier (opportunistic). For example, the majority of processing work can complete before the work with a network constraint needs to be met.
So if you're happy with your current scheduler implementation and the two features I mentioned don't add value, I don't see a huge benefit to making the switch just yet. But if you're writing something new, it'll probably be worth it to use WorkManager.
QUESTION
So per the documentation Firebase JobDispatcher is deprecated and should be migrated to use the WorkManager. I was following the migration guide which said the functionality implemented in a JobService should be migrated to a ListenableWorker. However I am stumped on how to implement startWork()
, the guide only says
ANSWER
Answered 2019-May-17 at 09:37You need to use ListenableWorker if you need to execute asynchronous code. There's a Threading in ListenableWorker documentation page that covers this:
If you wanted to execute some work based on an asynchronous callback, you would do something like this:
QUESTION
i have to download json response from web server on every night,previously i have used AlarmManager
for scheduling tasks but i think for this kind of situation JobDispatcher
is great because it auto perform task if network available so i don't have to manage this kind of stuf.But i have found many examples of JobDispatcher
and JobScheduler
in all of them a simple job is scheduled or scheduled for some time delay but there is nothing relevant to my requirements,
if anyone have idea of this please help or provide any link related to this, it will be very helpful.
UPDATE
1. How to make this to work every night,because currently it is only set alarm to midnight for once , how to make it repeted for every night at same time ?
...ANSWER
Answered 2017-Oct-11 at 09:04This is how you need to schedule time-based jobs
QUESTION
As From Firebase JobDispatcher Documentation Firebase JobDispatcher
...ANSWER
Answered 2017-Nov-29 at 14:27I think the reason why it runs 2 times is your execution window.
QUESTION
In an Android app (with minSdkVersion 16
) I use the nv-websocket-client library:
ANSWER
Answered 2017-Nov-19 at 17:30Put ReconnectService
in its own class (not an inner class to MainActivity
). Alternatively, try making the inner class static
.
The way non-static inner classes work in Java is that they can only be instantiated by an instance of the outer class. This is what allows instances of the inner class to access members of the outer class. So, when Android is trying to create an instance of the inner class, it can't do so because it doesn't know what instance of the outer class it should be a part of. The error message is a bit misleading.
QUESTION
I am using Firebase Job Dispatcher and setting it up like described in https://github.com/firebase/firebase-jobdispatcher-android/blob/master/README.md.
The job to be scheduled is a http request. The http request could run while the app is on the foreground (the user is looking at it), or while the app is in the background/not started.
Should the http request (using the okhttp library) be put in a separate thread / asynchronous or can I just call it directly from the JobService?
...ANSWER
Answered 2017-Oct-02 at 08:45JobService
extends Service
so it runs on the main thread. Therefore, you shouldn't be able to make network calls directly. However, there is SimpleJobService
where you can make direct calls.
I think using SimpleJobService
is better than using AsyncTask
within JobService
because it already does it in its own way as you can see here.
QUESTION
I have an app that to displays new data in a notification. This data is provided by a network device. I can query this device and compare it the cached data in my service to determine if the notification needs to be updated. My app has a service that has local variables in which it caches the data. If the device has newer data, I present that in a notification to the user. Now I started to get IllegalStateException because Android O doesn't allow startService() gets called when the app is in background mode. I know I can start the service in Foreground mode, but since Android is providing less resource intensive ways, I would like to try something new. Next to the data being cached in local variables it gets stored in Firebase Database.
My requirements:
- Check every 10 seconds (if the screen is on) if there's new data
- Check if there's new data when the screen is switched on
- If there is new data, update the notification
- Needs to be long running and be able to compare new data to old (cached or from firebase) data.
- Can run when the app is in background mode
My thoughts: I've looked at Firebase job-dispatcher (https://github.com/firebase/firebase-jobdispatcher-android#user-content-firebase-jobdispatcher-). Maybe I can configure it to run every time the screen is switched on, and every 10 seconds, to retrieve the new data from the network device and match that up with the data in Firebase database. But maybe it will cost a lot of performance to query the database that often.
...ANSWER
Answered 2017-Sep-28 at 12:48Try Object based Database like Realm, SnappyDB(Uber uses it) etc. Queries are super fast
QUESTION
I am trying to add Firebase Job Dispatcher to my project, but I am unable to build because of this error:
Gradle sync failed: Could not find com.firebase:firebase-jobdispatcher:[version]. Required by: project :[module]
My build.gradle
file looks like this:
ANSWER
Answered 2017-Apr-02 at 03:22Apparently, Gradle could not resolve the dependency using Maven Central alone. Adding JCenter to my list of repositories fixed the issue:
QUESTION
I have implemented job scheduling using Firebase job dispatcher. In which it was given in the doc that an IntentFilter
with a specific action Action
should be added to the job service as below
ANSWER
Answered 2017-Mar-14 at 19:37An intent filter specifies the types of intents that an activity, service, or broadcast receiver can respond to. It allows service to start when it receives intent of specific type while ignoring others which are not meaningful for the service. So, if you are NOT specifying intent filter jobscheduling will work but there is no restriction on the service for the type of intent it should respond to.
Intents sends signals to the Android system telling it that some action needs to be performed by another component in the same app or a different app.
So, when you have scheduled job and added intent filter ,your service will respond to event with action com.firebase.jobdispatcher.ACTION_EXECUTE
only.
QUESTION
I would like to know if it's possible to use Firebase jobdispatcher to schedule an url hit and get the response in order to update the db. I would like it to run once per day at night. Does anyone know if this is possible?
I can't find any good example of doing this. I already read android documentation and https://github.com/firebase/firebase-jobdispatcher-android#user-content-firebase-jobdispatcher- .
I need to use Firebase jobdispatcher because I'm targeting API 16.
Thanks in advance.
UPDATE
This is what I did to schedule it once per day.
...ANSWER
Answered 2017-Feb-02 at 03:47You can schedule a recurring job by telling the Job.Builder to create a recurring job with a Trigger that has an execution window according to your needs.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install firebase-jobdispatcher-android
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page