title: Android Retrofit how to get images from api
body: <p>i have an api, where i get info and i want to get images, if they have too, and put it in ListView. Data i was get, but dont understand how to get images, can yoy help me?
  Api link: <a href="http://gdetut.com/api/firms?salt=63926e380bdc96ef990d57898daeb71c&amp;category_id=1" rel="nofollow">http://gdetut.com/api/firms?salt=63926e380bdc96ef990d57898daeb71c&amp;category_id=1</a>
  Api in normal view: <a href="http://jsonprettyprint.com/json-pretty-printer.php" rel="nofollow">http://jsonprettyprint.com/json-pretty-printer.php</a></p>
  
  <p>This application shows the service stations and auto parts stores , it is necessary to upload images from api , if they are, the best way to do this ?</p>
  
  <p>Retrofit class:</p>
  
  <pre><code>public class Retrofit {
  
  private static final String ENDPOINT = "http://gdetut.com/api";
  private static ApiInterface apiInterface;
  
  interface ApiInterface {
      @GET("/firms?salt=63926e380bdc96ef990d57898daeb71c&amp;category_id=1")
      void getPlaces(Callback&lt;List&lt;Places&gt;&gt; callback);
  
  
  }
  
  static {
      init();
  }
  
  private static void init() {
      RestAdapter restAdapter = new RestAdapter.Builder()
              .setEndpoint(ENDPOINT)
              .setLogLevel(RestAdapter.LogLevel.FULL)
              .build();
      apiInterface = restAdapter.create(ApiInterface.class);
  }
  
  public static void getPlaces (Callback&lt;List&lt;Places&gt;&gt; callback) {
      apiInterface.getPlaces(callback);
   }
  
  }
  </code></pre>
  
  <p>Ratrofit success in Activity: </p>
  
  <pre><code> Retrofit.getPlaces(new Callback&lt;List&lt;Places&gt;&gt;() {
          @Override
          public void success(List&lt;Places&gt; places, Response response) {
  
  
              listView.setAdapter(new MyAdapter(MainActivity.this, places));
  
  
          }
  </code></pre>
  
  <p>Adapter:</p>
  
  <pre><code> class MyAdapter extends ArrayAdapter&lt;Places&gt; {
  
      public MyAdapter(Context context, List&lt;Places&gt; objects) {
          super(context, R.layout.list_item, objects);
      }
  
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          ViewHolder holder;
          View rowView = convertView;
          if (rowView == null) {
              LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              rowView = inflater.inflate(R.layout.list_item, parent, false);
              holder = new ViewHolder();
              holder.nameOfPlace = (TextView) rowView.findViewById(R.id.name_id);
              holder.subcategory_name = (TextView) rowView.findViewById(R.id.subcategory_name_id);
              holder.geometryName = (TextView) rowView.findViewById(R.id.geometry_name_id);
              holder.imageView = (ImageView) rowView.findViewById(R.id.image_id);
              holder.rating = (TextView) rowView.findViewById(R.id.rating_id);
              rowView.setTag(holder);
          } else {
              holder = (ViewHolder) rowView.getTag();
          }
  
          Places places = getItem(position);
          holder.nameOfPlace.setText(places.getName());
          holder.subcategory_name.setText(places.getSubcategory_name());
          holder.geometryName.setText(places.getGeometry_name());
          holder.imageView.setImageResource(places.getImage());
          holder.imageView.setImageResource(R.drawable.restaurant48);
          holder.rating.setText(places.getRating());
  
  
          return rowView;
      }
  
      class ViewHolder {
  
          public TextView nameOfPlace;
          public TextView subcategory_name;
          public TextView geometryName;
          public TextView rating;
          public ImageView imageView;
      }
  }
  </code></pre>
  
  <p>Places class:</p>
  
  <pre><code>public class Places implements Serializable {
  
  
  String name;
  String geometry_name;
  String rating;
  String subcategory_name;
  int image;
  
  public Places(String name, String geometry_name, String rating,String subcategory_name, int image) {
      this.name = name;
      this.geometry_name = geometry_name;
      this.rating = rating;
      this.subcategory_name = subcategory_name;
      this.image = image;
  }
  
  
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  
  public String getGeometry_name() {
      return geometry_name;
  }
  
  public void setGeometry_name(String geometry_name) {
      this.geometry_name = geometry_name;
  }
  
  public String getRating() {
      return rating;
  }
  
  public void setRating(String rating) {
      this.rating = rating;
  }
  
  public String getSubcategory_name() {
      return subcategory_name;
  }
  
  public void setSubcategory_name(String subcategory_name) {
      this.subcategory_name = subcategory_name;
  }
  
  public int getImage() {
      return image;
  }
  
  public void setImage(int image) {
      this.image = image;
  }
  </code></pre>
  
  <p>}</p>