Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 12    Views: 96

QC
Aspiring developer
Profile
Posts: 50
Reg: Apr 20, 2013
Milwaukee, WI
6,650
03/22/15 04:03 PM (9 years ago)

Android - Email - send automationall

Android What I want to do is email some information to myself without user interaction using the native email. This works great. I am going to use it to send myself some crash logs. I have this below which works great! But it still requires me to press the send button Anyone know what I have to add at the end to send it without me pressing the button? I haven't found it.... Intent intent = new Intent(Intent.ACTION_SENDTO); // it's not ACTION_SEND intent.setType("message/rfc822"); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, "Subject of email"); intent.putExtra(Intent.EXTRA_TEXT, "Body of email"); intent.setData(Uri.parse("mailto:[email protected]")); // or just "mailto:" for blank intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // this will make such that when user returns to your app, your app is displayed, instead of the email app. startActivity(intent); Any idea? Thanks,
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
03/22/15 04:24 PM (9 years ago)
You can't without making a custom plugin.
 
QC
Aspiring developer
Profile
Posts: 50
Reg: Apr 20, 2013
Milwaukee, WI
6,650
like
03/22/15 06:04 PM (9 years ago)
This sets up the email with all the information and uses the native email I would think there would be a way to tell it to send. we do it in Linux/Unix all the time.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
03/22/15 08:52 PM (9 years ago)
The system admin sets it up that way on your Unix servers/machines. You would basically make the code do the same thing as that. I've looked into it before. The intent loads up the email app which exits the app.once it exits the app the app cant have control Of it anymore.once you press send it exits the email app, which then returns you to your app because that was the last screen you were on. You would have to write a whole new plugin. Are you using David's plugin or you wrote a new one?
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
03/23/15 10:54 AM (9 years ago)
I put the code into one of the BT plugins When I run the code I put above, the composer comes up and I have to push the composer send button. Doesn't exit the composer until I push the button So I was looking to "send" a click to the composer send button somehow. I guess I could write a plugin but there should be a way to send a click to the composer send.....
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
03/24/15 05:25 AM (9 years ago)
What button closes it? Copy your logcat when you bring it up and send it and paste in here please. LA
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
03/27/15 07:32 PM (9 years ago)
Method 1: Using the Native email Composer The code above - I am using evokes the native email Composer, which works find except that you manually have to press the send button for the email to be sent. Which I don't want to do as I want the crash files to email me automatically. I haven't found a way to tell composer to send the email and not have to press the button. 2) I tried making separate mail program and calling it, using http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android installed the 3 jar files but when the mail program is called getting: android app java.io.filenotfoundexception not loading resources so still stuck
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
03/28/15 06:26 AM (9 years ago)
The second method would be the only way you could do it
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
03/28/15 08:26 AM (9 years ago)
maybe.. there should be a way to send a click to their send button or call it in composer Anyway I am working on why the 2nd way isn't finding the java mail. I updated the mail.jar but no dice. Trying to see if maybe there is a new jar file I need
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
03/28/15 09:05 AM (9 years ago)
maybe.. there should be a way to send a click to their send button or call it in composer Anyway I am working on why the 2nd way isn't finding the java mail. I updated the mail.jar but no dice. Trying to see if maybe there is a new jar file I need
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
03/28/15 09:22 AM (9 years ago)
Yea I wish they gave us permission to.it would be a lot easier. The second method brings about security issues too though
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
03/28/15 09:24 AM (9 years ago)
well I am just emailing out logs if the app crashes. Not sure what security you are talking about
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
03/28/15 09:24 AM (9 years ago)
well I am just emailing out logs if the app crashes. Not sure what security you are talking about
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.