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


Java VKJsonHelper类代码示例

本文整理汇总了Java中com.vk.sdk.util.VKJsonHelper的典型用法代码示例。如果您正苦于以下问题:Java VKJsonHelper类的具体用法?Java VKJsonHelper怎么用?Java VKJsonHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VKJsonHelper类属于com.vk.sdk.util包,在下文中一共展示了VKJsonHelper类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VKError

import com.vk.sdk.util.VKJsonHelper; //导入依赖的package包/类
/**
    * Generate API error from JSON
    *
    * @param json Json description of VK API error
    */
   @SuppressWarnings("unchecked")
public VKError(JSONObject json) throws JSONException {
       VKError internalError = new VKError(json.getInt(VKApiConst.ERROR_CODE));
       internalError.errorMessage = json.getString(VKApiConst.ERROR_MSG);
       internalError.requestParams = (ArrayList<Map<String, String>>) VKJsonHelper.toList(
               json.getJSONArray(VKApiConst.REQUEST_PARAMS));
       if (internalError.errorCode == 14) {
           internalError.captchaImg = json.getString(VKApiConst.CAPTCHA_IMG);
           internalError.captchaSid = json.getString(VKApiConst.CAPTCHA_SID);
       }
       if (internalError.errorCode == 17) {
           internalError.redirectUri = json.getString(VKApiConst.REDIRECT_URI);
       }

       this.errorCode = VK_API_ERROR;
       this.apiError = internalError;
   }
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:23,代码来源:VKError.java

示例2: getSaveRequest

import com.vk.sdk.util.VKJsonHelper; //导入依赖的package包/类
@Override
protected VKRequest getSaveRequest(JSONObject response) {
    VKRequest saveRequest;
    try {
        saveRequest = VKApi.docs().save(new VKParameters(VKJsonHelper.toMap(response)));
    } catch (JSONException e) {
        return null;
    }
    if (mGroupId != 0)
        saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.GROUP_ID, mGroupId));
    return saveRequest;
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:13,代码来源:VKUploadWallDocRequest.java

示例3: getSaveRequest

import com.vk.sdk.util.VKJsonHelper; //导入依赖的package包/类
@Override
protected VKRequest getSaveRequest(JSONObject response) {
    VKRequest saveRequest;
    try {
        saveRequest = VKApi.photos().saveWallPhoto(new VKParameters(VKJsonHelper.toMap(response)));
    } catch (JSONException e) {
        return null;
    }
    if (mUserId != 0)
        saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.USER_ID, mUserId));
    if (mGroupId != 0)
        saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.GROUP_ID, mGroupId));
    return saveRequest;
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:15,代码来源:VKUploadWallPhotoRequest.java

示例4: getSaveRequest

import com.vk.sdk.util.VKJsonHelper; //导入依赖的package包/类
@Override
protected VKRequest getSaveRequest(JSONObject response) {
    VKRequest saveRequest;
    try {
        saveRequest = VKApi.photos().save(new VKParameters(VKJsonHelper.toMap(response)));
    } catch (JSONException e) {
        return null;
    }
    if (mAlbumId != 0)
        saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.ALBUM_ID, mAlbumId));
    if (mGroupId != 0)
        saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.GROUP_ID, mGroupId));
    return saveRequest;

}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:16,代码来源:VKUploadAlbumPhotoRequest.java

示例5: getSaveRequest

import com.vk.sdk.util.VKJsonHelper; //导入依赖的package包/类
@Override
protected VKRequest getSaveRequest(JSONObject response) {
    VKRequest saveRequest;
    try {
        saveRequest = VKApi.photos().saveMessagesPhoto(new VKParameters(VKJsonHelper.toMap(response)));
    } catch (JSONException e) {
        return null;
    }
    return saveRequest;
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:11,代码来源:VKUploadMessagesPhotoRequest.java

示例6: VKError

import com.vk.sdk.util.VKJsonHelper; //导入依赖的package包/类
/**
    * Generate API error from JSON
    *
    * @param json Json description of VK API error
    */
   @SuppressWarnings("unchecked")
public VKError(JSONObject json) throws JSONException {
       VKError internalError = new VKError(json.getInt(VKApiConst.ERROR_CODE));
       internalError.errorMessage = json.getString(VKApiConst.ERROR_MSG);
       internalError.requestParams = (ArrayList<Map<String, String>>) VKJsonHelper.toList(
               json.getJSONArray(VKApiConst.REQUEST_PARAMS));
       if (internalError.errorCode == 14) {
           internalError.captchaImg = json.getString(VKApiConst.CAPTCHA_IMG);
           internalError.captchaSid = json.getString(VKApiConst.CAPTCHA_SID);
       }

       this.errorCode = VK_API_ERROR;
       this.apiError = internalError;
   }
 
开发者ID:LizaAlert-HotLine,项目名称:AndroidMobileWorkplace,代码行数:20,代码来源:VKError.java

示例7: callApiMethod

import com.vk.sdk.util.VKJsonHelper; //导入依赖的package包/类
private boolean callApiMethod(String method, JSONObject params, CallbackContext context) {
    try {
        VKRequest req = new VKRequest(method, new VKParameters(VKJsonHelper.toMap(params)));
        performRequest(req, context);
        return true;
    } catch(Exception ex) {
        return false;
    }
}
 
开发者ID:DrMoriarty,项目名称:cordova-social-vk,代码行数:10,代码来源:SocialVk.java


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