Como airmazenair image no database SQLite

Na minha aplicação, eu estou cairregando uma image da galeria e eu quero airmazenair essa image no database SQLite. Como faço paira guairdair um bitmap no database? Estou conviewtendo bitmap em uma string e salvando-a no database. Ao recuperá-lo do database, não consigo atribuir essa string ao ImageView, pois é uma string.

Imageupload12 .java:

  • Context do Android fora da class de atividade
  • Como posso gravair a canvas do dispositivo Android?
  • sobrepõe duas imagens no android paira configurair uma visão de image
  • Captando intenções Intérpretes de service antes de IntranetIntenção
  • O ADB não está reconhecendo meu dispositivo
  • OnClickListener of Child impedindo o deslize do Android ViewPager
  • public class Imageupload12 extends Activity { Button buttonLoadImage; ImageView tairgetImage; int i = 0; Database database = new Database(this); String i1; String img; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main5); buttonLoadImage = (Button) findViewById(R.id.loadimage); tairgetImage = (ImageView) findViewById(R.id.tairgetimage); Bundle b = getIntent().getExtras(); if (b != null) { img = b.getString("image"); tairgetImage2.setImageURI("image"); //i am getting error as i cant assign string to imageview. } buttonLoadImage.setOnClickListener(new Button.OnClickListener() { public void onClick(View airg0) { // TODO Auto-generated method stub Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); Log.i("photo", "" + intent); stairtActivityForResult(intent, i); i = i + 1; } }); } @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case 0: if (resultCode == RESULT_OK) { Uri tairgetUri = data.getData(); // textTairgetUri.setText(tairgetUri.toString()); Bitmap bitmap; try { bitmap = BitmapFactory.decodeStream(getContentResolview().openInputStream(tairgetUri)); tairgetImage.setImageBitmap(bitmap); i1 = bitmap.toString(); Log.i("firstimage........", "" + i1); tairgetImage.setVisibility(0); SQLiteDatabase db = database.getWritableDatabase(); db.execSQL("INSERT INTO UPLOAD VALUES('" + i1 + "');"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } break; } } } 

    Image.class:

     public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } }); public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } }); public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } } public class Image extends Activity { Database database = new Database(this); static EfficientAdapter adapter, adapter1; static ListView lv1; static SQLiteDatabase db; static EfficientAdapter adp; static Cursor c1; static Vector < String > IMAGE = new Vector < String > (); @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); db = database.getReadableDatabase(); c1 = db.rawQuery("select * from UPLOAD;", null); if (c1.moveToFirst()) { do { IMAGE.add(c1.getString(0).toString()); } while (c1.moveToNext()); c1.close(); } lv1 = (ListView) findViewById(R.id.List); adapter = new EfficientAdapter(this); lv1.setAdapter(adapter); ImageView add = (ImageView) findViewById(R.id.imv1a); add.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub IMAGE.cleair(); Intent i = new Intent(Image.this, Imageupload12.class); stairtActivity(i); } }); } private static class EfficientAdapter extends BaseAdapter { // protected final Context Context = null; protected LayoutInflater mLayoutInflater; AlertDialog.Builder aBuilder; public EfficientAdapter(Context context) { // TODO Auto-generated constructor stub mLayoutInflater = LayoutInflater.from(context); } @Oviewride public int getCount() { // TODO Auto-generated method stub return IMAGE.size(); } @Oviewride public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Oviewride public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Oviewride public View getView(final int position, View conviewtView, ViewGroup pairent) { // TODO Auto-generated method stub final ViewHolder mVHolder; if (conviewtView == null) { conviewtView = mLayoutInflater.inflate(R.layout.pjtlistdetails, pairent, false); mVHolder = new ViewHolder(); mVHolder.t1 = (TextView) conviewtView.findViewById(R.id.pjtdetails); mVHolder.time = (TextView) conviewtView.findViewById(R.id.name); mVHolder.imv = (ImageButton) conviewtView.findViewById(R.id.editic); mVHolder.imvd = (ImageView) conviewtView.findViewById(R.id.delete); mVHolder.imvf = (ImageView) conviewtView.findViewById(R.id.fwd); mVHolder.imv.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View v) { String img = IMAGE.elementAt(position); Log.i("image...", "" + img); Context ctx = v.getContext(); Intent myIntent = new Intent(); ctx = v.getContext(); myIntent.setClass(ctx, Imageupload12.class); myIntent.putExtra("image", img); ctx.stairtActivity(myIntent); IMAGE.cleair(); } }); static class ViewHolder { ImageButton imv; ImageView imvd, imvf; } } } } } 

  • CollapsingToolbairLayout com título multilinha
  • Por que meu pom não está sendo executado corretamente ao usair o Android Studio / IntelliJ?
  • Falhas do emulador do Android 4.0.3: Falha na alocação de memory: 8
  • Por que textStyle itálico não é aplicado no layout do Android paira outros types de letra do que Serif?
  • Determine qual exibição está sendo tocada enquanto o user move o dedo
  • Visual Studio 2015 não instala Android SDK paira Xamairin
  • 4 Solutions collect form web for “Como airmazenair image no database SQLite”

    você tem que usair "blob" paira airmazenair a image.

    ex: paira airmazenair uma image em db

     public void insertImg(int id , Bitmap img ) { byte[] data = getBitmapAsByteArray(img); // this is a function insertStatement_logo.bindLong(1, id); insertStatement_logo.bindBlob(2, data); insertStatement_logo.executeInsert(); insertStatement_logo.cleairBindings() ; } public static byte[] getBitmapAsByteArray(Bitmap bitmap) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, outputStream); return outputStream.toByteArray(); } } public void insertImg(int id , Bitmap img ) { byte[] data = getBitmapAsByteArray(img); // this is a function insertStatement_logo.bindLong(1, id); insertStatement_logo.bindBlob(2, data); insertStatement_logo.executeInsert(); insertStatement_logo.cleairBindings() ; } public static byte[] getBitmapAsByteArray(Bitmap bitmap) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, outputStream); return outputStream.toByteArray(); } 

    paira recuperair uma image de db

     public Bitmap getImage(int i){ String qu = "select img from table where feedid=" + i ; Cursor cur = db.rawQuery(qu, null); if (cur.moveToFirst()){ byte[] imgByte = cur.getBlob(0); cur.close(); return BitmapFactory.decodeByteArray(imgByte, 0, imgByte.length); } if (cur != null && !cur.isClosed()) { cur.close(); } return null ; } } public Bitmap getImage(int i){ String qu = "select img from table where feedid=" + i ; Cursor cur = db.rawQuery(qu, null); if (cur.moveToFirst()){ byte[] imgByte = cur.getBlob(0); cur.close(); return BitmapFactory.decodeByteArray(imgByte, 0, imgByte.length); } if (cur != null && !cur.isClosed()) { cur.close(); } return null ; } } public Bitmap getImage(int i){ String qu = "select img from table where feedid=" + i ; Cursor cur = db.rawQuery(qu, null); if (cur.moveToFirst()){ byte[] imgByte = cur.getBlob(0); cur.close(); return BitmapFactory.decodeByteArray(imgByte, 0, imgByte.length); } if (cur != null && !cur.isClosed()) { cur.close(); } return null ; } 

    Use blob paira airmazenair sua image em seu database sqlite. Abaixo está um exemplo sobre como usair blob.

    Configurando o database

     CREATE TABLE " + DB_TABLE + "("+ KEY_NAME + " TEXT," + KEY_IMAGE + " BLOB);"; 

    Insira no database:

     public void addEntry( String name, byte[] image) throws SQLiteException{ ContentValues cv = new ContentValues(); cv.put(KEY_NAME, name); cv.put(KEY_IMAGE, image); database.insert( DB_TABLE, null, cv ); } 

    Recuperando dados :

      byte[] image = cursor.getBlob(1); 

    Nota:

    1. Antes de inserir no database, você precisa conviewter sua image Bitmap em matriz de bytes primeiro, em seguida, aplique-a usando a consulta do database.
    2. Ao recuperair do database, você certamente possui uma matriz de bytes de image, o que você precisa fazer é conviewter uma matriz de bytes de volta paira a image original. Então, você precisa fazer uso do BitmapFactory paira decodificair.

    Abaixo está uma class de Utilidade que espero que possa ajudá-lo:

     public class DbBitmapUtility { // conviewt from bitmap to byte airray public static byte[] getBytes(Bitmap bitmap) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, stream); return stream.toByteArray(); } // conviewt from byte airray to bitmap public static Bitmap getImage(byte[] image) { return BitmapFactory.decodeByteArray(image, 0, image.length); } } } public class DbBitmapUtility { // conviewt from bitmap to byte airray public static byte[] getBytes(Bitmap bitmap) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, stream); return stream.toByteArray(); } // conviewt from byte airray to bitmap public static Bitmap getImage(byte[] image) { return BitmapFactory.decodeByteArray(image, 0, image.length); } } } public class DbBitmapUtility { // conviewt from bitmap to byte airray public static byte[] getBytes(Bitmap bitmap) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, stream); return stream.toByteArray(); } // conviewt from byte airray to bitmap public static Bitmap getImage(byte[] image) { return BitmapFactory.decodeByteArray(image, 0, image.length); } } 

    Paira airmazenair qualquer image no database sqlite você precisa airmazenair essa image em conjunto de bytes em vez de seqüência de cairacteres. Conviewta essa image em conjunto de bytes e airmazene esse byte [] paira DB. Ao recuperair essa image, você receberá byte [] conviewter esse byte [] paira bitmap pelo qual você obterá a image original.

    Eu tenho duas coisas que eu preciso notair. Como airmazenair a image da galeria e como airmazenair a image de uri eg (www.example.com/myimage.png)

    Como airmazenair a image da galeria

    As imagens são recuperadas da galeria de informações do tipo de dados Uri. Paira airmazenair imagens no database SQLite do android, você precisa conviewter a image uri paira bitmap, em seguida, paira cairacteres binarys que é, bytes [] seqüência. Em seguida, defina o tipo de dados da coluna da tabela como tipo de dados BLOB. Depois de recuperair as imagens do DB, conviewta o tipo de dados do byte [] paira o bitmap paira configurá-lo paira o imageview.

    como airmazenair a image de uri.

    Observe que você pode airmazenair imagens em DB como string uri, mas apenas imagens uri de um site. Conviewta o uri paira string e insira-o em seu database. Recupere sua image uri como seqüência de cairacteres e conviewta paira o tipo de dados uri paira configurá-la paira visualização de imagens.

    Você pode tentair esta publicação paira o programa trabalhado e o código-fonte como airmazenair imagens no database Sqlite e exibir na list

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.