iPhone apps and state aware web connections - iphone

I'm working on an interface for an existing web application that will allow iPhone and other mobile clients.
I have started implement a JSON API and I need to give some detailed specificaitions for the App to an iPhone developer.
What I am curious about is whether other developers are using session data in their JSON / mobile client communications.
Do the common url grabbing libraries of iPhones (and other mobile devices) mimic a browser's cookie handling?
Can someone suggest what libraries might be used to achieve this? Are there any online tutorials or blog entries that outline state based web connectivity in an iPhone app?

I've used ASIHTTP (http://allseeing-i.com/ASIHTTPRequest/) and JSONFramework (http://code.google.com/p/json-framework/) to achieve this.
Both very good libraries that are easy to work with.

Related

Phonegap for iphone development on Windows questino re native api

I've spent the day googling all the leads on developing iphone apps on Windows and apart from buying a mac the most suitable route seems to be Phonegap. I cannot find out whether Phonegap gives access to all the native functionality. For example I want to access and manipulate the address book contents. I also want to be able to send text messages programatically and intercept and examine incoming text messages. It would be helpful if someone could confirm whether this can be done with Phonegap.
My understanding is that Phonegap is based on webapps but I am assuming that an app developed with it can run offline for operations that dont require internet access.
Even using Phonegap you will still need access to a mac to actually build your iOS application. This is a restriction that Apple has in place, and to my knowledge there is no way around it.
Phonegap uses a UIWebView to display your application built using HTML, CSS, Javascript etc, but this does not mean that an Internet connection is required for the app to run (so offline apps are definitely possible).
With regards to Phonegap's functionality, details of the Phonegap API can be found on their website. Specific to your needs, I believe phonegap provides access to the device's address book through the contacts API:
http://docs.phonegap.com/en/2.3.0/cordova_contacts_contacts.md.html#Contacts
I don't think Phonegap provides the ability to send SMS messages itself, but many people have developed extensions to add extra functionality to their applications through plugins. The majority of Phonegap iOS plugins can found at the following GitHub repo. The plugin I think you require is the SMSComposer:
https://github.com/phonegap/phonegap-plugins/tree/master/iOS/SMSComposer

Rails3 and Devise working with Iphone/Android/Wp7 applications

I searched arround for solutions and didn't find anything of really pertinent on the subject.
This is why, I ask you guys your help :-)
Assuming I have an application running with Rails 3 using Devise to authenticate the users.
I need to create mobile applications for Iphone/Android and WP7.
The mobiles applications should communicate/login/create/list, do whatever the website can do.
The mobile Applications could commuicate by parsing the XML .... but maybe there are already lib/frameworks or something more sexy ?
What would be the best way to communicate between my mobile applications and my Rails website ?
I'd use the xml or json output to share data back and forth; For authentication you can set (in initializers/devise.rb)
config.http_authenticatable = true
That enables you to send basic HTTP Auth headers with every request which devise will handle for you.
--
For creating a webapplication that is also possible to view in a mobile version for the website i'd recommend to check out this railscast: http://railscasts.com/episodes/199-mobile-devices
It sounds like, if the mobile app is just an interface to the web app, that you would likely be best served by creating a mobile HTML5 "style" within your web app, that gets served automatically when a mobile phone accesses your website. All of your code can be in Rails, which it sounds like you're already familiar with, and you've also got the advantage of keeping your codebase all together in one place - if you want to add functionality later, you just update your web app, and don't worry about updating 2 different mobile phone apps as well.

Can you access the iPhone's address book in a Dashcode-designed web application?

I'm writing a web application using Dashcode. Is it possible to access the iPhone address book from within this web application?
Dashcode is just the development environment IDE for generating widgets and iPhone apps and actually write the apps using JavaScript, HTML and CSS. Any app you make will need to sit on a server and be accessed through the mobile browser on the iPhone. So the question is can you/i connect from a web app to the iPhone native applications. Just from a security point of view i would doubt that this is possible or even desirable,
However i have seen suggestions that a native application in x-code could be built that would have a web interface that would be able to talk to the browser but i am not sure how you would engineer that or if it would work.
I suspect a simple solution is to sync your iPh=one contact with Gmail, or similar web app and then access it or write your own server that you sync contacts to. However this is not a general solution i suspect.
Hope this helps even though it is not the answer.

Will a Safari-based app for iPhone be accepted to the iTunes store?

I'm about to begin development of an iPhone app. The app itself is fairly basic, and I want a speedy turnaround time.
I'm a web developer myself, specialising in traditional web technologies such as PHP/MySQL; I have no experience in Objective-C.
My plan was to create a very basic iPhone app that is just a Safari service that passes some basic variables to a URL. That URL is the app built in PHP and housed on my servers, this way I can create the app very quickly without needing to outsource anything.
My question is whether apps of this nature would be accepted into the iTunes store, or would they be out-right rejected? Anyone's experiences or comments are very welcome.
Thanks
It could go either way, but mind bullet 12.3 from the App Store Review Guidelines:
12.3 Apps that are simply web clippings, content aggregators, or a collection of links, may be rejected
In my opinion, a simple UIWebView wrapper around your web site comes close to the definition of a simple web clipping. Your approval may very well hinge on your luck in drawing a sympathetic reviewer.
It really depends upon your application...These kinds of application have been approved in the past but again I am saying that it depends on many factors.
Try to test your app in every possible manner and also keep in mind the memory issues.
Best of luck!!!
Should be fine - its called a web app and there is software out there that will do just this for you.
All you need to do is to make a UIWebView and put your web app into it.
Also look at http://jqtouch.com. That gives you some idea of what you can do web-side. :)
http://www.netbiscuits.com/559
Native Hybrid Apps
Native apps can interface more deeply
with the mobile handset modules and
sensors to create an even richer
mobile user experience. Netbiscuits
provides pre-build native apps
frameworks for all major mobile
operating systems to be easily
customized for the needs of
enterprises.
Get "2in1" by combining the power of
mobile websites and native apps by
wrapping mobile websites into hybrid
apps and list them easily in all major
app stores of providers like Apple,
Nokia, Google or Samsung to open a new
mobile distribution channel. The
benefits of this approach are fast
time to market, minimized development
and maintenance efforts and maximum
mobile cross-platform technology
coverage.
Yes, it will be accepted as long as you stick with HTML, CSS, JS and Obj-C on the client side. You still need to wrap it in an iPhone app. In my experience, the best way to this is to use http://www.phonegap.com/ or a similar framework.
You'll have the option of deploying you app through iTunes or as a regular web app (you users will be able to create a link to your web app right on their springboards)
It SHOULD be accepted, granted you test test test and make it look just like a native application. Also you'll have to make sure that your server is never down, or if the application can't reach it just display an error message. You also have to keep in mind that there are a lot of iPod Touch users, and they don't have access to the internet all the time. Which means that chances are you'll get a BUNCH of 1 star reviews

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.