当我在Android模拟器上发送短信时,会转到内容提供商:
content://sms/sent
Run Code Online (Sandbox Code Playgroud)
对?
所以我想从内容提供商处获取最后发送的短信.所以我使用了这个Uri,你可以在上面看到,我使用了方法查询,内容解析器对象.我得到了光标,并使用了movetofirst()方法,所以我会有最后发送的短信.检查下面的代码.
package com.sys;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.net.Uri;
import android.database.Cursor;
public class SMS extends Activity {
Button btnVerSms;
EditText txtFinal;
final Uri CONTENT_URI = Uri.parse("content://sms/sent");
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btnVerSms= (Button)findViewById(R.id.btnVerSms);
txtFinal = (EditText)findViewById(R.id.txtFinal);
btnVerSms.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Cursor cursor = getContentResolver().query(CONTENT_URI, null, null, null, null);
String …Run Code Online (Sandbox Code Playgroud) 我正在通过笔记本电脑上的Web应用程序向手机发送短信.问题是SMS始终是空白的.谁能知道可能出错了什么.下面是我用来将变量传递给kannel的URL(用户名,密码和电话号码已经被eXd显而易见了).我可以收到短信.但它总是空白
http://localhost:13013/cgi-bin/sendsms?username=xxxxx&password=xxxxx&to=+254xxxxxxxxx&test=message
Run Code Online (Sandbox Code Playgroud) 我遵循了这个教程:http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/ 我得到了警告'此设备上未启用短信".
我在我的.h文件中导入了MessageUI框架"MessageUI/MessageUI.h"和MFMessageComposeViewControllerDelegate.从我在网上看到的,人们似乎能够查看MFMessageComposeViewController.
//.h file
#import <UIKit/UIKit.h>
#import "sqlite3.h"
#import <MessageUI/MessageUI.h>
...
@interface DateDetailsViewController : UIViewController <UIActionSheetDelegate, MFMessageComposeViewControllerDelegate, UINavigationControllerDelegate>
...
//.m file
MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];
if([MFMessageComposeViewController canSendText])
{
controller.body = @"testing";
controller.recipients = [NSArray arrayWithObjects:@"12345678", @"87654321", nil];
controller.messageComposeDelegate = self;
[self presentModalViewController:controller animated:YES];
}
...
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
switch (result) {
case MessageComposeResultCancelled:
NSLog(@"Cancelled");
break;
case MessageComposeResultFailed:
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"MyApp" message:@"Unknown Error"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert …Run Code Online (Sandbox Code Playgroud) 我正在开发一个应用程序,它定期向选定的联系人发送SMS指定的次数.我有短信发送功能,但我需要在每轮后发送短信之间加一个延迟.
例如,如果我想在我的联系人中将消息M发送到S和D,我需要应用程序等待N秒,然后再将相同的消息发送到S和D.
我怎样才能使这个工作?如何在向联系人发送消息之间添加延迟功能?
提前致谢!
我想知道我们是否可以在iPhone中阅读传入的短信.
如果有任何新的短信到达,我想通过我的应用程序打开它.
你能建议任何解决方案吗?
我想从Android设备获取所有的收件箱短信.我怎么做?
有没有办法在PHP上发送关于mysql数据库数据更改的短信?我使用twillo作为短信网关.
目标是在将文本共享到来自应用程序的SMS消息以及电子邮件中时能够插入带有文本的图像.就像它在下面的图片中一样.当我尝试使用UIActivityViewController共享图像时,图像显示在下一行而不是文本旁边.是否可以将图像嵌入文本和电子邮件中,如内置的表情符号文本?