手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >基于Android CALL && SendMes Test的相关介绍
基于Android CALL && SendMes Test的相关介绍
摘要:Intent:当找到与设置的Intent限制相同的Activity时候通过startActivity()就会启动该Activity电话播号器...

Intent:当找到与设置的Intent限制相同的Activity时候通过startActivity()就会启动该Activity

电话播号器:

intent.setAction("android.intent.action.CALL");

intent.addCategory("android.intent.category.DEFAULT");

intent.setData(Uri.parse("tel:" + strmobile));

startActivity(intent);//方法内部会自动为Intent添加类别:android.intent.category.DEFAULT

短信发送器:

SmsManager manager = SmsManager.getDefault();

ArrayList<String> texts = manager.divideMessage(comtent);

for (String text : texts) {

manager.sendTextMessage(number, null, text, null, null);// 4和5参数分别为短信发送状态,对方是否收到短信状态;

}

Toast.makeText(getApplicationContext(),R.string.success,Toast.LENGTH_LONG).show();

吐西对话框// Toast.makeText(MainActivity.this, resId, duration);//内部类访问外部类;

****************************************************************

findViewById(R.id.button);// 根据id查找显示控件;

View.OnClickListener() {

@Override

public void onClick(View arg0) {

//arg0 就是被点击的对象

}

}

@+id/button:在R文件的id内部类里面,添加一个id为button的常量,使用该常量的值作为此控件的id值;

@android:表示访问android包下的R文件;

@id/label:表示访问id为label的文件;(相对布局)

单元测试:

继承类:AndroidTestCase

<instrumentation

android:name="android.test.InstrumentationTestRunner"

android:targetPackage="com.hellokity" />

<application

android:icon="@drawable/ic_launcher"

android:label="@string/app_name" >

<uses-library android:name="android.test.runner" />

</application>

actual = function();

Assert.assertEquals(3,actual);判断actual是否为3;

【基于Android CALL && SendMes Test的相关介绍】相关文章:

android ListView内数据的动态添加与删除实例代码

基于Android SQLite的使用介绍

Android控件系列之Toast使用介绍

Android Fragment 基本了解(图文介绍)

Android ellipsize的小问题介绍

基于Android ListView之加载使用技巧

浅谈Android Content Provider的使用

基于Android LayoutInflater的使用介绍

基于Android开发支持表情的实现详解

基于Android 监听ContentProvider 中数据变化的相关介绍

精品推荐
分类导航