Guidance needed to develop an hybrid mobile app - iphone

i have an existing iPhone and android application. my goal is to make some component in thsese apps reusable. so i am identifying components which are not using device capabilities and then will design these components from HTML pages so that the same code will be used in both apps.
one more requirement is that whatever web service is being used , that will be called from objective C or Java code and response will be consumed in my Html page.
Please give me your ideas as how can i achieve it?
what all tools should i use to make these pages?
are there any challenges, that we need to face at any stage in development?
I have no idea of web site development and html technologies, that's why i am looking for a help here.
Thanks

Rather than have bits of native and bits of HTML you would be better to develop the entire thing in Phonegap. Phonegap is developed in HTML and JS and then compiled into a native app utilising the OS's web view. This means that you will have the exact same code across devices and will allow for a more consistent UI.
Phonegap allows for native device functions to be used such as geolocation, accelerometer, audio, video, notifications, storage and more.

use Jquery Mobile to develop user interface and to package it as a offline app use phonegap.com
Hope it Helps !!!

Related

Cross platform mobile developement using UIWebView and Webview

I am just wondering is it worth to do a cross platform mobile app development using UIWebView (iphone) and Webview(Android)? We need to port multiple web applications as mobile apps for iphone and Android. One of the strategy is to use the UIWebView to render content from server and this content from server is same for Android and iPhone.
Have a you developed using this concept? Is there any limitations you found in it? Such as issues with redirect of web-pages, cookies, java-script library performance etc
So far I see only two issues:
Non availability specific UI design features native to device such as may be rounded corner buttons not available etc
Infrastructure code for handling cookies, sending and receiving information back and forth from server to device.
any advice?
Thank you
Cross platform frameworks are talking similar approach and also adding wrapper libraries to abstract away platform specific functionlity. Check out PhoneGap, Appcelerator and others.
Checkout Pyxis, which is a cross platform mobile app development software.

How to gain direct access to the hardware capabilities of mobile devices from mobile browsers

We are developing web browser application for mobile phones and I am trying to figure out a way that I can gain access to the camera and take a photo and then upload it to the internet. But so far what I was suggested is to use phonegap and create native application. Phonegap is fine but it is not what I am looking for because my client wants to design forms and these html forms somehow will be able to trigger the camera and take photo and upload it to a server. Do you think developing a native API for every platform and having access to its functions from the web browsers is possible? What your suggestion would be?
(Note: My customer only want application that can run on mobile web browsers no native application runs on I-Phone, windows mobile, Blackberry and Android)
Thanks a lot...
Web apps (not wrapped in native code as Kumar details) cannot access all device hardware and sensors. Location support is available on iOS and Android, but camera access is only available on Android (via JavaScript). Similarly, device motion APIs are not accessible on Android, but are on iOS.
As you can see, support is sketchy and if you are truly looking to use such features, you are better off (and in many cases, realistically looking at) writing native apps for each platform you intend to support.
HTML5 is not yet at the point where it can replace native apps. It can do some of the things that native apps can, but even then performance is suboptimal. Currently, native apps may be more difficult and time-consuming, but they are necessary.
Calling android native APIs from javascript functions of embedded WebView
Use JS to call Java code which will in-turn call the Camera API or whatever else you are looking for.
It's not going to be possible to do it on iPhone, the only known way of accessing the camera is through the Cocoa layer.

How can I develop an iPhone app in HTML5?

I have seen a blog which claims that we can develop iPhone applications in HTML5. Untill then I was aware about Objective-C on Mac.
Can we develop an interface with backend support application in HTML5 on iPhone? Will it be secure and scalable?
If HTML5 is a markup language, then how can I make conditional statements in it? Would it be via jQuery or Javascript?
Which IDE should I use to develop an iPhone app in HTML5?
A great place to start when developing an iPhone app in HTML5 is PhoneGap.
You could either go the full-blown app route by developing an iOS app using PhoneGap, or only selecting certain tools/frameworks to help build a web-based app for mobile devices.
And very much like how it works with websites, HTML is used for the structure, CSS for presentation and JavaScript for behaviour. So yes, JS is used for conditional statements, etc.
Yes.
You can develop an HTML5/CSS3/Javascript app, then wrap it in PhoneGap or Apache Cordova to make it native and put it in the App Store (or Android Market...), as well as publish it on the web. You can do this with whatever tools you're comfortable with.
Using a tool like PhoneGap has many benefits over browser-based Mobile Web Apps, such as allowing you to parse iPhone contacts and access the local hardware.
It's great in combination with jQuery Mobile, but since performance is a MAJOR issue you must be very cautious to really streamline your images, CSS, and Javascript.
See this link to learn more about Mobile Frameworks.
I have seen a blog which claims that we can develop iPhone applications in HTML5. Untill then I was aware about Objective-C on Mac.
If you want to write a native iPhone application, then Objective-C is your only option. However, as the iPhone’s web browser has a lot of capabilities (e.g. offline caching), you can develop applications that run in its web browser, as opposed to natively. They can’t access all the features of the iPhone, and they are simply websites (so you need a server to serve them), but before the iPhone SDK was released, Steve Jobs himself described web apps as the way to write software for the iPhone.
Can we develop an interface with backend support application in HTML5 on iPhone? Will it be secure and scalable?
I have no idea what that means.
If HTML5 is a markup language, then how can I make conditional statements in it? Would it be via jQuery or Javascript?
Correct: JavaScript. (jQuery is just a JavaScript framework, and it’s probably a bit heavy to use on current iPhones.)
The HTML5 spec blurs the distinction between HTML and JavaScript by defining the DOM interface for the HTML elements it specifies, and defining new DOM features (e.g. offline caching) that aren’t technically part of HTML. Apple (and other people) have further blurred the term “HTML5” by using it to encompass various CSS features like animations and transforms, which you’ll probably find very useful for making web apps feel more like native apps.

