1

I am trying to make an HTTP GET API call to properly append Static Google Map to an image view.

The below tutorial has shown how to do it using the http client method.

http://www.journaldev.com/10392/android-google-static-maps-example-tutorial

But when using the retrofit I need a pojo class right?

How do I make pojo for a response like in the below link.

http://maps.google.com/maps/api/staticmap?center=%22%20+lati%20+%20%22,%22%20+%20longi%20+%20%22&zoom=15&size=200x200&sensor=false%22;%20Bitmap%20bmp%20=%20null;

Or is there a way to do this without pojo using retrofit.

The response we get after we make the call is a bitmap according to the following voted post.

How to display static google map on android imageview?

xomena
  • 31,125
  • 6
  • 88
  • 117
Amal p
  • 2,882
  • 4
  • 29
  • 49
  • You only need a POJO when using a Converter like the Gson one. If you only want to fetch HTTP, you can use Okhttp – OneCricketeer Aug 07 '17 at 12:39
  • but i would like to make this call using retrofit can i make it without a pojo if so how ? – Amal p Aug 07 '17 at 12:43
  • Are you getting JSON? https://stackoverflow.com/questions/40503343/is-it-possible-to-use-retrofit-without-model-class Or a string? https://stackoverflow.com/questions/32617770/how-to-get-response-as-string-using-retrofit-without-using-gson-or-any-other-lib – OneCricketeer Aug 07 '17 at 12:49
  • http://maps.google.com/maps/api/staticmap?markers=color:red|13.0827,80.2707&zoom=13&size=400x400&sensor=true...this is the url the response is an image. please read my question i completely explained my problem – Amal p Aug 07 '17 at 12:52
  • 2
    Glide.with(getContext()) .load(myDataList.get(position).getImage()) .into(holder.imageThumb); I am using Glide to show static Google image You can use Picasso or any other image loading library – QAMAR Aug 07 '17 at 12:52
  • 1
    QAMAR please post it as an answer the code part where to place the url key etc – Amal p Aug 07 '17 at 12:53
  • did you come up with a solution? It would be awesome to see the complete result here =) – Hilal Jan 24 '19 at 18:58

0 Answers0