Ubiquitous framework to target multiple smartphone OS? - smartphone

Is there already a ubiquitous/general framework to target multiple smartphone OS, i.e. like a QT for Android/iPhone/Symbian? Or would be technically too hard to write such a framework?

Technically it would be pretty much impossible (at least very difficult).
The first problem is that the mentioned platforms don't share a common language, so you wouldn't be able to directly share source code. Second is that your abstraction layer would have to be so big that it would probably kill performance.
The closest thing that I'm aware of is something like OpenGL es (you can almost copy & paste OpenGL code across platforms).
A more realistic option is targeting the web layer with an HTML5 application.

Phonegap if it fits your needs. Packages a web app with limited access to device services as an installable.

Related

What is the difference between a cross-platform and platform-independant framework? Particular case of the Qt application framework

I am a novice runner in Qt. Reading what Qt it is, I get confused in the meaning of some terms in web sites. Indeed I meet the term cross-platform framework, often platform-independant framework. I'd really like to understand the difference between these two group of words.
In the specific case of Qt, it is said that it is a cross-platform application framework
Please, Let me give you my thinking. I'd like to confirm that by someone else.
By Qt is a cross-platform framework, I myself understand the Qt source code is the same for each OS (Windows, Linux, Mac OS ...), but compilers used to build the source code which are different depending on OS. Is that true?
Contrary to a framework like java, that is an independant-platform since compiler is the same on any platform or OS.
Please tell me if my understanding is right/wrong about Qt and the meaning both a cross-platform and an independant-platform framework.
Whether I'm correct or not, I tend to think of it like this:
multi-platform: Different versions (possibly with different codebases) exist for more than one platform.
platform-independent: One codebase exists that tends not to rely on any platform-specific features or libraries, so should work on many different platforms without (source code) changes. The code might rely only on the language features and standard library, for example, so is very generic.
cross-platform: One codebase exists for more than one platform, but it may sometimes use different sections of platform-specific code for different platforms where needed.
I don't think people rigidly follow any specific definitions for these terms, though, and often see them used interchangeably.

Does Qt have general-purpose classes besides GUI-related classes?

