Introduction to Android call && sendmes test _android

Source: Internet
Author: User

Intent: The activity is initiated by startactivity () when the activity is found with the same Intent limit as the set.
Telephone Broadcasting Device:
Intent.setaction ("Android.intent.action.CALL");
Intent.addcategory ("Android.intent.category.DEFAULT");
Intent.setdata (Uri.parse ("Tel:" + strmobile));
StartActivity (Intent)//method will automatically add categories for intent: Android.intent.category.DEFAULT

SMS Transmitter:
Smsmanager manager = Smsmanager.getdefault ();
arraylist<string> texts = Manager.dividemessage (comtent);
for (String text:texts) {
Manager.sendtextmessage (number, NULL, text, NULL, NULL),//4 and 5 parameters are sent SMS status, whether the other party received the message status;
}
Toast.maketext (Getapplicationcontext (), R.string.success,toast.length_long). Show ();
Toast.maketext dialog (Mainactivity.this, Resid, duration);//inner class access external class;

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

Findviewbyid (R.id.button);//Find display control based on ID;
View.onclicklistener () {
@Override
public void OnClick (View arg0) {
ARG0 is the object that was clicked
}
}

@+id/button: Within the ID class of the R file, add a constant with the ID button, using the value of the constant as the ID value of the control;
@android: Access to the R file under the Android package;
@id/label: Indicates access to a file with ID label; (relative layout)

Unit test:
Inheriting classes: 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), judge whether the actual is 3;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.