access website within android code and retrieve a generated image - java

This description was very hard to word. Basically I want to know if it is possible to access a website inside Android coding without actually sending the user to that website.
What I want to do is use a free website that generates a random pic after you upload your picture to it. I want the user to be able to upload their selected image to the website, and I guess somehow in code make that website generate an edited image and retrieve it back into the application for further use.
I know this sounds really ridiculous but I just wanted to know if this was at all possible before I try writing the code. Thanks!

The first thing you need to do is do an HTTP post upload of your image, as outlined here:
Upload image
Then you can do your processing on the server side - you didn't specify which platform you are planning to use on the server side, but in PHP you might want to look at this:
HTTP POST file upload
Finally, you'll want to retrieve the resultant image you made available on the server side this way:
Retrieve image from an URL

Related

Upload image to mysql server

Is there a way to upload image to my mysql database (Blob type) and make it for example like facebook, when i take a picture it appears a button in front of image so when i click it sends. All the tutorials that i found are like this: https://trinitytuts.com/capture-image-upload-server-android/
And i didnt want to take picture put it in a image view and then send i wanted to do it like i said. Is it possible to do? how can i do it?
Yes! it is possible to save images in BLOB type, but it increases your database size. Hence I will suggest you to upload images to server and just save their path/URL in a database. You can retrieve images using that URL.
Saving images as a BLOB is not a good idea for large images.
yes it is possible.
usign post
usign post multipart
remember the backend for test.

How to use Java to process Webcam data as Image immediately in Webpage

So I have a webpage. I want to catch a webcam data and processing the image I get from that. I thought I could get the image from webcam with WebRTC in javascript. The thing is that, the library I found most suitable with the image processing I need is in Java. It reads an image and do the processing.
How do I combine this? Get image from webcam using WebRTC in javascript and processing it using Java? Or is there any other way to do this?
If my question's wrong, please tell me why. If you think I ask this in a wrong site, please also tell me where I should ask this. Thank you.
Note
As I'm new to web programming, searching and searching, I found that the practice is to execute JSP in server. But what if I have to process the image continously? Won't it be so slow since I would have to send the data continously? Though, in this case, I just need to practice it locally, not in real server. But, is there any way to execute Java in browser?
You can capture individual images over a period of time utilizing a WebRTC recording Javascript library. You can then send the images or the blob down over a websocket to your Java websocket server and process the images.
Check this out, this should pretty much give you all the tools you need to do exactly what you want to do.

A live image feed in Android?

What would be some ways to create an application that goes and fetches images (using URIs, that's the only way I've come across) so that the app's company can change the images without requiring alterations to the android code?
I've looked at URL redirection but it does not seem quite reliable.
(Each time the app starts, it goes and fetches the image for display)
Your app would pull images from
http://company.comm/images/1
http://company.comm/images/2
...
http://company.comm/images/n
and you would have a website/service that would allow to upload and set live images.
Using the Tumblr API achieved what I desired. It allows the fetching of the 6 most recent posts of a particular blog as JSON data. Recursively parsing the JSON received allows the program to dig in and use the URLs for a particular resolution.

Linking to images in dynamic webpages

This is a little tricky to explain but I will try.
We have a employee web directory at work that displays the employee photo and their phone extension number etc. Its a dynamic page written in javascript each page has the same layout but obiously the link to the image is always different.
Now what I wanted to do for some fun was to grab those images to use in our continuous build server (this is something people have requested believe it or not), so that when someone breaks the build I can embed their picture in the broken build email. I can generate the web page link to the persons details page but dont know how to grab the image link from that (there is no obvious naming convention) - I dont have access to the network share where the images are stored but do have permission to embed a link to the in the mail if I can figure it out.
Im flexible with the languages I can use I am just curious how to do this task
The web directory must be making an HTTP request for the image at some point. If you can find out what the details of that request are, then you can make an identical request to fetch the image. The "Web Scraping Proxy" logs HTTP request/responses in the form of Perl code. Set it up, navigate through the web directory to the image, and look in the proxy's log.

Multiple file uploader with previews

I'm trying to find something that will let users upload multiple files to a website. The requirements are that it let them easily select multiple files (preferably with something like check boxes) and that it displays a preview of the images they select.
I'd prefer to only use Javascript or Flash if possible, but Java is also an option (this needs to work on platforms where Silverlight isn't available).
So far all I've been able to find are things that use the native file selector (which doesn't show previews on Windows, and makes it unclear that you can select multiple by holding ctrl).
I'm not sure if the preview requirement is even possible, but it's the most important.
This is a firefox solution:
It uses the FileReader javascript object to load, display and upload images.
http://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/
It still doesnt show previews in the FileSelection dialog but at least allows you to preview the images before uploading.
And here is a ready made java applet solution:
http://jumploader.com/doc_overview.html
To upload multiple files I use RichFaces rich:fileUpload component.
Concerning the preview, I've got the similar problem and the best I found after couple of days of googling is following.
Alfresco has the same problem and resolved it with :
An open office which runs in server mode (socket) and all the office documents are sent by alfresco to open office in order to convert them in PDF
Those PDF are converted to .swf viewer thanks to SWFTOOLS
This .swf is integrated in the HTML
For images, it uses ImageMagick to create small version of the file I suppose
Personnaly, I will try to implement it this way :
Converting office documents to PDF thanks to open office in socket mode
Transform the first page of the PDF into a PNG thanks to JPedal library
Diplay that PNG to the end user
For images I would perhaps use ImageMagick too ... but for now, I'm using Seam Image.scaleToFit API
I am assuming 2 things here:
1) Some kind of client/enduser will be doing the file upload
2) You get some kind of say on what the client installs on their computer to help make this happen.
If this is the case, my first suggestion would be:
Give them FTP or SFTP client software to upload files. The php page you make can have a link to Filezilla, along with instructions on how to use it. ftp and sftp are THE protocols to use for transferring files. HTTP is just not designed(well) for it, nor are browsers.
Once the user has the (S)FTP client software installed, you can give them URL's to upload files to that are specific to their user account, and you can have a backend script process and load/move files that they upload. It's pretty easy to create a local temporary directory using a server side script, have the client upload files via ftp, then go back to the web browser and click a button that says "Done uploading, please process my stuff".
The browser can even give back confirmations on everything that gets uploaded/processed.

Categories