Write ONE code-base for Mobile and Desktop? - android

I am interested in writing a single code-base for an application, that will work across iPhone, Android and Blackberry mobile devices as well as on desktop browsers like Firefox, IE and Chrome.
Is this possible or I am just dreaming?
Also, another limitation I have, is that I want to use a .Net programming language for this app in combination with HTML5, jQuery and CSS3.
Technology changes very rapidly nowadays by every month, and I was wondering if this is possible now in Nov, 2012. I knew it was not possible in May, 2012.

You can use:
PhoneGap
Appcelerator Titanium

Yes they will render Html Table's fine.. There is really little limitation if any when using html. The only restrictions are if the browser supports Html 4.x which most now support HTML 5 so you will be alright. Your CSS will be the main thing that determines how the items are rendered on different platforms nothing else.

Depending on what you want to do, you can always use C. A library function written in C can be accessed from within Objective C on the iPhone, via JNI on Android and via CGI or most server-side scripting languages on a webserver (Ruby, PHP).
I dont know of any library that would generate user interfaces for all these platforms and I dont think that would even make sense because user interaction will be so much different.
In case you want to create a game, have a look at the Unity Game Engine which runs on a number of different platforms.

Related

offline HTML5 or native SDK for cross-platform app development or JQUERY mobile

I am planning to build an app for selecting things from a menu and manipulating with it. I was earlier thinking of learning java and build on android, but then I came across HTML5 and JQuery mobile.
Can anybody guide me what should I start learning? I am planning to build a simple app. I just want a good GUI and want to write once. That's why I thought I'll work on HTML5 and then store it locally and open it in webview component of different platforms. So I will write once and use it on all platforms.
Am I going in the right direction?
Also tell me the difference between HTML5, JQuery and Phonegap
I'll go through each of them in plain English.
Phonegap is a set of API's to do things such as take a photo using the phones camera, use the devices accelerometer, geolocation etc..
Basically, it is a way of communicating (through javascript) between your application and the device. For example, to take a photo (open the camera) using Phonegap you would do something like:
navigator.camera.getPicture( cameraSuccess, cameraError, [ cameraOptions ] );
This is in essence no more difficult than opening the camera in a native device language (ie: Objective C for iOS), but the beauty is that this piece of code would work on multiple device platforms (there are one or two little tweaks you have to do per device, but it is basically write once and use multi platform). So that's what Phonegap is. It is a bunch of API's to communicate with multiple device platforms using the same code.
jQuery, and more specifically in your case, jQuery mobile is a javascript library used mostly in user interface design (as well as Ajax). It makes it easier to perform animations (things like an image fading in, or moving across the screen), event handling (what happens when a user clicks, hovers, focuses on, an image or button or any element). For example, look at the following piece of code:
$('.mybutton').click(function(){
$('#myelement').fadeOut(500);
});
Those 3 lines of code fade out a specific image when a user clicks on a specific button in 500 miliseconds. Short and sweet. So that's exactly what jQuery is, a library that makes creating a nice UI easier.
jQuery mobile is (as the name suggests) aimed at mobile platform development. So besides the animations and events of jQuery, it includes functionality for touch and gestures (swipes etc..), as well as a great framework for handling pages and navigation within a mobile application.
HTML5 is the latest generation of HTML which is designed to provide a comprehensive application development platform for web based content that eliminates the need for 3rd party plugins like flash or java. Audio visual playback, drag and drop, local file storage with webSQL, and of course the canvas element for advanced drawing and animation.
Basically it's just the new version of HTML which allows a lot more modern functionality.
Are you heading in the right direction? Yes, you definitely are. While learning a mobile platforms native language has its perks and is well worthwhile, a lot of developers are turning to more universal platforms such as Phonegap.
A great place to start is right here (StackOverflow), and I would definitely suggest having a good read through the documentation for Phonegap and jQuery Mobile and playing around with some of the demos.
Here are a few useful links on the subject:
Questions and Myths About PhoneGap
Intro to Phonegap
jQuery Mobile: What Can It Do for You?
What is HTML5? (video)
Good luck and have fun
Html5 is the raw information. Jquery (a part of Javascript) codes the interactive elements. CSS is the design. Keep them all separate, web standards etc.
These technologies work for web-browsers, but non web-browsers cant read this code, like app stores etc. Phonegap packages this code so can be read on other platforms. So rather than redoing the code many times - write once publish everywhere, or somethign like that. It can be seen in this picture:
Phonegap is a framework which allows you to develop your application using HTML5, CSS and JavaScript and package it as a native app for each of the major mobile platforms. In theory you could write the application once and target the browser as well as the major mobile platforms (using Phonegap) with the same core codebase.
jQuery Mobile is a mobile development framework, built on HTML5, CSS and JavaScript which can be used in conjunction with Phonegap to build mobile apps. It provides a customisable, mobile-optimised user interface (think pages, headers, list items, form components) and a system for navigating between the pages of your application.
jQuery Mobile is dependant on the jQuery library which aims to make client-side scripting easier by papering over many of the browser inconsistencies which can make writing JavaScript difficult. It's particularly useful for selecting HTML elements and traversing the DOM, and is in use on 50% of all websites according to this survey.
Based on your description of the application and your stated desire to write code once which will run on various platforms, I would say that you are definitely on the right track.
Since it is built on these technologies, I would suggest you begin by trying to get a solid grounding in HTML, CSS and jQuery before looking at jQuery Mobile. I think you can probably ignore Phonegap for now safe in the knowledge that when you've built your application using the above technologies, you will be able to use the framework to package your application for the platforms you plan to target.

