1
インターネットから複数の画像をsdcardに保存し、パスをデータベースに保存する方法は?複数の画像の場合、どうすればよいですか?データベースに画像を保存する方法
"create table table1 (_id integer primary key autoincrement, "
+ "title text not null, definition text not null, image BLOB not null);";
が、1つの値を格納するために私は、同じ画像があるすべてのタイトルのためにそう
bmOptions = new BitmapFactory.Options();
bmOptions.inSampleSize = 1;
bm = Loadmage(image_URL, bmOptions);
mImageV.setImageBitmap(bm);
extStorageDirectory = Environment.getExternalStorageDirectory().toString();
OutputStream outStream = null;
File file = new File(extStorageDirectory, "er.PNG");
try{
outStream = new FileOutputStream(file);
bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.flush();
outStream.close();
}catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
として挿入されている。今まで私は..です
表は、クエリを作成したのは以下です表示...異なるタイトルの異なる画像を表示したい。
問題がありますか? iレコードをデータベースに1つ保存するか?おそらく、あなたのdbテーブルがどのように見えるかというような、より詳細な質問が必要です。 – aha