SailfishOS first application: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Add "cleanup" tag)
(Clean)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
[[Category:SailfishOS]]


[[Category:SailfishOS::Introduction_tutorial]]
{{LangSwitch}}
 
----
[toc align_right="yes" depth="2"]
Article is part 2 of the [[SailfishOS Introduction Tutorial]] <br>
 
< [[SailfishOS SDK Installation|Go to part 1]] ||| [[SailfishOS using app in emulator basics|Go To Part 3]] >
'''English''' | [[:SailfishOS_first_application_Polish|Polski]]
----
 
''''_
Article is part 2 of "Introduction Tutorial":/wiki/Category:SailfishOS::Introduction_tutorial.
"< Go To Part 1":/wiki/SailfishOS_SDK_Installation ||| "Go To Part 3 >":/wiki/SailfishOS_using_app_in_emulator_basics
''''_


= First application =
= First application =


''if you don't have the SDK installed and running yet, follow the'' "installation guide.":/wiki/SailfishOS_SDK_Installation
''if you don't have the SDK installed and running yet, follow the [[SailfishOS SDK Installation|installation guide]]''.


== 1.Launch Sailfish OS IDE ==
== 1.Launch Sailfish OS IDE ==
Line 24: Line 19:
== 2. Create a Sailfish UI project ==
== 2. Create a Sailfish UI project ==


The SDK comes with a Sailfish UI template project that makes it very easy to get started. Dialog windows shown in screenshots may vary between diffrent versions/systems so treat them as a example.
The SDK comes with a Sailfish UI template project that makes it very easy to get started. Dialog windows shown in screenshots may vary between different versions/systems so treat them as an example.
 
1. In the IDE, click on File→New File or Project
2. Select Applications→SailfishOS Qt Quick Application.
 
http://i.imgur.com/wmXnFos.png
 
3. Give a name to your project. Ensure it is created somewhere under your home directory and click Next.


# In the IDE, click on File→New File or Project
http://i.imgur.com/woU1BS0.png
# Select Applications→SailfishOS Qt Quick Application.
 
