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

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

Related

Reuse code in iPhone, Android and a Web applications

I'm about to develop an app for iPhone, Android, and for web too. I think there must be some "standard" way for doing this, in order to reuse as much code as possible.
Which is the best way for doing that? Webservices? (only if the app uses internet) Maybe an API? Another way?
Just for the record, the web application will probably be developed in Ruby On Rails 3.
Thanks!
There are a few cross platform development tools out there that let you write once and compile for multiple platforms. I know I've seen questions on both tool here on SO, so others might have some good advice on these specific products.
PhoneGap
http://www.phonegap.com/
Appcelerator
http://www.appcelerator.com/
Barring that, if you are looking at doing native development on each platform, the web services APIs are a good way to go. I've built an App that is heavily data driven, and I built out RESTful services over JSON that do the heavy lifting for the iPhone, Android and Web versions.
There still is quite a bit of work that goes into implementing a feature on each platform, but once I architect code on one platform the hard, creative work is done and it's just porting it to the next platform (Same applies, mostly, to the graphics as well). Since I am coding for each platform individually I do try to take advantage of both code and UI conventions for that platform to give the user a native experience (say building menus for the menu button on Android, something not supported on iPhone). To me that's a benefit of developing for each platform individually, however, it also greatly increases time to market for each version.
Since you're looking at Objective-C, Java and Ruby, 3 completely different languages, there's not an easy way to develop a shared library without using a intermediary layer like those linked above.
Well, all three are different languages, so anything you write for one won't work for the other. An API on a server may be able to get you the same data to all, but its highly unlikely that you'll get any reusable code. I'm doing the same thing, and realize that, so I am just sharing common things such as UI and code-design between them.

Developing mobile C# app to run on multiple platforms

We have an line-of-business app that runs on Windows Mobile. It's a Winforms app with a local SQL CE database and gets its data from a WCF Web Service running on the server.
Now customers are always asking "why don't you make a version for iPhone/iPad/Android/Phone 7 etc". My boss asked how hard this would be. My initial answer is very hard especially since I would probably be the only person doing the work. I don't have any experience outside my Visual Studio happy place.
Now I've come across MonoTouch and MonoDroid. They appears to offer an easy solution but I'm sure there are lots of issues. I doubt that I will be able to just compile my app for Android.
I'm inclined to suggest that it would be far too much work and that the only realistic solution is a mobile web site with several versions of each page for different screen resolutions. Unfortunately the existing app has a local database and is "sometimes connected" so that won't cut it.
Any suggestions and tips before I waste a huge amount of time?
Cheers
Mark
I doubt that I will be able to just compile my app for Android
That is correct; you won't.
So, background: the design philosophy of MonoTouch and Mono for Android is to bring the "core" .NET and C# experience to iOS and Android while also exposing the underlying features of each specific platform. Whereas PhoneGap and Titanium abstract the underlying platform (for a "write-once, run-anywhere" vibe), MonoTouch and Mono for Android provide no platform abstractions and directly expose the underlying platform types and members.
The result is that MonoTouch programs use MonoTouch.UIKit.UIButton, which directly wraps the underlying CocoaTouch UIButton type.
Similarly, Mono for Android programs would use Android.App.Activity, which directly wraps the underlying Android android.app.Activity type.
Common across both platforms are the "core" framework namespaces and types which you find on .NET, .NET CF, Silverlight, Windows Phone 7, and Mono: System, System.Collections.Generic, System.Linq (yes, Linq-to-Objects), System.Xml.Linq (yes, Linq-to-XML), System.IO, etc., etc. For example, see the assemblies included in Mono for Android.
So, can you use your existing Windows Mobile app as-is on Android? No, because Mono for Android doesn't provide System.Windows.Forms.
However, it should be possible for you to refactor your existing code to follow a Model/View/Controller design pattern (or MVVM, or...), abstracting away the UI (View) so that you can replace it for various platforms, e.g. an iOS UI with MonoTouch, a WP7 UI with XAML, an Android UI with Mono for Android, an HTML UI with ASP.NET MVC, etc., etc. You won't get a "write once, run anywhere" experience, but you will be able to provide the user with native user interfaces which are consistent with their chosen platform.
For example, see the MIX11 Conference Apps, which utilize a common code base while providing platform-specific UIs for iOS, Android, and WP7.
look at titanium and phonegap.
My suggestion is to have a quick look at WP7. It's quite easy to jump in to, even more so if you have Visual Studio (which you do) and C# experience of any sorts. Then you should be able to more easily guesstimate how long it would take you to develop a C# application (and possibly port that to Android using MonoDroid).
And yes, Titanium & PhoneGap are options, but I personally think MonoDroid looks better.
What platform are you getting the most requests for? I am guessing Android, as that seems the most likely. I have seen a lot of people saying MonoDroid is really solid.