Unified UI between mobile devices

I want to know if there is a Unified UI framework that I can use when creating a mobile application that can be used between iOS, Android and Windows Phone OS? I have never touched HTML 5 but I heard one can create complex UI so that it will look more or less same across these platforms. My idea will be to create one application, have a generic framework that can be ported easily.
EDIT:
Just found this site http://en.wikipedia.org/wiki/Multiple_phone_web_based_application_framework
There are lots of platforms, Corona, Titanium, PhoneGap and of course HTML5 to name a few. This does put limitations on performance and on the features that you can take advantage of. I'm not sure if any except HTML 5 supports Windows phone, but they all support Android and iOS.

Android, Windows Metro apps and Windows Desktop

Hello everyone and thanks for viewing this question :)
I am an indie to-be-developer and want to make apps for android, windows 8 desktop and metro.
After having read through a lot of forums and blogs, I believe that perhaps to make the best looking(native-feel) apps I have to learn
Java for Android
HTML,CSS and JS for Metro
Something else for Windows desktop
What I need your help in is, whether there is any one particular language which I should start with which will make my journey better ?
By app I mean something to do with sharing and transferring of files.
P.S. Read that Python might be perfect !
Do you agree ? Please suggest something.
As Tanis alluded to, you'll need to determine where your goals are in terms of "rich functionality versus maximum reach" - and from your "best looking (native-feel)" comment, I'd say you're leaning toward "rich"
Pure HTML5/CSS/JavaScript will give you the greatest reach because of browser ubiquity, BUT you can still use HTML5/CSS/JS for native development for modern Windows 8 applications and via PhoneGap for Android and other mobile devices. Having one code base AND supporting native features across those platforms would be difficult, if not impossible, but with the right design and architecture you should be able to get a great amount of reuse of your HTML/CSS/JS assets.
Another option, since you've mentioned Windows Desktop as well, is to use WPF and XAML with C#. You can build native Windows desktop applications with it, and those same technologies (XAML/C#) are one of the three primary development options (along with HTML5/JS and C++/XAML) for modern Windows 8 (nee Metro) applications. For the Android piece of it, Xamarin's Mono for Android lets you reuse many of your C#/.NET assets for deploying native applications to Android (and they have MonoTouch as well to add iOS to your arsenal!)
As for Python, productive and powerful language, and great for backend services - like the plumbing for sharing and transferring files - but it wouldn't be my tool of choice for building mobile apps.
If you want the highest level of cross-platform compatibility, a web-app (typically HTML, CSS, and JS) would be best. Making a web app will help ensure that your app works on nearly every device with a web browser, and you only need to maintain one code base.
The trade-off is that you often lose some features, such as the use of some of a phone's sensors.
If you want to make native apps for each, then I would suggest Java (particularly for Android) or C/C++ (particularly for desktop environments).
Python is an excellent starting language as well (and codeacademy has some great tutorials), but isn't as directly applicable to app development as Java or C/C++.

