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

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 there 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.

Related

Where can I find out about coding a website to my app?

I just found out that an iPhone can act as a web server to access the app's data. I'm using Xcode. How do I extend my app's capabilities so that users can edit app data using a Mac. Where can I learn about this? Can you give me summary and a website please?
I hope it's using Apache Tomcat. I suppose I have to build a website to process and display the app's data. I wonder if iPhone supports jsp since it's using UNIX. I really don't want to use PHP.
Currently Money Manager has that feature.
Searching for embedded iOS web server returns a few solutions:
Run a webserver on an iOS device
A small, lightweight, embeddable HTTP server for Mac OS X or iOS applications
Lightweight GCD based HTTP server for OS X & iOS
You will be unlikely to fit php or tomcat onto an iOS device; the lack of memory and processing power will be technically challenging.
Apple will also likely take a negative view of the inclusion of a general purpose scripting language in any app your submit to the App Store.

Lotus Native Application on iPhone

How can i make a lotus application an iPhone native apps?
For e.g: eLeave.
The submit or approve action button in the form was created using lotusscript. So how can it work in iOS ? I have no idea how can i extend my lotus application to an iPhone Native Apps. Someone had suggested to use either SOAP or REST via HTTP to communicate between iOS and domino. But i don't even know what can i do with SOAP in my apps.
Pls help.
The suggestions along the lines of SOAP or other HTTP-based access to the data are correct. Since you can't just port a Notes app to the iPhone (for a variety of reasons) or use the Notes Java API classes (since the iPhone doesn't have Java), some form of HTTP access is your best bet. Either traditional Domino web access via forms or XPages are most likely the best way to go, since then you can write your UI in Designer. If you don't want to or can't do that for whatever reason, you're on the hook for writing the UI for your iOS app separately and then connecting to Domino via Web Services or REST functionality.
SOAP Web Services are probably what you want. They have the advantage of being supported directly in Designer - you can create a Web Service Provider in LotusScript or Java in much the same way you would write an Agent or Script Library. You would have to write methods to access and update the data you want, but it would also mean you have full control over what happens. You could re-implement your form-submission code as a web service call that takes the changed data as parameters and then does whatever manipulation you want and creates/saves the document.
It does depend on the version of Lotus/Domino you are running. This could be a start XPages Mobile Controls I am not sure about the "native"here. This is XPages, web based.
Based on your comment, I know of one native application TSAzr. This application uses XPages as web-services on the domino server. A bit more info can be found here dominoGuru
Your follow-up suggests that a mobile-optimised web application will not cut it, and that you want a native application. This means writing a new iOS application, end of story. There are different ways to go about this of course—e.g. you could build a web app and then wrapper it using something like Appcelerator Titanium, or PhoneGap—but ultimately, you need to write something.
As #Jesse Gallagher has already stated, Notes applications can't be ported directly to an iOS device. Apart from anything else, a Lotus Notes client application is a proprietary data store (NSF) sitting within a C and C++-based client built and compiled for the relevant underlying platform (Win or OS X). There is no direct analogue for iOS other than re-coding your app (of course, you could re-use the existing Lotusscript business logic via web service calls, as detailed in earlier answers).

Is PhoneGap on iPhone pointed to local proxy possible and allowed?

We are looking on building a project that would run on Android, iPhone and other platforms with Phonegap. The app would be fairly simply, making use of the camera and basic UI features. The first versions would simply point to a web service and load information from there.
Over time, however, we want to improve the speed by:
1.) Downloading content via a separate thread when the app is running and storing the results in a local database,
2.) Hosting a mini webserver in the app*, and
3.) Pointing the PhoneGap UI to the app's mini webserver instead of the service's external webserver.
Two questions:
1.) Is it technically possible to host a mini webserver in iPhone that the app will access?
2.) Would this functionality be rejected by Apple?
Thanks in advance.
*I realize this step probably isn't really necessary. But, if it enables to truly build a "write-once-run-anywhere" UI, it might make sense still.
You're much more likely to want to have the HTML for presentation generated on your actual server, downloaded and stored by your separate thread as an .html file on the iPhone filesystem and served through local URLs using PhoneGap. Essentially, an advanced cache.
This way no web-server is necessary and you only need to write the UI generation code once on the server.

