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 7014853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:34:31+00:00 2026-05-27T22:34:31+00:00

Trying to create a starter app with PhoneGap. I’m stuck on this line: navigator.device.capture.captureAudio(onSuccess,

  • 0

Trying to create a starter app with PhoneGap. I’m stuck on this line:

navigator.device.capture.captureAudio(onSuccess, onError, {limits:1, duration:5});

It works fine on iOS but throws this error on Android emulator:

Cannot read property ‘capture’ of undefined

Here’s navigator object, at the time of error (notice there’s no device property which is causing this error)

{
    "language": "en-US",
    "product": "Gecko",
    "mimeTypes": {
        "length": 0
    },
    "appVersion": "5.0 (Linux; U; Android 4.0.3; en-us; sdk Build/MR1) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
    "plugins": {
        "length": 0
    },
    "onLine": true,
    "connection": {
        "type": 0
    },
    "platform": "Linux armv7l",
    "vendor": "Google Inc.",
    "appCodeName": "Mozilla",
    "geolocation": {},
    "cookieEnabled": true,
    "appName": "Netscape",
    "productSub": "20030107",
    "userAgent": "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; sdk Build/MR1) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
    "vendorSub": ""
}

And here’s the PhoneGap object just after Phonegap.js has loaded (notice it says device: true)

{
    "commandQueue": [],
    "commandQueueFlushing": false,
    "_constructors": [
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null
    ],
    "documentEventHandler": {},
    "windowEventHandler": {},
    "resources": {
        "base": true,
        "debugconsole": true,
        "position": true,
        "acceleration": true,
        "accelerometer": true,
        "battery": true,
        "camera": true,
        "device": true,
        "capture": true,
        "contact": true,
        "file": true,
        "filetransfer": true,
        "geolocation": true,
        "compass": true,
        "media": true,
        "notification": true,
        "orientation": true,
        "sms": true,
        "telephony": true,
        "network": true,
        "splashscreen": true
    },
    "available": false,
    "sessionKey": 0,
    "callbackId": 0,
    "callbacks": {},
    "callbackStatus": {
        "NO_RESULT": 0,
        "OK": 1,
        "CLASS_NOT_FOUND_EXCEPTION": 2,
        "ILLEGAL_ACCESS_EXCEPTION": 3,
        "INSTANTIATION_EXCEPTION": 4,
        "MALFORMED_URL_EXCEPTION": 5,
        "IO_EXCEPTION": 6,
        "INVALID_ACTION": 7,
        "JSON_EXCEPTION": 8,
        "ERROR": 9
    },
    "mediaObjects": {}
}

Any ideas how to get past this?

  • 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-05-27T22:34:32+00:00Added an answer on May 27, 2026 at 10:34 pm

    Ok, this is the most douchy solution I ever stumbled upon!

    The JS for Android is different than that for iOS. The files is named the same though – phonegap-x.x.x.js. No points for guessing it’d be different for every other mobile platform.

    I understand that you need to have different JS for different platform, but how about mentioning that somewhere?

    Once I dragged the JS from Android folder, everything fell into place.

    Thanks to this question for the answer: deviceready won't fire in Phonegap 1.0.0 on Android

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

Sidebar

Related Questions

Trying to create a black line in my view to separate text blocks but
Trying to create a facebook app just to learn and coming across a strange
I am trying to create a Music Player App in J2ME. I want to
Just started playing with Android and I'm trying to create an app that has
I'm trying to create a speech to text app, to get started I got
I am trying to create an app for the Mac OS X that will
I just started using VS2010 and C#. I'm trying to create an app which
I'm trying to create a basic bluetooth application, for testing the device. I got
I'm trying to create a simple iPhone app that displays a picture with a
i've been trying to create a map-related android app, but i realized that the

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.