Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8962147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:04:11+00:00 2026-06-15T16:04:11+00:00

I am using JSON to retrieve user data and I am also getting the

  • 0

I am using JSON to retrieve user data and I am also getting the image URL but how can I show the image instead of the URL? Currently it only shows the URL from the image.

Here is the code:

StringBuilder tweetResultBuilder = new StringBuilder();
            try {
                //get JSONObject from result
                JSONObject resultObject = new JSONObject(result);
                //get JSONArray contained within the JSONObject retrieved - "results"
                JSONArray tweetArray = resultObject.getJSONArray("results");
                //loop through each item in the tweet array
                for (int t=0; t<tweetArray.length(); t++) {
                    //each item is a JSONObject
                    JSONObject tweetObject = tweetArray.getJSONObject(t);
                //get the username and text content for each tweet
                tweetResultBuilder.append(tweetObject.getString("from_user")+": ");

           tweetResultBuilder.append(tweetObject.get("profile_image_url")+"\n");

                tweetResultBuilder.append(tweetObject.get("text")+"\n\n");
            }
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:04:13+00:00Added an answer on June 15, 2026 at 4:04 pm

    You should download and cashe you image first.
    Please read this article Displaying Bitmaps Efficiently, and check Sample application

    The shorter way to display image from url:

    new DownloadImageTask((ImageView) findViewById(R.id.imageView1))
                    .execute("http://java.sogeti.nl/JavaBlog/wp-content/uploads/2009/04/android_icon_256.png");
    
    
    
    
    private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
        ImageView bmImage;
    
        public DownloadImageTask(ImageView bmImage) {
            this.bmImage = bmImage;
        }
    
        protected Bitmap doInBackground(String... urls) {
            String urldisplay = urls[0];
            Bitmap mIcon11 = null;
            try {
                InputStream in = new java.net.URL(urldisplay).openStream();
                mIcon11 = BitmapFactory.decodeStream(in);
            } catch (Exception e) {
                Log.e("Error", e.getMessage());
                e.printStackTrace();
            }
            return mIcon11;
        }
    
        protected void onPostExecute(Bitmap result) {
            bmImage.setImageBitmap(result);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I'm using AsyncTask to handle Http connection and retrieve data as JSON format.
I can retrieve data from normal json link But I have one link which
I'm using Ember to retrieve JSON data from an API to insert into a
I am using jQuery to retrieve json data from a server. The server responds
Im new to using Knockout for data-binding and MVC, I can retrieve data just
I'm using the following code to retrieve a json string from my webserver: var
I am trying to retrieve a JSON file from a web service using the
I'm attempting to retrieve a JSON file from an API for parsing. I'm using
I want to create JSON object using tow query in PHP , Then retrieve
I'm using JSON.Net for serializeation. I need my data to look like this json

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.