Send an Email from an Android App Using Intents
This article covers the sending of an email from an Android App, useful for support and feedback purposes. Developing successful Apps requires more than good ideas and good code. You also need to support your users and respond to their questions, suggestions and bug reports. One way is to provide a contact, feedback or suggestion form in your App. Usually accessible from a menu option or button. In this example the first activity is the contact form.
One of the good things about programming with Android is the ability to reuse existing functionality with a few lines of code. The use of Intents allows the programmer to access other Apps code without directly linking to them or common libraries. It is achieved via a type of internal messaging system and similar to declarative programming. This is the case with sending an email from an App. All that is needed is for the App to set up an Intent with the required recipient, subject and text and hand it over to Android to let the email client do the rest.
Example Contact Form Project
To follow this tutorial start by creating a new Android Project in Eclipse using the File menu, select New then Android Project. Fill in the Project Name, here Contact Form is used. Click Next and select the build target from the installed APIs, e.g. Android 1.5, any of the installed APIs will work and it can be changed later if required. Click Next and enter the Package Name in the required format, e.g. biz.tekeye.contactform, leave Create Activity checked with the default Activity name, click Finish. Continue reading