开发者

Client-server web app with both client AND server running on iPhone - is this possible?

开发者 https://www.devze.com 2023-01-31 02:10 出处:网络
I\'d like to build a simple native iPhone app with tools traditionally used for web apps. I would prefer to use something like jQTouch and Rails, but I want it to work offline (not require an internet

I'd like to build a simple native iPhone app with tools traditionally used for web apps. I would prefer to use something like jQTouch and Rails, but I want it to work offline (not require an internet connection or a server).

Is there a framework that enables simple creation of native iOS aps by encapsulating a lightweight web server and a server-side app framework (Rails or something simpler and more lightweight that can run on a phone), thus allowing you to write the client side code in HTML+JavaScript ?

If the开发者_JS百科re is not such a thing, is there a way to create an app (with HTML+JS) that basically only has a client-side component with persistent data storage?

Thanks.


Have you tried Phonegap?

www.phonegap.com

You write your app in HTML/CSS/JavaScript.

You access the phones APIs through JavaScript - boom!

Also; Appcelerator Titanium would be an option: http://www.appcelerator.com/

-IMO Titanium is more powerful, and offers a more native look.

Why would you want to run a webserver off of the iPhone? Is it so that you could send back data to the mothership?


Yes, you can included a lightweight http server running in another thread inside your iPhone app, and have your UIWebView connect to it. But unless you are going to do a fancier web server that generates dynamic content, it might be easy to just download your HTML/CSS/Javascript content to a local directory, and then point any URLs to those local files when offline.

0

精彩评论

暂无评论...
验证码 换一张
取 消