-1

Can someone help me to know how to attach a Image/Audio into my App?, this file will be sent to my server.

I think the easy way is launch an Android Intent for Android and it shows me a popup with all apps that supports a type file like I want.. and I guess this gives me the file path.

I really don't understand this, please someone could give me a guide? thx.

Julio Del Valle
  • 369
  • 1
  • 4
  • 17

1 Answers1

0

Check this out:

/* Create the Intent */
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

/* Fill it with Data */
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"to@email.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");

/* Send it off to the Activity-Chooser */
context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));

and then see this post:

Trying to attach a file from SD Card to email

It should help you understand how to create the email intent before actually getting into attaching something to the email. Good luck.

Community
  • 1
  • 1
eplewis89
  • 112
  • 11