Author Topic: Getting started  (Read 8770 times)

0 Members and 1 Guest are viewing this topic.

Offline saildev

  • Jr. Member
  • **
  • Posts: 60
  • Developing Qt5 applications for SailfishOS.
    • View Profile
  • Phone model: Jolla
Getting started
« on: November 18, 2013, 07:56:56 AM »
Howdy!  8)

I provide a few - and a little bit more - links which you should read before you get started with. You can also find a lot of useful informations if you have problems.

I try to explain some details about each link I give you to help you find a correct section with your problem. Just remember that you do not have to read every possible content from each site before you're getting started. That's why I have categorized them.


Before getting started

There are two sites that you must get familiar with. Why? Because it contains everything you need to know about Qt and Silica.

-----
Qt 5.1 documentation: http://qt-project.org/doc/qt-5.1/qtdoc/index.html
Here you can find all possible QML elements you're able to use in your projects. Not only that, you find information and examples using C++ and connecting it to your QML files.

Remember to read QtQuick 2.0 specific documentations as well.

Code: [Select]
// You don't have to import Qt 5.1 package, but QtQuick is required.
import QtQuick 2.0

-----
Sailfish Silica Reference: https://sailfishos.org/sailfish-silica/sailfish-silica-all.html
Here you can find all Sailfish related components, called Silica.

Code: [Select]
// Also you have to import Silica library.
import Sailfish Silica 1.0

** Both of these imports should be in your .qml files by default when you create a new project.

** When you create your first, empty project, remember to read all of it's files carefully. It provides the basic functions you need when you start developing. To save some time - and your nerves - the most important are .qml files.
“First, solve the problem. Then, write the code.” - John Johnson

Offline saildev

  • Jr. Member
  • **
  • Posts: 60
  • Developing Qt5 applications for SailfishOS.
    • View Profile
  • Phone model: Jolla
Re: Getting started
« Reply #1 on: November 18, 2013, 07:57:21 AM »
After the basics

When you've read two the most important links and you know what they keep inside, it's time to move on.

-----
Silica components
I mentioned the Sailfish Silica Reference which holds almost all the Silica components in it. You can also find an example project from [... / SailfishOS - examples - SailfishOS - componentgallery - qml - pages] directory.

Get familiar with these codes and also remember to see how they work in action. Launch your emulator - either from SDK or VirtualBox - and open the application named "Component...". It has this dark, propeller kind of icon.

-----
Joona Petrell's PDF documentation: https://sailfishos.org/presentations/qtdevdays_beijing_2013_jpetrell.pdf
Here Joona explains a little bit more about Silica's components and functions. Well, he doesn't actually explain but shows you what they actually are. Still I suggest you to try every single one of the links found in Sailfish Silica Reference. That way you get the idea of it.

-----
Vesku's (Vesa-Matti Hartikainen) presentation in QtDevDays [download link]: https://sailfishos.org/presentations/QtDevDay-SailfishSDK_presentation.zip
Here you can find an example project which Vesku create during the QtDevDays' Sailfish presentation. If you read it carefully you may find some interesting little details from it. ;)
“First, solve the problem. Then, write the code.” - John Johnson

Offline saildev

  • Jr. Member
  • **
  • Posts: 60
  • Developing Qt5 applications for SailfishOS.
    • View Profile
  • Phone model: Jolla
Re: Getting started
« Reply #2 on: November 18, 2013, 07:57:39 AM »
Where do I get more information about Qt?

Qt 5.1 documentation gives you a lot of information about the whole Qt based coding. It includes QML, Javascript and C++. To be honest, in basic applications QML is everything you need. With Javascript you achieve a little bit more advanced things but to get really good with this and provide the best high-end solutions for your application you should learn C++. With it you can do almost anything. -- Almost..

-----
MeeGo 1.2 Harmattan Developer Library: http://harmattan-dev.nokia.com/docs/library/html/guide/html/Developer_Library_MeeGo_1.2_Harmattan_Developer_Library.html
It may sound funny, but if you want more examples about both QML - plus Javascript - and C++ examples this is a great place to learn.

Only thing you should remember is that MeeGo uses - or actually used ... - different Qt version. It doesn't only affect on Qt library, but also QtQuick. So pay attention on it! If you try something and it gives you an error, it might be because of it.

The best way to avoid mistakes - when studying this specific library - is to always make sure you can find it in Qt 5.1 documentation - and if it uses it in a different way.

-----
Nokia Developer - Qt - Code examples: http://developer.nokia.com/Develop/Qt/Code_examples/
Yes, I know. Another Nokia website for learning ...

However this holds more example codes than the MeeGo 1.2 Harmattan Developer Library. Well, to be precise, it contains more useful, a real life examples.
“First, solve the problem. Then, write the code.” - John Johnson

Offline saildev

  • Jr. Member
  • **
  • Posts: 60
  • Developing Qt5 applications for SailfishOS.
    • View Profile
  • Phone model: Jolla
Re: Getting started
« Reply #3 on: November 18, 2013, 07:57:59 AM »
What's next?

I think by so far you know a lot about Qt. Does that make you a great developer now? To be honest, no.

