失效链接处理 |
微博Android SDK使用指南_v9.12.0 PDF 下载
本站整理下载:
相关截图:
主要内容:
ኩ᧗֦ጱApp Key
᧗کஙܗනଘݣӤ ౯ጱଫአ ᶭᶎ҅᭗ᬦݎᘏղᦊᦤਭ໐҅ਠ࠺ଫአמ௳҅ਖ਼ᧆଫአ
Իਭ໐҅ݝํਭ໐᭗ᬦጱଫአᚆᬰᤈݎ̶
ݷᓋݷଫአᑕଧጱ۱ٙဳ
ࣁஙܗනଘݣӤဳٙଫአᑕଧጱ۱ݷᓋݸݷᚆྋᏟദ̶
ဳғ۱ݷᓋݷ๚ဳٙ҅ᘏᓋݷဳٙӧྋᏟ҅᮷տᛘ෫ဩദ̶
ᵞ౮SDK
微博SDK 2019/12/11, 11:16
http://localhost:8081/#/docs/user-guide/instruction-android Page 2 of 9
Android Studioሾहӥғ
ࣁProjectጱbuild.gradleկӾႲےׁᩢᯈᗝғ
allprojects {
repositories {
maven { url 'https://dl.bintray.com/thelasterstar/maven/' }
}
}
ࣁModuleጱbuild.gradleկӾႲےׁᩢંᯈᗝғ
android {
defaultConfig {
ndk {
// ᦡᗝඪ೮ጱSOପຝ
abiFilters 'armeabi' //, 'armeabi-v7a','arm64-v8a'
}
}
}
dependencies {
compile 'com.sina.weibo.sdk:core:9.12.0:openDefaultRelease@aar'
}
݇හᯈᗝ
ࣁAndroidManifest.xmlӾႲےᴴғ
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
微博SDK 2019/12/11, 11:16
http://localhost:8081/#/docs/user-guide/instruction-android Page 3 of 9
ဳғইຎጱAppᵱᥝӤփک google play store ҅ᵱᥝਖ਼ READ_PHONE_STATE
ᴴᠰധᘏᑏᴻ҅ݢڞވᚆտᤩӥຝ̶
᧗عႰႝஙܗSDK҅ࣁProguardႰႝկӾीےզӥᯈᗝғ
-keep public class com.sina.weibo.sdk.**{*;}
ত۸SDKڡ
ত۸դᎱইӥғڡ
private static final String APP_KY = "ࣁஙܗݎଘݣԅଫአኩ᧗ጱApp Key";
private static final String REDIRECT_URL = "ࣁஙܗනଘݣᦡᗝጱദࢧ᧣ᶭ";
private static final String SCOPE = "ࣁஙܗනଘݣԅଫአኩ᧗ጱṛᕆᴴ";
private IWBAPI mWBAPI;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//init sdk
initSdk();
}
private void initSdk() {
AuthInfo authInfo = new AuthInfo(this, APP_KY, REDIRECT_URL, SCOPE);
mWBAPI = WBAPIFactory.createWBAPI(this);
mWBAPI.registerApp(this, authInfo);
}
ֵአஙܗദ
ஙܗദᐏֺդᎱইӥғ
//ദ֢
微博SDK 2019/12/11, 11:16
http://localhost:8081/#/docs/user-guide/instruction-android Page 4 of 9
private void startAuth() {
//auth
mWBAPI.authorize(new WbAuthListener() {
@Override
public void onComplete(Oauth2AccessToken token) {
Toast.makeText(MainActivity.this, "ஙܗദ౮ۑ", Toast.LENGTH_SHORT).show();
}
@Override
public void onError(UiError error) {
Toast.makeText(MainActivity.this, "ஙܗദڊᲙ", Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel() {
Toast.makeText(MainActivity.this, "ஙܗദݐၾ", Toast.LENGTH_SHORT).show();
}
});
}
|