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 7941673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:44:20+00:00 2026-06-03T23:44:20+00:00

I am trying to load images from a server, according to their id number.

  • 0

I am trying to load images from a server, according to their id number. Which would be the best method to retrive it from the webservice?

package com.crispsys;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class imageviewer extends Activity {
    /** Called when the activity is first created. */
    
    Bitmap image; 
    private TextView ordernumber;
     ImageView imageView;
     private Button butt;
     String Str="image",ordno;
     
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.imageviewerr);
        
         this.butt = (Button) this.findViewById(R.id.getbutt);
          this.imageView =(ImageView) findViewById(R.id.blodig);
          this.ordernumber=(TextView)this.findViewById(R.id.ordernotext);
          
          final Bundle getdata = getIntent().getExtras();
          
          if (getdata != null)    
          {
              ordno=getdata.getString("orono");
              ordernumber.setText(ordno);
          }
         
        
        this.butt.setOnClickListener(new View.OnClickListener() {
            
            public void onClick(View v) {
                // TODO Auto-generated method stub
                
                
                Toast.makeText(getApplicationContext(),"loading" , Toast.LENGTH_LONG).show();
                
                      URL url = null;
                
                
                      try 
                      {
                        
                          url = new URL("http://www.cyberstudents.in/aaa/car.jpg");
                          
                      }
                      catch (MalformedURLException e) 
                      {
                          e.printStackTrace();
                      }
                      try {
                          image = BitmapFactory.decodeStream(url.openStream());
                         
                      } 
                      catch (IOException e) 
                      {
                          e.printStackTrace();
                      }
                
                imageView.setImageBitmap(image);
            }
        });
       
    }
}

XML File:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:background="@drawable/cr_isp"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="match_parent"
        android:gravity="center"
        android:paddingTop="20dp"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/ordernotext"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#8B8682"
            android:text="" />

       
    </TableRow> 
    
    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="match_parent"
        android:gravity="center"
        android:paddingTop="20dp"
        android:layout_height="wrap_content" >

        <Button
            android:id="@+id/getbutt"
            android:layout_width="210dp"
            android:layout_height="40dp"
            android:background="@drawable/bcbut"
            android:textColor="#8B8682"
            android:text="Get Block Dig" />
        
    </TableRow>

    <TableRow
        android:id="@+id/tableRow2"
        android:layout_width="match_parent"
        android:gravity="center"
        android:paddingTop="20dp"
        android:layout_height="wrap_content" >

        <ImageView
            android:id="@+id/blodig"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_launcher" />

    </TableRow>

</LinearLayout>

Tried with this code, but I could only work with small sized images. When I go for a big sized image, it doesn’t work. It remains the same, I can’t find any error. It is showing the same screen.

  • 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-03T23:44:21+00:00Added an answer on June 3, 2026 at 11:44 pm

    make a Get request with that id number to the webservice and the service responds with the required image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to load images from Facebook Albums to my flex app, this is
trying to load in a bunch of images into a list from a directory...my
i am trying to load images from the northwind database (categories table, images that
I'm trying to preload a number of images generated on the server to a
I am trying to load image from a remote server on the UIImageView in
I'm trying to load profile images (friend images) from Facebook with AS3 but I
I am trying to load the latest image from a CCTV server for each
I'm trying to build a jcarousel slider with images loaded from an external server.
I'm trying to load map tiles from an internal SSL server. The SSL certificate's
I'm trying to load images from a relative folder /media/one.jpg but it never loads,

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.