Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:20:09+00:00 2026-06-13T20:20:09+00:00

I am writing an app using PhoneGap and Jquery, in my app i have

  • 0

I am writing an app using PhoneGap and Jquery, in my app i have a panic button, onclick it should automatically call a predefined number. I’m managing to open the native android dialer but still i need the user to click again on send button to dial.

How can I make a direct call from the app?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:20:11+00:00Added an answer on June 13, 2026 at 8:20 pm

    You will need to write a plugin for this functionality. The first thing you will need to do is add the:

    android.permission.CALL_PRIVILEGED
    

    to your AndroidManifest.xml. This will allow you to dial a number skipping the Dialer app. A small bit of JavaScript code is required for the plugin interface:

    cordova.define("cordova/plugin/emergencydialer", 
      function(require, exports, module) {
        var exec = require("cordova/exec");
        var EmergencyDialer = function () {};
    
        var EmergencyDialerError = function(code, message) {
            this.code = code || null;
            this.message = message || '';
        };
    
        EmergencyDialer.CALL_FAILED = 0;
    
        EmergencyDialer.prototype.call = function(telephoneNumber,success,fail) {
            exec(success,fail,"EmergencyDialer", "call",[telephoneNumber]);
        };
    
        var emergencyDialer = new EmergencyDialer();
        module.exports = emergencyDialer;
    });
    

    Then you’ll need to write some Java code to do the phone call. You’ll need to create a new class that extends the Plugin class and write an execute method like this:

    public PluginResult execute(String action, JSONArray args, String callbackId) {
        PluginResult.Status status = PluginResult.Status.OK;
        String result = "";
    
        try {
            if (action.equals("call")) {
                String number = "tel:" + args.getString(0);
                Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse(number)); 
                this.cordova.getActivity().startActivity(callIntent);
            }
            else {
                status = PluginResult.Status.INVALID_ACTION;
            }
            return new PluginResult(status, result);
        } catch (JSONException e) {
            return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
        }
    }
    

    Whatever you call this class you’ll need to add a line in the res/xml/config.xml file so the PluginManager can create it.

    <plugin name="EmergencyDialer" value="org.apache.cordova.plugins.EmergencyDialer"/>
    

    and finally in your JavaScript code you’ll need to create they plugin and call it like this:

    function panicButton() {
        var emergencyDialer = cordova.require("cordova/plugin/emergencydialer");
        emergencyDialer.call("18005551212");
    }
    

    That should about do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a quiz app using phonegap & jquery. I have a number of
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample
i am writing a app using jquery-mobile and phonegap and i try to make
I'm writing an iPhone app using jQuery mobile & phonegap. When I rotate my
I'm writing a website/iPad app (using PhoneGap ), where I have 1024x768 images on
I'm writing an app using WPF (should apply to Silverlight too) where I have
I'm writing a Silverlight app using the MVVM pattern. I have a main view
I am currently writing a small web app using Asp.net MVC and jQuery mobile.
I have an app that I'm writing in Javascript for use with Phonegap, that
I'm writing an app using phonegap. I can open the native android dialer using:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.