I have recently regained some interest in learning Qt, but have the following doubt:
Does Qt have enough classes that are not GUI-related?
For example, Python is "batteries-included", .NET is definitely "batteries-included", and as far as I have seen, Android API also has a lot of classes to design and implement application/domain logic, not directly related to visual presentation.
The main reason I am asking is because I don't know C++ and don't plan to learn it deeply (too much time needed), so if I had to take third party C++ libraries all the time and struggle to use them inside Qt projects that would be a strong point against going ahead.
The intended use is mostly to create small desktop apps for personal use while gaining insight on software design good practices - a profession I am slowly migrating to.
I have already used some Python/Pygtk (without IDE) and WPF (in VStudio/ExpressionBlend). In both platforms, most of my work is related to scientific computations, image processing and interactive scientific visualization, and there are good libraries for that either in Python (Numpy, Scipy, Matplotlib, Pandas, PIL, cairo) and .NET(AForge, alglib, System.Media.Media3D). I wonder if the Qt ecosystem is so complete in that regard.
Qt isn't a language in itself, so you can't compare it to Python or .NET. With that being said, Qt does provide general-purpose classes like containers, a Unicode string class, character set encoders/decoders, multimedia, device and file I/O, etc. All these modules are fully documented.
There are also some external modules available for Qt, like Qwt which provides widgets for technical applications.
For other functionality where something Qt-specific isn't available, you can obviously use another appropriate library. Like OpenCV.
Oh, and you can use Qt in Python too, through PyQt.
As far as I know, Qt doesn't have image processing libraries. For that, you'll need to use something like OpenCV. Qt does have libraries for loading most common image types.
However, Qt does extend beyond just GUI classes.
There is a database module that's quite convenient. The concurrency/threading classes are nice. I've enjoyed making use of the Qt Networking classes. The FileIO classes are alright.
These classes/modules are all useful for making platform-independent code. Things like image processing are mostly algorithmic and tend to be platform-independent by nature. So I think they fall out of the scope of the Qt framework. It shouldn't be too difficult, however, to simply find a library that does what you need and link that in to your project.
A lot of the Qt Core services that heltonbiker and Nikos C. mentioned, can be thought of as extensions to C++, a little like std. Although I often prefer the Qt implementations myself. But Qt has gone much further with their libraries, with the I/O, and web services etc...
The QtXML library provides reading and writing of XML files. Traditionally we had always used xerces, but the Qt XML library is almost as simple as .NETs.
The QtNetwork library offers TCP/IP and other networks services
The QtMultimedia library performs playback and recording of audio
and video content to the use of available devices like cameras and
radios.
The QtSQL library interfaces with SQL databases.
And there is much more than that. Although these are probably services that are used to most. The other benefit is that for the most part the implementations are cross platform. So for example using the I/O services does not require you to write separate code for Linux and Windows. That is a general rule, and there are exceptions. But I am sure most people would agree that any of the services they offer are easy to use, and well documented.
Happy coding.
Qt provides ample abstraction besides UI - it comes with a set of functionality enhancing features that come with certain usage paradigms.
Container classes - shallow copy by value, copy on write
Implicit sharing for containers and certain data types
Event driven, signals and slots
A powerful and usable metasystem
Properties
Platform abstraction for a lot of functionality, from file access to network and multithreading
Cross platform atomics (not that important since C++11 atomics)
Settings API
Undo API
OpenGL abstraction (not necessarily UI, custom graphics)
Basic image formats and basic image manipulations
Qt Declarative, a.k.a QtQuick and QML markup (usable for all kind of structure markup BTW)
Dynamic plugin API
Platform abstraction and portability - same code, multiple platforms
High and low level multimedia - audio, video
Sensors and serial port
Unit test
XML, JSON, SQL
An outdated and hopefully soon updated OpenCL abstraction
Last but not least, a lot of 3rd party modules built around Qt fitting a wide range of applications
Honestly, all its missing is support for some more popular formats for file, media encoding/decoding and containers, some parallel and vector abstraction, USB, WIFI/NFC (in the works in an addon module) and it will be 100% versatile.
Note that you can also use Python with Qt, although I have no experience with that, Qt is a very versatile tool that allows for quick and easy application development - and since 5.1 supports pretty much the entire market, with the addition of Android and iOS to the list of supported platforms. It is very useful for creating custom use applications for creative or research purposes.
Although not perfect for every task, Qt is easily the "best of the bunch" of tools you can use in this regard. Unbeatable in terms of portability and very thorough, if not a little bloated for the set of functionality it provides. And finally, it is free, you can even develop commercial applications under LGPL as long as you link dynamically. All in all, it is well worth the investment to learn, the only downside is it lacks uniformity between the old C++ native APIs and the QML runtime, which is actively worked on and is based on JS, so the APIs are a bit different and some glue APIs are required to fuse C++ with JS and QML.
(just for the record, from the official site):
The Foundation: Qt Core Module
The Qt Core module forms the foundation of all Qt-based applications
with core non-graphical classes used by other modules.
Key Functions
File IO, event and object handling
Multi-threading and concurrency
Plugins, setting management
Signals and Slots inter-object communications mechanism
Benefits
Reduce development time and cost by leveraging a complete set of application building blocks
Develop portable code from the ground up with cross-platform functionality

Smartphone programming

I have been tasked to develop an application for my school that should be usable by smartphones.
Now, I have never done any smartphone programming so there is a lot of research to be done regarding well, everything.
So, my question here is, if I have to develop an application with no specific smartphone in mind, what would the most generic kind then be?
Second, I am looking for some reading material where I can get an understanding of the common aspects of the various smartphones so that I can pick the tools to work with, that are generic across smartphones. Any suggestions?
For the lowest barrier to entry for this project, consider using HTML/JavaScript and running it (at first) as a web page. Then, if you decide this is the path you want to take, use PhoneGap (or similar) to create native apps from your existing work.
May not be at the exact 'generic' level you are looking for, but the 'Mono' project may be worth a look.
http://www.mono-project.com/Main_Page
Its a commercial project allowing developers to create production code in C#/.Net, and use the Mono framework to deploy to cross platforms such as Macs, iphones, andriods etc..
I would agree with the above that HTML/CSS coded for the respective browsers using mobile resolutions would be the easiest way to go - but should you really wish to have a native application instead of a web-app, then Mono could be useful to you.

Development Effort: Web vs. App

