Hi!
I think the code help you:
public int addImage(byte[] data, int offset, int numBytes)
{
if(mSQLLiteDataBase != null)
{
if(offset >= 0 && numBytes > 0)
{
byte[] bzMid = null;
if(offset == 0 && numBytes == data.length)
{
bzMid = data;
}
else
{
bzMid = new byte[numBytes];
for(int i = 0;i < numBytes;++i)
{
bzMid[i] = data[offset + i];
}
}
ContentValues contentValues = new ContentValues();
contentValues.put(DATA_BASE_RECORD_VALUE, bzMid);
try
{
mSQLLiteDataBase.insert(mRMSName, null, contentValues);
Cursor cursor = mSQLLiteDataBase.rawQuery("SELECT * FROM
" + mRMSName, null);
cursor.moveToLast();
recordID =
cursor.getInt(cursor.getColumnIndex(DATA_BASE_RECORD_ID));
cursor.close();
//Fire added RecordListener
fireAddedRecordListener(recordID);
}
catch(Exception e)
{
throw new Exception();
}
}
}
else
{
throw new Exception();
}
Return recordID;
}
Yevgeni
http://www.UpOnTek.com
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nithin
Sent: Wednesday, December 16, 2009 13:55
To: Android Developers
Subject: [android-developers] Re: SQlite Db problems
Hi,
If you are using images from the resource, just store the ID or use
blob..
On Dec 16, 3:48 pm, MPS <[email protected]> wrote:
> hai developers,
>
> i want to know how to store the images in SQLite database in
> android.and also how to retrieve it. anyone give the samplecode or
> any URL give me to develop my application.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en