Recently I ported my Crazy Chickens game for Harmattan / Maemo6. Its now available on Ovi Store.
Find out more information about this game here. Following are few snaps of game from Harmattan version.
Sharing information related to Qt, Maemo development and some other information
const char AWS_KEY[] = "YOU ACCESS KEY"; const char AWS_PASS[] = "YOUR SECRET KEY"; const char END_POINT[] = "http://ecs.amazonaws.com/onca/xml"; AwsAlbumArtHelper::AwsAlbumArtHelper(QObject *parent) : QObject(parent) { _netManager = new QNetworkAccessManager(this); } QByteArray AwsAlbumArtHelper::getTimeStamp() { QDateTime dateTime = QDateTime::currentDateTimeUtc(); return dateTime.toString(Qt::ISODate).toUtf8(); } void AwsAlbumArtHelper::downloadAlbumArt(const QString& bookname) { _bookName = bookname; QMap< QString,QString > queryItems; queryItems["AWSAccessKeyId"] = AWS_KEY; queryItems["ResponseGroup"] = "Images"; queryItems["Keywords"] = QUrl::toPercentEncoding(bookname); queryItems["Operation"] = "ItemSearch"; queryItems["SearchIndex"] = "Books"; queryItems["Service"] = "AWSECommerceService"; queryItems["SignatureMethod"] = "HmacSHA1"; queryItems["Timestamp"] = QUrl::toPercentEncoding(getTimeStamp()); queryItems["Signature"] = createSignature(queryItems); QUrl downloadUrl = createUrl(queryItems); QNetworkRequest request(downloadUrl); disconnect(_netManager,SIGNAL(finished(QNetworkReply*)),this,SLOT(imageDownloaded(QNetworkReply*))); connect(_netManager,SIGNAL(finished(QNetworkReply*)),this,SLOT(xmlDownloaded(QNetworkReply*))); _netManager->get(request); }Following code create signature from query parameters. I used code pasted here for signing string with hmacSha1.
QByteArray AwsAlbumArtHelper::createSignature(const QMap< QString,QString >& queryItems) { QUrl url(END_POINT); QString stringToSign = "GET\n"; stringToSign.append(url.host() + "\n"); stringToSign.append(url.path() + "\n"); QList<qstring> keys = queryItems.keys(); for( int i=0; i < keys.count() ; ++i ) { stringToSign.append(keys[i]+"="+queryItems[keys[i]]); if( i != keys.count() -1 ) { stringToSign.append("&"); } } QString signature = hmacSha1(AWS_PASS,stringToSign.toUtf8()); return QUrl::toPercentEncoding(signature); } QUrl AwsAlbumArtHelper::createUrl( const QMap< QString,QString >& queryItems ) { QUrl url(END_POINT); QMapIterator<QString, QString> it(queryItems); while (it.hasNext()) { it.next(); //everything is already URL encoded url.addEncodedQueryItem(it.key().toUtf8(), it.value().toUtf8()); } return url; }Now we are ready to submit request using downloadAlbumArt method with required book name and AWS should return xml data with various image link. We need to parse xml and use mentioned link to download image.
Page{ orientationLock: PageOrientation.LockPortrait }To make application full screen, I need to disable statusbar and toolbar from PageStackWindow. I used following code
PageStackWindow { showStatusBar: false showToolBar: false }In one of my application I was using GraphicsView framework, I loaded graphics view to QML using QDeclarativeItem and QGraphicsProxyWidget. Visit following link for more info.
setFrameStyle(QFrame::NoFrame);Desktop file also needs to be changed to locate icon correctly and to launch only single instance of application.
[Desktop Entry] Encoding=UTF-8 Version=0.1 Name=appname GenericName=app name Comment=some comment Exec=/usr/bin/single-instance /usr/bin/appname Terminal=false Type=Application Icon=/usr/share/icons/hicolor/64x64/apps/icon.pngAlso in control file, to make your application user application and not system component, we need to add following flag.
Maemo-Flags: visibleI used following in my project file to transfer icon file to proper location.
unix { #VARIABLES isEmpty(PREFIX) { PREFIX = /usr } BINDIR = $$PREFIX/bin DATADIR =$$PREFIX/share DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" INSTALLS += target desktop icon64 target.path =$$BINDIR desktop.path = $$DATADIR/applications desktop.files += ./image/$${TARGET}.desktop icon64.path = /usr/share/icons/hicolor/64x64/apps/ icon64.files += ./image/$${TARGET}.png }I also faced segmentation fault while testing Webview with emulator, but on device it works fine.