HOW-TO:HelloWorld addon: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
I'd advise using a text editor for your first add-on, something like notepad++ or sublime are good due to their text syntaxing.
I'd advise using a text editor for your first add-on, something like notepad++ or sublime are good due to their text syntaxing.
Also make sure you have a version of Kodi installed on your development environment.
Also make sure you have a version of Kodi installed on your development environment.
[[File:helloworld1.png]]


=Installing=
=Installing=
Line 16: Line 18:
You can first give the add-on a test run by going to:
You can first give the add-on a test run by going to:
System >> Add-Ons >> Enabled Add-Ons >> Program Add-Ons >> Hello World. You should now see a popup with 3 lines of text.
System >> Add-Ons >> Enabled Add-Ons >> Program Add-Ons >> Hello World. You should now see a popup with 3 lines of text.
[[File:helloworld3.png]]


=Modifying the Add-On=
=Modifying the Add-On=
Line 21: Line 25:
On windows this will be in:
On windows this will be in:
C:\Users\user\AppData\Roaming\XBMC\addons\plugin.program.hello.world
C:\Users\user\AppData\Roaming\XBMC\addons\plugin.program.hello.world
[[File:helloworld2.png]]


=Structure=
=Structure=

Revision as of 13:36, 27 November 2014

Home icon grey.png   ▶ Development ▶ Add-on development ▶ Python development ▶ Python examples ▶ HOW-TO:HelloWorld addon


Introduction

This tutorial will explain how to write your first Kodi/XBMC Add-on!

Tools

I'd advise using a text editor for your first add-on, something like notepad++ or sublime are good due to their text syntaxing. Also make sure you have a version of Kodi installed on your development environment.

Helloworld1.png

Installing

For this example we can install the official "Hello World" add-on that is in the repository. It is under: System >> Add-Ons >> Get Add-Ons >> All Add-ons >> Program Add-Ons

Testing

You can first give the add-on a test run by going to: System >> Add-Ons >> Enabled Add-Ons >> Program Add-Ons >> Hello World. You should now see a popup with 3 lines of text.

File:Helloworld3.png

Modifying the Add-On

Each time we want to change the add-on you can simply go to the appdata folder and live edit it! No need to even close Kodi. This will allow you to quickly test your add-on modifications. On windows this will be in: C:\Users\user\AppData\Roaming\XBMC\addons\plugin.program.hello.world

File:Helloworld2.png

Structure

addon.py <-- This is the actual python code for your Add-On

addon.xml <-- This is the Add-Ons metadata

changelog.txt <-- This is a text file with any changelog information in it. We advise updating this on each release.

icon.png <-- A PNG icon for the add-on. It can be 256x256 or 512x512 pixels big. Try to make it look nice!

LICENSE.txt <-- Another text file with the Add-On license text.