Iphone App vs. Offline Web App. Which way is the smartest?

I think about starting from scratch building a small application fullfilling two technical requirements:
should be usable on iPhone
should work offline
There are two obvious alternatives here to choose between
A real iPhone application with offline capabilities
A web app using HTML5 offline, Google Gears or similar
Having no iPhone app development experience (I don't own an iPhone), i wonder which way would be the easiest to go?
What are the learning curves for building offline HTML vs building an iPhone app?
Honestly, it depends what your app is going to do.
MobileSafari supports all the HTML5 offline stuff, so you could store data in a clientside SQL database, cache the application clientside, etc... The mobile Gmail app is probably the most notable example of that, giving you full-featured access to your Gmail even when offline. You can also use geolocation through JavaScript APIs that were added in 3.0. Web Clips let your web app share the home screen with native applications too. There is more on using web apps on the iPhone on this Stack Overflow post.
Obviously, doing a Web app will be of interest to people who like dealing with HTML, CSS, and JavaScript (and possibly whatever language is running server-side). It is possible to do really neat stuff with offline Web apps, but its performance won't be as good as that of native apps, especially on pre-3GS devices.
Developing a native application will require you to learn Objective-C (or C# as soon as Mono Touch is available to the masses) and pay a $99 fee to be allowed to test on-device and deploy to App Store. A lot more of the system is exposed to you through the various APIs, such as the camera, compass, multitouch, and so on.
Objective-C is pretty simple to pick up if you're familiar with Java; you only really need to get used to the square bracket syntax and memory management and then it's pretty straight-forward.
Then there are the hybrid systems, like PhoneGap, which expose more of the device's APIs, provided the Web app runs in a special container app. It is also crossplatform, so you could also deploy the app on Android and BlackBerry if you wanted to. This still requires you to pay the App Store fee, but if you're more familiar with Web development, this gives you the best of both worlds.
I can't tell you too much about HTML apps in general, but I can tell you that the API for the UIWebView is extremely minimal, and of course there is much less you can do than in a native iPhone application.
An HTML5 offline app would have security issues as you would have to hard code your oauth secret into code that anyone could see ( by clicking view source, or inspecting in Firebug ). You could simply use http auth, but then you get the ugly "from API" credit with every tweet sent from your app, and also that ugly http auth popup from the browser.

Wordpress database access in mobile applications

I am new to wordpress and I want to create an interface for being able to access my database hosted on wordpress in my mobile applications - particularly iPhone and Android.
As these do not directly access SQL databases and would need routines on the server-side for being able to do so, what would be the best way for me to go about writing these routines/web-service calls?
Are there any wordpress plugins available for this? If not, what language should I use - php or something else?
I need some lead.
Perhaps you do not need to access the database directly?
Wordpress supports the XML-RPC standard interface so applications can communicate with WP across the internet, without needing access to WP's database. http://codex.wordpress.org/XML-RPC_Support
If you choose to implement your apps' using XML-RPC, all your communication will be reduced to simple HTTP calls.
To get started I suggest checking out the source code of Wordpress' own iPhone application, which utilizes XML-RPC http://iphone.wordpress.org/
Also, note that Wordpress has published an extension to the XML-RPC API that includes WP specific functions: http://codex.wordpress.org/XML-RPC_wp
I would suggest creating a webapp (iPhone style) for the phone application and calling everything with AJAX to a PHP (Due to Wordpress running PHP) backend to validate and execute the queries. iPhone webapps dev link I haven't found any solid tutorial/resource for developing BlackBerry webapps (Please post back if you find one)
Instead of creating a new app, or trying to port the database, check out WP Touch, which is a Wordpress plugin/theme which will turn your wordpress install into an iPhone friendly site on iPhones.