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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:13:25+00:00 2026-06-15T04:13:25+00:00

I need to develop mobile apps using jquery mobile and Phonegap to capture image

  • 0

I need to develop mobile apps using jquery mobile and Phonegap
to capture image from camera and then upload it to REST web service,
using WCF (.NET) or JAX-RS (Jersey), is this can be done ?

if yes, is there any sample/tutorial to do that?

  • 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-15T04:13:26+00:00Added an answer on June 15, 2026 at 4:13 am

    By using phonegap, you can capture image from camera, please have look at the camera api.

    To upload image on server, please go through with the following code:

    <!DOCTYPE HTML>
    <html>
    <head>
    <title>Cordova</title>
    <link rel="stylesheet" href="style.css" media="screen" />
    <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
    <script type="text/javascript" charset="utf-8" src="jquery-1.7.2.min.js"></script>
    <script type="text/javascript" charset="utf-8">
         var pictureSource; // picture source
         var destinationType; // sets the format of returned value 
         document.addEventListener("deviceready", onDeviceReady, false);
         function onDeviceReady() {
             pictureSource = navigator.camera.PictureSourceType;
             destinationType = navigator.camera.DestinationType;
         }
    </script>
    </head>
    <body>
    <script type="text/javascript" charset="utf-8">
    
             var myData = "";
             $(document).ready(function() {
                 $("#getDataFromServer").click(function() {
                     var imageData = myData;
                     $.ajax({
                         type : "POST",
    
                         url : 'http://my.domain.name/saveImage.ashx',
    
                         data : {
                             image : imageData
                         },
    
                         beforeSend : function() {
    
                             $("#comment2").text("Start ajax " + imageData.length);
                         },
    
                         success : function(data) {
    
                             $("#comment2").text("Uploaded! " + data);
                         },
    
                         error : function(request, error) {
    
                             $("#comment2").text("Error! " + error);
                         }
                     });
                 });
             })
    
             function capturePhotoEdit(source) {
    
                 navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
    
                     quality : 50,
    
                     destinationType : destinationType.DATA_URL,
    
                     sourceType : source
                 });
             }
    
             function onFail(message) {
                 alert('Failed because: ' + message);
             }
    
             function onPhotoDataSuccess(imageData) {
    
                 console.log(imageData);
    
                 var smallImage = document.getElementById('smallImage');
    
                 smallImage.style.display = 'block';
    
                 smallImage.src = "data:image/jpeg;base64," + imageData;
    
                 myData = imageData;
    
                 $("#comment").text(imageData.length);
             }
         </script>
         <h1>Hello World</h1>
         <p>
             <a href="#" onclick="capturePhotoEdit(pictureSource.PHOTOLIBRARY);">get
                 image</a>
         </p>
         <p>
             <a href="#" id="getDataFromServer">send image</a>
         </p>
         <span id="comment2"></span>
         <img style="display: none; width: 100px; height: 100px;"
             id="smallImage" src="" />
         <span id="imagename"></span>
         <span id="comment"></span>
    </body>
    </html>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to develop an HTML5 mobile business application using PhoneGap. After finishing my
We're using Phonegap to develop our mobile app, and we borrowed code from here
I need to develop a mobile app that is capable of using the device's
I am trying to develop a mobile app using Sencha touch .I need to
I need to develop a easy web site, I usually use bootstrap CSS framework,
I need to develop a Rest Webservice, Where can I find tutorial or complete
I need to develop on mobile application in J2ME, So i need to know
I need to develop a mobile application for Motorola MC70 Device. And i was
I need to develop an application for mobile devices. I'm good in .Net and
I need to send files from PC to mobile through the support of www

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.