access website within android code and retrieve a generated image

不羁岁月 提交于 2020-01-03 02:51:07

问题


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!


回答1:


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



来源:https://stackoverflow.com/questions/9546859/access-website-within-android-code-and-retrieve-a-generated-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!