I have a method called hostPhoto(); it basically uploads an image to a site and retrieves a link. I then have an other method to post the link to a website.
hostPhoto()
you can use AsyncTask , refer this :
AsyncTask
EDIT: and he is a video tutorial of asynctask , or refer this sample example : clic here