-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    LinuxDaily.com    Linux42.org    OpenSkillz.com   
 
Apps
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login

-
- News . 
0
votes
click to vote up

Adnane Belmadiaf: Adding UserMetrics to your app on Ubuntu Touch


Published Nov 30 2013 via RSS

The Welcome Screen infographic is one of the key components for the customization of the user experience on Ubuntu Touch, beautiful visualisations of data from multiple sources, the UserMetrics is the responsible component for updating the infographic using QML.

Welcome Screen

To use the UserMetrics QML module you need to install qtdeclarative5-usermetrics0.1 package on the desktop :

$ sudo apt-get install qtdeclarative5-usermetrics0.1

Apparmor Policy groups

Add the usermetrics to your apparmor file :

{
    "policy_groups": [
        ...
        "usermetrics"
    ],
    "policy_version": 1.0
}

QML

First you need to import the UserMetrics module :

import UserMetrics 0.1

Then create the metric(s) :

Metric {
    /* Set a unique ID for each metric object you use so you can access it in your QML code. */
    id: gameMetric

    /* Set a unique name for each metric object, this is used for the storage of the metric data. */
    name: "game-metrics"

    /* This is the format for the plural case. */
    format: "%1 missions completed today"

    /* This is the format for no data for the day. */
    emptyFormat: "0 missions completed today"

    /* This is the gettext domain used for the localisation, you can use the applicationName. */
    domain: "com.ubuntu.developer.daker.mygame"
}

The Metric component provides two methods :

increment(double amount = 1.0) : You can use this method if you want to increment metric by a specific amount ex: gameMetric.increment(3) or gameMetric.increment() to increment the metric by 1.
update(double value) : You can use this method if you want to reset the metric and set a specific amount ex: gameMetric.update(5)

The use of the Metric is not limited by the number.



BackRead original postSend to a friend

Add comment

Add comment
Show all posts




-
 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Apps
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Facebook App
Content RSS   
Events RSS   

Participate
Groups
Forum
Add App
Public API
About GTK-Apps.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2007-2014 GTK-Apps.org Team  
All rights reserved. GTK-Apps.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.