本文整理汇总了Java中com.birbit.android.jobqueue.JobManager类的典型用法代码示例。如果您正苦于以下问题:Java JobManager类的具体用法?Java JobManager怎么用?Java JobManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JobManager类属于com.birbit.android.jobqueue包,在下文中一共展示了JobManager类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configureJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
private static JobManager configureJobManager(Context context) {
Configuration.Builder builder = new Configuration.Builder(context)
.minConsumerCount(1)//always keep at least one consumer alive
.maxConsumerCount(3)//up to 3 consumers at a time
.loadFactor(3)//3 jobs per consumer
.consumerKeepAlive(120)//wait 2 minutes
.customLogger(customLogger);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
builder.scheduler(FrameworkJobSchedulerService.createSchedulerFor(context,
SchedulerJobService.class), true);
} else {
int enableGcm = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
if (enableGcm == ConnectionResult.SUCCESS) {
builder.scheduler(GcmJobSchedulerService.createSchedulerFor(context,
GcmJobSchedulerService.class), true);
}
}
return new JobManager(builder.build());
}
开发者ID:jshvarts,项目名称:OfflineSampleApp,代码行数:20,代码来源:JobManagerFactory.java
示例2: JobHelper
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
public JobHelper(Context context) {
mContext = context;
mJobManager = new JobManager(new Configuration.Builder(mContext)
.maxConsumerCount(10)
.build());
mDatabaseManager = new DatabaseManager();
}
开发者ID:CrazyDude1994,项目名称:lostfilm-android-client,代码行数:8,代码来源:JobHelper.java
示例3: provideJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
@Provides
@Singleton
public JobManager provideJobManager(@NonNull final Context poContext) {
final Configuration loConfiguration = new Configuration.Builder(poContext)
.minConsumerCount(1) //always keep at least one consumer alive
.maxConsumerCount(3) //up to 3 consumers at a time
.loadFactor(3) //3 jobs per consumer
.consumerKeepAlive(120) //wait 2 minutes
.build();
return new JobManager(loConfiguration);
}
开发者ID:RoRoche,项目名称:AndroidStarter,代码行数:12,代码来源:ModuleAsync.java
示例4: getJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
@NonNull
@Override
protected JobManager getJobManager() {
return RemoteApplication.getInstance().getJobManager();
}
开发者ID:anikraj1994,项目名称:Remote,代码行数:6,代码来源:MyJobService.java
示例5: getJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
public synchronized JobManager getJobManager() {
if (jobManager == null) {
configureJobManager();
}
return jobManager;
}
开发者ID:anikraj1994,项目名称:Remote,代码行数:7,代码来源:RemoteApplication.java
示例6: getJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
@NonNull
@Override
protected JobManager getJobManager() {
return JobManagerFactory.getJobManager();
}
开发者ID:jshvarts,项目名称:OfflineSampleApp,代码行数:6,代码来源:GcmJobService.java
示例7: getJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
public static synchronized JobManager getJobManager() {
return jobManager;
}
开发者ID:jshvarts,项目名称:OfflineSampleApp,代码行数:4,代码来源:JobManagerFactory.java
示例8: getJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
public JobManager getJobManager() {
return jobManager;
}
开发者ID:bnsantos,项目名称:android-upload-service,代码行数:4,代码来源:App.java
示例9: getJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
public static synchronized JobManager getJobManager() {
return mJobManager;
}
开发者ID:solidgear,项目名称:priority-job-queue,代码行数:4,代码来源:AppJobManager.java
示例10: getJobManager
import com.birbit.android.jobqueue.JobManager; //导入依赖的package包/类
@NonNull
@Override
protected JobManager getJobManager() {
return AppJobManager.getJobManager();
}
开发者ID:solidgear,项目名称:priority-job-queue,代码行数:6,代码来源:AppJobService.java
注:本文中的com.birbit.android.jobqueue.JobManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论