调用第三方架包-----百度实践//加载百度接口架包(百度API-key)Frontia.init(this.getApplicationContext(),Conf.APIKEY);《第三方登录》//获得百度第三方登录接口FrontiaAuthorizationmAuthorization=Frontia.getAuthorization();//百度自己登录ArrayListscope=newArrayList();scope.add("帐户")scope.add("密码")mAuthorization.authorize(this,FrontiaAuthorization.MediaType.BAIDU.toString(),scope,newAuthorizationListener());//新浪微博登录需验证APP-keymAuthorization.enableSSO(所用的登录类型,app-key)-----------激活登录接口(新浪,应用key)//除百度以外的登录重载mAuthorization.authorize(activity,登录类型,认证监控事件)------登录认证{事件:登录成功、登录出错onFailure、取消登录onCancel--方法//登录成功执行的方法@OverridepublicvoidonSuccess(FrontiaUserresult){Frontia.setCurrentAccount(result);if(null!=mResultTextView){Stringlog="socialid:"+result.getId()+"\n"+"token:"+result.getAccessToken()+"\n"+"expired:"+result.getExpiresIn();mResultTextViesetText(log);}}}mAuthorization.clearAuthorizationInfo(登录类型)-------登录注销、退出登录(新浪、开心、qq、人人、百度)mAuthorization.clearAllAuthorizationInfos()------退出所有登录,注销mAuthorization.isAuthorizationReady()-------登录状态验证(true/false)//获得登录后的用户信息mAuthorization.getUserInfo(登录类型,newUserInfoListener(){//登录成功拿到的用户信息@OverridepublicvoidonSuccess(FrontiaUser.FrontiaUserDetailresult){if(null!=mResultTextView){StringresultStr="username:"+result.getName()+"\n"+"birthday:"+result.getBirthday()+"\n"+"city:"+result.getCity()+"\n"+"province:"+result.getProvince()+"\n"+"sex:"+result.getSex()+"\n"+"picurl:"+result.getHeadUrl()+"\n";mResultTextViesetText(resultStr);}}});《百度社会分享》FrontiaSocialSharemSocialShare=Frontia.getSocialShare();------获得百度社会分享//设置分享的上下文mSocialShare.setContext(this);//设置mSocialShare.setClientId(MediaType.SINAWEIBO.toString(),Conf.SINA_APP_KEY);mSocialShare.setClientId(MediaType.QZONE.toString(),"100358052");mSocialShare.setClientId(MediaType.QQFRIEND.toString(),"100358052");mSocialShare.setClientName(MediaType.QQFRIEND.toString(),"百度");mSocialShare.setClientId(MediaType.WEIXIN.toString(),"wx329c742cb69b41b8");FrontiaSocialShareContentmImageContent=newFrontiaSocialShareContent();-----分享内容对象//设置分享标题mImageContent.setTitle("百度开发中心");//分享中的文字mImageContent.setContent("欢迎使用百度社会化分享组件,相关问题请邮件dev_support@baidu");//分享到哪个地址urlmImageContent.setLinkUrl("developer.baidu/");//分享中的图片mImageContent.setImageUri(Uri.parse("apps.bdimg/developer/static/04171450/developer/images/icon/terminal_adapter.png"));//百度社会分享mSocialShare.share(mImageContent,MediaType.BATCHSHARE.toString(),newShareListener(),true);//分享事件监听privateclassShareListenerimplementsFrontiaSocialShareListener{@OverridepublicvoidonSuccess(){Log.d("Test","sharesuccess");}@OverridepublicvoidonFailure(interrCode,StringerrMsg){Log.d("Test","shareerrCode"+errCode);}@OverridepublicvoidonCancel(){Log.d("Test","cancel");}}