Email, Send, Intent, IntentChooser

Quickly share your Android Code Snippets here...

Re: Email, Send, Intent, IntentChooser

Postby sblantipodi » Sat Jul 17, 2010 10:19 am

is there a way to try the mail api on the emulator now?
do I need a real device to try the email or can I test it on emulator?
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Top

Re: Email, Send, Intent, IntentChooser

Postby sumit_android » Mon Jul 19, 2010 5:51 am

i think right now,this is not possible to test email api on emulator.
its necessery to test it on real android device.
sumit_android
Junior Developer
Junior Developer
 
Posts: 19
Joined: Fri Feb 19, 2010 6:59 am
Location: India

Re: Email, Send, Intent, IntentChooser

Postby Nia » Mon Jul 26, 2010 10:02 pm

i m facing a problem..the link which i want to send comes as hyperlink while sending mail..ie i c it dt its a hyperlink

BUT on recieving mail it gets converted back to text..any idea what might be happening??r i might b doing wrng

it would b really great if u could help
thanks in advance
Nia
Freshman
Freshman
 
Posts: 8
Joined: Fri Jun 18, 2010 6:29 pm

Re: Email, Send, Intent, IntentChooser

Postby vani.v » Fri Jul 30, 2010 12:06 pm

i am one month old in android dev, i am not able to store music files into sd card and play,when i copy some song in form of windows media player into raw folder ,the format is changing, please help me as soon as possible.....
thanks ,
VANI.
vani.v
Freshman
Freshman
 
Posts: 7
Joined: Fri Jul 30, 2010 11:59 am

Re: Email, Send, Intent, IntentChooser

Postby vani.v » Wed Aug 04, 2010 11:18 am

hi ,
i have done a simple application on database ,i went to file explorer in ddms perspective,in that under data/data/
packages/<name of database> is not shown ,so that i can pull a file from the device and view the table. in mozilla firefox i have put sqlite manager addon, what can be the problem?reply soon.
Thanks
vani.v
Freshman
Freshman
 
Posts: 7
Joined: Fri Jul 30, 2010 11:59 am

Re: Email, Send, Intent, IntentChooser

Postby kameshkarthik » Wed Aug 11, 2010 7:43 am

Hello,

I am using this code to send a mail.

final Intent mail_Intent=new Intent(Intent.ACTION_SEND); mail_Intent.setType("plain/text"); mail_Intent.putExtra(Intent.EXTRA_EMAIL,new String[]{toText.getText().toString()}); mail_Intent.putExtra(Intent.EXTRA_SUBJECT,subjectText.getText().toString()); mail_Intent.putExtra(Intent.EXTRA_TEXT,bodyText.getText().toString());
Intent i=Intent.createChooser(mail_Intent, "Send Mail"); startActivity(i);

But on the following screen i get the default android API.I do not want that screen to popup. Is there any other way where i can silently send the mail .

Any help is appreciated. Thanks in advance..
kameshkarthik
Freshman
Freshman
 
Posts: 2
Joined: Mon Jul 19, 2010 10:39 am

Top

Re: Email, Send, Intent, IntentChooser

Postby hawkeyedriver » Wed Aug 18, 2010 11:27 pm

Having same problem. Cannot get email field or subject field to populate on either emulator or an actual Droid X device.
hawkeyedriver
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Aug 18, 2010 11:23 pm

Re: Zooming of images

Postby vani.v » Fri Aug 27, 2010 11:26 am

Hi,
I have used ViewFlipper to swipe through all the images, i am not able to zoom those images. please give me some idea or please send me the code.
Below is my code:

import android.app.Activity;

import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.TranslateAnimation;
import android.widget.Button;
import android.widget.ViewFlipper;
public class Flip extends Activity implements OnTouchListener {

ViewFlipper flipper;
private float downXValue;
int count=-1;

private Animation inFromRightAnimation() {
Animation inFromRight = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);
inFromRight.setDuration(500);
inFromRight.setInterpolator(new AccelerateInterpolator());
return inFromRight;
}

private Animation outToLeftAnimation() {

Animation outtoLeft = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, -1.0f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);
outtoLeft.setDuration(500);
outtoLeft.setInterpolator(new AccelerateInterpolator());
return outtoLeft;
}
private Animation inFromLeftAnimation() {
Animation inFromLeft = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, -1.0f, Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);
inFromLeft.setDuration(500);
inFromLeft.setInterpolator(new AccelerateInterpolator());
return inFromLeft;
}
private Animation outToRightAnimation() {
Animation outtoRight = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, +1.0f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);
outtoRight.setDuration(500);
outtoRight.setInterpolator(new AccelerateInterpolator());
return outtoRight;
}
/** Called when the activity is first created. */

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View lView = new View(this);
flipper = (ViewFlipper) findViewById(R.id.flipper);
flipper.setOnTouchListener(this);
// Button button1 = (Button) findViewById(R.id.Button01);
// Button button2 = (Button) findViewById(R.id.Button02);
// button1.setOnClickListener(new View.OnClickListener() {
// public void onClick(View view) {
// flipper.setInAnimation(inFromRightAnimation());
// flipper.setOutAnimation(outToLeftAnimation());
// flipper.showNext();
// } });
// button2.setOnClickListener(new View.OnClickListener() {
// public void onClick(View view) {
// flipper.setInAnimation(inFromLeftAnimation());
// flipper.setOutAnimation(outToRightAnimation());
// flipper.showPrevious();
// } });


}



