Loading image from a web?

Monkey Targets Forums/iOS/Loading image from a web?

FelipeA(Posted 2013) [#1]
Hello,
Is it possible to load an image from a website on iOS using monkey?
I'll be having a advert banner showing an image every month, but to avoid updating the app every month I want that banner to be loaded from a website.
I hope someone can help me with this.
Thanks!


FelipeA(Posted 2013) [#2]
I've been using HttpGetter to get the pixels of the image from a php file. But this takes too long ( it's a 900x600 image ), it even crashes on android. Any idea if there is a better way?
Thanks.


FelipeA(Posted 2013) [#3]
After testing, I guess I can actually load an image like this LoadImage("url")


GfK(Posted 2013) [#4]
As far as I know, everything is sandboxed on iOS, so even if you did figure out a way of downloading an image from the web, you wouldn't be able to store it anywhere and would have to re-download it every single time you wanted to display it.

(unless somebody knows something about iOS that I don't).


FelipeA(Posted 2013) [#5]
For now I don't need to save the image on the device, so just downloading it as a temp. image is no problem for me. I've only just started working with iOS, so I don't know if this would work, but saving the pixels of the image as a string with SaveState() could help with that.


Beaker(Posted 2013) [#6]
Gfk - you can save files on iOS, but only inside the app sandbox (images can also go to the camera roll).


rIKmAN(Posted 2013) [#7]
(images can also go to the camera roll).

Is this possible with Monkey, or were you talking about iOS generally?


Beaker(Posted 2013) [#8]
Sorry, iOS generally.


anawiki(Posted 2013) [#9]
But writing your own function to save files on iOS isn't that hard. I made my own to save "game saves" to files instead of NSPrefs (like SaveState does) in 5 minutes.