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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:13:41+00:00 2026-06-13T05:13:41+00:00

I am using PhoneGap + Sencha Touch on an application. I have managed to

  • 0

I am using PhoneGap + Sencha Touch on an application. I have managed to take a picture and upload to a server. I am having a problem selecting a picture from the photolibrary.

selectPicture: function () {
    navigator.camera.getPicture(this.uploadPicture.bind(this), this.getPictureError.bind(this), {
      // camera options
      quality: 50,
      destinationType: navigator.camera.DestinationType.FILE_URI,
      sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
    });
  }

I think there is something wrong with the destinationType property. In my uploadPicture function the imageURI is returning a directory like: ‘content://media/external/images/media/[some random number]’.

I thought the imageURI should be something like: ‘file://storage/sdcard/DCIM/Camera/myimage.jpg’

I tried using window.resolveLocalFileSystemURI and it works fine if you are taking a picture, but not when selecting a picture. Here is my code when I want to select a picture form the photolibrary (I am using sencha touch 2):

selectPicture: function () {
    navigator.camera.getPicture(this.resolveFileURI.bind(this), this.getPictureError.bind(this), {
      // camera options
      quality: 50,
      destinationType: navigator.camera.DestinationType.FILE_URI,
      sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
    });
},

resolveFileURI: function (entry) {
    console.log(entry);
    window.resolveLocalFileSystemURI(entry, this.uploadPicture.bind(this), this.fail.bind(this));
},

uploadPicture: function (entry) {
    console.log(entry.fullPath)
}

According to logcat I don’t even make it into the resolveFileURI function. In fact my application crashes. The error in logcat is:

10-23 14:39:24.552: E/AndroidRuntime(2975): FATAL EXCEPTION: main
10-23 14:39:24.552: E/AndroidRuntime(2975): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=17, result=-1, data=Intent { dat=content://media/external/images/media/584 }} to activity {com.dwmobile.android/com.dwmobile.android.AndroidSencha}: java.lang.NullPointerException
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.app.ActivityThread.deliverResults(ActivityThread.java:3141)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3184)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.app.ActivityThread.access$1100(ActivityThread.java:130)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.os.Handler.dispatchMessage(Handler.java:99)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.os.Looper.loop(Looper.java:137)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-23 14:39:24.552: E/AndroidRuntime(2975): at java.lang.reflect.Method.invokeNative(Native Method)
10-23 14:39:24.552: E/AndroidRuntime(2975): at java.lang.reflect.Method.invoke(Method.java:511)
10-23 14:39:24.552: E/AndroidRuntime(2975): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-23 14:39:24.552: E/AndroidRuntime(2975): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-23 14:39:24.552: E/AndroidRuntime(2975): at dalvik.system.NativeStart.main(Native Method)
10-23 14:39:24.552: E/AndroidRuntime(2975): Caused by: java.lang.NullPointerException
10-23 14:39:24.552: E/AndroidRuntime(2975): at org.apache.cordova.CameraLauncher.onActivityResult(CameraLauncher.java:453)
10-23 14:39:24.552: E/AndroidRuntime(2975): at org.apache.cordova.DroidGap.onActivityResult(DroidGap.java:823)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.app.Activity.dispatchActivityResult(Activity.java:5192)
10-23 14:39:24.552: E/AndroidRuntime(2975): at android.app.ActivityThread.deliverResults(ActivityThread.java:3137)

  • 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-13T05:13:42+00:00Added an answer on June 13, 2026 at 5:13 am

    That is correct on Android. You are able to use the content URI’s to set the image source attribute. You can even pass that uri into FileTransfer.upload. However, if you want to get a real file type uri then send it into window.resolveLocalFileSystemURI and the success callback will give you the file path.

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

Sidebar

Related Questions

So I have this Phonegap application built using Sencha Touch. I have a textarea
I have implemented a sencha touch phone gap application on ipad. using the kitchen
I have implemented a phone gap application using Sencha Touch, I Want to add
I am building a Sencha Touch application that I then build using PhoneGap. When
I have a PhoneGap based application, written in html upon the Sencha Touch platform,
I am trying to build an android application using phonegap and sencha touch ,
I have started implementing my application using phone gap and Sencha Touch . I
We are building an application using Sencha Touch 1.1 and PhoneGap 1.3.0 for deployment
I am currently creating an application using Phonegap 1.6.0 and Sencha Touch 1.1. Recently,
I am using Phonegap file upload to upload SVG files to my server. It's

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.