android分享qq
Ⅰ android 如何实现bitmap分享到QQ空调
public class AndroidShare {
/**
* 上下文
*/
private Context context;
/**
* 文本类型
*
*/
public static int TEXT = 0;
/**
* 图片类型
*/
public static int DRAWABLE = 1;
public AndroidShare(Context context) {
this.context = context;
}
/**
* 分享到QQ好友
*
* @param msgTitle
* (分享标题)
* @param msgText
* (分享内容)
* @param type
* (分享类型)
* @param drawable
* (分享图片,若分享类型为AndroidShare.TEXT,则可以为null)
*/
public void shareQQFriend(String msgTitle, String msgText, int type,
Bitmap drawable) {
shareMsg("com.tencent.mobileqq",
"com.tencent.mobileqq.activity.JumpActivity", "QQ", msgTitle,
msgText, type, drawable);
}
/**
* 分享到微信好友
*
* @param msgTitle
* (分享标题)
* @param msgText
* (分享内容)
* @param type
* (分享类型)
* @param drawable
* (分享图片,若分享类型为AndroidShare.TEXT,则可以为null)
*/
public void shareWeChatFriend(String msgTitle, String msgText, int type,
Bitmap drawable) {
shareMsg("com.tencent.mm", "com.tencent.mm.ui.tools.ShareImgUI", "微信",
msgTitle, msgText, type, drawable);
}
/**
* 分享到微信朋友圈(分享朋友圈一定需要图片)
*
* @param msgTitle
* (分享标题)
* @param msgText
* (分享内容)
* @param drawable
* (分享图片)
*/
public void shareWeChatFriendCircle(String msgTitle, String msgText,
Bitmap drawable) {
shareMsg("com.tencent.mm", "com.tencent.mm.ui.tools.ShareToTimeLineUI",
"微信", msgTitle, msgText, AndroidShare.DRAWABLE, drawable);
}
/**
* 点击分享的代码
*
* @param packageName
* (包名,跳转的应用的包名)
* @param activityName
* (类名,跳转的页面名称)
* @param appname
* (应用名,跳转到的应用名称)
* @param msgTitle
* (标题)
* @param msgText
* (内容)
* @param type
* (发送类型:text or pic 微信朋友圈只支持pic)
*/
@SuppressLint("NewApi")
private void shareMsg(String packageName, String activityName,
String appname, String msgTitle, String msgText, int type,
Bitmap drawable) {
if (!packageName.isEmpty() && !isAvilible(context, packageName)) {// 判断APP是否存在
Toast.makeText(context, "请先安装" + appname, Toast.LENGTH_SHORT)
.show();
return;
}
Intent intent = new Intent("android.intent.action.SEND");
if (type == AndroidShare.TEXT) {
intent.setType("text/plain");
} else if (type == AndroidShare.DRAWABLE) {
intent.setType("image/*");
// BitmapDrawable bd = (BitmapDrawable) drawable;
// Bitmap bt = bd.getBitmap();
final Uri uri = Uri.parse(MediaStore.Images.Media.insertImage(
context.getContentResolver(), drawable, null, null));
intent.putExtra(Intent.EXTRA_STREAM, uri);
}
intent.putExtra(Intent.EXTRA_SUBJECT, msgTitle);
intent.putExtra(Intent.EXTRA_TEXT, msgText);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (!packageName.isEmpty()) {
intent.setComponent(new ComponentName(packageName, activityName));
context.startActivity(intent);
} else {
context.startActivity(Intent.createChooser(intent, msgTitle));
}
}
/**
* 判断相对应的APP是否存在
*
* @param context
* @param packageName
* @return
*/
public boolean isAvilible(Context context, String packageName) {
PackageManager packageManager = context.getPackageManager();
List<PackageInfo> pinfo = packageManager.getInstalledPackages(0);
for (int i = 0; i < pinfo.size(); i++) {
if (((PackageInfo) pinfo.get(i)).packageName
.equalsIgnoreCase(packageName))
return true;
}
return false;
}
/**
* 指定分享到qq
* @param context
* @param bitmap
*/
public void sharedQQ(Activity context,Bitmap bitmap){
Uri uri = Uri.parse(MediaStore.Images.Media.insertImage(
context.getContentResolver(), BitmapFactory.decodeResource(context.getResources(), R.mipmap.company_mainback), null, null));
Intent imageIntent = new Intent(Intent.ACTION_SEND);
imageIntent.setPackage("com.tencent.mobileqq");
imageIntent.setType("image/*");
imageIntent.putExtra(Intent.EXTRA_STREAM, uri);
imageIntent.putExtra(Intent.EXTRA_TEXT,"您的好友邀请您进入天好圈");
imageIntent.putExtra(Intent.EXTRA_TITLE,"天好圈");
context.startActivity(imageIntent);
}
}
Ⅱ android studio实现android 分享qq怎样实现的
首先新建了一个项目用来演示集成ShareSDK
下载好了ShareSDK之后,解压sharesd
我们按照下面的步骤使用快速集成ShareSDK的工具QuickIntegrater.jar。
Windows下
当然要运行sharesdk快速集成工具,你需要有jdk环境,详细做android开放人员早就具备了这个环境条件,在此就不对jdk环境啰嗦了。
此时您可以双击QuickIntegrater启动程序
Ⅲ 安卓手机qq分享屏幕怎么分享声音
1、首先,需要在手机上将qq版本升级至8.4.1.166。
Ⅳ Android的qq分享,不知道怎么分享纯文本
private void doShareToQQ(final Bundle params) {
final Activity activity = this.activity;
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
mQQShare.shareToQQ(activity, params, new IUiListener() {
@Override
public void onCancel() {
// if(shareType != QQShare.SHARE_TO_QQ_TYPE_IMAGE){
//// Util.toastMessage(activity, "onCancel: ");
// }
}
@Override
public void onComplete(Object response) {
// TODO Auto-generated method stub
// Util.toastMessage(activity, "onComplete: " + response.toString());
}
@Override
public void onError(UiError e) {
// TODO Auto-generated method stub
// Util.toastMessage(activity, "onError: " + e.errorMessage, "e");
}
});
}
}).start();
}
Ⅳ 安卓手机怎么把屏幕上的软件转发给qq好友
选中截取的图片,点击它或长按它,在弹出菜单里寻分享”或“发送”,再选发送方式,一般有短信/微信/QQ/蓝牙/邮件,等等,你选择一个,再在其中查找并选择好友,点击发送按钮即可。9333
Ⅵ 安卓手机qq分享屏幕怎么用
1.首先qq更新到最新版本,登录进入
Ⅶ 安卓qq共享屏幕没声音
使用手机qq进行分享屏幕的时候,会发现没有声音的情况。那么,手机qq分享屏幕没有声音怎么办。
工具/原料
手机qq
手机上打开qq点击联系人选项。
方法/步骤
Ⅷ android分享qq后怎么返回应用
1、一般点击手机上的“返回”键即可;
2、常按Home键打开近期应用,选择你刚才用的应用即可;
3、若是没有“返回”键,可以借助第三方工具,安装虚拟按键,有返回功能
希望能解决你的问题!
Ⅸ 安卓系统怎么把QQ文件传给微信好友
目前不能将QQ里文件直接发给微信朋友,可以通过其他简便方法,方法如下:
1、找到Tencent文件里你准备发的文件;
2、点击该文件选择分享;
3、点击微信发送给好友;
4、找到你的微信朋友点击发送即可。
Ⅹ android开发 请问用qq分享文件怎么分享sdk例子上都是些 分享图片音乐什么的 不知道文件应该怎么分享
java">Intentshare=newIntent(Intent.ACTION_SEND);
ComponentNamecomponent=newComponentName("com.tencent.mobileqq","com.tencent.mobileqq.activity.JumpActivity");
share.setComponent(component);
Filefile=newFile(Environment.getExternalStorageDirectory()+"/001.jpg");
System.out.println("file"+file.exists());
share.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(file));
share.setType("*/*");
startActivity(Intent.createChooser(share,"发送"));