-2

I have a bitmap and how can I get this image to url?

Bitmap image = BitmapFactory.decodeStream(inputStream);

I got bitmap from url. I want this things reverse. I want a url.

Hilalkah
  • 945
  • 15
  • 37
  • `I got bitmap from url`. Well then you have an url. What are you asking for? – greenapps Apr 18 '17 at 14:09
  • Because this url wants cookie. I read url with cookie and get image. But TileProvider doesn't support cookie. So I got images, bbox but not without cookie url. So.. I want to tiling wms on google map. So my base problem is : http://stackoverflow.com/questions/43446270/setting-cookie-for-custom-tile-urls-in-google-maps-android-sdk – Hilalkah Apr 18 '17 at 14:21
  • Dont understand. Your working code is the same as of TileProvider for cookies. So its supports cookies i would say. – greenapps Apr 18 '17 at 14:59
  • But its not working. Its not tiling. Either swift – Hilalkah Apr 18 '17 at 15:01
  • Can be. But why are you stating that TileProvider does not support cookies while their code is the same as yours? Investigate deeper please. – greenapps Apr 18 '17 at 15:03
  • I made a juice of mango and Now I want mango from juice. Sorry for this but I think this example will clear what type of question you are asking. – Vishal Chhodwani Apr 18 '17 at 17:12
  • Ahahahahahha. But really this link working with cookie. I want to create url without cookie soo.. – Hilalkah Apr 18 '17 at 17:14

1 Answers1

3

Step #1: Save the Bitmap to a file, using compress().

Step #2: Upload the file to a server somewhere, for which you can derive the resulting URL.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks. I have done step 1. But how can i do step 2 simply? – Hilalkah Apr 18 '17 at 14:00
  • @Hilalkah: Ask whoever set up your server how you should upload the `Bitmap` to that server. There are many, many possible ways that this could be done, and the details of the Android side will depend upon the server implementation. – CommonsWare Apr 18 '17 at 14:03