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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:24:22+00:00 2026-05-28T04:24:22+00:00

In my android project, i have saved camera snapshots along with some description in

  • 0

In my android project, i have saved camera snapshots along with some description in a SQLite database. Now i want to retrieve all those images plus the description one by one and view them in a xml layout that i have created.

here is my xml layout:

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

<LinearLayout 


android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">



<TextView
    android:id="@+id/showTv"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Show Data" />

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

 </LinearLayout>

</LinearLayout> 

i tried following code snippets seperatly,

 String[] columns = new String[]{"_id", "name","description","image"};
    Cursor c = myDb.query(DATABASE_TABLE, columns, null, null, null, null, null);
    if (c.getCount()>0){
    c.moveToNext();
    byte[] data = c.getBlob(c.getColumnIndex("image"));
    return data;
    }else{
    return null;

//i converted the byte array to bitmap and displayed on the layout

String result = "";
    int iname= c.getColumnIndex("name");
    int ides= c.getColumnIndex("description");
    TextView tv = (TextView) findViewById(R.id.showTv);
    for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {                    
    result += c.getString(iname) + c.getString(ides);    

    }
    return result;

but i want to get both image and the description together for ALL the data.
please suggest me a method to all the Images and description one by one.

Thank you…

  • 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-28T04:24:23+00:00Added an answer on May 28, 2026 at 4:24 am

    The layout you made won’t support more than one Image. Since there is only one ImageView. Unless you want to do a lot of image manipulation, that is. So you should choose an View that fits your needs. I would look at the Gallery widget or ListView widget. Then you need to create a cursor adapter that will adapt the data from your database to your Gallery or Listview widget.

    Take a look at:
    listview with sqllite

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

Sidebar

Related Questions

I have a Android project for SDK1.5 and now I want to convert it
I am working on an Android project and have a problem with SQLite database
I created an Android project a few months ago and now have to automate
I have a little Android project going on which involves some IPC where client
I have a problem that I want to reference with another android project, I
i have done implementing mobile app on android,webos,blackberry,iphone. now i integrate project with .net
In my android project I have an image that i want to rotate it
I have an android project containing only login module. I want to integrate this
I have an Android project that branched into three different applications, app-1 , app-2
I have an Android project and Eclipse is telling me my project has an

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.