-1

I am new for IOS development. I need to show an image from in an offline mode in Ipad device. Because if i going to online means the image rendering time is high. so i plan to put an image in lightweight IOS Webserver which install in same ipad device.

Please suggest me light weight and fast IPAD web server.

tshepang
  • 12,111
  • 21
  • 91
  • 136
user2632693
  • 1
  • 1
  • 2
  • If you want to access images locally, is there any reason to use a web server? – cahn Jul 30 '13 at 06:23
  • "IOS"? "IPAD"? Really? –  Jul 30 '13 at 06:23
  • What @cahn said -^. Plus, there are no web servers designed for the iPad because the iPad is a foolish environment for a web server. – borrrden Jul 30 '13 at 06:23
  • @borrrden (However, `NSNetService` is available on iOS, and one can compile Mongoose at any time as well...) –  Jul 30 '13 at 06:24
  • @H2CO3 To be fair, `NSNetService` is not designed to be a "web server" (most people think of it as a server which delivers traffic outside its own network boundaries). However, it *is* a very useful tool for local discovery of peers. – borrrden Jul 30 '13 at 06:29
  • @borrrden Yes, but most applications use it as a web server anyway. Nevermind you can access it only from within your LAN, if your app serves content to the user through the browser on his PC, then most users will regard it as a "web server". (Too bad most users are non-technical people, right?) –  Jul 30 '13 at 06:31
  • Yes, i have a reason because i have already running on "Online" way the images are cached.but this machanisum rendering images through online is bit slow. So we need to reder the image fastly. so we choose offline way render images fastly using cached image. – user2632693 Jul 30 '13 at 06:36
  • @H2CO3 Ok, you win on the web server definition thing :p. I can see how the combination of the two could do that. I would still have a hard time recommending it (outside of a few scenarios such as attempting to share files off of an iOS device or something) but that's another story. – borrrden Jul 30 '13 at 06:38
  • @borrrden Yeah of course it's not a solution if you simply want to display images. You use `UIImageView` for that, not a web server. –  Jul 30 '13 at 06:41
  • I have cached images in my hand. i need to render the cached images to browser offline mode. What is the way in PAD ? please provide me the solution... – user2632693 Jul 30 '13 at 06:47
  • You already have one - load the image into a UIImageView. – Abizern Jul 30 '13 at 10:26
  • it's having lot of parameters.for example, if rotate image,the image will show based on angle, image color , size and so on.. So first we need to parse the parameter then only can pick the image – user2632693 Jul 30 '13 at 12:17

3 Answers3

1

You cannot install any web server on a non jailbroken device which will run continuously in background in any iOS device as of now. But you can serve offline images by implementing offline caching for web images. You can use SDWebImageManager for the same.

Vaibhav Gautam
  • 2,074
  • 17
  • 17
  • 1
    This is not true, I have lighttpd running on my iPhone :P –  Jul 30 '13 at 06:25
  • (and the point is that you **can** embed a webserver into your application, there's even an official Cocoa class for that.) –  Jul 30 '13 at 06:25
  • i need to render the cached images offline way. I not run continuously. The images render only for that particular device. is there any way to achieve ? – user2632693 Jul 30 '13 at 06:32
  • 1
    @H2CO3 that is only available for jailbroken devices. – Vaibhav Gautam Jul 30 '13 at 06:33
  • @user2632693 Use `UIImageView` without any sort of web server involved, for example? –  Jul 30 '13 at 06:33
  • @VaibhavGautam "You cannot install any web server in ***any*** iOS device" (which you state) is not the same as "You cannot install any web server in a ***non-jailbroken*** iOS device" (which is the truth). These statements would be only equivalent (well, more or less, anyway) if jailbreaking was impossible. –  Jul 30 '13 at 06:34
  • @user2632693 : installing a web server is not a solution to render images offline. offline (disk)caching is the solution for you. – Vaibhav Gautam Jul 30 '13 at 06:38
  • I have cached images. i need to render the cached images to browser. What is the way in PAD ? – user2632693 Jul 30 '13 at 06:43
  • @user2632693 sorry to say but this cannot be achieved. i guess u should create your custom web browser which caches images internally. – Vaibhav Gautam Jul 30 '13 at 07:14
  • please provide some name of IOS Web Server? – user2632693 Jul 30 '13 at 07:30
0

Light weighted webservice for ios is JSON, but you want to load an image when you are offline, that itself does mean that you can not use a webservice call. So loading an image which was stored locally when you are in ofline mode should be your choice.

  • Yes.I stored in locally.But need to render the cached image to browser in offline. what is the way in IPAD? – user2632693 Jul 30 '13 at 06:50
  • What i understood is you want to show the image which was already stored in local on a uiwebview, to accomplish this task, please follow the following code NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"png"]; [myWebView loadHTMLString:[NSString stringWithFormat:@"",path] baseURL:nil]; – Siva Kalyan Jul 31 '13 at 11:04
  • it's not a single image. I have lot of images.it's having lot of parameters.for example, if rotate image,the image will show based on angle, image color , size and so on.. So first i need to parse the parameter.Based on the parameter only can pick the image – user2632693 Jul 31 '13 at 12:00
0

Edited to remove incorrect description.

If you have images saved locally, you can make an HTML string containing img tags and load the string in web view.

For details see this question.

Community
  • 1
  • 1
cahn
  • 1,350
  • 1
  • 12
  • 24
  • it's having lot of parameters.for example, if rotate image,the image will show based on angle, image color , size and so on.. So first we need to parse the parameter then only can pick the image. – user2632693 Jul 30 '13 at 06:57
  • 1
    I am willing to bet that anything you can accomplish in the browser can be accomplished natively. Your request is unreasonable (why didn't you ever mention the whole "image will show based on angle, image color, size, etc" before?) and people will not want to help you. – borrrden Jul 30 '13 at 07:35