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

  • Home
  • SEARCH
  • 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 8046677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:52:00+00:00 2026-06-05T05:52:00+00:00

i have to retrieve image of all size from server to android mobile with

  • 0

i have to retrieve image of all size from server to android mobile with reference to id ,so that i tried with this below coding and successfully got the base 64 string and retrieved image for equivalent base64string it works fine for small size images but when i go for big size image it remains black screen not able to get large size images on screen through this method.

thanks in advance.

how to retrieve

large size base64 string through soap object from a server

package com.imageload;

import java.io.IOException;
import java.util.StringTokenizer;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.Base64;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class ImageloadActivity extends Activity {
    /** Called when the activity is first created. */

    private Button submit,clr,ext;
    private ImageView imageView;
    private TextView institute,orderno,name,mobno,handeled,regdat,delvdat,pname,pamt,dirby,regby,delby;

    String val11,val12,val13,val14;
    String str = null,str2 = null;
    String error="0",IiD;


/*  private static final String SOAP_ACTION = "http://tempuri.org/sta1";
    private static final String METHOD_NAME = "sta1";
    private static final String NAMESPACE = "http://tempuri.org/";
    private static final String URL = "http://cyberstudents.in/newand//service.asmx";*/


    private static final String SOAP_ACTION = "http://tempuri.org/IMAGE";
    private static final String METHOD_NAME = "IMAGE";
    private static final String NAMESPACE = "http://tempuri.org/";
    //private static final String URL = "http://cyberstudents.in/crdroid//service.asmx";
    private static final String URL = "http:///localdb/Service.asmx";


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);


        this.orderno=(TextView)this.findViewById(R.id.ordernoeditText);
        this.pname=(TextView)this.findViewById(R.id.insTextView);
        this.submit=(Button)this.findViewById(R.id.getbutton);
        this.clr=(Button)this.findViewById(R.id.clearbutton);
        this.ext=(Button)this.findViewById(R.id.Exitbutton);
        this.imageView =(ImageView) findViewById(R.id.imageView1);

        orderno.setText("CB2-1112-CEA0883");


        this.submit.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub


                               IiD=orderno.getText().toString();    


                                if(error.equals("0"))
                                {
                                    SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
                                    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                                    envelope.dotNet=true;

                                    request.addProperty("ID",IiD);                                                                              
                                    envelope.setOutputSoapObject(request);
                                    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);



                                        try
                                        {
                                            try 
                                            {
                                                androidHttpTransport.call(SOAP_ACTION, envelope);


                                            } 
                                            catch (XmlPullParserException e)
                                            {
                                                // TODO Auto-generated catch block
                                                e.printStackTrace();
                                            }   

                                            SoapPrimitive result =  (SoapPrimitive)envelope.getResponse();
                                            //to get the data should be a base
                                            String resultData = result.toString();

                                            //pname.setText(resultData);

                                            byte[] decodedString = Base64.decode(resultData, Base64.DEFAULT);
                                            Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
                                            imageView.setImageBitmap(decodedByte);


                                        } 
                                        catch (IOException e)
                                        {
                                            // TODO Auto-generated catch block
                                            e.printStackTrace();
                                        }

                                    }

                }
        });


        this.clr.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub

                pname.setText("");


            }
        });

        this.ext.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub
                System.exit(0);
            }
        });





    }
}

It returns null for soapprimitive(result) when it returns image size bigger than 150kb or 2500*3000 dimention

[WebMethod]
    public string  IMAGE(string ID)
    {

SqlConnection conn = new SqlConnection("Data Source=;Initial Catalog=;Persist Security Info=True;User ID=sa;");
        conn.Open();
        SqlDataAdapter sdImageSource = new SqlDataAdapter();
        sdImageSource.SelectCommand = new SqlCommand("select ImageData from ImagesStore where ImageId=('" + ID + "')", conn);
        DataSet dsImage = new DataSet();
        sdImageSource.Fill(dsImage);
        byte[] blob = (byte[])dsImage.Tables[0].Rows[0][0];
        int k = blob.Length;
        string c = Convert.ToBase64String(blob);
        return c;
}
  • 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-05T05:52:03+00:00Added an answer on June 5, 2026 at 5:52 am

    It is my advice to store the Base64 image in a server folder and save its path in database so you can retrieve it easily

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

Sidebar

Related Questions

I have the following function that retrieves an image from a twitter feed, the
I have never saved and retrieved an image to and from the database before.
If I have a link of a picture like that: http://www.google.com/images/srpr/logo3w.png Can I retrieve
Basically, I want to have my program retrieve various variables from the hard drive
I have installed splunk to retrieve information from my log files and elert me
Currently i'm using something like this: images = Image.all() count = images.count() random_numb =
Having a reallllll mind pain. I have a php image uploader which is all
I have been through pretty much every post on this site it seems that
I have retrieve JSON from my controller of asp.net mvc : {ja: [ {Name:ABC1,PictureName1:my
Im trying to read in image file from a server , with the code

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.