Loading image from a web?
Monkey Targets Forums/iOS/Loading image from a web?
| ||
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! |
| ||
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. |
| ||
After testing, I guess I can actually load an image like this LoadImage("url") |
| ||
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). |
| ||
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. |
| ||
Gfk - you can save files on iOS, but only inside the app sandbox (images can also go to the camera roll). |
| ||
(images can also go to the camera roll). Is this possible with Monkey, or were you talking about iOS generally? |
| ||
Sorry, iOS generally. |
| ||
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. |