what does the relation between a Web frontend and a smartphone App with identical feature sets look like regarding the development effort? Are there any specific differences regarding the development effort between Apps of different smartphone platforms (iOS, symbian OS, Android, etc.) ignoring training time? A general estimation would completely satisfy me. ;)
Thanks in advance,
Flinsch.
I hesitate to call this an estimate, or even an informed guess, but perhaps by putting down some ideas I might help your thinking.
Ignoring any particular platform specifics I see the fundamental difference of Web v Native is that in the Web case you have some extra work to do:
a). You have presentation separated from the backend, with probably HTTP in between. So there are services to write and issues concerned with notifications and/or polling to deal with.
b). You're likely using a browser to do the presentation so you will be using some JavaScript kind of library, and these are still hard to drive.
So, if you are targeting a single device my guess is that writing native code is likely to be 50% quicker than web-based code - assuming that you really are targetting identical function.
What seems to happend is that we compromise Web Apps, reducing functionality somewhat and hence the overhead is reduced.
Also there's another factor, the UI portions of the Web App are in principle portable, hence in fact the Web App development may be a reasonable investment even if it does take more effort.
I suspect that portability may well end up being a dominant consideration.
specific differences? There are plenty, but each with their own tradeoff:
UI: Web applications have CSS, (HTML, XHTML, HTML5) specifications that is supported by major browsers (although have have their issues). For Smartphone apps, each UI has to be designed and implemented according to the language the apps can be built on. You can effectively create apps like Winamp (having skins). For web applications, this is relatively a quick effort compared to writing UI's for each different smartphone OS models out there.
Language of use/Portability: In Web applications, an application sits in a server, so every request is sent to the server and response is returned from it. This allows that 1) Web applications can be written in any language of choice, as the end user never sees the server nor needs to configure it, 2) It allows the developer to write in a language that he/she is comfortable in. In smartphone apps, for the developer to run his apps to all the smartphone OS'es, he/she has to learn the programming language for the OS, and learn to port their code to work there (if porting is possible). That never exists in Web applications.
Hardware limitations: For smartapps, the developer must be aware of the cellphone capabilities and limitations. Facebook (e.g.) can essentially grow their memory, and add new servers and cluster their environment as the demand grows. You can't do that with smartphone apps. You will have to limit your implementation to run in a capability that your desired smartphone can accommodate.
There are more (feel free to add) but all these are part of the development effort that a software developer has to look at if they want to go a a field of choice.

Any really modern, good-looking desktop apps that are developed with PyQt/PySide?

I have started using Python for web development recently, it's kinda cool;
I have seen programs that are developed in QT/C++, which is good enough in terms of esthetics;
I have just noticed the new PySide project (which brings LGPL Qt license to Python and it doesn't support Windows yet).
In view of the above, I see the possibility of using Python + PyQt/PySide to develop cross platform apps in the future :) but I have several doubts right now:
Can PyQty/PySide be used to develop really complex/modern UI? Can somebody give me some points to have a look at some nice-looking screenshots of apps that are developed in Python+QT?
What about the performance of using Python + QT for a desktop app?
Thanks in advance!
Can PyQty/PySide be used to develop really complex/modern UI?
Desktop applications come in all sorts of varieties -- some nicely laid out, some extremely customized with virtually no semblance to a standard application for that OS. The same can be done with Qt/PyQt/PySide. As Alex said, there should be no visible difference between an application written with PyQt/PySide versus one written with Qt in C++. Any program written with Qt4 (using bindings or not) will, by default, look like a standard modern application.
Of course, there are features of recent Windows releases (and likely some on Mac OS X) that aren't supported immediately and by default in Qt, but you can almost always write some custom platform specific code for those situations where said features are truly important.
Can somebody give me some points to have a look at some nice-looking screenshots of apps that are developed in Python+QT?
The best and most open source program that I know of and which is written with PyQt, is Eric -- a Python based IDE.
What about the performance of using Python + QT for a desktop app?
For most applications the performance difference between a C++ Qt application and a PyQt application are not noticible. But if you really need performance, you can write certain parts of the application in C++ and make bindings available in Python so you can integrate the two.
TortoiseHg was re-designed using Qt and PyQt for its 2.0 release.
Here is one of several posted screenshots:
There is no aesthetic difference between the look and feel of C++ based Qt, and the PyQt and PySide wrappers on top of it. I use basically no desktop GUI apps so I couldn't point you to any implemented with any of these language/toolkit combos, but if you like the former, you'll be hard put to distinguish it in any way from the latter.
A bit late but for the record, apps such as Skype, GoogleEarth or the recent versions of VLC (media player & more) used the Qt libs.

Resources