HTML5 web app vs Native mobile apps

Hi I have been recently exploring some of the Javascript mobile frameworks that can be used for developing mobile web apps like Sencha, JQTouch, JQuery mobile etc.
I know the adv and disadvantages of both.
I just need some recent stats which show the market's adoption or opinion.
I tried three ways to develop mobile applications.
First method is to use frameworks that will take your html/css/js files and package them into mobile applications depending on your targets (BlackBerry, iPhone, Android, ...). I used PhoneGap (known today as Cordova). I didn't like it at all because the UI's rendering is so ugly on some devices and the user experience is broken. I had to use it with jQuery Mobile because it gave me a good UI design start. I tried some Phonegap Android generated applications on my personal device and it's really horrible. Some of them got rejected by Apple because of that ...
Second method is to use Appcelerator Titanium SDK. One word to sum it up: Awesome. One language to use (javascript) to create your UI/Controller. It's so easy to learn, so powerful to develop with and it has many out-of-the-box functionnalities (like facebook API, Yahoo Query Language, ...) that will allow you to put in place solutions easily for both Android and iPhone. BlackBerry is coming soon. What I liked the most is that it converts the written Javascript into the targetted platform with the default UI. It's really great. And, above all, the UI is easily customizable (with a css like system).
Personally, I put in place apps that can: Take a photo with the device then send it to a remote server, send messages to twitter/facebook, advanced geolocation, etc.
Third method: Native! It would take time if you target both iPhone and Android but, the big advantage is that you can create anything you want without being tied to a Framework for areas such as games, augmented reality , etc.
In my opinion, if you want to create simple applications with some nice features (weather, twitter feeds, sending on a facebook wall, ...), use Appcelerator Titanium SDK.
It converts your code into NATIVE.
If you have time to spend learning native languages, do it. It's the best way ;)
Hope it helps.
Regards.
I've summed up my thoughts on the whole "native vs. web" discussion in a blog post here: http://www.springenwerk.com/2011/09/thoughts-on-mobile-ui-design.html
In a nutshell: You can't get around getting to know the platform you are targeting if you want to provide a great user experience. Plus, you shouldn't try to mimic native UI/UX in a web application, it will only disappoint your users.
here are some pros and cons of native apps vs. web apps:
Native apps:
Native apps have more security
Native apps have higher user engagement, it has higher click-through rate (CTR) among the ad-serving publishers
When it comes to aesthetics and overall user experience, it is incredibly difficult for web apps to trump native apps
you don't have to buy a server and maintain it, therefore, for small businesses it is the ideal solution, not web apps which require a server.
Web apps:
it's cross platform - that means your one app will work on both iphone and android
cheaper and faster to develop and maintain
you will find programmers easier than native apps
updates are easier
Check out this post for some more opinion - http://www.thorntech.com/2013/01/html5-vs-native-apps-which-will-win-the-mobile-app-development-battle/
In particular, the last paragraph is worth noting. If you go down the path of building an HTML5 app, it is worth having some type of background "syncing" of content so you are not always pulling it from the web in real time. The app will be much more responsive if you load HTML pages from disk.
From my experience, the success rate of a native apps are much better than html or javascript based ones. I do not have sufficient numbers to back it up, but these are some issues that may crop up when trying to build html5 apps for different platforms. e.g.
Browser OS or webkit differences can cause unexpected bugs, css issues that could take quite a while to debug.
Your app is running on top of a webkit browser engine which takes up additional resources.
Older or non-smart phone devices may not have a modern webkit engine.
Nevertheless if you have good web skills over native, then getting an app to the market the quicket and cheapest route would be html5. Some apps lend very well for html5 such as data listing, and text content driven apps. I have written a writeup on HTML5 vs Native on my blog. Hope its useful.

phoneGap/Titanium developing

I was looking into PhoneGap and Titanium framework, and I did not clearly understand how to they work, let's suppose I have already developed an app for android or iphone, can I run this app on another mobile with a different OS with PhoneGap or Titanium help?
Or I have to develop again my app with PhoneGap/Titanium framwork?
In this case I have full support at all the features like thread, JSON or XML parsing and so on?
Thank you
PhoneGap basically takes a client-side web app (HTML, CSS, JavaScript) and wraps the whole thing in a native device's web view control. You can hook to some of the device's native functions, but as you can guess, it's pretty limited compared to native development. But easy, and brings in a whole range of skills that a lot of people already have. That's really the appeal of PhoneGap.
Titanium is also html/javascript oriented, but it actually claims to compile to native code. Their sample "kitchen sink" app demos quite a lot of the native APIs, at least for the iPhone. I doubt you'd be able to deal directly with threading, but JSON for sure, and I'd think XML as well.
Titanium has full support for JSON or XML parsing.
You can see Titanium examples - Kitchen Sink - for more details.
The idea behind phone gap is that you can take a browser based client app that is written in html/css/javascript and use phonegap to gain access to some native mobile hardware like contacts, gps, accelerometer, etc. Phonegap allows you also to build this web app for different mobile devices all using the same web app code.
To answer the first part of your question, no, you would not be able to take a developed app and use PhoneGap or Titanium to run the app on another device.You would have to write the app in either the PhoneGap or Titanium Framework and then build the application to the devices you want to support through the tools that each give you.
For example, you would write your code in JavaScript(Titanium) or HTML/CSS/JavaScript(PhoneGap), then use the app's build tool to create the file that would be released onto the phone.