PhoneGap vs. Titanium - iphone

PhoneGap and Titanium allow you build native iPhone Apps based on HTML and JavaScript.
Has anyone gained experience with both? What are the differences?

There is a pretty lengthy discussion about PhoneGap VS Titanium (and Corona) on StackOverflow already that might be useful.
One of the big differences is that PhoneGap is MIT licensed and Titanium is (just recently changed) Apache licensed.

This article is a good summary of the practical and philosophical differences. Note its from an Appcelerator evangelist, but I still think its pretty impartial. In fact I think he shares Titanium more warts that I probably would :).
http://developer.appcelerator.com/blog/2012/05/comparing-titanium-and-phonegap.html

It's probably worth following the current Apple/Adobe spat, in which Mr Jobs has put the future of products that aren't written in language XYZ in the balance. OS 4 SDK states:
Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).
I believe Titanium is affected by this.

Well..! this is not certain that which is better to implement the project.
Both technologies are new and having their pros & cons as well.
Titanium says to keep native environment with the help of java Script Based framework, on the other hand the phoneGap provides everything inside the WebView, you only need to put your web based project having index.html inside the WWW folder, found in the project directory structure of the Project.
So if you comfortable with Web Works, phoneGap is suitable in this case otherWise you should go with Titanium.Its easier to use and fully facilitated.

Unfortunately Titanium is not opensource anymore. You can develop apps freely but You have to buy Indie account to publish an app to appstore which cost some money.
PhoneGap is a free and open source framework that allows you to create mobile apps using web APIs for any platforms (iOS, android,windows, Blackberry etc) you think of.

Titanium: Is a cross platform, where in the code you write in JS and Titanium API's will be converted to native code and look and feel of the app will be same as native apps.
PhoneGap: Is a hybrid platform, where in you write the code using web technologies like JS, HTML and CSS. Which uses web views present in the native devices to render the UI. Look and feel is not same as native apps.

Related

phonegap vs objective-c web-kit

Can somebody tell me what are pros and cons when developing with phonegap or objective-c and web-kit. In other words, if you want to develop (html,css,js) based application is it better to develop it in phonegap or in objective-c with
First, google "Native vs web-app". There are several good guides and comparisons out there, and much of what you will do in phonegap is in the web-app domain. The pros with using web-technology is that it is easier to port to other platforms, it also lets you use HTML, CSS and Javascript some Apache declarations and other snacks that probably will be relatively stable in the years to come instead of learning Objective-C, Java and a lot of APIs. One of the great things about native apps is speed (perhaps not the biggest issue for most applications), it is also some functionality which can't be achieved through the browser or web-app runtime (that's where Phonegap tries to fill the gap). Also, the developers of each of the various mobile-OS make a lot of convenient shortcuts and tools which you perhaps would have to emulate through web-technologies.

Mobile App - Targeting iPhone, WP7, Android, and Blackberry