public boolean onTouch(View arg0, MotionEvent arg1) {
// Get the action that was done on this touch event
switch (arg1.getAction())
{
case MotionEvent.ACTION_DOWN:
{
// store the X value when the user's finger was pressed down
downXValue = arg1.getX();
break;
}

case MotionEvent.ACTION_UP:
{
// Get the X value when the user released his/her finger
float currentX = arg1.getX();

// going backwards: pushing stuff to the right
if ((downXValue < currentX) && (count>-1))
{
flipper.setInAnimation(inFromLeftAnimation());
flipper.setOutAnimation(outToRightAnimation());
flipper.showPrevious();
count--;
}

// going forwards: pushing stuff to the left
if (downXValue > currentX &&(count<4))
{
flipper.setInAnimation(inFromRightAnimation());
flipper.setOutAnimation(outToLeftAnimation());
flipper.showNext();
count++;
}
break;
}
}

// if you return false, these actions will not be recorded
return true;

}

}
vani.v
Freshman
Freshman
 
Posts: 7
Joined: Fri Jul 30, 2010 11:59 am

Re: Email, Send, Intent, IntentChooser

Postby kmil023 » Wed Sep 22, 2010 10:37 pm

Dear All:

Just wanted to follow up on the issue dealing with emails being sent from the emulator. I got it working using Android 7 platform on my App. However, on needs to create an email client on the emulator first. After that's done, voila!

Furthermore, if you want to only send an email directly instead of having the selector dialog, you may do so as follows:
Code: Select all
Uri uri = Uri.parse("mailto:papichulo@test.com");
Intent i = new Intent(Intent.ACTION_SENDTO , uri );
                    i.putExtra(Intent.EXTRA_SUBJECT,some_title );
                    i.putExtra(Intent.EXTRA_TEXT ,Html.fromHtml(some_body));
                    
                    try {
                        startActivity(i);
                    } catch (android.content.ActivityNotFoundException ex) {
                       progressDialog.cancel();
                       showAlert("Share via Email" , "There are no email clients installed.");
                    }


It is important to note that the HTML being sent is not appearing on the email being received, but the link appears on the emulator...
"Go confidently into the directions of your dreams. Live the live you always imagined" ~ Thoreau
kmil023
Freshman
Freshman
 
Posts: 5
Joined: Wed Mar 10, 2010 4:18 pm
Location: MIA, FL

Re:

Postby android_programmer » Mon Sep 27, 2010 7:15 pm

plusminus wrote:Yes, it works on real devices ! (Didn't include the last SDK-Update the email-client for the emulator ??)

Best Regards,
plusminus


Hi,
Why do we need to Intent.createChooser() when we going to invoke native email application.?
android_programmer
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Aug 08, 2010 2:50 pm

Re: Email, Send, Intent, IntentChooser

Postby shardulp » Fri Oct 29, 2010 9:35 am

is there a way to automatically select email client, instead of user choosing between email or messaging ?
shardulp
Freshman
Freshman
 
Posts: 6
Joined: Thu Oct 28, 2010 7:42 am

Re: Email, Send, Intent, IntentChooser

Postby kiranmatrixlee » Thu Jun 23, 2011 5:09 am

is there need a sender email id?it is not specified in the above code.
kiranmatrixlee
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Jun 23, 2011 5:07 am

Re: Email, Send, Intent, IntentChooser

Postby wiliamsmith4444 » Sat Jul 16, 2011 5:38 pm

I try use emailIntent.setType("html/text"); but text in email is with tags, not like html page. Haw can I do it? Thanks for recommend.
wiliamsmith4444
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Jul 16, 2011 5:00 pm

Re: Email, Send, Intent, IntentChooser

Postby b.rakeshbabubalagani » Tue Aug 09, 2011 12:47 pm

I need to send the mail with text and image as signature/logo in compose mail body.


Note: Not as an attachement.
b.rakeshbabubalagani
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Aug 09, 2011 12:21 pm

Re: Email, Send, Intent, IntentChooser

Postby keetper » Tue Nov 15, 2011 10:25 am

Hey, i got the problem: why pictures won't show in the emails you send or receive? I had such problem when received my mobile spy logs via email
Last edited by keetper on Wed Jun 20, 2012 12:24 pm, edited 2 times in total.
keetper
Freshman
Freshman
 
Posts: 3
Joined: Mon Oct 31, 2011 8:47 am

Top
PreviousNext

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 6 guests