Force image to reload in Android webkit/phonegap - android

Does anyone know how to force an image to reload in Android webkit?
I'm building and HTML-app with phonegap, where the user is allows to change his/her profile photo by uploading a new one from the camera. But the browser keeps displaying the old image until I browse to another page and back to the "profile page". Very annoying!
I've tried adding a timestamp to the url as below, which I know work with most desktop browsers. Not here though.
actual url:
/my/image/url.jpg
switched to:
/my/image/url.jpg?12345678 (<-- current time in millis)
Any ideas on what to do?
Once the image is uploaded I use window.location = same/url/again.jsp to reload the page. But no luck there. The image is only reloaded once I browse to another page and back again..

Related

how to open pdf file with default apps and auto navigate to specific page

so i found a way to open pdf file using open_file but now i want to open with specific page.. for example there is 10 page and i want to navigate to page 5 as initial page when it is done opening from default app.. is there a way to achieve that?? i want to avoid open pdf in app using other plugin.. the thing is i have like 360 page pdf and i want user to be able to open to specific page when he pressed a button...
open_file plugin can't do that.
here for android source code and here for iOS source code.
You may change to another plugin such as syncfusion_flutter_pdfviewer or any one can do this.

Multi Image Picker doesn't locate my image until I open Google Photos in Flutter

I'm using multi_image_picker to allow picking images in my Flutter app.
I've noticed odd behavior when I download an image and store in the Download folder of the device, and the following things happen:
After I download an image, I trigger the image picker (by running MultiImagePicker.pickImages).
Image Picker doesn't show the image, which is odd since I've downloaded the image.
I'm navigating to the Android Files app and I do find the image.
Restarting my app and navigating again to the Image Picker, but still - image not exists.
Opening Google Photos app and after a second the image appears.
Navigating back to my app -> Image Picker, and then I see the image.
I know it sounds odd. I have no idea how or why it happens. I'm using Flutter 1.10.3 and a fresh Android API 28 emulator. I ran the app in an Android Q too and the results are the same.
Looks like your download directory and your GooglePhotos sync directory are in two different places and MultiImage.pickImages is looking at the GooglePhotosSync directory (which might also be the devices CameraRoll directory).
So you are dependent on GooglePhotos uploading the photo from one place and downloading it to another.
Most of my work is ios so sorry I cant be more specific.
I observed similar behavior in terms of some photos not showing when picking image from gallery.
I just found the cause 5 minutes ago before asking "Have you found out the solution?"
It turns out, the flutter image pickter starts from "Recent" folder, the photos I have recently downloaded have much older timestamp. So these photos are futher down in the list.
I will look into a solution.

Use Google search by Image uploading an image from gallery

I'm trying to create an Android application to recognize an image by Google images search. I want that a user provides an image to Google (by uploading it from the gallery) and Google returns the web page with the best guess for the loaded image.
I would open the google images search page (https://www.google.it/imghp?hl=it&tab=wi&ei=ZzCGWIW9EcyuswHu7KroDA&ved=0EKouCBYoAQ) inside of my activity.
But, in this page, in order to see the camera icon next to the search bar that lets you upload images, you must set your browser with the "pc view".
So how can I open in my activity this page directly in "view PC" mode? In addition there is a way to directly execute the image search using Google image search without opening the associated page but through an http request?
I am also interested in different approaches to the problem.
Thanks in advance.
To open the page in PC mode, you could set the user agent to that of a desktop browser
webview.getSettings().setUserAgentString("DESKTOP_USERAGENT");
An alternative would be to send the image to Chrome and allow the user to perform the reverse image search using the built-in menu, but that is no longer a native solution.

Auto sync recently captured image into ionic app android

I want to sync image or video to my ionic app as soon as user captures image or video. I got many solutions to capture image from ionic app. I even got the answer for manually selecting the picture from gallery, but I do not need that.
I want to achieve something as described by below image.
enter image description here
ShoeBox an app that is automatically syncs that image into their app after user takes a photo.
I want to do exactly the same. Any help would be appreciated.

How to open the Gallery view Under My app

I am working on an App which is selecting a single picture at a time from the gallery. Right Now I have used the intent to open the gallery. But I do not want to use this. This is just because of the Use Case which is as below :
If the user Selects the Picture which is not in Portrait then my app should show him dialog to warn him that he is selecting the wrong Photo. Only Portrait photos are allowed.
So for this, I think If I would open the gallery by intent I can not achieve this, So I moved to another Idea , to bring all the photos from the gallery into the app. For this I tried using the Universal image loader, But Unfortunately it is slow and not looking good.
So is there any way to open the device Gallery into the app directly so please guide me share me the code or any link. thanks

Categories

Resources