简易短信发送器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
最新文章
- Cocoa/iPhone App/静态库 嵌入资源文件 rtb v0.1发布
- JAVA操作Excel表格
- apache camel_令人印象深刻的第一个Apache Camel版本
- 有哪些是你成为一名开发之后才知道的事情
- Linux 内核通知链和例程代码
- 记一次 Redis Cluster 宕机引发的事故
- 【转】SpringMVC整合websocket实现消息推送及触发
- 当当图书项目首页实现
- thinkphp使用dompdf导出pdf(html转pdf)
- 优动漫PAINT上色小技巧——套索填充功能教程
- 你一定要掌握的三条IT运维面试技巧
- 华三交换机snmp配置
- 传播正能量——《海南英才》阅读的读后感2200字
- 发现新大陆,超级好用的轻量级接口测试工具 Postcat
- IDEA快捷键以及和win10系统冲突
- 宏定义时对整数进行数据类型定义
- Centos7的最小化安装
- 洛谷P4233 射命丸文的笔记 分治NTT+竞赛图
- 人到中年才懂10个“潜”规则,过来人:除了生死,其他都是闲事
- OJ7826-KKT最少的操作次数