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

Great new UX assets!

Hey there,

Have you already tried out the new Qt Quick Components 1.1 for Symbian? They are a part of the latest Qt SDK release. We also updated the Symbian design guidelines for your convenience, and included a brand new set of visual design stencils for you to create app mockups. The stencils (and the components) come in both dark and light theme, so you can choose which you want to use for your app. The stencil set is available for Adobe Illustrator CS5, Adobe Fireworks CS5 AND Inkscape version 0.48 or above.

The Symbian design guidelines library has a simplified structure, with dedicated sections for Component descriptions and UI patterns, not forgetting the overall UI introduction!

If you wish to update your previous Avkon application to using the Qt Quick components, this library section might be just the resource you are looking for! It provides you a comparison between the different component sets, and helps you learn which Qt Quick Component is the best counterpart for the Avkon components you have been using. We have a similar comparison section for Nokia N9 to Symbian, as well. Take a look!

And then there’s The icon competition. Last week we announced an icon competition for creating your application launcher icon with our icon templates. The templates can now be found in one single toolkit, and are available for Adobe Illustrator CS5, Adobe Fireworks CS5 AND Inkscape version 0.48 or above. For step-by-step guidelines on how to use the templates, just pick your platform and click on the link below!

Series 40 launcher icon template guidelines
Symbian launcher icon template guidelines
MeeGo 1.2 Harmattan launcher icon template guidelines

If you wonder why there are different templates for different platforms, see this Iconography style summary section

For more of our recent UX related materials, such as UX Checklists, visit this page.

Happy developing!