简易短信发送器iSMS
这是一个由哥开发的简单的不能再简单的短信发送器。
附上源码:
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TextView
- android:text="@string/moble"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- />
- <EditText
- android:id="@+id/mobile"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
- <TextView
- android:text="@string/content"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- />
- <EditText
- android:id="@+id/content"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:minLines="5" />
- <Button
- android:id="@+id/send"
- android:text="@string/send"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- ></Button>
- </LinearLayout>
- package gphone.cc.iSMS;
- import android.app.Activity;
- import android.os.Bundle;
- import android.telephony.SmsManager;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.Toast;
- import java.util.ArrayList;
- public class iSMSActivity extends Activity
- {
- EditText mobile=null;
- EditText content=null;
- Button sent=null;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- sent=(Button)this.findViewById(R.id.send);
- sent.setOnClickListener(new Button.OnClickListener(){
- public void onClick(View view) {
- mobile=(EditText)findViewById(R.id.mobile);
- String mobileStr=mobile.getText().toString();
- content=(EditText)findViewById(R.id.content);
- String contentStr=content.getText().toString();
- SmsManager smsManager=SmsManager.getDefault();
- if(contentStr.length()>70){
- ArrayList<String> contents=smsManager.divideMessage(contentStr);
- for(String sms :contents){
- smsManager.sendTextMessage(mobileStr,null,contentStr,null,null);
- }
- }
- else{
- smsManager.sendTextMessage(mobileStr,null,contentStr,null,null);
- }
- Toast.makeText(iSMSActivity.this,R.string.msg,Toast.LENGTH_LONG).show();
- }
- });
- }
- }
androidminifast.xml
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="gphone.cc.iSMS"
- android:versionCode="2"
- android:versionName="1.1">
- <application android:label="@string/app_name" android:icon="@drawable/icon">
- <activity android:name="iSMSActivity"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
- <uses-sdk android:minSdkVersion="3"/>
- <uses-permission android:name="android.permission.SEND_SMS"/>
- </manifest>
string.xml
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <string name="app_name">iSMS</string>
- <string name="moble">请电话输入号码</string>
- <string name="content">请输入短信内容</string>
- <string name="send">发送短信</string>
- <string name="msg">短信已发送</string>
- </resources>
下载地址:iSMS (rar改为apk即可)
转载于:https://www.cnblogs.com/AlexCheng/archive/2011/07/12/2119994.html
简易短信发送器iSMS相关推荐
- 实例教程二:短信发送器
2012eoe移动开发者大会各嘉宾ppt汇总 http://www.eoeandroid.com/thread-206795-1-1.html OpenGL es 3D游戏火力篮球源码及PPT教程 h ...
- android学习笔记----短信发送器
目录 模拟效果: 短信发送器: 短信发送器demo地址:https://github.com/liuchenyang0515/SmsSend 模拟效果: 我们初步想要的功能就是ListView显示一些 ...
- Android两个小Demo之电话拨号器和短信发送器
两个简单的小案列 <1>电话拨号器 实现一个电话拨号器,我们分为简单的三步走: 1.在layout中写好布局 2.在MainActivity中写出对应的事件 3.在Manifest中配置好 ...
- Android实现电话拨号器和短信发送器
电话拨号器 实现原理:用户输入电话号码,当点击拨打的时候,由监听对象捕获,监听对象通过文本控件获取到用户输入的电话号码,由于系统已经实现了电话拨号功能,所以我们只需要调用这个功能就可以了. 步骤: 1 ...
- Android实现简单短信发送器
布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:too ...
- Android(java)学习笔记69:短信发送器
1. 一般我们第一步都是先创建这个main.xml布局文件,这是良好的习惯: 1 <?xml version="1.0" encoding="utf-8" ...
- Android之制作短信发送器
这次,我们做一个手机都有的功能--发短信,首先,既然是个小软件,新建项目的时候顺便图标也选为短信图标那个.首先我们还是先来实现页面布局,到activity_main.xml添加代码(我的默认是相对布局 ...
- Android项目——短信发送器
因为应用要使用手机的短信服务,所以要在清单文件 AndroidManifest.xml 中添 加短信服务权限 : <?xml version="1.0" encoding=& ...
- 11_短信发送器_快速回复页面实现
12321312 转载于:https://www.cnblogs.com/ZHONGZHENHUA/p/7136592.html
最新文章
- 4、libgdx应用框架
- 哪种营销方法效果最差_网络营销推广中如何监控评测网络效果?
- 服务器显示rl112,【RL-TCPnet网络教程】第13章 RL-TCPnet之TCP服务器(下)
- OpenCV“智能剪刀“Intelligent Scissors的实例(附完整代码)
- 2/5 MySQL入门总结:数据类型
- 前端学习(628):数字类型
- root - 计算机术语,root什么意思
- ubuntu16.04 64bit 安装 ida
- 2004我曾经最喜欢的歌(一)
- Hibernate的HQL中in参数设置和JdbcTemplete中的in参数
- 解析库之——beautifulsoup
- Linux用户管理命令和压缩解压命令
- 【论文笔记】使用物理原理和领域知识进行无标注的监督学习
- 人类如何学习和表征网络?
- bash pitfall
- 联合国发布2019年《世界人口展望》:人口老化加剧, 到本世纪末地球人口将达109亿...
- 配置Hiveserver 高可用,新增Hiveserver2启动失败
- C语言--正弦、余弦函数
- 迁移selenium脚本迁移后出现unknown error: DevToolsActivePort file doesn‘t exis
- 嵌入式学习⑤——STM32嵌入式应用系统设计