Java源码示例:com.tencent.connect.auth.QQToken
示例1
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);
}
示例2
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
requestWindowFeature(1);
setRequestedOrientation(1);
setContentView(a());
d = new Handler();
Bundle bundle1 = getIntent().getBundleExtra("key_params");
r = bundle1.getString("picture");
c = bundle1.getString("return_activity");
String s1 = bundle1.getString("appid");
String s2 = bundle1.getString("access_token");
long l1 = bundle1.getLong("expires_in");
String s3 = bundle1.getString("openid");
n = bundle1.getInt("exitAnim");
b = new QQToken(s1);
b.setAccessToken(s2, (new StringBuilder()).append((l1 - System.currentTimeMillis()) / 1000L).append("").toString());
b.setOpenId(s3);
b();
e();
m = System.currentTimeMillis();
a("10653", 0L);
}
示例3
public static void c(Context context, QQToken qqtoken)
{
b(context, qqtoken);
String s = qqtoken.getAppId();
String s1 = (new StringBuilder()).append("Aqc").append(s).toString();
StatConfig.setAutoExceptionCaught(false);
StatConfig.setEnableSmartReporting(true);
StatConfig.setSendPeriodMinutes(1440);
StatConfig.setStatSendStrategy(StatReportStrategy.PERIOD);
StatConfig.setStatReportUrl("http://cgi.connect.qq.com/qqconnectutil/sdk");
try
{
StatService.startStatService(context, s1, "1.0.0");
return;
}
catch (MtaSDkException mtasdkexception)
{
Log.e("DEBUG", "MTA init Failed.");
}
}
示例4
public TaskGuide(Context context, QQAuth qqauth, QQToken qqtoken)
{
super(context, qqauth, qqtoken);
d = null;
e = null;
g = new Handler(Looper.getMainLooper());
i = com.tencent.open.z.a;
j = com.tencent.open.z.a;
A = 0;
B = 0;
C = 0.0F;
D = new AccelerateInterpolator();
E = false;
a = false;
F = false;
G = false;
L = null;
M = null;
f = (WindowManager)context.getSystemService("window");
d();
}
示例5
public TaskGuide(Context context, QQToken qqtoken)
{
super(context, qqtoken);
d = null;
e = null;
g = new Handler(Looper.getMainLooper());
i = com.tencent.open.z.a;
j = com.tencent.open.z.a;
A = 0;
B = 0;
C = 0.0F;
D = new AccelerateInterpolator();
E = false;
a = false;
F = false;
G = false;
L = null;
M = null;
f = (WindowManager)context.getSystemService("window");
d();
}
示例6
public static void getUserInfo(Activity activity,IUiListener listener) {
if (api == null) {
api = Tencent.createInstance(APP_ID, MainApp.getContext());
}
if(api==null){
return;
}
QQToken token=api.getQQToken();
UserInfo info = new UserInfo(activity, token);
info.getUserInfo(listener);
}
示例7
public BaseApi(QQAuth qQAuth, QQToken qQToken) {
this.mTaskList = null;
this.mActivityIntent = null;
this.mUiListener = null;
this.mQQAuth = qQAuth;
this.mToken = qQToken;
this.mTaskList = new ArrayList();
}
示例8
private static QQToken parseToken(String appId, SocialToken socialToken) {
QQToken token = new QQToken(appId);
//3600是随意定义的,不影响token的使用
token.setAccessToken(socialToken.getToken(), "3600");
token.setOpenId(socialToken.getOpenId());
return token;
}
示例9
public static void b(Context context, QQToken qQToken) {
try {
if (a(context, qQToken)) {
f.invoke(a, new Object[]{Boolean.valueOf(true)});
return;
}
f.invoke(a, new Object[]{Boolean.valueOf(false)});
} catch (Exception e) {
e.printStackTrace();
}
}
示例10
public static void d(Context context, QQToken qQToken) {
if (g) {
b(context, qQToken);
if (qQToken.getOpenId() != null) {
try {
c.invoke(b, new Object[]{context, qQToken.getOpenId()});
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
示例11
public static void a(Context context, QQToken qQToken, String str, String... strArr) {
if (g) {
b(context, qQToken);
try {
d.invoke(b, new Object[]{context, str, strArr});
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例12
public PKDialog(Context context, String str, String str2, IUiListener iUiListener, QQToken qQToken) {
super(context, 16973840);
this.mWeakContext = new WeakReference(context);
this.mUrl = str2;
this.mListener = new OnTimeListener(context, str, str2, qQToken.getAppId(), iUiListener);
this.mHandler = new THandler(this.mListener, context.getMainLooper());
this.listener = iUiListener;
this.mWebviewHeight = Math.round(185.0f * context.getResources().getDisplayMetrics().density);
f.e(TAG, "density=" + context.getResources().getDisplayMetrics().density + "; webviewHeight=" + this.mWebviewHeight);
}
示例13
public void onDownloadStart(String str, String str2, String str3, String str4, long j) {
f.b(f.d, "-->(AppbarActivity)onDownloadStart : url = " + str);
try {
this.a.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
} catch (Exception e) {
f.b(f.d, "-->(AppbarActivity)onDownloadStart : activity aciton_view not found.");
}
QQToken access$500 = this.a.getToken();
if (access$500 != null) {
a.a(access$500.getAppId(), "200", "SDK.APPBAR.HOME ACTION");
}
}
示例14
public void shareToQQ() {
final QQToken token = getToken();
if (token != null) {
QQShare qQShare = new QQShare(this, token);
Bundle bundle = new Bundle();
bundle.putString("title", this.model.a);
bundle.putString("targetUrl", this.model.d);
bundle.putString("summary", this.model.b);
bundle.putString("imageUrl", this.model.c);
f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mTitle = " + this.model.a);
f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mTargetUrl = " + this.model.d);
f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mDescription = " + this.model.b);
f.b(f.d, "-->(AppbarActivity)shareToQQ : model.mIconUrl = " + this.model.c);
qQShare.shareToQQ(this, bundle, new IUiListener(this) {
final /* synthetic */ AppbarActivity b;
public void onError(UiError uiError) {
f.b(f.d, "-->(AppbarActivity)shareToQQ onError");
this.b.jsBridge.responseShareFail(1);
}
public void onComplete(Object obj) {
f.b(f.d, "-->(AppbarActivity)shareToQQ onComplete");
this.b.jsBridge.responseShare(1);
a.a(token.getAppId(), PLAYER.PLAY, "SDK.APPBAR.HOME.SHARE.QQ");
}
public void onCancel() {
f.b(f.d, "-->(AppbarActivity)shareToQQ onCancel");
this.b.jsBridge.responseShareFail(1);
}
});
a.a(token.getAppId(), "200", "SDK.APPBAR.HOME.SHARE.QQ");
}
}
示例15
public void shareToQzone() {
final QQToken token = getToken();
if (token != null) {
QzoneShare qzoneShare = new QzoneShare(this, token);
Bundle bundle = new Bundle();
bundle.putInt("req_type", 1);
bundle.putString("title", this.model.a);
bundle.putString("summary", this.model.b);
bundle.putString("targetUrl", this.model.d);
ArrayList arrayList = new ArrayList();
f.b(f.d, "-->shareToQzone : mIconUrl = " + this.model.c);
arrayList.add(this.model.c);
bundle.putStringArrayList("imageUrl", arrayList);
qzoneShare.shareToQzone(this, bundle, new IUiListener(this) {
final /* synthetic */ AppbarActivity b;
public void onError(UiError uiError) {
f.b(f.d, "-->(AppbarActivity)shareToQzone onError");
this.b.jsBridge.responseShareFail(2);
}
public void onComplete(Object obj) {
f.b(f.d, "-->(AppbarActivity)shareToQzone onComplete");
this.b.jsBridge.responseShare(2);
a.a(token.getAppId(), PLAYER.PLAY, "SDK.APPBAR.HOME.SHARE.QZ");
}
public void onCancel() {
f.b(f.d, "-->(AppbarActivity)shareToQzone onCancel");
this.b.jsBridge.responseShareFail(2);
}
});
a.a(token.getAppId(), "200", "SDK.APPBAR.HOME.SHARE.QZ");
}
}
示例16
public TDialog(Context context, String str, String str2, IUiListener iUiListener, QQToken qQToken) {
super(context, 16973840);
this.c = new WeakReference(context);
this.e = str2;
this.f = new OnTimeListener(context, str, str2, qQToken.getAppId(), iUiListener);
this.j = new THandler(this.f, context.getMainLooper());
this.g = iUiListener;
this.l = qQToken;
}
示例17
public QzoneShare(Context context, QQToken qqtoken)
{
super(context, qqtoken);
a = true;
b = false;
c = false;
d = false;
}
示例18
public static void b(Context context, QQToken qqtoken)
{
if (a(context, qqtoken))
{
StatConfig.setEnableStatService(true);
return;
} else
{
StatConfig.setEnableStatService(false);
return;
}
}
示例19
public static void d(Context context, QQToken qqtoken)
{
b(context, qqtoken);
if (qqtoken.getOpenId() != null)
{
StatService.reportQQ(context, qqtoken.getOpenId());
}
}
示例20
private static void a(Context context, QQToken qqtoken, String s)
{
if (s.indexOf("add_share") > -1 || s.indexOf("upload_pic") > -1 || s.indexOf("add_topic") > -1 || s.indexOf("set_user_face") > -1 || s.indexOf("add_t") > -1 || s.indexOf("add_pic_t") > -1 || s.indexOf("add_pic_url") > -1 || s.indexOf("add_video") > -1)
{
com.tencent.connect.a.a.a(context, qqtoken, "requireApi", new String[] {
s
});
}
}
示例21
c(QQToken qqtoken, Context context, String s, Bundle bundle, String s1, IRequestListener irequestlistener)
{
a = qqtoken;
b = context;
c = s;
d = bundle;
e = s1;
f = irequestlistener;
super();
}
示例22
public PKDialog(Context context, String s, String s1, IUiListener iuilistener, QQToken qqtoken)
{
super(context, 0x1030010);
o = new WeakReference(context);
i = s1;
k = new g(context, s, s1, qqtoken.getAppId(), iuilistener);
l = new h(k, context.getMainLooper());
j = iuilistener;
p = Math.round(185F * context.getResources().getDisplayMetrics().density);
Log.e(b, (new StringBuilder()).append("density=").append(context.getResources().getDisplayMetrics().density).append("; webviewHeight=").append(p).toString());
}
示例23
public TDialog(Context context, String s, String s1, IUiListener iuilistener, QQToken qqtoken)
{
super(context, 0x1030010);
n = false;
o = null;
c = new WeakReference(context);
f = s1;
g = new o(context, s, s1, qqtoken.getAppId(), iuilistener);
m = new p(g, context.getMainLooper());
h = iuilistener;
o = qqtoken;
}
示例24
private void getUserInfo() {
/**
* {
"ret": 0,
"msg": "",
"is_lost": 0,
"nickname": "",
"gender": "",
"province": "",
"city": "",
"figureurl": "",
"figureurl_1": "",
"figureurl_2": "",
"figureurl_qq_1": "",
"figureurl_qq_2": "",
"is_yellow_vip": "0",
"vip": "0",
"yellow_vip_level": "0",
"level": "0",
"is_yellow_year_vip": "0"
}
*/
//sdk给我们提供了一个类UserInfo,这个类中封装了QQ用户的一些信息,我么可以通过这个类拿到这些信息
QQToken mQQToken = MyApplication.getInstance().getTencent().getQQToken();
UserInfo userInfo = new UserInfo(mContext, mQQToken);
userInfo.getUserInfo(new IUiListener() {
@Override
public void onComplete(final Object o) {
JSONObject userInfoJson = (JSONObject) o;
Message msgNick = new Message();
QQUserInfoBean qqUserInfoBean = (QQUserInfoBean) JsonUtil.parseStringToBean(userInfoJson.toString(), QQUserInfoBean.class);
msgNick.what = ON_GETINFO;//昵称
msgNick.obj = qqUserInfoBean;//直接传递一QQ信息内容过去
mHandler.sendMessage(msgNick);
}
@Override
public void onError(UiError uiError) {
ToastUtils.showLongToast(R.string.get_qqinfo_error);
}
@Override
public void onCancel() {
ToastUtils.showLongToast(R.string.get_qqinfo_cancel);
}
}
);
}
示例25
public QzoneShare(Context context, QQToken qQToken) {
super(qQToken);
}
示例26
public QQShare(Context context, QQToken qQToken) {
super(qQToken);
}
示例27
public UserInfo(Context context, QQToken qQToken) {
super(qQToken);
}
示例28
public UserInfo(Context context, QQAuth qQAuth, QQToken qQToken) {
super(qQAuth, qQToken);
}
示例29
public BaseApi(QQToken qQToken) {
this(null, qQToken);
}
示例30
public QQAvatar(QQToken qQToken) {
super(qQToken);
}