Measuring the speed of resource loading with JavaScript and HTML5

This is a follow up article to Measuring site performance with JavaScript on mobile, I suggest you read it before you continue. In the previous article I talked about the Navigation Timing spec, here I will talk about the Performance Timeline and Resource Timing specs and how they work in IE10, the first browser to implement them. I created a page that shows some of the data available and a library that generates a HAR that you can later analyse.

Continue reading

Measuring site performance with JavaScript on mobile

There is a lot of talk around responsive Web design being too slow or too resource intensive and that other methodologies can achieve better performance. I don’t want to go into the details of which approach is better because I think different scenarios require different solutions. What is certainly true in all cases is that a Web site or app that loads faster is better than one that is slow. Companies like Google, Gomez and Akamai have all published papers and survey results showing how speed affects user perception of a service from your desktop computer and even more on a mobile device (KISSmetrics has also drawn a nice infographic for the lazy ones). This is the first article and another one will follow shortly. Continue reading

HTML5 forms (and IE10 (Mobile))

One of the many improvements introduced by HTML5 is around forms, users hate filling forms and developers hate validating the data submitted. HTML5 makes these tasks a lot simpler.
In this article I will not talk about what HTML5 added, but I will rather focus on what is new in IE10 mobile, i.e. the browser that comes with Windows Phone 8. At the end of the article I have collected a few useful links that cover HTML5 forms at large and provide more examples and complete support tables. All the code examples are meant to be cross-browser, unless specified. Continue reading

Direct launch of Store client with parameters from Qt

Many Nokia Store distributed applications have "Buy full version" or "Check our other apps" functionality which require opening of Nokia Store client app on certain page. Usually such functions could be implemented by opening store url in system browser. Browser will automatically redirect user to Nokia Store client and open required content or author page in it. But that approach has some disadvantages:

1. Bad (well, not perfect) user experience. Web browser acts as a mediator between your app and Store client. And it looks unnecessary.

2. SwEvent capability should be declared in your .pro file. Without it your openUrl() request will be ignored by the system in case  system browser is already running. That’s a kind of security mechanism inherited from Symbian C++ and aimed to prevent malware from webpage urls spoofing while user browse the web. Some developers don’t know about that and suppose their openUrl() works in all cases. Some forget to add SwEvent declaration before submitting sis in Store (SwEvent require signing by Developer or Ovi certificates, so if you need only User granted capabilities for other features you can use more convenient self-generated certificate during development) .

At the same time there are one advantage: That more or less official method, so you can expect some compatibility here. There is no any guarantees that the method I describe below will work for all future Store versions. But i hope it will.

Well, so we have the indirect method, which looks like that:

#include <QDesktopServices>

 // Opens Angry birds page in Store client app

QDesktopServices::openUrl(QUrl(QString("http://store.nokia.mobi/content/61009"))); 

 // Opens author’s page in Store client app

QDesktopServices::openUrl(QUrl(QString("http://store.nokia.mobi/publisher/RovioMobile/")));

 //Here you will need SwEvent capability declaration in case browser is already open

 

Now we want open Store client directly without system browser use.

After shot investigation of the page used for user redirection I find out that it launches ovistore_2002D07F.exe and passes whole original url to it as a parameter. Its worth to say for Symbian C++ guys that app’s UID3 is obviusly 2002D07F and you may not read further bcs you can implement even more flexible and reliable launcher with Symbian C++.

For others I wrote a class that launches the Store directly by the application name and in case something goes wrong (for example, executable was renamed) fall back to the old reliable web browser url opening. The demo app sources and sis are attached.

Some code snippets:

storelauncher.h

#include <QObject>

#include <QProcess>
class QStoreLauncher : public QObject
{
    Q_OBJECT
public:
    explicit QStoreLauncher(QObject *parent = 0);
    void LaunchNokiaStore(QString);
private slots:
    void processError(QProcess::ProcessError error);
private:
    QProcess *myProcess;
    QString arguments;
 };

 

storelauncher.cpp

#include <QDesktopServices>

#include <QUrl>
#include "storelauncher.h"
 
QStoreLauncher::QStoreLauncher(QObject *parent) :
    QObject(parent)
{
    myProcess = new QProcess(this);
    QObject::connect(myProcess, SIGNAL(stateChanged(QProcess::ProcessState)),
                     this, SLOT(stateChanged(QProcess::ProcessState)));
}
void QStoreLauncher::LaunchNokiaStore(QString params)
{
    arguments = params;
    const QString NokiaStoreLauncherApp ("ovistore_2002D07F");
    myProcess->start(NokiaStoreLauncherApp, arguments.split(QString("\n")));
}
void QStoreLauncher::processError(QProcess::ProcessError error)
{ // Hey, something goes wrong
    switch (error)
    {
    case QProcess::FailedToStart:
    case QProcess::Crashed:
    case QProcess::Timedout:
    case QProcess::ReadError:
    case QProcess::WriteError:
    case QProcess::UnknownError:
    {
        //Here you will need SwEvent capability declaration in case browser is already open
        QDesktopServices::openUrl(QUrl(arguments));
        break;
    }
    default:
    {
        break;
    }
    }
}
 
Usage:
QStoreLauncher launcher(this);
// Opens author's page in Store client app 
launcher->LaunchNokiaStore(QString("http://store.nokia.mobi/publisher/RovioMobile/"));
// Opens Angry birds page in Store client app 
launcher->LaunchNokiaStore(QString("http://store.nokia.mobi/content/61009")); 

 

So as you see it’s pretty simple. Tested with my N8-00 Anna and Store v3.18.

I suppose url host may vary. For example store.ovi.mobi, store.nokia.com or store.ovi.com. It’ll work for all, but didn’t check much.

And no – I don’t know if Store client supports or will support any other url formats, for ex. reviews page opening etc.

NokiaStoreLauncher.sis
NokiaStoreLauncher.zip