Author Archives: admin

Ubuntu Edge and crowdfunding

image-edgeA few days ago Ubuntu started Crowd funding project Ubuntu Edge

Ok, I likes the idea behind the Ubuntu Edge, likes Ubuntu Phone OS itself, but still have question: what was the real reason behind the crowdfunding project?

Ubuntu claimed that all money will be invested to phone development. Ok, but what I can see, significant part of the money will be returned by devices, sent to users. So what money will left after phone design and production?

Second, Ubuntu claims that they already has designers, hardware and software engineers around the world, waiting for crowdfunding stage finished. I doubt that all these people sitting unplayable.

Third, what this means:

Fastest multi-core CPU, 4GB RAM, 128GB storage

?

This means that there is no any hardware even in design because not every SoC supports 4GB RAM. And if the choosen one will support 4GB RAM, will it support

Dual-LTE, dual-band 802.11n Wi-Fi, Bluetooth 4, NFC
GPS, accelerometer, gyro, proximity sensor, compass, barometer

etc, etc

Also, 1280 x 720 HD looks pretty outdated even today. And this resolution will be oldfashioned in the middle of 2014

But anyway, I want to wish Canonical good luck in their journey

 

QImage in QML

In this post I’ll show how to provide QImage from C++ code to QML

All we know, that Image {} element in QML supports only source property, which takes an URL as input. So how to put an QImage (or QPixmap or texture) to Image {}?

Answer is: QQuickImageProvider (in Qt 5)

First of all you have to create a so called image provider class, derived from QQuickImageProvider:

#include <QQuickImageProvider>

QT_BEGIN_NAMESPACE

class ImageProvider : public QQuickImageProvider
{
public:
explicit ImageProvider();
virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize);
};

You have to reimplement method requestImage(). It takes an string id as input as well as requested image size.
String id is an unique id, generated in your QML code. We will come there later
If Image {} element request specific image size, you’ll get the size in requestedSize parameter. Just check it is it valid or not. If so, you have to resize your original image and return resized version. Also, you have to return new image size in the size parameter

Before using your image provider, you have to register it in QML engine:

ImageProvider *imageProvider = new ImageProvider;
QQmlApplicationEngine engine(QUrl("qml/main.qml"));
engine.addImageProvider("images", imageProvider);

in this case, “images” is an identifier for your image provider
Note: if you want to register several identifiers for several providers, you have to create separate object for each identifier:

QQmlApplicationEngine engine(QUrl("qml/main.qml"));

ImageProvider *imageProvider = new ImageProvider;
engine.addImageProvider("images", imageProvider);

ImageProvider *imageProvider1 = new ImageProvider;
engine.addImageProvider("images1", imageProvider1);

 

And, finally, last step. Adding Image element to QML code:

Image {
source: "image://images/" + id
cache: false
}

 

Take a look at source property.
In that URL image means that you will use an image provider. Then, images is provider identifier and id is the string value, which will be passed to your requestImage() implementation

Its important to turn cache off if you gonna to reuse an image id

That’s it. Hope this will help to someone

Last note: with the QQuickImageProvider class you can pass not only QImage but also QPixmaps and OpenGL textures to Image element

 

Very last note: do not try to use QSharedPointer<QImage>

Ubuntu preparing something new

There is counterdown on http://www.ubuntu.com/ and only 4 days left

There is some speculations about this on OMG Ubuntu: http://www.omgubuntu.co.uk/2013/07/countdown-appears-on-ubuntu-website

I’m not sure it will be Smart Watches. Btw, about Smart Watches…I think the only benefit from them is remote control for an TV, which is hard to loose somewhere in apartments

So, what it can be? I hope, they will release Ubuntu Touch for extended range of smartphones and tablets

Anyway, will see in four days…

Nokia Development Projects discontinued

Today I’ve got mail from Nokia:

With some sadness we announce that the Nokia Developer Projects service (https://projects.developer.nokia.com) will be discontinued in the following months (due to ongoing trend of low activity and increasing costs). Please backup any project data you wish to save as soon as possible (ideally within the next few weeks). After the service has been stopped all unsaved data will be lost!

Well, its really sad but it was expected

Why mobile web apps are slow

Found interesting article: http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/

I’d name it: why any sandboxed mobile app is slow? Performance of Java-based android apps is just terrible. Even on Quad core CPUs. Moreover, its drain power like crazy.

HTML5+JS+CSS and .Net has same issues, i.e. not a solution

How Mobile OS vendors resolve performance issues? Just turning off multitasking! Ridiculous! Its 21 century, guys, wake up!

So, is there a solution? Yes! Qt + QML! And it quite surprising that the authors of such kind of articles give no any word about Qt as a solution

Why Android become so popular? Cost of entering to platform for a regular developer quite low because of Java. But look at QML! Its much much simple, but technology behind it makes it almost fast as native code.

Taking in account the following:

  • Qt Quick 2 based on OpenGL, i.e any screen draw is hardware optimized, \
  • Qt is multiplatform. Currently it supports Android, iOS, Tizen, BlackBerry 10, Ubuntu Touch and Meego based OS such as Sailfish and Nemo
  • Its easy to learn. There is a lot of documentation, examples and videos. Don’t be scary by C++ behind it. In most cases, C++ complications hidden by Qt framework

makes Qt+QML perfect solution for native mobile development.

Please, think about it

If you looking for 2D game engine

which support 2D physics, I’d recommend you to take a look at V-Play game engine.

  • Based on Box2D and Cocos2D engines
  • API is fully integrated into QML. This speeds up development a lot. Plus you have full power of Qt Quick API for your games
  • Supports several major mobiles and desktop platforms and more to come
  • Great support on forum