Accessing Device Function using Java Script

  • Create MAF Application.
  • Create Feature “SendMail” and Set ContentType=”LocalHTML”
  • Paste below code to HTML File.

<!DOCTYPE html>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″/>
<script type=”text/javascript”>
if(!window.adf) window.adf = {}; adf.wwwPath = “../../../../www/”;
<script type=”text/javascript” src=”../../../../www/js/base.js”></script>
<script type=”text/javascript” src=”../../../../www/js/cordova-2.2.0.js”></script>
<script type=”text/javascript”>
function sendSMS(){{to:”9999999999″, body:”Confirmation sent!”});
<body><button onClick=”sendSMS()”>Send SMS</button></body>

Make sure SMS plug-in for the application is enabled. If not, Open maf-application.xml and enable it.




One comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s