1

I have started developing a Phonegap app for android. I have some doubts implementing some features.

I have a text box and four buttons. The buttons are:

  • SMS Button
  • Email Button
  • Twitter Button
  • Facebook Button

When I click the sms button I want to open android native sms app. When I click the email button I want to open android native email app. When I click the twitter button I want to share the text present in the textbox. When I click the facebook button I want to share the text present in the textbox.

Can any one help me on this? I know in native apps it's very easy, But I don't know how to do this on Phonegap apps.

Fabio Antunes
  • 22,251
  • 15
  • 81
  • 96
Amarnath
  • 1,091
  • 3
  • 19
  • 32
  • have you,worked on these.did it work smoothly? – user May 20 '13 at 12:30
  • when i copied the javA file for e-mail from the link given below,it was showing errors.could not fix them. **I AM USING CORDOVA 2.1.0** – user May 21 '13 at 04:48
  • you need to change the package name in java file. also in the config.xml file you need to add this activity. – Amarnath May 21 '13 at 06:51
  • yeah did them,I got the problem with the **callbackcontext** in the line `public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {` **and** this `import org.apache.cordova.api.CallbackContext; import org.apache.cordova.api.CordovaPlugin;` **and** `CordovaPlugin` **and** the last method `The method onActivityResult(int, int, Intent) of type EmailComposer must override or implement a supertype method` – user May 21 '13 at 06:56
  • did you add coredova.jar file into build path? – Amarnath May 21 '13 at 07:16
  • Amarnath,yeah cordova-2.1.0.jar – user May 21 '13 at 07:17
  • follow the steps in eclipse: select the project -> click Project in menu -> click properties -> click Java compiler -> in the right side click the check box, enable project specific settings -> set the compiler compilation level to 1.6. i think your problem will solve. – Amarnath May 21 '13 at 07:31
  • Amarnath, how did you implement it for the native apps.I have started with SMS and i found that it is retrieving the value from the HTML format. – user May 21 '13 at 09:33
  • for native apps, we don't need this plugins. we can achieve from share intent. this is for phonegap only.refer this for native http://mobile.tutsplus.com/tutorials/android/android-sdk-implement-a-share-intent/ – Amarnath May 21 '13 at 09:56
  • Amarnath,this SMS plugin too is not working, THE message is not going.Even I want it for **PHONE GAP** – user May 21 '13 at 09:58
  • Amarnath, check [this](http://stackoverflow.com/questions/16666589/how-to-connect-an-application-with-the-social-networks-in-phone-gap) – user May 21 '13 at 10:31
  • i think it would be best to migrate to coredova 2.7 – Amarnath May 21 '13 at 10:47

3 Answers3

1

You will need to use plugins for PhoneGap to do these things.

Community
  • 1
  • 1
Rod Burns
  • 2,104
  • 13
  • 24
0
<a href="mailto:EMAIL@email.com>Email me</a>

In your html code will invoke the native email in android

 <a href="sms:212-111-4444>SMS me</a>

Will also do the native bit

fb://messaging

does stuff and

twitter://messages

Check out http://wiki.akosma.com/IPhone_URL_Schemes#Facebook

Jon
  • 6,437
  • 8
  • 43
  • 63
0

This plugin allows you to use the native sharing window of all mobile device. Give a try

https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin

Suresh Kamrushi
  • 15,627
  • 13
  • 75
  • 90