title: How to store images in sqlite database and display them?
body: <p>In my application I need to display questions along with images in Android. I have stored questions in sqlite db and displaying them. I have created a folder DBimages in assets folder. Now all my images are there in DBimages folder. </p>
  
  <p>I have created two classes. I am able to display the question and options from local sqlite db but I am unable to display the image which is stored in <code>assets\DBimages\abc.png</code>. </p>
  
  <p>The names of all the images are stored in pictures column in sqlite db table. But how to display the image related to that particular question. Please help me regarding this.</p>
  
  <p><strong>UserBO.java</strong></p>
  
  <pre><code>public String getQuestion() {
  return question;
  }
  public void setQuestion(String question) {
  this.question = question;
  }
  public String getImage() {
  return pictures;
  }
  
  public void setImage(String pictures) {
  this.pictures = pictures;
  }
  </code></pre>
  
  <p><strong>Select.java</strong></p>
  
  <pre><code>ArrayList&lt;UserBO&gt; usersList = new ArrayList&lt;UserBO&gt;();
  for (int i = 0; i &lt; stringList.size(); i++) {
  ArrayList&lt;String&gt; list = stringList.get(i);
  UserBO user = new UserBO();
  try {
  user.id = Integer.parseInt(list.get(0));
  user.name = list.get(2);
  user.question = list.get(3);
  user.option1 = list.get(4);
  user.option2 = list.get(5);
  user.option3 = list.get(6);
  user.option4 = list.get(7);
  user.option5 = list.get(8);
  user.pictures = list.get(9);
  user.answer = (list.get(10));
  } 
  catch (Exception e){}
  public View getView(int position, View convertView, ViewGroup parent){
  View view = convertView;
  try{
  if (view == null) {
  LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  view = vi.inflate(R.layout.list_item, null); 
  }
  final UserBO listItem = mList.get(position);                
  if (listItem != null) {
  ( (TextView) view.findViewById(R.id.tv_question) ).setText( listItem.getQuestion()+"");
  ((ImageView) view.findViewById(R.id.imageView1)).setImageResource(R.drawable.f);
  ( (RadioButton) view.findViewById(R.id.option1) ).setText( listItem.getOption1() );
  ( (RadioButton) view.findViewById(R.id.option2) ).setText( listItem.getOption2()+"" );
  ( (RadioButton) view.findViewById(R.id.option3) ).setText( listItem.getOption3()+"" );
  ( (RadioButton) view.findViewById(R.id.option4) ).setText( listItem.getOption4()+"" );
  ( (RadioButton) view.findViewById(R.id.option5) ).setText( listItem.getOption5()+"" );
  }}catch(Exception e){}
  return view;
  </code></pre>
  
  <p>}
  }   </p>