views:

25

answers:

1

Is it possible to set up a form in an application and have the person filling out the form send the information to you? If so could I get some examples?

+1  A: 

You can keep a EditText box in your application and pass data that has been entered on the same using bundle while calling Default Email client. You can do the same with the following code

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String[] recipients = new String[]{"[email protected]", "",};
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is email's message");
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send mail..."));

It is recommended to use the default EMail client in Android since the user would have all login credential info saved on it.He needs to just send a mail from there. IF you want to send a mail from your application you need to write an application that can send Emails and the user should configure his account again inside your application.

Rahul