Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi is there any tutorial on storing and retrieving images from android sqlite. The tutorials I have all seen is display on list view but I don't want it to be displayed on listview. I will post my xml below to make it clearer.

<?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"
    >

    <include layout="@layout/toolbar"
        android:id="@+id/toolbar" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:removed="@drawable/display_main_outside"
        >
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="left">

            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="10dp">
                <ImageView
                    android:layout_width="150dp"
                    android:layout_height="50dp"
                    android:scaleType="fitXY"
                    android:src="@drawable/logo_png" />
            </TableRow>
            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">
                    <ImageView
                        android:layout_width="120dp"
                        android:layout_height="120dp"
                        android:layout_gravity="center"
                        android:scaleType="fitXY"
                        android:id="@+id/shoe1a"
                        android:src="@drawable/onsale" />
                    <ImageView
                        android:layout_width="100dp"
                        android:layout_height="100dp"
                        android:layout_gravity="center"
                        android:id="@+id/shoe1b"
                        android:src="@drawable/buy1get1free" />
                </LinearLayout>
                <ImageView
                    android:layout_width="200dp"
                    android:layout_height="200dp"
                    android:layout_gravity="center"
                    android:scaleType="fitXY"
                    android:id="@+id/shoe1"
                    android:src="@drawable/shoe1png" />
            </TableRow>
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="10dp">
                <TextView
                    android:layout_width="wrap_removed"
                    android:layout_height="wrap_removed"
                    android:textColor="#000000"
                    android:text="@string/Description"
                    android:id="@+id/text"
                    android:textStyle="bold"/>
                <TextView
                    android:layout_width="250dp"
                    android:layout_height="wrap_removed"
                    android:textColor="#000000"
                    android:textStyle="italic"
                    android:id="@+id/textview1"
                    />
            </TableRow>
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="10dp">
                <TextView
                    android:layout_width="wrap_removed"
                    android:layout_height="wrap_removed"
                    android:textColor="#000000"
                    android:text="@string/SA"
                    android:textStyle="bold"
                    android:id="@+id/sa"
                    />
                <Spinner
                    android:id="@+id/spinner1"
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:popupremoved="#ffffff"
                    />
            </TableRow>
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="10dp">
                <TextView
                    android:layout_width="wrap_removed"
                    android:layout_height="wrap_removed"
                    android:textColor="#000000"
                    android:text="@string/CA"
                    android:textStyle="bold"
                    android:id="@+id/ca"/>
                <Spinner
                    android:id="@+id/spinner2"
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:popupremoved="#ffffff"/>

            </TableRow>
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="10dp">
                <TextView
                    android:layout_width="wrap_removed"
                    android:layout_height="wrap_removed"
                    android:textColor="#000000"
                    android:text="@string/COO"
                    android:id="@+id/text4"
                    android:textStyle="bold"/>
                <TextView
                    android:layout_width="200dp"
                    android:layout_height="wrap_content"
                    android:textColor="#000000"

                    android:id="@+id/textview2" />
            </TableRow>
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="10dp">
                <TextView
                    android:layout_width="wrap_removed"
                    android:layout_height="wrap_removed"
                    android:textColor="#000000"
                    android:text="@string/SM"
                    android:id="@+id/text5"
                    android:textStyle="bold"/>
                <TextView
                    android:layout_width="200dp"
                    android:layout_height="wrap_content"
                    android:textColor="#000000"
                    android:id="@+id/textview3" />
            </TableRow>
            <TableRow
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="10dp">
                <TextView
                    android:layout_width="wrap_removed"
                    android:layout_height="wrap_removed"
                    android:textColor="#000000"
                    android:text="@string/Price"
                    android:id="@+id/text6"
                    android:textStyle="bold"/>
                <TextView
                    android:layout_width="200dp"
                    android:layout_height="wrap_content"
                    android:textColor="#000000"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:id="@+id/textview4" />
            </TableRow>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal"
                >
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/RD"
                    android:/>
                <Button
                    android:id="@+id/buttonBack"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:/>
            </LinearLayout>

        </TableLayout>
    </ScrollView>
</LinearLayout>


I want all the images to be store in database when onclick, it will display the images.
Posted
Updated 21-Dec-17 0:47am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900