So on my android app, it uses webview to connect to my website and display the index.php file that is on there. That file takes images from a directory on my website and displays them. The problem is that it takes forever for the images to download onto the app! Is there a way I could get the images pre-loaded into the application so that it still runs the PHP like it is supposed to but it doesn't download the images from my website? The images would have the same name and everything. Think of it as having the images cached before downloading them. Is there anyway to do that?
Related
I am working on one android application,in that I have to download images from web and I am showing in listview using imageloader.Next time if I am not connected to internet I have to show saved images.So that If I want to save downloaded images where I have to store.I have two ways one way I have to store in sdcard and another one is in database.Is there any alternative way to store images.Image sizes are very small
Try it with Cache? Best way to do this:
http://www.androidhive.info/2014/05/android-working-with-volley-library-1/
Volley gives you a NetworkImageView, this is a "normal" ImageView, but you can give it a URL and volley will do all the rest for you (download, or load from cache, if already loaded).
I have a task that sounds simple, but I have not yet figured out how to do it. I have a URL in my Android App. Now I want to download it, save it on my device, and then load it into a webview (let's say it is an image). I have to load my file from the device itself, so I cannot just load my image into my webview.
And the image has to be stored permanently. So that I can reopen it after closing the app even without internet connection.
I know how to work with Assets, but I cannot store files there that I am downloading during runtime, if I got this right.
If you are saving file in an html format on sd card you can load it in web view as shown below
webView.loadUrl("file://"+Environment.getExternalStorageDirectory()+"/filename.html");
When I visit my site from android (Froyo 2.2) browser and when i click to view image it start to automatically download that image instead of displaying the image in browser.
How can I display my images in browser instead of downloading them?
My browser is set up to load images in settings and I can view pictures on other sites without downloading them to my sd card or phone memory.
Thanks!
If your site when you click on the image send you directly to the image file then that's probably why the android browser tries to download it since he understands it as file. Maybe you should try to display the image in an html file.
For example when you click on an image, it could direct you to an html file with a parameter of the image name. Then inside that html you can have a javascript code that will load and display that image.
I have an Android app that reads content from a different APK. Videos, and pictures can be loaded from the other APK and displayed just fine. I also want to be able to load a web site from the other APK as well. I can currently load a single page by extracting the text from the resource and putting it into a WebView. This is great, but I need it to load an entire site (multiple web pages, pictures, etc.). Can anyone tell me how I can do this? Can I get a URL to a different APK's res or asset directories?
Thanks
The easiest route to go is probably to send the web site as a zip archive. You would then simply send it as a single file as you do with your videos and picture.
When your APK receives the zip file it is fairly easy to decompress the archive and browse the website.
I am developing an application to display all the images in android's built-in gallery in to a php page. I posted the uri (content://media/extrenal/images/media) of the gallery images to the php page. I was not able to recreate images by using webView's function loadUrl().
Should I need to upload the whole gallery to another directory and display the images?
Or passing the bitmap itself will do?
Please suggest me an idea to solve the problem.
I think you should make an ashynchronous connection of your application with an php application on the server, which will tell the android app to upload the requested image, and when the java app receives the upload command, make the app upload the picture to the server, and make the server php app display the image uploaded. I know this is a bit complicated, but this is the only thing that is comparatively easier than doing socket transports and other things. Good luck :)