本文整理汇总了Java中com.tencent.connect.common.Constants类的典型用法代码示例。如果您正苦于以下问题:Java Constants类的具体用法?Java Constants怎么用?Java Constants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Constants类属于com.tencent.connect.common包,在下文中一共展示了Constants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: a
import com.tencent.connect.common.Constants; //导入依赖的package包/类
private StringBuffer a(StringBuffer stringBuffer, Bundle bundle) {
f.c(f.d, "fillShareToQQParams() --start");
String str = "...";
bundle.putString("action", SystemUtils.QQ_SHARE_CALLBACK_ACTION);
bundle.putString("appId", this.mToken.getAppId());
bundle.putString("sdkp", "a");
bundle.putString("sdkv", Constants.SDK_VERSION);
bundle.putString("status_os", VERSION.RELEASE);
bundle.putString("status_machine", Build.MODEL);
String str2 = WidgetRequestParam.REQ_PARAM_COMMENT_CONTENT;
if (bundle.containsKey(str2) && bundle.getString(str2).length() > 40) {
bundle.putString(str2, bundle.getString(str2).substring(0, 40) + str);
}
str2 = "summary";
if (bundle.containsKey(str2) && bundle.getString(str2).length() > 80) {
bundle.putString(str2, bundle.getString(str2).substring(0, 80) + str);
}
stringBuffer.append("&" + Util.encodeUrl(bundle).replaceAll("\\+", "%20"));
f.c(f.d, "fillShareToQQParams() --end");
return stringBuffer;
}
示例2: onCreate
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
requestWindowFeature(1);
setRequestedOrientation(1);
setContentView(a());
this.d = new Handler();
Bundle bundleExtra = getIntent().getBundleExtra(Constants.KEY_PARAMS);
this.r = bundleExtra.getString(SocialConstants.PARAM_AVATAR_URI);
this.c = bundleExtra.getString("return_activity");
String string = bundleExtra.getString("appid");
String string2 = bundleExtra.getString("access_token");
long j = bundleExtra.getLong("expires_in");
String string3 = bundleExtra.getString("openid");
this.n = bundleExtra.getInt("exitAnim");
this.b = new QQToken(string);
this.b.setAccessToken(string2, ((j - System.currentTimeMillis()) / 1000) + "");
this.b.setOpenId(string3);
b();
e();
this.m = System.currentTimeMillis();
a("10653", 0);
}
示例3: setAvatar
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public void setAvatar(Activity activity, Uri uri, IUiListener iUiListener, int i) {
if (this.a != null) {
this.a.onCancel();
}
this.a = iUiListener;
Bundle bundle = new Bundle();
bundle.putString(SocialConstants.PARAM_AVATAR_URI, uri.toString());
bundle.putInt("exitAnim", i);
bundle.putString("appid", this.mToken.getAppId());
bundle.putString("access_token", this.mToken.getAccessToken());
bundle.putLong("expires_in", this.mToken.getExpireTimeInSecond());
bundle.putString("openid", this.mToken.getOpenId());
this.mActivityIntent = a(activity);
if (hasActivityForIntent()) {
a(activity, bundle);
d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_SET_AVATAR, "12", "18", "0");
return;
}
d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_SET_AVATAR, "12", "18", "1");
}
示例4: a
import com.tencent.connect.common.Constants; //导入依赖的package包/类
private void a(Bundle bundle) {
if (this.mToken != null) {
bundle.putString("appid", this.mToken.getAppId());
if (this.mToken.isSessionValid()) {
bundle.putString(Constants.PARAM_KEY_STR, this.mToken.getAccessToken());
bundle.putString(Constants.PARAM_KEY_TYPE, "0x80");
}
String openId = this.mToken.getOpenId();
if (openId != null) {
bundle.putString("hopenid", openId);
}
bundle.putString(Constants.PARAM_PLATFORM, "androidqz");
try {
bundle.putString(Constants.PARAM_PLATFORM_ID, Global.getContext().getSharedPreferences(Constants.PREFERENCE_PF, 0).getString(Constants.PARAM_PLATFORM_ID, Constants.DEFAULT_PF));
} catch (Exception e) {
e.printStackTrace();
bundle.putString(Constants.PARAM_PLATFORM_ID, Constants.DEFAULT_PF);
}
}
bundle.putString("sdkv", Constants.SDK_VERSION);
bundle.putString("sdkp", "a");
}
示例5: onActivityResult
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public void onActivityResult(Activity activity, int i, int i2, Intent intent) {
if (i2 == -1) {
int intExtra = intent.getIntExtra(Constants.KEY_ERROR_CODE, 0);
if (intExtra == 0) {
String stringExtra = intent.getStringExtra(Constants.KEY_RESPONSE);
if (stringExtra != null) {
try {
this.a.onComplete(Util.parseJson(stringExtra));
return;
} catch (JSONException e) {
this.a.onError(new UiError(-4, Constants.MSG_JSON_ERROR, stringExtra));
return;
}
}
this.a.onComplete(new JSONObject());
return;
}
this.a.onError(new UiError(intExtra, intent.getStringExtra(Constants.KEY_ERROR_MSG), intent.getStringExtra(Constants.KEY_ERROR_DETAIL)));
return;
}
this.a.onCancel();
}
示例6: reportBernoulli
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public static void reportBernoulli(final Context context, String str, long j, String str2) {
final Bundle bundle = new Bundle();
bundle.putString("appid_for_getting_config", str2);
bundle.putString("strValue", str2);
bundle.putString("nValue", str);
bundle.putString("qver", Constants.SDK_VERSION);
if (j != 0) {
bundle.putLong("elt", j);
}
new Thread() {
public void run() {
try {
HttpUtils.openUrl2(context, "http://cgi.qplus.com/report/report", "GET", bundle);
} catch (Exception e) {
f.e(Util.a, "reportBernoulli has exception: " + e.getMessage());
}
}
}.start();
}
示例7: composeHaboCgiReportParams
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public static Bundle composeHaboCgiReportParams(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9) {
Bundle bundle = new Bundle();
bundle.putString(Constants.PARAM_PLATFORM, "1");
bundle.putString("result", str);
bundle.putString("code", str2);
bundle.putString("tmcost", str3);
bundle.putString("rate", str4);
bundle.putString("cmd", str5);
bundle.putString("uin", str6);
bundle.putString("appid", str7);
bundle.putString("share_type", str8);
bundle.putString("detail", str9);
bundle.putString("os_ver", VERSION.RELEASE);
bundle.putString("network", a.a(Global.getContext()));
bundle.putString("apn", a.b(Global.getContext()));
bundle.putString("model_name", Build.MODEL);
bundle.putString("sdk_ver", Constants.SDK_VERSION);
bundle.putString(ShareRequestParam.REQ_PARAM_PACKAGENAME, Global.getPackageName());
bundle.putString("app_ver", getAppVersionName(Global.getContext(), Global.getPackageName()));
return bundle;
}
示例8: startAppbar
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public void startAppbar(Activity activity, String str) {
if (a(str)) {
String c = c(str);
Object b = b();
if (TextUtils.isEmpty(b) || SystemUtils.compareVersion(b, "4.2") < 0) {
a(activity, c);
return;
}
String str2 = c + a();
f.b("AppbarAgent", "-->(AppbarAgent)startAppbar : yybUrl = " + str2);
try {
Intent intent = new Intent();
intent.setClassName("com.tencent.android.qqdownloader", "com.tencent.assistant.activity.ExportBrowserActivity");
intent.putExtra("com.tencent.assistant.BROWSER_URL", str2);
activity.startActivity(intent);
activity.overridePendingTransition(17432576, 17432577);
return;
} catch (Exception e) {
f.b("AppbarAgent", "-->(AppbarAgent)startAppbar : ExportBrowserActivity not found, start H5");
a(activity, c);
return;
}
}
Toast.makeText(activity, Constants.MSG_PARAM_ERROR, 0).show();
}
示例9: a
import com.tencent.connect.common.Constants; //导入依赖的package包/类
private void a(Activity activity, String str) {
if (this.mToken != null) {
Intent intent = new Intent(activity, AppbarActivity.class);
intent.putExtra("appid", this.mToken.getAppId());
if (!(this.mToken.getAccessToken() == null || this.mToken.getOpenId() == null)) {
a aVar = new a();
aVar.b = this.mToken.getAccessToken();
aVar.c = Long.parseLong(this.mToken.getAppId());
aVar.a = this.mToken.getOpenId();
a.a(activity, str, this.mToken.getOpenId(), this.mToken.getAccessToken(), this.mToken.getAppId());
}
intent.putExtra("url", str);
f.b("AppbarAgent", "-->(AppbarAgent)startAppbar H5 : url = " + str);
try {
activity.startActivityForResult(intent, Constants.REQUEST_APPBAR);
} catch (Exception e) {
f.b("AppbarAgent", "-->(AppbarAgent)startAppbar : activity not found, start H5");
}
}
}
示例10: a
import com.tencent.connect.common.Constants; //导入依赖的package包/类
private void a(Activity activity, String str, Bundle bundle, String str2, IUiListener iUiListener) {
f.b(f.d, "-->handleIntentWithH5 " + str + " params=" + bundle);
Intent targetActivityIntent = getTargetActivityIntent("com.tencent.open.agent.AgentActivity");
Object cVar = new c(this, activity, iUiListener, str, str2, bundle);
Intent targetActivityIntent2 = getTargetActivityIntent("com.tencent.open.agent.EncryTokenActivity");
if (targetActivityIntent2 == null || targetActivityIntent == null || targetActivityIntent.getComponent() == null || targetActivityIntent2.getComponent() == null || !targetActivityIntent.getComponent().getPackageName().equals(targetActivityIntent2.getComponent().getPackageName())) {
String encrypt = Util.encrypt("tencent&sdk&qazxc***14969%%" + this.mToken.getAccessToken() + this.mToken.getAppId() + this.mToken.getOpenId() + "qzone3.4");
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put(SocialConstants.PARAM_ENCRY_EOKEN, encrypt);
} catch (JSONException e) {
e.printStackTrace();
}
cVar.onComplete(jSONObject);
return;
}
targetActivityIntent2.putExtra("oauth_consumer_key", this.mToken.getAppId());
targetActivityIntent2.putExtra("openid", this.mToken.getOpenId());
targetActivityIntent2.putExtra("access_token", this.mToken.getAccessToken());
targetActivityIntent2.putExtra(Constants.KEY_ACTION, SocialConstants.ACTION_CHECK_TOKEN);
this.mActivityIntent = targetActivityIntent2;
if (hasActivityForIntent()) {
startAssitActivity(activity, (IUiListener) cVar);
}
}
示例11: getTargetActivityIntent
import com.tencent.connect.common.Constants; //导入依赖的package包/类
protected Intent getTargetActivityIntent(String str) {
Intent intent = new Intent();
intent.setClassName(Constants.PACKAGE_QZONE, str);
Intent intent2 = new Intent();
intent2.setClassName("com.tencent.mobileqq", str);
if (SystemUtils.isActivityExist(Global.getContext(), intent2) && SystemUtils.compareQQVersion(Global.getContext(), "4.7") >= 0) {
return intent2;
}
if (!SystemUtils.isActivityExist(Global.getContext(), intent) || SystemUtils.compareVersion(SystemUtils.getAppVersionName(Global.getContext(), Constants.PACKAGE_QZONE), "4.2") < 0) {
return null;
}
if (SystemUtils.isAppSignatureValid(Global.getContext(), intent.getComponent().getPackageName(), Constants.SIGNATRUE_QZONE)) {
return intent;
}
return null;
}
示例12: onComplete
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public void onComplete(Object obj) {
JSONObject jSONObject = (JSONObject) obj;
try {
List arrayList = new ArrayList();
JSONObject jSONObject2 = jSONObject.getJSONObject(ShareRequestParam.RESP_UPLOAD_PIC_PARAM_DATA);
if (!jSONObject2.isNull(WidgetRequestParam.REQ_PARAM_COMMENT_CONTENT)) {
JSONArray jSONArray = jSONObject2.getJSONArray(WidgetRequestParam.REQ_PARAM_COMMENT_CONTENT);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject3 = jSONArray.getJSONObject(i);
arrayList.add(new WeiyunFile(jSONObject3.getString("file_id"), jSONObject3.getString("file_name"), jSONObject3.getString("file_ctime"), (long) jSONObject3.getInt("file_size")));
}
}
this.mListener.onComplete(arrayList);
} catch (JSONException e) {
this.mListener.onError(new UiError(-4, Constants.MSG_JSON_ERROR, jSONObject.toString()));
}
}
示例13: a
import com.tencent.connect.common.Constants; //导入依赖的package包/类
private StringBuffer a(StringBuffer stringBuffer, Bundle bundle) {
f.c(f.d, "fillShareToQQParams() --start");
String str = "...";
bundle.putString("action", SystemUtils.QQ_SHARE_CALLBACK_ACTION);
bundle.putString("appId", this.mToken.getAppId());
bundle.putString("sdkp", "a");
bundle.putString(SocializeProtocolConstants.PROTOCOL_KEY_VERSION, Constants.SDK_VERSION);
bundle.putString("status_os", VERSION.RELEASE);
bundle.putString("status_machine", Build.MODEL);
String str2 = Utils.RESPONSE_CONTENT;
if (bundle.containsKey(str2) && bundle.getString(str2).length() > 40) {
bundle.putString(str2, bundle.getString(str2).substring(0, 40) + str);
}
str2 = "summary";
if (bundle.containsKey(str2) && bundle.getString(str2).length() > 80) {
bundle.putString(str2, bundle.getString(str2).substring(0, 80) + str);
}
stringBuffer.append(com.alipay.sdk.sys.a.b + Util.encodeUrl(bundle).replaceAll("\\+",
"%20"));
f.c(f.d, "fillShareToQQParams() --end");
return stringBuffer;
}
示例14: a
import com.tencent.connect.common.Constants; //导入依赖的package包/类
protected void a(IUiListener iUiListener) {
f.c(f.d, "reportDAU() -- start");
String str = "tencent&sdk&qazxc***14969%%";
String str2 = "qzone3.4";
Object accessToken = this.mToken.getAccessToken();
Object openId = this.mToken.getOpenId();
Object appId = this.mToken.getAppId();
Object obj = "";
if (!(TextUtils.isEmpty(accessToken) || TextUtils.isEmpty(openId) || TextUtils.isEmpty
(appId))) {
obj = Util.encrypt(str + accessToken + appId + openId + str2);
}
if (TextUtils.isEmpty(obj)) {
f.e(f.d, "reportDAU -- encrytoken is null");
return;
}
Bundle composeCGIParams = composeCGIParams();
composeCGIParams.putString("encrytoken", obj);
HttpUtils.requestAsync(this.mToken, Global.getContext(), "https://openmobile.qq" +
".com/user/user_login_statis", composeCGIParams, Constants.HTTP_POST, null);
f.c(f.d, "reportDAU() -- end");
}
示例15: reportBernoulli
import com.tencent.connect.common.Constants; //导入依赖的package包/类
public static void reportBernoulli(final Context context, String str, long j, String str2) {
final Bundle bundle = new Bundle();
bundle.putString("appid_for_getting_config", str2);
bundle.putString("strValue", str2);
bundle.putString("nValue", str);
bundle.putString("qver", Constants.SDK_VERSION);
if (j != 0) {
bundle.putLong("elt", j);
}
new Thread() {
public void run() {
try {
HttpUtils.openUrl2(context, "http://cgi.qplus.com/report/report", "GET",
bundle);
} catch (Exception e) {
f.e(Util.a, "reportBernoulli has exception: " + e.getMessage());
}
}
}.start();
}