Android EmailComposer PhoneGap 2.6

August 7, 2013

I know this is late but could be useful for someone. So lately I’ve had trouble implementing an EmailComposer Plugin for an Android version of PhoneGap 2.6 because there weren’t any instructions on the official plugin’s github page. I figured I would explain the steps to how I implemented it myself.

First off thank you to Dpa99c from answering this question it really helped! Remember this is for PhoneGap 2.6. I haven’t tested it a newer version of PhoneGap but I’m sure I’m not too far off.

Of course you have to have PhoneGap installed and ready to go. Make sure you’ve gone through the import setup for Eclipse also.

Add files:

add emailcomposer.js into your www folder and include it in your index.html

add EmailComposer.java to your build. I added it into

src/com/phonegap/plugins/emailComposer/EmailComposer.java

Edit config.xml to include plugin by adding
```html

4. Then finally you can add the javascript to make it work. You would use something like this (I passed in a couple variables in this example):
```javascript
cordova.require('cordova/plugin/emailcomposer').showEmailComposer(
function() { console.log( 'successfully called email composer' ); },
function() { console.log( 'failed to call email composer' ); },
"Look at this photo",
"Take a look at <b>this<b/>:",
["fred@blogs.com", "peter@pan.com"],
[],
[],
true,
["image.jpg", "file.zip"]
);

Works just fine on my Nexus 7. Just for safe measure here is the callable interface: