Android API Chinese Document (111) -- MailTo

Source: Internet
Author: User

Preface

This chapter is about android.net. MailTo. The version is Android 3.0 r1! I look forward to your participation in Android API translation, contact me over140@gmail.com.

 

Statement

You are welcome to repost, but please keep the original source of the article :)

Blog Garden: http://www.cnblogs.com/

Android Chinese translation group: http://goo.gl/6vJQl

 

Body

I. Structure

Public class MailTo extends Object

Java. lang. Object

Android.net. MailTo

 

Ii. Category Overview

MailTo URL parser. This class resolves the email to the URL plan (a mailto schema URL can be found here) and can be used to parse parameter queries. It implements the RFC 2368 protocol.

 

3. Constants

Public static final StringMAILTO_SCHEME

Constant Value: "mailto :"

 

Iv. Public Methods

Public StringGetBody()

Obtain the body of the email from a Url. If no body content is set, null is returned.

Return Value

Returns the body or null.

 

Public StringGetCc()

Obtain the CC address from a Url. This may be a space separated by commas (,) for multiple email addresses. If no CC address is specified, null is returned.

Return Value

Email Addresses separated by commas (,) or null

 

Public Map <String, String>GetHeaders()

Get the mail header from a Url (Android123: such as the encoding type, sending time, IP address, etc)

Return Value

Map containing resolution Value

 

Public StringGetSubject()

Obtain a topic from a Url. If no topic row is specified, null is returned.

Return Value

Topic or null

 

Public StringGetTo()

Get the recipient from a Url. This may be a space separated by commas (,) for multiple email addresses. If this parameter is not specified, null is returned.

Return Value

Email Addresses separated by commas (,) or null.

 

Public static booleanIsMailTo(String url)

Test whether the specified string contains the Email Url.

Parameters

Url string used for testing

Return Value

If it is true, the string is the Url containing the Email.

 

Public static MailToParse(String url)

Parses the specified Url string into A MailTo class. RFC 2368 implemented by this parser. The returned object can be used to query parsed parameters.

Parameters

The url contains the Url string of the Email.

Return Value

MailTo object

Exception

ParseException if the structure does not contain the Email Url, this exception is thrown.

 

Public StringToString()

Returns a string that contains concise and understandable objects. Child classes are encouraged to override this method and provide an implementation that takes into account the object type and data. The default implementation price is based on the following expression:

If you want to implement your own toString method, see Writing a usefultoStringMethod.

Return Value

The printable output of this object.

 

5. Supplement

Article Link

Email parsing android.net. MailTo class (see this link for translation)

 

 

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.