published: October 11th, 2009

Email via Android Intent code snippet

I’m moving away from using the Android email client in Note To Me, but wanted to share the snippet to launch the client.  And who knows, maybe I’ll add it back in if people want it as an option.

        Button sendBtn = (Button) findViewById(R.id.send_btn_id);
        sendBtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v)
            {
            	Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
            	emailIntent.setType("text/html");
            	emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
                  new String[]{ sendToAddress } );

            	emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject );
            	emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, msg );

            	hideKeyboard();

            	NoteToMe.this.startActivity(emailIntent);
            	NoteToMe.this.finish();
            }
        });

published: October 1st, 2009

Email directly from Note To Me

I’m pretty excited about this…don’t remember how I found Nilvec, but thanks to a pair of blogs on their site I’ve been able to integrate dispatching of emails directly into Note To Me (this feature isn’t yet available for the version in the Android market) so the user doesn’t have to go through the Gmail client, very slick.  Check out these posts…

Sending Email Without User Interaction In Android

Email Sending Example

They packaged the Apache classes very nicely and made it easy to get the email set up and running.  Now for all the other features that are needed because I’m implementing my own email client…ie, making sure the emails are sent later if there is no wireless connection.