android-jobscheduler

Unable to implement callback in Android

微笑、不失礼 提交于 2020-01-02 07:49:07
问题 I am building an SDK. The Scenario From the app, the developer passes the JsonObject and URL in a method and inside the SDK. I add those values in SQLite database and start a JobScheduler. The Jobscheduler takes the request at 0 indexes out of the database executes it. When I get the response, I delete that request from the database and now the request at 1 index comes to the 0 index and again I execute the same code where 0th index request is fired. The Problem When I get the response from a

Run service on incoming SMS in android Oreo

天涯浪子 提交于 2019-12-29 07:44:09
问题 I'm developing an app which needs to run some code (Networking) whenever an SMS is received. In API 25 and lower it's fine, I register an implicit receiver in Manifest file and start my service in the specified class which extended BroadcastReceiver . In API 26 however you cannot register android.provider.Telephony.SMS_RECEIVED in a receiver since it won't work. From Android documentation: Note: If your app targets API level 26 or higher, you cannot use the manifest to declare a receiver for

Some questions about GcmTaskService

戏子无情 提交于 2019-12-29 04:35:27
问题 Background I wanted to use the new JobScheduler API that was presented on Lollipop, but sadly it doesn't have an official port for pre-Lollipop. However, there is the GcmTaskService, which provides very similar functionalities. The problem This API is quite new, so there are very few places to look for information of how to use it (here and here, for example). The questions I have a few questions about this new API : It seems that it requires Google Play Services (here) to be used (except for

Some questions about GcmTaskService

泄露秘密 提交于 2019-12-29 04:35:12
问题 Background I wanted to use the new JobScheduler API that was presented on Lollipop, but sadly it doesn't have an official port for pre-Lollipop. However, there is the GcmTaskService, which provides very similar functionalities. The problem This API is quite new, so there are very few places to look for information of how to use it (here and here, for example). The questions I have a few questions about this new API : It seems that it requires Google Play Services (here) to be used (except for

Can i use Firebase JobDispatcher for triggering time specific tasks

瘦欲@ 提交于 2019-12-25 08:52:22
问题 I am developing an application where certain tasks as to be done in background at a specific time. Android developer docs suggests various methods. I know AlarmManager can be used for this purpose. But, I think, using AlarmManager in Android 6.0 in Doze mode will give improper triggers. I came across JobScheduling libraries from developer docs As my application supports version below Android 5.0. I thought of using FireBaseJobDispatcher. Can I use FirebaseJobDispatcher for trigger a specific

Android JobScheduler with Idle requirement does not get fired

♀尐吖头ヾ 提交于 2019-12-24 11:23:31
问题 I have a service that extends JobService as below: public class MyService extends JobService { private int notificationNumber = 0; private Thread thread; @Override public boolean onStartJob(JobParameters params) { Toast.makeText(this, "Service1 Started with JobId: " + params.getJobId(), Toast.LENGTH_LONG).show(); thread = new WorkerThread(this, params); thread.start(); return true; } @Override public boolean onStopJob(JobParameters params) { createNotification("Service1 onStop with JobId");

How to reschedule a job in android in case of failure using job scheduler

前提是你 提交于 2019-12-24 01:27:52
问题 I am using Job scheduler to complete some task . In case of failure I want to reschedule my job until it gets completed , how do I achieve that with Job Scheduler ? 回答1: The JobService method jobFinished() has a needsReschedule parameter. Try calling this method after you received the unrecoverable error. 来源: https://stackoverflow.com/questions/41242058/how-to-reschedule-a-job-in-android-in-case-of-failure-using-job-scheduler

Android- setPeriodic for JobScheduler won't work

谁说胖子不能爱 提交于 2019-12-23 10:17:46
问题 I've wrote an app for creating and reminding task which uses local SqliteDatabase. I wrote a jobScheduler service to check the device time and date with tasks on the database and if matches shows a push notification. What I want also is service to run in background and check the data every 5 seconds . but when I write builder.setPeriodic(5000); builder.setPersisted(true); the service stops checking data. Here's my code MainActivity public class MainActivity extends AppCompatActivity {

Jobscheduler API android L

纵然是瞬间 提交于 2019-12-22 08:35:06
问题 I am making an application that makes use of the jobscheduler API. I want to run a service periodically and when the device is charged. This is the code. JobInfo.Builder builder = new JobInfo.Builder(kJobId++, mServiceComponent); builder.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY); builder.setPeriodic(3000); builder.setRequiresCharging(true); mTestService.scheduleJob(builder.build()); Now when I run this and I unplug the device, the service still runs after 3 secs. There is no effect of

How to Detect network disconnection in Firebase Job dispatcher?

一世执手 提交于 2019-12-22 07:09:04
问题 In firebase Job dispatcher its possible to detect when we connect to a network, but how to detect when we disconnect from a network? Job myJob = dispatcher.newJobBuilder() .setService(MyJobService.class) .setTag("my-unique-tag") .setConstraints( // only run on an unmetered network Constraint.ON_UNMETERED_NETWORK, // only run when the device is charging Constraint.DEVICE_CHARGING ) .build(); dispatcher.mustSchedule(myJob); This will detect when connected to Unmetrered Network , i want to start