How to create a file from Image Url without downloading

How to create from Imageurl? File

I know how

Download image from Url with AsyncTask

I want to know how I can create an object without loading an image from a URL. File

I tried as shown below.

File file = new File("http://www.planwallpaper.com/static/images/Winter-Tiger-Wild-Cat-Images.jpg");

I want to use this file in the status.setMedia file (file)

    StatusUpdate status = new StatusUpdate(twitterMessage);
    status.setMedia(file );
    try {
           twitter4j.Status response = twitter.updateStatus(status);
           return response.toString();
    } catch (TwitterException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
    }

But no success.

Please help me create a file directly from imageurl without uploading an image.

+4
source share
2 answers

How to create a file from Imageurl?

. File . URL- , , , URL- ... .

status.setMedia()

, API , File, Uri, . , , File, .

+3

, , . , , . right?

JSON , ImagerUrls . , ImagerUrl AsyncTask.

0

Source: https://habr.com/ru/post/1620746/


All Articles