I am using phonegap for the first time and attempting to get a simple image uploaded to my server. I am using the js from the Full Example in the docs (http://docs.phonegap.com/en/3.3.0/cordova_file_file.md.html#FileTransfer)
I am able to pull up the image gallery and select the image, but nothing is being uploaded to my server, and neither the success or failure callbacks are being fired.
I am not sure if it matters but I am using phonegap build and I am currently testing on iOS but this will eventually be on Android as well.
Any ideas?
after trying to manually run the functions through the debug console I realized that I had the file plugin but not the FileTransfer plugin installed. installing that appears to have fixed it.
The phonegap documentation is sorely lacking!
Related
I am building my Apps with JavaScript using Cordova and Electron for mobile and desktop apps. In my App, I have a offline feature, where you can download content which is saved using localforage. It works great to show my images, audios, videos and so on.
However, I also have files in the app for users to download (zip, pdf, ...), by using the window.open command, which works as long as I'm using the file's url from the server. But when I use the offline feature and use the blob-url from my localforage, the app doesn't react at all to my onClick event. It doesn't open and also showing no errors in the console.
In the browser though it works just fine, whether it's the blob-url or server-url.
I first used window.open(src, '_blank');, but also tried to remove the _blank attribute with no luck.
Any help would be very appreciated! Thanks!
I am using Cordova Plugin Inappbrowser to run my external website on device. In this external website I need to upload an Image (Gallery/Capture camera) or file on server. For this I have implemented HTML5 File API to make this feature run into my app too. I have tried various demo 1, demo 2 and tried this URL open into IAB to test; unfortunately they didn't work earthier inside my app. Whereas if I try to open these two demo in native browsers like Chrome, safari, firefox apps into my device these demo are allowing me to perform File API.
So can anyone help me to fix this issue........
I have successfully implemented image library PhoneGap app which company users use to view our company published photos. In there I have implemented a feature, when you click an hold on the image then the image will be saved on Camara Roll of the mobile device. For implementing that I used the Phonegap plugin Canvas2ImagePlugin
It was working fine. Recently, I have enabled image caching on the server (IIS 7.5 Output Cashing - added extension .png and .jpg ).
Then suddenly that feature stopped working. Further checking I have found that Canvas2Image plugin uses following method to get the image data from the URL. And after enabling Output caching, imageData is always empty.
var imageData = canvas.toDataURL().replace(/data:image\/png;base64,/,'');
Can anyone experienced this before? Can you please help me to resolve this?
Are there any Plugins available for Recording a Call in Android using PhoneGap? Or some guidance on how to implement it!
Thanks.
I don't think that this is possible at all. I hope the phone will protect the calls from beeing recorded by any app.
This is not a matter of phonegap.
edit
I found some apps, that can record calls at android phones.
Basicly it would be like audiorecording:
http://docs.phonegap.com/en/3.0.0/cordova_media_capture_capture.md.html
The only thing would be to detect the phonestate. Now the trouble may start, because your app is send to background and maybe will be paused.
There's not one that I can find.
Here's the documentation on creating a plugin for phonegap 3.x:
http://docs.phonegap.com/en/3.0.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide
And here's a tutorial on writing a plugin for phonegap 3.x:
http://devgirl.org/2013/09/17/how-to-write-a-phonegap-3-0-plugin-for-android/
You'll need to have this file stucture
src
android
ios
www
plugin.xml
You can also put more platform folders inside of src depending on which ones you want to support. plugin.xml includes all of the instructions for phonegap to be able to automatically install the plugin for each supported platform.
Here is an example of a plugin that's been upgraded to Phonegap 3.x.
I have packaged my jQuery/javascript application with phonegap for Android, and later plan to do this for iOS/BlackBerry. In this project, I implemented the FileTransfer.download function from the phonegap API to download a file from the server. The function is working successfully, but it blocks me from navigating to other pages within the app until the download is complete.
Maybe I'm missing something in the documentation: what's the best way to get FileTransfer.download to work in the background so that I can freely navigate page to page? Is it possible without resorting to device-specific code?
The solution I'm settling for is creating a plugin to call native code that does the downloading. In Android for example, I can create an AsyncTask to do the downloading in a phonegap plugin. I guess I'll be required to do something similar in iOS/BlackBerry/etc. Still welcoming others' solutions