本文整理汇总了Java中com.octo.android.robospice.SpiceManager类的典型用法代码示例。如果您正苦于以下问题:Java SpiceManager类的具体用法?Java SpiceManager怎么用?Java SpiceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpiceManager类属于com.octo.android.robospice包,在下文中一共展示了SpiceManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startParse
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public static void startParse(final String storeName, final Context context, final SpiceManager spiceManager) {
Toast.makeText(context, AptoideUtils.StringUtils.getFormattedString(context, R.string.subscribing, storeName), Toast.LENGTH_SHORT).show();
GetSimpleStoreRequest request = new GetSimpleStoreRequest();
request.store_name = storeName;
CheckSimpleStoreListener checkStoreListener = new CheckSimpleStoreListener();
checkStoreListener.callback = new CheckSimpleStoreListener.Callback() {
@Override
public void onSuccess() {
addStoreOnCloud(storeName, context, spiceManager);
}
};
spiceManager.execute(request, checkStoreListener);
}
示例2: voteComment
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public static void voteComment(SpiceManager spiceManager, int commentId,
String repoName,
String token,
RequestListener<GenericResponseV2> commentRequestListener,
AddApkCommentVoteRequest.CommentVote vote) {
AddApkCommentVoteRequest commentVoteRequest = new AddApkCommentVoteRequest();
commentVoteRequest.setRepo(repoName);
commentVoteRequest.setToken(token);
commentVoteRequest.setCmtid(commentId);
commentVoteRequest.setVote(vote);
spiceManager.execute(commentVoteRequest, commentRequestListener);
Toast.makeText(Aptoide.getContext(), Aptoide.getContext().getString(R.string.casting_vote), Toast.LENGTH_SHORT).show();
}
示例3: extractReferrer
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public static void extractReferrer(ApkSuggestionJson.Ads ads, final SpiceManager spiceManager, final SimpleFuture<String> simpleFuture, final int retries) {
// Just in case
try {
final String packageName = ads.getData().getPackageName();
final long appId = ads.getData().getId().longValue();
final long adId = ads.getInfo().getAd_id();
final long networkId = ads.getPartner().getPartnerInfo().getId().longValue();
final String click_url = ads.getPartner().getPartnerData().getClick_url();
extractReferrer(packageName, appId, adId, networkId, click_url, spiceManager, simpleFuture, retries);
} catch (Exception e) {
e.printStackTrace();
}
}
示例4: addStoreOnCloud
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
/**
* If there's a local account created, add the store to its aptoide account
*
* @param storeName
* @param context
* @param spiceManager
*/
private static void addStoreOnCloud(String storeName, Context context, SpiceManager spiceManager) {
if (AccountManager.get(context).getAccountsByType(Aptoide.getConfiguration().getAccountType()).length > 0) {
ChangeUserRepoSubscription changeUserRepoSubscription = new ChangeUserRepoSubscription();
ChangeUserRepoSubscription.RepoSubscription repoSubscription = new ChangeUserRepoSubscription.RepoSubscription(storeName, true);
changeUserRepoSubscription.setRepoSubscription(repoSubscription);
spiceManager.execute(changeUserRepoSubscription, null);
}
}
示例5: removeStoreOnCloud
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public static void removeStoreOnCloud(Store store, Context context, SpiceManager spiceManager) {
if (AccountManager.get(context).getAccountsByType(Aptoide.getConfiguration().getAccountType()).length > 0) {
ChangeUserRepoSubscription changeUserRepoSubscription = new ChangeUserRepoSubscription();
ChangeUserRepoSubscription.RepoSubscription repoSubscription = new ChangeUserRepoSubscription.RepoSubscription(store.getName(), false);
changeUserRepoSubscription.setRepoSubscription(repoSubscription);
spiceManager.execute(changeUserRepoSubscription, null);
}
}
示例6: startScheduledDownload
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public void startScheduledDownload(@NonNull final ScheduledDownloadItem scheduledDownload) {
final GetApkInfoRequestFromMd5 requestFromMd5 = new GetApkInfoRequestFromMd5(this);
requestFromMd5.setRepoName(scheduledDownload.getRepo_name());
requestFromMd5.setMd5Sum(scheduledDownload.getMd5());
final SpiceManager spiceManager = new SpiceManager(AptoideSpiceHttpService.class);
if (!spiceManager.isStarted()){
spiceManager.start(getApplicationContext());
}
spiceManager.execute(requestFromMd5, new RequestListener<GetApkInfoJson>() {
@Override
public void onRequestFailure(SpiceException spiceException) { }
@Override
public void onRequestSuccess(final GetApkInfoJson getApkInfoJson) {
if (getApkInfoJson == null) {
return;
}
final GetApkInfoJson.Apk apk = getApkInfoJson.apk;
final Download download = new Download();
download.setMd5(scheduledDownload.getMd5());
download.setId(scheduledDownload.getMd5().hashCode());
download.setName(scheduledDownload.getName());
download.setVersion(apk.getVername());
download.setIcon(apk.getIcon());
download.setPackageName(apk.getPackageName());
startDownloadFromJson(getApkInfoJson, apk.getId().longValue(), download);
}
});
}
示例7: bind
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public GetStopResponseListener bind(String stopId, Marker marker,
GoogleMap map, SpiceManager spiceManager,
List<GroundOverlay> busMarkers) {
mStopId = stopId;
mMarker = marker;
mMap = map;
mSpiceManager = spiceManager;
mIconGenerator = new IconGenerator(mContext);
mBusMarkers = busMarkers;
return this;
}
示例8: StopPointRenderer
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public StopPointRenderer(@NotNull Context context, GoogleMap map, ClusterManager<Stop>
clusterManager, SpiceManager spiceManager, List<GroundOverlay> busMarkers) {
super(context, map, clusterManager);
mSpiceManager = spiceManager;
mContext = context;
mBusMarkers = busMarkers;
CUMtdApplication app = (CUMtdApplication) context.getApplicationContext();
if (app != null) t = app.getTracker();
}
示例9: waitForSpiceManagerShutdown
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
private void waitForSpiceManagerShutdown(SpiceManager spiceManager) throws InterruptedException {
if (spiceManager != null && spiceManager.isStarted()) {
spiceManager.cancelAllRequests();
spiceManager.removeAllDataFromCache();
spiceManager.shouldStopAndJoin(SPICE_MANAGER_WAIT_TIMEOUT);
spiceManager = null;
}
}
示例10: onStart
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
@Override
protected void onStart() {
for(SpiceManager manager : spiceManagerMap.values()) {
if(!manager.isStarted()) {
manager.start(this);
}
}
super.onStart();
}
示例11: onStop
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
@Override
protected void onStop() {
for(SpiceManager manager : spiceManagerMap.values()) {
if(manager.isStarted()) {
manager.shouldStop();
}
}
super.onStop();
}
示例12: setupNetworkServices
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
private void setupNetworkServices() throws AuthenticationError {
AccessToken accessToken = null;
if(this.bundle!=null) {
accessToken = this.bundle.getParcelable(ACCESS_TOKEN);
}
if(accessToken==null) {
accessToken = FiveHundredPxAccessToken.build(FiveHundredPxConfiguration.INSTANCE);
}
FiveHundredPxClient.INSTANCE.setConsumer(accessToken);
//final SpiceManager spiceManager = new SpiceManager(FiveHundredPxGsonSpiceService.class);
final SpiceManager spiceManager = new SpiceManager(FiveHundredPxJacksonSpiceService.class);
addToSpiceManager(MainActivity.class.getName(), spiceManager);
spiceManager.start(this);
}
示例13: executeWith
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public static void executeWith(Context context, SpiceManager spiceManager) {
spiceManager.execute(new DownloadSpiceRequest(context.getApplicationContext()), DownloadSpiceRequest.CACHE_KEY, DurationInMillis.ALWAYS_EXPIRED, new RequestListener<Result>() {
@Override
public void onRequestFailure(SpiceException spiceException) {
// ignore
}
@Override
public void onRequestSuccess(DownloadSpiceRequest.Result result) {
// ignore
}
});
}
示例14: onActivityCreated
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
CitiesBaseActivity citiesBaseActivity = (CitiesBaseActivity) getActivity();
spiceManager = new SpiceManager(JacksonSpringAndroidSpiceService.class);
locationManager = (LocationManager) citiesBaseActivity.
getSystemService(Context.LOCATION_SERVICE);
ArrayList<City> cities = new ArrayList<City>();
CitiesAdapter adapter = new CitiesAdapter(getActivity(), cities);
setListAdapter(adapter);
refreshLocation();
}
示例15: BillingBinder
import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public BillingBinder(Context context, SpiceManager manager) {
this.context = context;
this.manager = manager;
}