當前位置: 首頁>>代碼示例>>Java>>正文


Java RequestContext類代碼示例

本文整理匯總了Java中com.gc.android.market.api.model.Market.RequestContext的典型用法代碼示例。如果您正苦於以下問題:Java RequestContext類的具體用法?Java RequestContext怎麽用?Java RequestContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RequestContext類屬於com.gc.android.market.api.model.Market包,在下文中一共展示了RequestContext類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: queryApp

import com.gc.android.market.api.model.Market.RequestContext; //導入依賴的package包/類
public List<Object> queryApp(AppsRequest requestGroup)
{
	List<Object> retList = new ArrayList<Object>();
	
	request.addRequestGroup(RequestGroup.newBuilder().setAppsRequest(requestGroup));
	
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	try {
		Response resp = executeProtobuf(request.build());
		for(ResponseGroup grp : resp.getResponseGroupList()) {
			if(grp.hasAppsResponse())
				retList.add(grp.getAppsResponse());
		}
	} finally {
		request = Request.newBuilder();
	}
	return retList;
}
 
開發者ID:hunatika615,項目名稱:android-market-api,代碼行數:21,代碼來源:MarketSession.java

示例2: queryGetAssetRequest

import com.gc.android.market.api.model.Market.RequestContext; //導入依賴的package包/類
public GetAssetResponse queryGetAssetRequest(String assetId){
    setIsSecure(true);
    RequestContext ctxt = context.build();
    context = RequestContext.newBuilder(ctxt);
    request.setContext(ctxt);
    GetAssetResponse assetResponse = null;
    try {
        Response response = executeProtobuf(request.addRequestGroup(
                    RequestGroup.newBuilder().setGetAssetRequest(
                    GetAssetRequest.newBuilder().setAssetId(
                    assetId).build())).setContext(ctxt).build());
        assetResponse = response.getResponseGroup(0).getGetAssetResponse();
    } finally {
        setIsSecure(false);
        request = Request.newBuilder(); 
    }
    return assetResponse; 
}
 
開發者ID:hunatika615,項目名稱:android-market-api,代碼行數:19,代碼來源:MarketSession.java

示例3: flush

import com.gc.android.market.api.model.Market.RequestContext; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public void flush() {
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	try {
		Response resp = executeProtobuf(request.build());
		int i = 0;
		for(ResponseGroup grp : resp.getResponseGroupList()) {
			Object val = null;
			if(grp.hasAppsResponse())
				val = grp.getAppsResponse();
			if(grp.hasCategoriesResponse())
				val = grp.getCategoriesResponse();
			if(grp.hasCommentsResponse())
				val = grp.getCommentsResponse();
			if(grp.hasImageResponse())
				val = grp.getImageResponse();
		((Callback)callbacks.get(i)).onResult(grp.getContext(), val);
			i++;
		}
	} finally {
		request = Request.newBuilder();
		callbacks.clear();
	}
}
 
開發者ID:hunatika615,項目名稱:android-market-api,代碼行數:27,代碼來源:MarketSession.java

示例4: queryCategories

import com.gc.android.market.api.model.Market.RequestContext; //導入依賴的package包/類
public CategoriesResponse queryCategories() {
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	CategoriesResponse categoriesResponse = null;
	try {
		Response response = executeProtobuf(request.addRequestGroup(
				RequestGroup.newBuilder().setCategoriesRequest(
						CategoriesRequest.newBuilder().build())).setContext(ctxt).build());
		categoriesResponse = response.getResponseGroup(0).getCategoriesResponse();
	} finally {
		request = Request.newBuilder();;
	}
	return categoriesResponse;
}
 
開發者ID:hunatika615,項目名稱:android-market-api,代碼行數:16,代碼來源:MarketSession.java

示例5: execute

import com.gc.android.market.api.model.Market.RequestContext; //導入依賴的package包/類
public ResponseGroup execute(RequestGroup requestGroup) {
	RequestContext ctxt = context.build();
	context = RequestContext.newBuilder(ctxt);
	request.setContext(ctxt);
	Response resp = executeProtobuf(request.addRequestGroup(requestGroup).setContext(ctxt).build());
	return resp.getResponseGroup(0);
}
 
開發者ID:hunatika615,項目名稱:android-market-api,代碼行數:8,代碼來源:MarketSession.java

示例6: getContext

import com.gc.android.market.api.model.Market.RequestContext; //導入依賴的package包/類
public RequestContext.Builder getContext() {
	return context;
}
 
開發者ID:hunatika615,項目名稱:android-market-api,代碼行數:4,代碼來源:MarketSession.java


注:本文中的com.gc.android.market.api.model.Market.RequestContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。