Back to project page wonderpush-android-sdk.
The source code is released under:
Apache License
If you think the Android project wonderpush-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.wonderpush.sdk; /*from www .j ava 2 s . c o m*/ import android.location.Location; /** * A static helper class that will add parameters to a {@link WonderPush.RequestParams} object depending on the resource * path and user configuration of the {@link WonderPush} object. */ class WonderPushRequestParamsDecorator { protected static void decorate(String resource, WonderPush.RequestParams params) { // Always add lang addParameterIfAbsent(params, "lang", WonderPush.getLang()); // Always add location addParameterIfAbsent(params, "location", WonderPush.getLocation()); // Always add the sdk version addParameterIfAbsent(params, "sdkVersion", WonderPush.SDK_VERSION); // Add the SID for web resources if (resource.startsWith("/web")) params.put("sid", WonderPushConfiguration.getSID()); } private static void addParameterIfAbsent(WonderPush.RequestParams params, String paramName, String paramValue) { if (null == params || null == paramName || null == paramValue) return; if (params.has(paramName)) return; params.put(paramName, paramValue); } private static void addParameterIfAbsent(WonderPush.RequestParams params, String paramName, Location paramValue) { if (null == paramValue) return; addParameterIfAbsent(params, paramName, "" + paramValue.getLatitude() + "," + paramValue.getLongitude()); } }