How to Share Images from Browser to Android Native Apps? - android

I'm looking for ways to share images from web browser in android. Either by pasting a link to load target image(not as a thumbnail on the left that usual comes from meta), or directly sending the image through share.
I've used Chrome's Web Share API but it only gives options to share title, text and url. If there is an image in this url as a meta, it's loading as a thumbnail on the left. But I need to share the actual image directly. Please help.

Related

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.

Google+ share image using URL like Facebook

I'm currently looking for a way to share in Google+ using URL from web and not from local storage. Problem is that I've used UniversalImageLoader to cache my image and I don't have the image file of the images I wanted to post on my share. I wanted it to be as simple the way facebook done their sharing but using the setContentUrl(Uri.parse(IMG_URL)) will give me the way I wanted it minus the image URL below the post.
Other workarounds I'm thinking is to download the image using the URL, store it somewhere on the device then share it using the setStream(Uri.parse(IMG_URI)) but only problem is that I will need to wait more compared to sharing using URL.
Now is there's any way I can achieve a faster image sharing on Google+? Or if ever is there's a way I can convert the cached file back into image so that I can share it using Stream?

Extracting image from a page displayed in Android Webview

My app displays third party website pages in webview based on certain search. Now if user clicks on some image (e.g. small product image on a site), I'd like to capture that image in my app?
I can capture URL in shouldOverrideUrlLoading() in my app but don't know how to extract image out of it.
Any link/suggestion is appreciated.
Thanks
Once you have the URL of the image, I'd suggest that you create an HttpURLConnection[1] to it, then decode the response into a Bitmap with BitmapFactory[2].
[1] http://developer.android.com/reference/java/net/HttpURLConnection.html
[2] http://developer.android.com/reference/android/graphics/BitmapFactory.html

Android browser downloading images automatically

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.

how to view all images in android's built- in gallery from a php page

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 :)

Categories

Resources