I am working on app where i need to download image from local using phonegap file api and then display it in application on various pages.I am using phonegap build not eclipse for build my application.
I have successfully downloaded images to SD card and display image in my pages like " file:///sdcard/project/promotion/promotion.jpg"
but it is not working properly. On some pages it works and some pages it doesn't work. I have checking path by alert and path is fine. I have checked the path by opening in browser and it works fine.
Can anyone help with this?
Related
My flutter app is successfully downloading media to 'android/media/com.example.testapp/testapp/images/'. I can see them via file explorer but for some reason I am not able to see them in gallery. Earlier I was storing images outside of the android storage at that time Images were showing in gallery. I'm using mediascanner for this.
print(directory.path);//outputs /storage/emulated/0/Android/media/com.example.testapp/testapp/images/image1.jpg
MediaScanner.loadMedia(path: directory.path);
I think the problem is that, you aren't telling the OS about new image or video, for this you need to use Android Intent or use this plugin https://pub.dev/packages/image_gallery_saver, it will update the media files every time you save your file using this plugin
I'm working on a hybrid app with Cordova/phonegap using AngularJs and some plugins and trying to show an image stored in the storage directory the path is:
"file:///data/data/com.myapp/images/dot.png"
In the html page I just try to access this file with
<img src="file:///data/data/com.myapp/images/dot.png">
but it never show anything:
I checked the file with the cordova plugin file and is there!
any tips or work around for showing images from this directory?
use following plugin to open images,audio file, video and pdf files.
https://github.com/pwlin/cordova-plugin-file-opener2
I am developing an web+cross platform app using Jquery Mobile+PhoneGap+Android. In web app, I am able to open pdf file links within my app page using iframe. But, in Phonegap generated Android build, iframe is unable to render pdf content,it is showing that iframe area as empty.How can I display the pdf file/content, whose src I know at runtime, within android webview. Thanks In Advance.
I've just published my plugin, which can open almost any type of file, which is stored locally on Android device.
Please take a look at: https://github.com/markeeftb/FileOpener
Plugin opens external application which handles the preview of the document.
I am new to Android and now trying to retrieve contact photo (thumb nail) from a content provider and set it onto my app. But for that as i am running on an AVD, i pushed some .png photos onto my 2.2 version. Now i tried to create a contact with the photo, but the Gallery is showing "No Media Found", hence i am stuck here.
Please help me in getting the photo visible in gallery.
Note : I am aware of the following facts :
I have restarted my AVD to force the Media Scanner to do its initial mockups.
Also i have seen the .png file through the File Explorer View of Eclipse Framework.
But strangely, I am not able to pull the file off the phone.
I have taken help of the link get the path of a Gallery Folder in Android for understanding the general view on Media Scanner.
I believe this is because the application doesn't know if there are images inside /data.
Try to put your images in:
/mnt/sdcard/Pictures
I am downloading PDF file in my application and want to allow user to view it. Is it possible that using webview I can display that pdf file downloaded to SD Card or local memory.
As I know there is workaround in which I can provide the link of pdf file to google url which will open pdf in webview. But it lags and is very slow.
Basic answer, no. You can't open a PDF in a webview; so you either need to fire an Intent to open the file (the file can then open in the default installed app on the device); or write your own PDF reader.
Try to use pdf.js.
See http://www.worldwidewhat.net/2011/08/render-pdf-files-with-html5/
I downloaded its source and placed it in sdcard.
Then I use a WebView to load its index.htm.
It did show pdf file on a webView in sdcard in Android 4.0 device but sometime it show white page. I need to reload it and it finally can show.
Unfortunately, I also tested on Android 2.2 and 2.3 devices. They just show white page, nothing.
I know it make use of html5 canvas technology. I have checked on loading http://html5test.com/ on WebView and have tick on canvas element but still can't show pdf. Strange behaviour. Maybe really depends on Android version.