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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:00:27+00:00 2026-05-22T03:00:27+00:00

I am using the Phonegap API to capture an image. Once i take the

  • 0

I am using the Phonegap API to capture an image.

Once i take the picture and attach it my success call back method is not called .

Here is how i have implemented it.

  1. I have added the Phonegap.jar file to the libs also added this to the build path .
  2. And on my Main Activity which extends the DroidGap class i specify
    super.loadUrl(“http://test.someU.com/Android/testandroid.html“);

  3. This page testandroid.html contains a reference to the PhoneGap.js script file also another js called the main .

  4. On click of the camera button the camera opens but on attach of the captured image the success callback method is not called .

    function dump_pic(data) {
        alert(data);        
    }
    
    function fail(msg) {
        alert(msg);
    }
    
    function show_pic() {
        navigator.camera.getPicture(dump_pic, fail, { quality: 50 });
    }
    

On successfull attach of the taken picture it has to call the dump_pic with it base64 data being alerted nothing happens.

Now , If i implement the same but with slight differences
That is i under the assets folder have a www folder under which i have a file say index.html and the same above code the only difference here is the super.loadUrl
method changes to super.loadUrl(“file:///android_asset/www/index.html”); as the phonegap example does it in that case everything just works fine it called t he success call back method also the failure method in case of a failure .

The application i have implemented is a web app and has to work some how by the first method . Any idea as to how to get through this . Thanks any help is greatly

  • 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-22T03:00:27+00:00Added an answer on May 22, 2026 at 3:00 am

    this is correct behaviour of a phonegap app for security reasons.

    If you could access the camera from a webpage loaded in the Webview this would open a lot of possible security hazards.

    You have to load the camera from the local index.html file.

    Take a look in how to deploy your app on the phone und and use market place for updates.

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

Sidebar

Related Questions

I created iOS app using PhoneGap version 0.9.6 long back. Now I am going
I am wanting to use the phonegap audio api in GWT using JSNI.I cannot
I am writing application using PhoneGap on Android. I need to call some PhoneGap
In my PhoneGap/jQuery Mobile app, I'm currently using PhoneGaps' Camera API to allow the
I'm writing a phonegap app for iPhone/Android, heavily using the google maps javascript api.
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
I am having some problems with Phonegap and the Android Camera API. I can
I'm using phonegap to create an app. I'm having a problem when I'm trying
I have an application built using PhoneGap (Android) that is essentially a shell for

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.