Android 集成友盟第三方登录分享

首先导入model 导入这个model   。 这个 debug.keystore导入

Android 集成友盟第三方登录分享_第1张图片

 

 

 

 

 

 

Android 集成友盟第三方登录分享_第2张图片

密码:android 

 

build文件粘贴 没有啥粘啥就完了

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.umeng.soexample"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            signingConfig signingConfigs.debug
            proguardFiles 'proguard-rules.pro'
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword "android"
            keyAlias "androiddebugkey"
            keyPassword "android"
        }
    }
    lintOptions {
        abortOnError false
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
    }

}

 

清单文件 + 

android:name="com.abner.ming.MyApplication"

简单的QQ登录和QQ分享

public void onClick(View view) {
        switch (view.getId()){
            case R.id.qqLogin:
                MingUtils.login(UmengLoginActivity.this, 0, new ResultListener() {
                    @Override
                    public void success(UmengBean umengBean) {
                        String name = umengBean.getName();
                        Log.i("TAG","AAAAAAAAAAAAAAAAAAA"+name);
                        Toast.makeText(UmengLoginActivity.this, name+"", Toast.LENGTH_SHORT).show();
                    }
                });
                break;
            case R.id.qqfenxiang:
                MingUtils.shared(this,0,"","","","");
                break;
        }
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
    }

记得最后 添加回调

你可能感兴趣的:(Android 集成友盟第三方登录分享)