public VKParameters getPreparedParameters() { if (mPreparedParameters == null) { mPreparedParameters = new VKParameters(mMethodParameters); // Set current access token from SDK object VKAccessToken token = VKSdk.getAccessToken(); if (token != null) mPreparedParameters.put(VKApiConst.ACCESS_TOKEN, token.accessToken); if (!this.secure) if (token != null && (token.secret != null || token.httpsRequired)) { this.secure = true; } // Set actual version of API mPreparedParameters.put(VKApiConst.VERSION, VKSdkVersion.API_VERSION); // Set preferred language for request mPreparedParameters.put(VKApiConst.LANG, getLang()); if (this.secure) { // If request is secure, we need all urls as https mPreparedParameters.put(VKApiConst.HTTPS, "1"); } if (token != null && token.secret != null) { // If it not, generate signature of request String sig = generateSig(token); mPreparedParameters.put(VKApiConst.SIG, sig); } // From that moment you cannot modify parameters. // Specially for http loading } return mPreparedParameters; }
/** * Adds additional parameter to that request * * @param key parameter name * @param value parameter value */ public void addExtraParameter(String key, Object value) { mMethodParameters.put(key, value); }