//Quick Dial
//Quick Dial
LL.bindClass(“android.net.Uri”);
LL.bindClass(“android.content.Intent”);
LL.bindClass(“android.content.ActivityNotFoundException”);
LL.bindClass(“android.telephony.TelephonyManager”);
var mctx = LL.getContext();
var num = “4444”; // replace with phone#
function check()
{
var service = mctx.getSystemService(Context.TELEPHONY_SERVICE);
// Check if device supports telephony
if (service.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE)
{
alert(“This device doesnt support telephony”);
}
else
{
// continue
}
}
check();
try
{
var i = new Intent(Intent.ACTION_DIAL);
i.setData(Uri.parse(“tel:” + num));
mctx.startActivity(i);
}
catch (anfe)
{
alert(anfe);
}
]]>
< ![CDATA[
Do you have the same with SMS and with possibly a preformated text ?
]]>
< ![CDATA[
Na mate I only wrote this because apparently there’s a bug with quick dial on Samsung phones. I thought it might be useful to Sammy users. I’ll have a go at writing an SMS script when I wake up.
]]>
< ![CDATA[
Try this the launcher doesn’t have SEND_SMS permission so I cant test it, my phones not rooted either. So you will need to use Lukases permission app to make this work.
LL.bindClass(“android.net.Uri”);
LL.bindClass(“android.content.Intent”);
LL.bindClass(“java.language.IllegalArgumentException”);
LL.bindClass(“android.telephony.TelephonyManager”);
LL.bindClass(“android.telephony.SmsManager”);
var mctx = LL.getContext();
var num = “######”; // replace with phone#
var message = “This is is a test”;
function check()
{
var service = mctx.getSystemService(Context.TELEPHONY_SERVICE);
// Check if device supports telephony
if (service.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE)
{
alert(“This device doesnt support telephony”);
}
else
{
// continue
}
}
check();
try{
var textMan = SmsManager.getDefault();
textMan.sendTextMessage(num, null, message, null,null);
Android.makeNewToast(“Sent”, false).show();
}catch(e){
alert(e)
}
]]>
< ![CDATA[
Jay M I’ll try
]]>
< ![CDATA[
If it works I’ll post it in the script section.
]]>
< ![CDATA[
Jay M it works perfectly,after adding the SEND_SMS permission with Lukas Morawietz ‘s module
]]>