frameworks choosing strategy for multi platform webapp

Issue
What is your strategy for building a desktop-like webapp that needs to be deployed to desktop web browsers and on mobile devices(Android, IPhone, etc)?
A course of action could be to firstly select the best framework for building the part that runs on computers(i.e. not mobile devices). Being a desktop-like app, a good candidate framework is GWT+ExtGWT since it provides:
Java-based development which is much scalable/solid than developing in Javascript via ExtJS for example
Good debugging
Good testability
Next, you'd want to deploy this app on mobile devices too. So how do you go from here? Write a separate implementation(separate from GWT) for Android, another one for iOS(in objective-c), another one for Windows Mobile, and so on?
Related
Related to above, I saw the presentation of PhoneGap which claims you develop in Javascript+HTML and it generates code for all mobile platforms: Android, iOS, etc.
However, PhoneGap is not an option since I don't think it integrates well with GWT and more important, it doesn't generate a native app which can take advantage of features like backgrounding, services, etc(see http://www.youtube.com/watch?v=xHXn3Kg2IQE for why native Android apps are much better than browser-based ones). There may be other frameworks like PhoneGap out there that I'm not aware of though but at this point I only see:
one implementation with GWT
one implementation for Android
one implementation for IPhone
and so on ...
If you are already planning on developing for multiple platforms, it is a good idea to at least consider cross platform frameworks like PhoneGap or Appcelerator. Beyond the fact that you are developing for multiple platforms there are a couple of other important questions to consider.
Do you want a web version as well?
Do you need intensive graphics support?
Do you have loads of money to target multiple platforms?
Do you have loads of time to target multiple platforms?
You also point out two more great questions to consider in debugging and testability. In terms of unit testing, any native platform is very difficult to unit test. Debugging is pretty easy for most native platforms.
Regarding PhoneGap, it is important to know a few things about it.
You can write PhoneGap plugins. A plugin is essentially native code for any given platform that can do pretty much anything you would want to do in native code -- background services, opengl, etc -- and make it accessible to JavaScript in the web view.
There are several open source projects that you might be very interested in such as GWT-PhoneGap, QUnit for JavaScript unit testing, and Weinre for Firebug like debugging.
Hope that helps!

Make Phone Applications Across All Operating Systems [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Write once deploy on Windows Mobile 6, Windows Phone 7, Android and iPhone?
Currently I have created a 2 simple apps for iphone and 1 for windows phone. When I go to promote these apps they usually....well do you have this for android or blackberry or whatever.
Do I have to rewrite my applications in every environment in order to have them compatible across all the operating systems out there? Is there tools that address this or do you guys simply recreate the app in eclipse, xcode, visual studio etc..?
Complex applications generally need to be created with the native environment.
Simple applications can be created with cross platform tools like Titanium and PhoneGap:
- http://www.appcelerator.com/
- http://www.phonegap.com/
#Fraggle (see comment)
I have quite some experience with Appcelerator Titanium. The choice for native v.s. cross-plafrom completely depends on the kind of application you need and your knowledge. General considerations:
Can the application be created with web technologies like HTML, CSS and JavaScript?
What language / environment do I know the best (native vs web technologies)?
How much time and money can I spend?
Do I really need cross-platform compatibility?
Most mobile phone applications only provide an easy interface for internet services like news updates, traffic info, social media and video. Those applications can be easily written with web technologies. Therefor most mobile applications can be written with tools like Titanium. The great thing about Titanium: Get the native experience on multiple devices while only maintaining one code-base. Cheap way of developing cross-platform applications.
Many developers use Titanium because they don't know the native language (objective-C / java), but they have extensive knowledge about web technologies. This way they can create pretty nice applications without learning new languages. Titanium is actually used for many non-cross-platform applications.
Complex graphics, device specific tools and complex interfaces still require the native environment.
Native applications will always perform better and use device specific features, but do you really need that degree of perfection? Yes, develop native applications for every device. No, simply create one cross-platform application.
Check this page to see what Titanium can do:
http://www.appcelerator.com/showcase/applications-showcase/
You may be able to use a third party tool like http://www.phonegap.com.
There are many options for cross-platform app development, but I would suggest Adobe AIR as it is also supported on the Blackberry Playbook by RIM. As far as I know, it's the only cross-platform runtime that is supported by a major platform owner.
I have also seen it do well on Android, and iOS support is also advertized.
Well there are definitely some supposed "write once, run everwhere" solutions out there. Here is one from RhoMobile which specializes in this space. But that is just what a quick Google search turned up. I haven't tried any of them.
I had an app that was developed for Android, and I ended up essentially re-writing it in Objective-C when I wanted to port it over to iPhone. It worked out pretty well and took less time than I thought (considering I hadn't done any iPhone programming prior). But now of course I have 2 code bases that I have to maintain and when I add features I'll have to do it for both the Android and iPhone version.
So having a single code base that lets me build apps for multiple platforms would be great. Do any of the tools out there work well? Not sure. Do they give you full control to make your app look and operate the way you want it, and make us of all the OS's features? Not sure.
Qt (now owned by Nokia) is another provider of a cross platform mobile framework
http://qt.nokia.com/
Even though iphone and android seem to be missing from their official Supported Platforms list I think there is an Android 2.3 release just around the corner. Qt for Iphone also seems to be in the works.
HTML5 may be one solution if the app you providing is simple enough. Google is doing it this way. Otherwise, even you have anything "cross-phone" it may still feels alien.

What can be achieved in a native mobile application that can't be done in a HTML5 web app?

I've talked to a lot of people recently who say they are expecting to stop writing native mobile apps and start writing web apps once HTML5 gets more fully baked in mobile OSs. I just finished my first HTML5 deep dive, and I'm not yet convinced.
Will HTML5 work as a replacement development platform for native apps, or are there certain things that require targeting the native runtime?
HTML 5 is not magic. it adds a lot of long awaited functionality to HTML and to traditional web applications, but still - many things are still out of it's scope.
for example:
accessing your contact list
getting bluetooth data
making use of an OS specific function
for those (and other) functions - you would still need to write vendor specific applications.
One thing which necessitates the native app is the access to more features on particular mobile devices; it's not guaranteed that that all the features of the device is exposed via javascript interfaces to HTML5. In that case, you are forced to use whatever native APIs available.
In short, no. HTML5 provides an appropriate toolset for a large range of applications, so I see it growing popular in this arena (for portability reasons). I except there will always be application developers (and users) that prefer the native look and feel though, and there will always be scenarios in which bare-metal coding is required, or a 3D engine is more practical to utilize using system level API's.
HTML5 is a compelling technology stack though, especially when coupled with some cross-platform API management (e.g., PhoneGap).
Native applications will continue be able to use new device features first, before they are eventually supported up through to the browser so for cutting edge development, native will still be the way to go.
There is also an issue with discovery - right now users are accustomed to using apps and can find them in their devices app store. Searching for a web app seems unnatural to a typical user and that wont change any time soon. That's why a lot of apps that would seem to make more sense as a web app are still being produced as native apps.
Conclusion: Native apps will continue to be necessary, but mobile web app development will grow and may well replace more native app development as time goes on.
It will make some native apps unnecessary but not all of them. Not really much more to say about it :)