Is PhoneGap the right choice for me?

I am new to PhoneGap, and I have several questions:
I need a way to develop an application that will have iOS, Android, and other platform compatibility. In other words, I want to write 1 app and get compatibility versions for different platforms.
By reading the "Get Started" guide linked by the PhoneGap website, I found there are different procedures for different platforms. So to have compatibility versions across platforms, do I have to go one-by-one and change all of them if I make a modification to my app?
Also, what exactly is PhoneGap Build? It seems like I can avoid all that hassle mentioned previously and toss my app into the PhoneGap Build? Do I really not have to do anything besides writing the app? What if I need to make changes?
And finally, I've read that PhoneGap works with HTML, CSS, and Javascript, but not PHP. What if my app needs to contact a server? Can PhoneGap handle that?
Thank you for bearing with all these questions!
PhoneGap achieves platform compatibility by embedding a webview within your application. Therefore you can apply your knowledge in HTML, CSS, JavaScript and it additionally provides ways to interact with native features (e.g. camera, gps, ...).
With PhoneGap you write one general web app, tweak parts for the specific platform (sometimes you do not have to this at all) and build it for that platform. The latter can be handled with PhoneGap Build service: It takes your webapp and bundles it for the mobile operating systems out there (Embeds it within a Java app on Android, an Objective-C app on iOs)
PhoneGap is able to communicate with a server hosting a PHP script just as every other web application. Trying to dynamically load resources from remote sites can be quite a hassle but this is another question.
traumalles is correct. All your HTML/Javascript/CSS is running from within a webview on the device. Your code is, therefore, all "client-side." You can communicate with a server just like with any other page. When they say PhoneGap isn't compatible with PHP, they mean only that PhoneGap can't execute PHP code like it's a server, because it's not. It's just loading your webapp in, basically, a browser.
One other important question is what exactly do you mean with "other platforms" phonegap does provide many functionality for nearly every platform but the different webbrowser of the mobile devices have their problems and limitations.
For example are there many problems if you want to provide your application on a WindowsPhone Device because the Webbrowser has a few limitations which will cause your app to not look and behave like a native app.
Just look a bit through the phonegap API you will see that some functions are just available for IOS or for Android and there are a few only Blackberry methods and so on.
So you really have to be careful when a framework tells you it will work on all devices.
So i really don't have a problem with phonegap i worked with it very great but there will be limitations you have to deal with.
If you primarily want to develop for IOS and Android you can really achieve great native like results !

developing smartphone apps using Rhomobile

I have been developing an Android application for about two months now, and the guy I'm writing it for wants me to use this instead of the android SDK so we can deploy the application for multiple smart phones: http://rhomobile.com/
he says you can write the application in one language and it can be deployed for most smart phones. Has anyone used this website to do something similar? Any advantages or disadvantages I should know about and tell him? Maybe someone could give me a better explanation on what this really does.
I'm current a one man army. He wants the application out for most smart phones but can afford to hire more developers.
Rhomobile will start up a small webserver on your phone and then show a webview that is directed to this webserver. You are able to write all the application logic in ruby in a way you would do it if you would write a web app that is deployed on a real web server. Rhomobile uses CSS etc. to have the app look look a little bit like a native app.
If you know Ruby you will get an App fast but it will look crappy and the user experience will be crappy too. A similar framework is appcelerator titanium they will let you write the app in Java Script and then compile it into a mix of javascript, webview and native components that run on an Iphone and on an Android phone and titanium has a much nicer user experience then rhomobile.
Visit their pages and test some of the apps that they are promoting as showcase for their frameworks.
As many developers writing apps in Objective C have learned using HTML for the view and styling with CSS styling libraries is a great way to create attractive native apps. Rhomobile's Rhodes uses this approach as well. We used to let people use whatever CSS they wanted and they could choose to use IUI, JQTouch, IWebKit, WebApp.net or any other library along with Rhodes. The best external apps all seemed to use JQTouch for styling and animated transitions.
Recently we decided to ship with our own fork of JQTouch (which we made work on Android) in order to make this even easier. The recent Rhodes master branch created apps with JQTouch builtin makes such attractive apps even easier to build, as the stylesheets are included with Rhodes scaffold-generated apps.

Categories

Resources