Learning Windows Phone7 development together (142.1-phone Task)

Source: Internet
Author: User

The previous development experience on SMS, Phone, Email, and Camera on Windows mobile is no longer valid because WP7 does not provide APIs for direct operation. However, this does not mean that it cannot be done, because in WP7, system tasks can be called through tasks, that is to say, you need to open the system-related applications to make calls, send text messages, save contacts, and take photos.

In addition, because the system application is called, that is, to open another program in your own program, because the WP7 system is a single Task system, after the Task is started, your application will be terminated.

If it is in debug, you can continue debugging by pressing F5. In the application, because the program already has Tombstone, you do not need to invoke the program to call the Task, however, the related status must be maintained by yourself.

1. Phone Task: a Task used to open the dialing interface in the application. You can call the Task directly and set the contact name and the called Phone number.

PhoneCallTask phonecall = new PhoneCallTask ();

Phonecall. DisplayName = "Town ";

Phonecall. PhoneNumber = "13567890000 ";

Phonecall. Show ();

 

II. SMS Task: You can open the system SMS program, set the content and sender of the SMS to be sent, or send MMS, but it seems that you can only send images, I wonder if sound files and other files can be sent to the real machine.

SmsComposeTask sms = new SmsComposeTask ();

Sms. Body = "Test sms ";

Sms. To = "13567890000 ";

Sms. Show ();

 

3. Save Phone Number Task: You can call the contact program to Save the set Phone Number to the selected contact or create a new contact.

SavePhoneNumberTask SavePhoneNumber = new SavePhoneNumberTask ();

SavePhoneNumber. PhoneNumber = "15888812345 ";

SavePhoneNumber. Completed + = new EventHandler <TaskEventArgs> (SavePhoneNumber_Completed );

SavePhoneNumber. Show ();

 

Related Article

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.