Is there a sane way to develop a cross platform Mobile app? We want these to be native apps on each platform, and not necessarily some kind of web page.
Currently we're thinking to split it into two languages:
C# backend (business logic)
--> Standard C# app for WP7
--> App built on MonoTouch for iPhone/iPad/etc.
Java backend (business logic)
--> Standard Android Java app (MonoDroid version of C# not ready
yet)
--> Standard Blackberry Java app
We could also develop initially in C# and use one of the conversion tools out there to get our C# converted into Java as a starting point.
Is there another approach? Our skillsets include mainly include a strong C# .Net background, and minor Java experience.
We don't really want to go low level and use something like C/C++ to get the job done. These are usually going to be simple LOB applications that communicate to some web service.
Side Question: how do game devs like the makers of Angry Birds do it?
UPDATE:
MonoDroid is now officially released. So it seems you would only need to use Java for the BlackBerry. We are considering not developing for BlackBerry at all, because developing for the other 3 platforms has been simplified. There is definitely some cost involved, as MonoTouch and MonoDroid are both $399 and you would also need a license for Visual Studio (this doesn't include cost for App store, etc.).
There's no good simple answer that I know of for all mobile platforms. You can use development environments like Appcelerator Titanium, which cross-compile to native code on various platforms (right now, for instance, I think Titanium supports iOS and Android, with plans for Blackberry). However, these usually have a limited API that you have access to, and you still end up needing to design different UIs for the different platforms (in my commercial work, I have never successfully used such a platform)
You could also design all the business logic in a web-services back end, and then just write "thin client" apps for each platform. This works, but of course requires network access when the end user wants to use your app. (Usually it'll be there, but sometimes may not)
Ultimately, I usually end up doing what you propose -- writing the basic business logic in a couple of different languages as generically as possible, and then bundling that in with custom UI/device code for each platform. Haven't found a better way myself....
(BTW, I believe games like Angry Birds are written largely in OpenGL and then loaded onto the OpenGL processor on each platform. But I could be mistaken...)
Those are some great answers. I agree, x-platform development is still very primitive. I'd like to add 2 points:
1) You do not need to write your backend in different languages. Choose one language (based on your comfort level, performance etc. criteria) and then connect from your platform-specific apps directly to the backend. If your backend is server-side code, one way of talking to it would be via XmlHttpClient. If it's a piece of native code common across various apps and is written in say C++, you can use JNI from Java and wrapper assembly from C#.
2) Another reason for avoiding x-platform tools is that you'd always need to wait for them to support the new APIs released by the platform vendor (Apple, Google, MSFT etc.). Once these companies release new APIs, the tools will need to be updated and only then will you be able to use the new APIs.
I don't think this is (easily) possible, if you're not using some HTML5 (jquerymobile etc.) in a WebView in your own app (looks like a real app, but still you will somehow see that it's not) instead of the normal browser. You can still use some native API from the device (accelerometer,...).
There are (commercial) platforms like Sybase Unwired Platform that help you in generating some client code. Afaik for Blackberry and Windows Mobile even some UI can be generated out of the business objects on the server. But to me it sounds that this might be too heavy-weight for your case.
Regards,
Martin

How do cross-platform mobile app development frameworks work?

How are Rhodes, Phonegap, and Appcelerator able to take Javascript or Ruby, and compile them into binaries for app SDKs that normally require apps to be written in Obj-C, Java, and others?
Jeff Haynie, Appcelerator co-founder, explains how Titanium Mobile works here.
Phonegap uses the default browser rendering engine, and uses that to display your application.
The javascript is then handled by the native (compiled) part of the framework.
Appcelerator uses something simular, but compiles the whole application if i remember correctly.
MoSync uses a somewhat simular setup as javaME.
Rhodes uses local server. It uses this to communicate with the device.
A Javascript interpreter is built into the webkit browser engine, and the iPhone/iOS SDK gives enough access to this interpreter to run nearly an entire app written in Javascript, with just a tiny Objective C wrapper to start things up.
Android supports native ARM machine code though the NDK, so nearly any language with a compiler that can create a stand-alone ARM binary (but requiring little to no OS access) can be used as a library and accessed via the NDK interface from a Java app stub.
I've created an open source project http://propertycross.com that helps select a cross-platform mobile framework by showing the same application implemented with Sencha, Titanium, Xamarin and more. The project also includes details of how each framework works. It should help you compare end-user experience, code, developer experience and code shared between the various options.

Is there a way to develop a cross-platform app for iPhone/iPad/Android? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Technology to write iPhone, BlackBerry and Android phone at the same time?
Edit - guys, we need one more vote to close this. This question is a dup (read the comments)
I've heard that Apple banned such tools. Ok, so Apple lifted their ban in September. Still, the question holds - is there a sane way to develop apps to these two platforms without writing nearly everything twice?
Is there something I'm missing, or is the current state of affairs really that every company that develops a cross-platform legally has to maintain two code bases?
Apple reversed their ban in early September after receiving some pressure from the FTC and EU. However, unless you plan on using a third-party tool such as Adobe Flash Pro CS5 (I believe you can create AIR apps that will run on Android this way, as well as the much publicized iOS functionality), you'll have to maintain two codebases anyway, as Android apps are written in Java and iOS apps in Objective-C, two vastly differently languages with vastly different APIs.
You can always use standard HTML5 technologies to make a pure web app. Apple has two tracks for apps: native apps through the App Store written in Objective-C, or web apps that have only the restrictions of the underlying HTML5 technologies.
If you don't like pure web apps you can even merge the two and make a custom app that displays heavily customized web-like content in an embedded browser view (UIWebKit on iOS). Android and iOS web browsers frameworks are from WebKit and very close in features/appearance/conformance.
Instead of starting from a viewpoint of "I can't do X on Apple's closed iOS" start with "Can I do this in any supported application technology, even if its web-based or a web app hybrid, available across all platforms?"
I've done some research on this recently and have found a few companies that can to do this for you.
Appcelerator Titanium Mobile. They make a product that allows you to write your code in Javascript. I've found that the business logic, like networking, files, etc are write once, but the UI has quite a bit of if(android) else \iphone logic to get right. Apps will look native.
FeedHenry. They are more of a HTML based solution, but have a broader support of devices. More than just iphone and android. The sdk is still pretty early, and work can only be done in their special ide that is web based.
Phonegap. A javascript/css/html based framework that targets the iPhone, Android, and the Blackberry.
There are plusses and minuses to all of the solutions. Depending on your app's complexity, it may be a good decision to pick a platform like those to develop on. Coding an app could be much faster if the features they support are right for your app. Right now, it seems that they are all in early release phases and don't support a full toolkit that a developer would be used to, like a debugger, full IDE support, etc. Also, many of them build to a lowest common feature set, so you may not get all of the new release features as they come out, you would have to wait for a particular version of the platform to be released in order to have them.
XMLVM: Android to iPhone
XMLVM can translate your Android code to Objective-C for iPhone. But as what I know you still need a Mac to compile the iPhone application.
Android has the NDK (native dev kit) to allow C and C++ code to be included in APKGs and called from Java via the JNI. Apple's toolchain will also deal with both; the code that will be different will be the platform interface code, mostly in Java on Android and ObjC on iOS.
This is only useful when the bulk of your application is in C or C++.
An alternate would be to go with MonoTouch and the upcoming MonoDroid, if everything works out you could basically code C# on all platforms including of course Win7 Mob.
It looks promising but haven't tried it myself yet.
In September, Apple lifted some of the restrictions in the iOS license that had made it difficult to do cross-platform development. See this press release. I'm not familiar with the details of the current license, but you can get a copy through their developer program.
Another possibility that would be the Rhodes framework, if you like MVC, ORM, and Ruby.
take a look at the System.getProperty() values with android the vendor shows as The Android Project. I haven't looked at the iPhone or the IPad since I don't have one but hopefully they have something changed for their's too. But this will only work with java that I know of.

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.