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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:20:32+00:00 2026-05-29T10:20:32+00:00

I’m developing an app which downloads a json objects into database,this is done so

  • 0

I’m developing an app which downloads a json objects into database,this is done so that the users can interact with the data without the knowladge of the data source.
I have managed to download the required fields from the json API into my database as string and I can display all fileds using textfields however I have 100 images which I want to present as images and not as string.
I have tried to implement several methods so that I can display the images.And followed several tutorails to see if I could find a solution to my problem.
1,2 and more.

Below is my DBHelper.

    @Override
public void onCreate(SQLiteDatabase db) {
    String sql = String.format( "create table %s ( %s int primary key, %s 
            TEXT, %s TEXT, %s TEXT, %S TEXT, %S TEXT, %S TEXT)",
            TABLE,C_ID 
             ,C_IDENTIFIER,C_PRICE,C_BEDROOMS,C_ADDRESS,C_PROPERTYTYPE,C_PHOTOS);

    Log.d(TAG, "OnCreate sql :"+sql);

    db.execSQL(sql);
    }

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    db.execSQL("drop table if exists "+TABLE);
    Log.d(TAG, "onUpdate dropped table" + TABLE);
    this.onCreate(db);
}

Here is the class which gets the fields from the database,which works fine other than the image.

    private SQLiteDatabase database;
private CursorAdapter dataSource;
private static final String fields[] = { "identifier", "price", "bedrooms",
        "ADDRESS", "PROPERTYTYPE", "PHOTOTHUMBNAILURL", BaseColumns._ID };

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.database);
    DBHelper helper = new DBHelper(this);
    database = helper.getReadableDatabase();
    database = helper.getWritableDatabase();
    Cursor data = database.query(DBHelper.TABLE, fields, null, null, null,
            null, null);

    dataSource = new SimpleCursorAdapter(
            this,
            R.layout.list,
            data,
            fields,
            new int[] { R.id.identifier2, R.id.price2, R.id.bedrooms2,
                    R.id.address2, R.id.propertytype2, R.id.propertyPhoto2 });

    setListAdapter(dataSource);


    // selecting single ListView item
    ListView lv = getListView();

    // Launching new screen on Selecting Single ListItem
    lv.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {


            // getting values from selected ListItem
            String identifier = ((TextView) view
                    .findViewById(R.id.identifier2)).getText().toString();

            String price = ((TextView) view.findViewById(R.id.price2))
                    .getText().toString();
            String bedrooms = ((TextView) view.findViewById(R.id.bedrooms2))
                    .getText().toString();
            String address = ((TextView) view.findViewById(R.id.address2))
                    .getText().toString();
            String propertyType = ((TextView) view
                    .findViewById(R.id.propertytype2)).getText().toString();

  String photoThumbnailUrl = ((TextView)  
   view.findViewById(R.id.propertyPhoto2)).getText()
                    .toString();





        }
    });
    database.close();
    helper.close();

}

When I try this( String photoThumbnailUrl = ((TextView)
view.findViewById(R.id.propertyPhoto2)).getText()
.toString();)It works and displays the images as string however when I try to use this
(ImageView image =(ImageView)findViewById(R.id.image1);
ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray);
Bitmap Image = BitmapFactory.decodeStream(imageStream);) it does not work.

Any solution or advice, thanks in advance.

  • 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-05-29T10:20:32+00:00Added an answer on May 29, 2026 at 10:20 am

    Ok, so you have the URLs to your photos… so what’s the problem? Make web requests for the photos using the URLs your first request returned to you.

    I’d use this, it’s pretty awesome:

    http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

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.