Why? Because programming is not just theory in coding language. It's practicing. Yes, it all comes down to practice. Try to place yourself some easy tasks at first.Also you have to remember that no matter you could create a very complex codes, it is not enough. You also need to know what would be the best way to design it in order to give the use the best experience among all the other similar applications. Believe it or not, the design is very important.

By design I don't mean how complicated or modern it is. Sometimes you achieve the best results by using default components - in this case Silica components - with icons provided with it. On the other hand, sometimes it might be better to create your own custom components and using icons only.

It's all up to you.

A good way to learn as well is to learn from the others. That's why I suggest you to try to find a lot of open source projects about Qt - especially related to Sailfish applications.

Not only that, but there are a lot of places where you can get more information and help if - and when - you have problems. You just have to remember that there are only few people who helps you by giving the answes. Most of the time they advice you where to get the information and how you should do it. There's a difference between how you do it and giving the answer itself. You won't learn if you just copy from others.

The best place - in my opinion - to get help is of course #sailfishos channel [Freenode] on IRC. You can use it by using this link: https://webchat.freenode.net/.
“First, solve the problem. Then, write the code.” - John Johnson

Offline saildev

  • Jr. Member
  • **
  • Posts: 60
  • Developing Qt5 applications for SailfishOS.
    • View Profile
  • Phone model: Jolla
Re: Getting started
« Reply #4 on: November 18, 2013, 07:58:20 AM »
Other useful links

There are two websites that has nothing to do with Qt itself But I've found them very helpful in many situations.

-----
HTML Entities: http://www.danshort.com/HTMLentities/index.php
Some of you may not be talented when it comes to designig icons for your application. To be honest, I try to find the icon - or should I say a symbol - from here which I can use.

There are actually another good reason why I prefer this instead of creating my own icon. As you may know Sailfish uses ambience. That's one thing which makes it so unique. If you create an icon using Photoshop, for example, it's hard to create a correct ambience for it. It can be done with C++ of course, but it requires a lot of skills. Therefore if I find a note symbol from there - which acutally can be found under Musical symbols entity type - I could use it on my Music library application. -- Which I did, by the way. ;)

-----
Color Hex Color Codes: ttp://www.color-hex.com/
This is another useful site for color designing. Some colors work better with each others - and that's a fact. You don't actually need a knowledge when it comes to color codes if you want darker color. Just find the correct color from there and it gives you a lot of information about it; Shades, tints, monochromatic, analogous, triadic and complementary colors, previews on black and white, ...

I use it a lot and that's enough for me. :)

-----
SailfishOS icon templates: http://forum.jollausers.com/sailfish-developers/sailfishos-icon-templates/
When the times come that you're about to release your application on Jolla Harbour [https://harbour.jolla.com] you can use these time saving icon templates for your work.

All thanks to Morpog! ;)

Also remember to name your application properly and give it a short summary and full description located in .yaml and / or .spec file. It's important when user downloads it. Also the release version is very important!
“First, solve the problem. Then, write the code.” - John Johnson

Offline saildev

  • Jr. Member
  • **
  • Posts: 60
  • Developing Qt5 applications for SailfishOS.
    • View Profile
  • Phone model: Jolla
Re: Getting started
« Reply #5 on: November 18, 2013, 07:58:33 AM »
Conclusion

I hope you can get a lot of inspiration and help from these links.

Like I've said - probably too many times - if you have any problem I'm more than happy to help you. Remember that you're not alone with this and we've all been novices at some point. :)

And for the final words; You can find all geeks  on #sailfishos IRC channel when it comes to developing applications for Sailfish.
“First, solve the problem. Then, write the code.” - John Johnson

Offline thesignal

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Getting started
« Reply #6 on: November 18, 2013, 04:13:32 PM »
Thank you saildev for this link-compilation, very helpful.  :D

I haven't read each post yet, but I got something to add, regarding the "coding or development" behaviour:

Some guy in the irc channel (#sailfishos), i think it was artemma, told me to fill each component I'm using in a qml page with a rectangle in a specific color. With this little trick you can easily see how big for example a picture or a list entry is, and where it overlaps,...

just put the following code into a, for example Image{}:

Code: [Select]
Rectangle {
anchors.fill: parent
color: "green"
opacity: 0.5
}

This will result in something like this:



Happy coding!

Offline mike7b4

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Getting started
« Reply #7 on: November 18, 2013, 10:35:46 PM »
There also Vesku's video



and MeR for those intrested in that. Kinda unrelated to enduser development but gives little info how MeR infra is built.


Offline Whippler

  • Full Member
  • ***
  • Posts: 215
    • View Profile
  • Phone model: Jolla
Re: Getting started
« Reply #8 on: December 16, 2013, 12:09:27 AM »
Now here's a quick question. Whats the standard path within a project to place javascript files?
Jolla
Nokia 6630 2004/12->2008/8 and 5310 2008/8 ->2010/12
HTC Desire Z 2010/12 -> 2013/12

azureblue

  • Guest
Re: Getting started
« Reply #9 on: December 26, 2015, 10:09:18 AM »
The links of the Sailfish Silica Reference and Joona Petrell's PDF documentation are not working. Might you provide those materials?