Giter Site home page Giter Site logo

libset's Introduction

1.在根目录下build.gradle的dependencies中加入classpath "com.mob.sdk:MobSDK:2018.0319.1724"
2.在app目录下build.gradle上加上插件apply plugin: 'com.mob.sdk'
3.在app目录下的build.gradle加上,注意是和android{}并列,不是包裹在android{}中
MobSDK {
appKey "申请Mob的appkey"
appSecret "申请Mob的AppSecret"

ShareSDK {
    //平台配置信息 http://bbs.mob.com/forum.php?mod=viewthread&tid=275&page=1&extra=#pid860
    devInfo {
        Wechat {
            appId "wx4868b35061f87885"
            appSecret "64020361b8ec4c99936c0e3999a9f249"
        }
        QQ {
            appId "100371282"
            appKey "aed9b0303e3ed1e27bae87c33761161d"
            shareByAppClient true
        }
        Facebook {
            appKey "1412473428822331"
            appSecret "a42f4f3f867dc947b9ed6020c2e93558"
            callbackUri "https://mob.com"
        }
        SinaWeibo {
            appKey "568898243"
            appSecret "38a4f8204cc784f81f9f0daaf31e02e3"
            callbackUri "http://www.sharesdk.cn"
            shareByAppClient true
        }
    }
}
4.调用代码
  //java
private void showShare() {
 OnekeyShare oks = new OnekeyShare();
 // title标题,微信、QQ和QQ空间等平台使用
 oks.setTitle(getString(R.string.share));
 // titleUrl QQ和QQ空间跳转链接
 oks.setTitleUrl("http://sharesdk.cn");
 // text是分享文本,所有平台都需要这个字段
 oks.setText("我是分享文本");
 // imagePath是图片的本地路径,确保SDcard下面存在此张图片
 oks.setImagePath("/sdcard/test.jpg");
 // url在微信、Facebook等平台中使用
 oks.setUrl("http://sharesdk.cn");
// 启动分享GUI
oks.show(this);

}

libset's People

Contributors

lancerer avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.