当前位置: 首页>>代码示例>>Java>>正文


Java SpiceManager类代码示例

本文整理汇总了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);
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:17,代码来源:AptoideUtils.java

示例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();
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:18,代码来源:AptoideUtils.java

示例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();
    }
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:14,代码来源:ReferrerUtils.java

示例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);
    }
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:16,代码来源:AptoideUtils.java

示例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);
    }
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:9,代码来源:AptoideUtils.java

示例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);
        }
    });
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:32,代码来源:DownloadService.java

示例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;
}
 
开发者ID:runningcode,项目名称:CUMtd,代码行数:12,代码来源:GetStopResponseListener.java

示例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();
}
 
开发者ID:runningcode,项目名称:CUMtd,代码行数:10,代码来源:StopPointRenderer.java

示例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;
    }
}
 
开发者ID:blandware,项目名称:android-atleap,代码行数:9,代码来源:RobospiceTestCase.java

示例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();
}
 
开发者ID:fsiu,项目名称:dw2020,代码行数:10,代码来源:BaseSpiceActivity.java

示例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();
}
 
开发者ID:fsiu,项目名称:dw2020,代码行数:10,代码来源:BaseSpiceActivity.java

示例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);
}
 
开发者ID:fsiu,项目名称:dw2020,代码行数:16,代码来源:MainActivity.java

示例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
        }
    });
}
 
开发者ID:n76,项目名称:Local-GSM-Backend,代码行数:14,代码来源:DownloadSpiceRequest.java

示例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();
}
 
开发者ID:Ruenzuo,项目名称:android-cd-travis-example,代码行数:13,代码来源:CitiesListFragment.java

示例15: BillingBinder

import com.octo.android.robospice.SpiceManager; //导入依赖的package包/类
public BillingBinder(Context context, SpiceManager manager) {
    this.context = context;
    this.manager = manager;
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:5,代码来源:BillingBinder.java


注:本文中的com.octo.android.robospice.SpiceManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。