本文整理汇总了Java中com.birbit.android.jobqueue.config.Configuration类的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Configuration类属于com.birbit.android.jobqueue.config包,在下文中一共展示了Configuration类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configureJobManager
import com.birbit.android.jobqueue.config.Configuration; //导入依赖的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.config.Configuration; //导入依赖的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.config.Configuration; //导入依赖的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
注:本文中的com.birbit.android.jobqueue.config.Configuration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论