在Android中创建即时消息应用程序

时间:2013-10-04 05:12:13

标签: android

我正在开发一款与Life360 for android相同的即时通讯应用程序。谁能告诉我如何向联系人列表中的朋友发送邀请以安装应用程序?

1 个答案:

答案 0 :(得分:0)

如果您的应用程序位于Play商店或已经托管在某个地方,只需创建一个包含您要发送的消息的字符串,其中包含指向Play商店或apk的链接。

这是显示类似

的代码

enter image description here

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));

更多信息:http://developer.android.com/training/sharing/send.html