0

i am trying to find a way to send SMS and make a phone call from a samsung gear s app.

the documentation is mostly missing and searching for this did not lead to much findings.

has anybody worked with that? is it at all possible?

as an alternative, if the app cannot send SMS or make the call, is it possible to start the default apps (similar to Android intent for SMS/Phone app or iOS openURL).

thanks.

memical
  • 2,061
  • 1
  • 20
  • 32

5 Answers5

1

here is what i find so far:

to make a call from a Gear S app use the following code:

var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/call", "tel:001....");

tizen.application.launchAppControl(appControl, null,
                    function() {
                        console.log("ok");
                    }, 
                    function(e)
                    {
                        console.log("error: " + e.message);
                    },
                    {
                        onsuccess : function()
                        {
                            console.log("ok 2");
                        },
                        onfailure : function(er)
                        {
                            console.log("error 2: " + er.message);
                        }
                    });

sending SMS is not possible at this time.

memical
  • 2,061
  • 1
  • 20
  • 32
1

There is no messaging API implemented on Tizen for wearable devices. You can check it yourself by calling:

console.log(tizen.messaging);

It will return 'undefined'

It means that you can't programmatically send or read an SMS or an email from your wearable device using Tizen messaging API.

Oleg Gryb
  • 4,361
  • 1
  • 22
  • 36
1

@memical - I have found a workaround to launch message/sms app using the app id.

<p onclick="hackSMS();">Send SMS</p>

<script>
function hackSMS() {
    tizen.application.launch("com.samsung.message", function(){console.log ("Launched")});
}
</script>

Remember to add this http://tizen.org/privilege/application.launch priviege in your apps config.xml

Note: I tried other methods also like using exposed tizen platform api's for web apps to launch some predefined app control. But it is working for Call and not for sms.

Shreeram K
  • 1,614
  • 9
  • 21
  • i have tried it and it does not work on the samsung gear – memical Jun 01 '15 at 13:01
  • Ok. Yes I tested first on Samsung Z1 which is tizen based and it worked for me on that. After your above comment I tested on Samsung Gear S, and I found out tht it is a bug. I found error log which says "APP_NOT_FOUND", which means there is a bug on samsung gear S platform in call and sms module. I'll report this to Samsung tizen platform team. – Shreeram K Jun 01 '15 at 14:29
  • @memical - I updated the answer with a workground. You can use that in the meantime till issue is not fixed on gear. – Shreeram K Jun 02 '15 at 11:39
  • thanks srkushwaha, it starts the app. is it possible to give it a predefined text? – memical Jun 03 '15 at 11:10
  • 1
    Currently with this workaround, its not possible because its a generalised API to launch any app based on app id. If the bug wouldn't be there, then using normal tizen api, it was possible. Anyways I'm expecting soon the bug would be closed. – Shreeram K Jun 03 '15 at 11:19
0

To open the app for make a call try this code:

Uri number = Uri.parse("tel:"+telNumber);
Intent openCallIntent = new Intent(Intent.ACTION_DIAL, number);
startActivity(openCallIntent);

To make a call:

Uri number = Uri.parse("tel:"+telNumber); 
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(number);
startActivity(callIntent);

To send an sms:

Intent sendSmsIntent = new Intent(Intent.ACTION_VIEW);
sendSmsIntent.setType("vnd.android-dir/mms-sms");
sendSmsIntent.putExtra("address", telNumber);
sendSmsIntent.putExtra("sms_body","Whatever you want");
startActivity(sendSmsIntent);

Similar questions to this one are already answered in stackoverflow

  • Ruben, yes the preinstalled apps on the watch can send SMS and make calls - even without being paired with an android device. my question is: how to make that programmatically or at least open the default apps? – memical Mar 16 '15 at 13:37
  • please note that i mentioned the app is running on a samsung gear s watch. the apps are developed using tizen wearable sdk, not the android sdk. so basically i need your code, but ported for tizen wearable sdk :) (not mobile sdk) – memical Mar 16 '15 at 15:17
  • Sorry then, i didn't understand your question – Rubén Jiménez Mar 16 '15 at 15:38
0

Try this which is very simple as compare to using the platform APIs.

http://www.w3.org/TR/mwabp/#bp-interaction-uri-schemes

The most broadly supported scheme is tel: as described in RFC3966 [RFC3966]. Code such as the following can be used to enable "Click-to-Call":

[PHONE-NUMBER]

Note that [PHONE-NUMBER] should always be entered using the full international prefix (e.g. +1-201-555-0111) to ensure that it works outside of its home country.

Similarly RFC5724 [RFC5724] can be used to send a GSM SMS (text message) as follows:

[PHONE-NUMBER]

Note that at the time of writing support for this RFC is limited and device compatibility should be verified before deployment.

memical
  • 2,061
  • 1
  • 20
  • 32
Shreeram K
  • 1,614
  • 9
  • 21