안드로이드 개발 질문/답변
(글 수 45,052)
Bitmap bit = BitmapFactory.decodeResource(getBaseContext().getResources(), R.drawable.icon);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bit.compress(CompressFormat.JPEG , 100 , stream);
byte[] b = stream.toByteArray();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bit.compress(CompressFormat.JPEG , 100 , stream);
byte[] b = stream.toByteArray();
ContentValues row;
row.put("photo", b);
db.insert("test", null, row);
이런식으로 저장을 시도 했는데여.. 저장이 안되는거 같아여 ㅠ
db.execSQL("CREATE TABLE test ( _id INTEGER PRIMARY KEY AUTOINCREMENT, " +
" photo BLOB);");
db는 이런식으로 했고요..




자답입니다, 그냥 uri 주소값 저장해서 하면 될 거 같아여..