Using PhoneGap to capture image, display it in app and save to local storage
based on what I have received in http://pastebin.com/4gE2D00a
You save you image path with sessionStorage.setItem('imagepath', entry.fullPath);
@2320 line. To read this value you should use sessionStorage.getItem('imagepath')
check what you have in this variable with alert or console.log right after cordova initialization @24
Now, if everything is right before this step, you should have path of last image. To read file from filesystem- study FileReader api
Display locally saved picture with Cordova
As Matthieu Marcé pointed out, the answer of this question should be :
the problem was about fetching the local system path, so i had to put
the path in a local storage item using
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSys) {
localStorage.setItem('_localsys',fileSys.root.toURL());
}
);
save image file in local storage and retrieve image from file path html cordova apps
I got this solved when i deploy my app in a real device like a ipad. Only on simulator i get this error.
Phonegap camera API save picture taken to camera roll
Do you mean the device's gallery?
If so, just use FILE_URI for Camera.DestinationType option.
Reference: http://docs.phonegap.com/en/2.6.0/cordova_camera_camera.md.html#cameraOptions
PhoneGap - storing an image, then getting its base64encoded data
It is because the Android OS has a URI handler for the content://
protocol. The File API does not. However, there is a way for you to convert a content://
type URI into a FileEntry
. Use:
window.resolveLocalFileSystemURI("content://media/external/images/media/4292", win, fail);
and the success callback win
will be called with a FileEntry
for you.
Phonegap - Retrieve photo from Camera Roll via path
After you retrieve the file using the FILE_URI method you should use the File API to copy the image from the temp folder to the Documents folder and store the new path in your DB.
So you would take the result of your getPicture() pass it to window.resolveLocalFileSystemURI() to get a FileEntry. Then you can call FileEntry.copyTo() method to back up your file.
Related Topics
What Is the '' Is or the ':' at the Equation When Coding in Swift
Xcode Stuck at "Your Application Is Being Uploaded"
How to Make an Uipickerview Component Wrap Around
Capturing and Storing a Picture Taken with the Camera into a Local Database/Phonegap/Cordova/Ios
Cannot Change Search Bar Background Color
Nscamerausagedescription in iOS 10.0 Runtime Crash
Xcode 9 Swift Language Version (Swift_Version)
Dismiss Keyboard on Touch Anywhere Outside Uitextfield
Force Landscape Orientation in Uiimagepickercontroller
Renew Push Certificate and Keep Current App Store App Working
How to Make a Uilabel Clickable
Is Silent Remote Notifications Possible If User Has Disabled Push for the App
Why Storyboard UI Elements Not Showing on Uiviewcontroller in Xcode 6
Long Press Gesture on Uicollectionviewcell
Uicollectionview Reloaddata Not Functioning Properly in iOS 7