Every software center that exists allows the user to look at screenshots and a long description of the application before it is installed. For most users it allows them to answer the question Do I want to install this application?
Traditionally in Linux distributions, we have none of this data for the vast majority of our desktop user-installable applications. To solve this, we have defined a new data file, which the upstream project can optionally translate using the same technique as GSetting schemas or Desktop files. Rather than create a new schema from scratch, we'll be using a subset of the AppStream metadata proposal.
Applications wishing to have long descriptions, screenshots and other useful things
are required to ship one or more files in /usr/share/appdata/%{id}.appdata.xml
.
The file should contain something like this:
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2013 First Lastname <your@email.com> --> <application> <id type="desktop">gnome-power-statistics.desktop</id> <licence>CC0</licence> <name>Power Statistics</name> <summary>Observe power management</summary> <description> <p> Power Statistics is a program used to view historical and current battery information and will show programs running on your computer using power. </p> <p>Example list:</p> <ul> <li>First item</li> <li>Second item</li> </ul> <p> You probably only need to install this application if you are having problems with your laptop battery, or are trying to work out what programs are using significant amounts of power. </p> </description> <screenshots> <screenshot type="default" width="800" height="600">http://www.hughsie.com/en_US/main.png</screenshot> <screenshot width="800" height="600">http://www.hughsie.com/en_US/preferences.png</screenshot> </screenshots> <url type="homepage">http://www.gnome.org/projects/en_US/gnome-power-manager</url> <updatecontact>gnome-power-manager-list@gnome.org</updatecontact> <project_group>GNOME</project_group> </application>
<id/>
The %{id}
is the same name as the installed .desktop file for the
application.
<licence/>
The <licence>
tag is indicating the content licence that you
are releasing the one AppData text file as.
This is not typically the same as the project licence.
By ommitting the licence value would probably mean your data would not be
incorporated into the distribution metadata.
Permissible licence codes include:
CC0
CC-BY
CC-BY-SA
GFDL
The licence codes correspond to the full licence texts as given by the
list of free content licences according to Fedora.
For instance, CC-BY-SA
corresponds to
http://creativecommons.org/licenses/by-sa/3.0/
<name/>
You can omit this tag if you want the software center to have the same strings
as the desktop menu.
In some cases it might be required to have a different name in the app-store,
but most appdata.xml
files will not need this.
<summary/>
You can omit this tag if you want the software center to have the same strings
as the desktop menu.
In some cases it might be required to have a different name in the app-store,
but most appdata.xml
files will not need this.
<description/>
The long description is an important part of the file. Important things to consider when writing the application description:
Do not assume the format is HTML. Only paragraph, ordered list and unordered list are supported at this time.
<screenshots/>
A screenshot presents your application to the outside world, and could be seen by hundreds or thousands of people.
Screenshots are an important part of how people choose which applications to install, so it's important to get them right. Consistent, good looking screenshots will make your application look more attractive and will expand your userbase. Consistent screenshots also provide a more predictable experience for people using the software center.
Screenshot size, shape and format:
Basic guidelines for things to include (and not include) in your screenshots:
Additional advice on how to take effective screenshots:
<url/>
Links of type homepage
should be a link to the upstream homepage
for the application.
<updatecontact/>
AppData is a new standard, and we'll likely be adding extra metadata in the
future.
If you include the <updatecontact>
tag then someone
will send an email when the standard is updated, detailing the new fields that
you may or may not want to add to your appdata.xml
file.
We're not expecting to do this more than 4 times a year, so don't expect a
deluge of email.
TIP:Use _at_
rather than @
if you're worried
about the email address being harvested by spammers.
<project_group/>
If you include the <project_group>
tag then this identifies
your project with a specific upstream umbrella project.
Known values include GNOME
, KDE
, XFCE
,
MATE
and LXDE
, although other umbrella projects like
Yorba
would make sense too.
NOTE:You should only identify with an umbrella project if you use all their infrastructure and policies, for instance string freezes dates, bugtracker and source control instance.
If you ship an .xml.in
file rather than an .xml
file,
you can use intltool to translate the data.
You can also use itstool to translate the data, and we've provided a
appdata.its
file for convenience.
Translated descriptions are a really nice feature, as only a fraction of the userbase installing application will be able to understand English text.
Different distros cut and join different source packages in different ways, plus, it's not typically translated.
This is one file per-project and is not suitable when one tarball will install several applications. It's also not translatable.
Put simply, we don't have the resources to moderate, check and translate each string for every application. We don't have the legal framework so that non-free applications could also ship application data.
The upstream project is in a much better place to describe itself, and the upstream project is able to use it's existing localization and translation teams. Also, things like the screenshot will change as the project is updated, and not all distros ship the same version of an application. We also want the long description to come up immediately, and be searchable, so we can't really use a web service in that case. Additionally, different distros have different policies on trademarks.
The GNOME Software Center currently shows a nag message that the upstream project doesn't ship the additional data. Additionally, we will penalize apps that do not ship the extra metadata by showing them lower in the search results.
At this moment we're trying to do the bare minimum for a software center technical preview. In the future I can totally see this file being used to express what portals are required (i.e. Firefox needs access to your addressbook) and other useful things. I'll update this page when we've got some more concrete use-cases.
AppData is a subset of the AppStream schema, which is also XML.
We will scrape this data when building and composing distributions, and depending on the implementation will either use an OCS server or directly copy the AppData data into the AppStream metadata.
Any 16:9 aspect resolution is fine, as long as the width is at least 624 pixels. A useful table of resolutions of the correct aspect can be found here:
640x360 | 800x450 | 960x540 | 1120x630 | 1280x720 | 1440x810 |
656x369 | 816x459 | 976x549 | 1136x639 | 1296x729 | 1456x819 |
672x378 | 832x468 | 992x558 | 1152x648 | 1312x738 | 1472x828 |
688x387 | 848x477 | 1008x567 | 1168x657 | 1328x747 | 1488x837 |
704x396 | 864x486 | 1024x576 | 1184x666 | 1344x756 | 1504x846 |
720x405 | 880x495 | 1040x585 | 1200x675 | 1360x765 | 1520x855 |
736x414 | 896x504 | 1056x594 | 1216x684 | 1376x774 | 1536x864 |
752x423 | 912x513 | 1072x603 | 1232x693 | 1392x783 | 1552x873 |
768x432 | 928x522 | 1088x612 | 1248x702 | 1408x792 | 1568x882 |
784x441 | 944x531 | 1104x621 | 1264x711 | 1424x801 | 1584x891 |
The native size for most software centers is 624x351 and so screenshots taken or cropped to this size will not be resized and will look pixel perfect. The largest resolution screenshot supported is 1600x900.
You can validate the AppData file using this web helper. Just upload the file you wish to validate:
There are several other ways to validate the data:
These schemas are installed in /usr/share/appdata/schema
when is
appdata-tools is installed.
See the commit that added the non-translated AppData metadata to gnome-power-manager or the translated metadata to gnome-color-manager.