[[Image:http://i.imgur.com/wmXnFos.png?2|Select application screenshot]]
4. Select MerSDK-SailfishOS-i486-x86 or MerSDK-SailfishOS-armv7hl kit and click Next.
# Give a name to your project. Ensure it is created somewhere under your home directory and click Next.
''What's the difference? Generally MerSDK-SailfishOS-i486-x86 kit is used when deploying your application on emulator, the second kit is used when deploying application on Mer ARM device.''
[[Image:http://i.imgur.com/woU1BS0.png?2|Nameapplication screenshot]]
 
# Select MerSDK-SailfishOS-i486-x86 or MerSDK-SailfishOS-armv7hl kit and click Next.
http://i.imgur.com/LV3atKp.png
''What's the diffrence? Generally MerSDK-SailfishOS-i486-x86 kit is used when deploying your application on emulator, the second kit is used when deploying application on Mer ARM device.''
 
[[Image:http://i.imgur.com/LV3atKp.png?2|Select kit screenshot]]
5. You can edit the short description of your project or just click Next
# You can edit the short description of your project or just click Next
 
[[Image:http://i.imgur.com/7YPwbVc.png?2|Edit description screenshot]]
http://i.imgur.com/7YPwbVc.png
# You can add version control to your project(in example GIT or SVN)
 
[[Image:http://i.imgur.com/lprPc7M.png?2|Add version controll system screenshot]]
6. You can add version control to your project(in example GIT or SVN)
# Click Finish
 
# The project template is imported into your project and opened in the editor.
http://i.imgur.com/lprPc7M.png
[[Image:http://i.imgur.com/OYyvFEK.png?2|Glance at project template screenshot]]
 
7. Click Finish
8. The project template is imported into your project and opened in the editor.
 
http://i.imgur.com/OYyvFEK.png


== 3. Launch the Mer build machine and Emulator ==
== 3. Launch the Mer build machine and Emulator ==
Line 49: Line 55:


When a Sailfish OS project is open, the SDK automatically displays two control buttons in the left toolbar for starting/stopping the Mer build machine and Emulator.
When a Sailfish OS project is open, the SDK automatically displays two control buttons in the left toolbar for starting/stopping the Mer build machine and Emulator.
[[Image:http://i.imgur.com/0vAckoW.png|Mer build toolbar screenshot]]


=== 3.1. Click on the [[Image:http://i.imgur.com/nSniuw6.png|launch Mer Build Engine icon screenshot]] icon to launch Mer Build Engine. ===
http://i.imgur.com/0vAckoW.png
 
=== 3.1. Click on the http://i.imgur.com/nSniuw6.png icon to launch Mer Build Engine. ===


The Mer Build Engine is started in the background and the icon will turn gray until the machine has booted up.
The Mer Build Engine is started in the background and the icon will turn gray until the machine has booted up.


=== 3.2.— Click on the [[Image:http://i.imgur.com/zzawOqw.png| launch the emulator icon screenshot]] icon to launch the emulator. ===
=== 3.2.— Click on the http://i.imgur.com/zzawOqw.png icon to launch the emulator. ===


A new VirtualBox window opens and boots up the emulator.
A new VirtualBox window opens and boots up the emulator.
[[Image:http://i.imgur.com/SP9eCDT.png?1| working emulator screenshot]]
 
http://i.imgur.com/SP9eCDT.png


== 4. Successful connection ==
== 4. Successful connection ==
Line 65: Line 73:


Before connection:
Before connection:
[[Image:http://i.imgur.com/ifAYFRi.png| Before connection screenshot]]
 
http://i.imgur.com/ifAYFRi.png


Connection established:
Connection established:
[[Image:http://i.imgur.com/tQe3Og8.png| Connection established screenshot]]
 
http://i.imgur.com/tQe3Og8.png


== 5. Build and Deploy the app ==
== 5. Build and Deploy the app ==


Press the [[Image:http://i.imgur.com/aI9ECKM.png| play/run button screenshot]] play/run button in the toolbar to compile and run the project on the emulator.
Press the http://i.imgur.com/aI9ECKM.png play/run button in the toolbar to compile and run the project on the emulator.


That's it. Congratulations! You just ran your first SailfishOS application. It should be running in the emulator as shown below:
That's it. Congratulations! You just ran your first SailfishOS application. It should be running in the emulator as shown below:
[[Image:http://i.imgur.com/wJ4tqvy.png?1| working emulator screenshot]]


''''_
http://i.imgur.com/wJ4tqvy.png
Article is part 2 of "Introduction Tutorial":/wiki/Category:SailfishOS::Introduction_tutorial.
 
"< Go To Part 1":/wiki/SailfishOS_SDK_Installation ||| "Go To Part 3 >":/wiki/SailfishOS_using_app_in_emulator_basics
----
''''_
Article is part 2 of the [[SailfishOS Introduction Tutorial]] <br>
< [[SailfishOS SDK Installation|Go to part 1]] ||| [[SailfishOS using app in emulator basics|Go To Part 3]] >
----

Latest revision as of 01:50, 27 March 2016


En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh


Article is part 2 of the SailfishOS Introduction Tutorial
< Go to part 1 ||| Go To Part 3 >


First application

if you don't have the SDK installed and running yet, follow the installation guide.

1.Launch Sailfish OS IDE

You can launch from the 'SailfishOS IDE' entry in the system menu (or from ~/SailfishOS/bin/qtcreator if you're a linux terminal person).

As an example, on Ubuntu, open the dash, type in 'sailfish'. Click on the 'SailfishOS IDE' icon to launch the IDE.

2. Create a Sailfish UI project

The SDK comes with a Sailfish UI template project that makes it very easy to get started. Dialog windows shown in screenshots may vary between different versions/systems so treat them as an example.

1. In the IDE, click on File→New File or Project 2. Select Applications→SailfishOS Qt Quick Application.

wmXnFos.png

3. Give a name to your project. Ensure it is created somewhere under your home directory and click Next.

woU1BS0.png

4. Select MerSDK-SailfishOS-i486-x86 or MerSDK-SailfishOS-armv7hl kit and click Next. What's the difference? Generally MerSDK-SailfishOS-i486-x86 kit is used when deploying your application on emulator, the second kit is used when deploying application on Mer ARM device.

LV3atKp.png

5. You can edit the short description of your project or just click Next

7YPwbVc.png

6. You can add version control to your project(in example GIT or SVN)

lprPc7M.png

7. Click Finish 8. The project template is imported into your project and opened in the editor.

OYyvFEK.png

3. Launch the Mer build machine and Emulator

The SailfishOS SDK uses a Mer build machine to compile your code and another virtual machine to run an emulator. If these are not running when you attempt to build or deploy an application you will be asked to start them.

Note: The Mer build machine needs access to your source code to compile it and by default your home directory is shared - this is why the project should be in your home.

When a Sailfish OS project is open, the SDK automatically displays two control buttons in the left toolbar for starting/stopping the Mer build machine and Emulator.

0vAckoW.png

3.1. Click on the nSniuw6.png icon to launch Mer Build Engine.

The Mer Build Engine is started in the background and the icon will turn gray until the machine has booted up.

3.2.— Click on the zzawOqw.png icon to launch the emulator.

A new VirtualBox window opens and boots up the emulator.

SP9eCDT.png

4. Successful connection

When the QtCreator can successfully connect to both the emulator and Mer build machine, the icons are updated as shown below.

Before connection:

ifAYFRi.png

Connection established:

tQe3Og8.png

5. Build and Deploy the app

Press the aI9ECKM.png play/run button in the toolbar to compile and run the project on the emulator.

That's it. Congratulations! You just ran your first SailfishOS application. It should be running in the emulator as shown below:

wJ4tqvy.png


Article is part 2 of the SailfishOS Introduction Tutorial
< Go to part 1 ||| Go To Part 3 >