Active Topics

 


Reply
Thread Tools
Posts: 646 | Thanked: 1,124 times | Joined on Jul 2010 @ Espoo, Finland
#11
There is is tutorial that also explain a bit how to set up the environment (Note: last updates is 1 year old, so current SDK might have changed a bit)
http://hardcodes.de/SailfishOS/Devel...SailfishOS.pdf
 

The Following 4 Users Say Thank You to minimos For This Useful Post:
Posts: 426 | Thanked: 1,812 times | Joined on Dec 2013
#12
I think there are several programming video tutorials also for SailfishOS.
I did one aswell almost two years ago: https://www.youtube.com/watch?v=z3hMGNwObx8
(Maybe I just need to update this video someday)

The basics are still the same I guess.
But the best is to practice and experiment with the Sailfish SDK and the demo applications there.
There is also a nice GUI in the emulator showing all the great UI elements and how you basically use them in SailfishOS.
What helps is reading code that other wrote (not like a book, just pick up the things you are interested in like "how did he/she did that ?").
Before writing your own application from the "scratch" you could also try to write little patches for existing applications to add your favorite feature or something like that.
I would also suggest you in writing and uploading this patches as suggestion to merge to the official code. Most of the times the developers are friendly to code submissions and will either directly integrate the code or give suggestions on how to improve the code for it to integrate.
__________________
Donation for my sailfish apps via PayPal

Donate using Liberapay
 

The Following 3 Users Say Thank You to llelectronics For This Useful Post:
lorenzo's Avatar
Posts: 491 | Thanked: 299 times | Joined on Jul 2012 @ Pordenone IT
#13
thank you all, i took a look at sailfish and qt5 sdk but i think i need something more basic
 
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#14
Originally Posted by lorenzo View Post
thank you all, i took a look at sailfish and qt5 sdk but i think i need something more basic
Well, if you're really starting from square one, just sitting down in front of the Qt SDK may be a bit too much to ask for.

You could certainly grab a couple of "intro to programming" books and work your way through them. But the best way to get a quick start, in my opinion, is to try out a few little examples in a language that doesn't require much effort to set up and get started.

I kind of like the idea of starting with "Javascript", because every web browser supports it, and you can see the results of your code instantly. And it does have variables, data types, functions, and most everything else you'll find standard in modern languages.

I haven't tried it myself, but there's a website called CodeAcademy that seems to offer an excellent introduction to languages like Javascript. There are lots of other Javascript resources on the net, and you can certainly just try out your own code by writing it to a text file and opening it into pretty much any web browser...

Anyway, just an idea.
 

The Following 9 Users Say Thank You to Copernicus For This Useful Post:
Posts: 594 | Thanked: 1,094 times | Joined on Aug 2012 @ Rhine
#15
when you start from zero, you shouldn't start with a specific language .

learn what are conditions, loops, arrays, objects, functions etc. in general
when you have an abstract understanding of all those basic elements, it's not so hard to transfer it to the language you need.

edit: leave ot the objects for some time, concentrate on the basics

Last edited by Leinad; 2015-01-06 at 22:03.
 

The Following 4 Users Say Thank You to Leinad For This Useful Post:
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#16
Originally Posted by Leinad View Post
when you start from zero, you shouldn't start with a specific language .

learn what are conditions, loops, arrays, objects etc. in general
when you have an abstract understanding of all those basic elements, it's not so hard to transfer it to the language you need.
I agree that an understanding of the basic concepts of programming languages is vital to becoming a successful programmer; but man, would you really want to work your way through every single concept before ever writing your first program? It sounds like an awfully painful method to bootstrap your way into writing code. (And besides, I'm not sure there even is a book or a website out there that describes the fundamentals of coding completely outside the context of a programming language...)

If you've got a computer sitting in front of you, I see no reason not to use it every step of the way. For each concept taught to a student, have that student put it to practice immediately, and see the results; at the very least, that seems a more enjoyable way to learn a subject.
 

The Following 6 Users Say Thank You to Copernicus For This Useful Post:
Posts: 594 | Thanked: 1,094 times | Joined on Aug 2012 @ Rhine
#17
for a beginner, fighting with syntax errors for hours can be even more frustrating than understanding concepts

i don't mean, he should do this for months or weeks without coding, but often you loose overview while fiddling in codelines
 

The Following User Says Thank You to Leinad For This Useful Post:
Posts: 100 | Thanked: 389 times | Joined on Dec 2013 @ Finland
#18
Start from the basics. I recommend that you start with some scripting language and move after that to C++, Java or C#.

1. Python has clean and nice syntax for beginners (http://www.codecademy.com/en/tracks/python)
2. After that you could learn basics of JavaScript (http://www.codecademy.com/tracks/javascript)
3. Learn C++ (or Java or C# or some other compiled language)

Python + Javascript + C++ is a nice combo in many aspects and especially if you're targeting mainly Sailfish OS (In QML you can use Javascript, Qt is C++ and pyotherside is allowed in Harbour).

C++ is not easy but it makes you familiar with memory management, pointers, compiler errors and a lot of other stuff which is very important if you really want to understand programming at lower level without all the abstractions.
 

The Following 7 Users Say Thank You to skvark For This Useful Post:
benny1967's Avatar
Posts: 3,790 | Thanked: 5,718 times | Joined on Mar 2006 @ Vienna, Austria
#19
I love this question because I was at that point a few months ago. The difference was that I had done some coding in my life, even with Qt/C++, and felt brave enough to try on my own although I had forgotten anything meanwhile.

Not knowing where you come from and what you've already done, my advice to someone without much coding experience would be:
  • Don't let people intimidate you by claiming QML is so easy and you'll learn coding for Sailfish in no time. You'll be very frustrated and feel dumb if you believe this. Yes, QML is easy, but it's only one part in a quite complex patchwork you have to master: handling the SDK, learning a programing language like JavaScript to make your code do more powerful stuff, maybe getting used to completely unrelated things like XPath and regular expressions if you need them in your particular application, finally packaging the whole stuff... You'll learn all this along the way, there's no one tutorial that you follow to the end and afterwards you can write any app for Sailfish.
  • Start with plain QML examples. QML can be as simple as HTML/CSS: "Draw a rectangle, 120px wide, 200px high, borders 5px, color red". You can expand such examples until the rectangles actually do something when you click on them (like changing colors or loading an image from the web). That'll feel a bit like a first simple application.
  • I'd recommend you do not start with the Sailfish SDK but use the regular Qt Creator instead. Experiment with simple QML in the classic desktop environment. I found it more straightforward because Sailfish's Silica components add an extra level of complexity you just don't need during your first steps. Also, you don't need to run such simple test code in a virtual machine that emulates Sailfish. Keep away from things that distract you at this stage.
  • If you don't know JavaScript, now's a good time to learn some. Chances are that your first simple Sailfish application won't even need much of it, but even with only a few lines of additional code you'll need to know the basics. You can still experiment with combining QML and JavaScript in the regular Qt Creator, no Sailfish specific stuff here. (The other route here would be to integrate C++, I guess, but as you stress you want something simple, JavaScript will be for you.)
  • Now throw away everything you've done so far, install the Sailfish SDK and try to make it run (which can be a torture on some machines). Follow the blueprints and examples, understand which QML-parts make a basic Sailfish application. Jolla added some simple building blocks you can use. Like the rectangles you started with, now there's buttons and pages and pulley-menus built for Sailfish. They follow the same rules and mechanics though that you got used to with your first steps in QML.
  • Put it all together. Take the rectangles from your first examples, put them in Sailfish application with a pulley menu and see if you can change the colors via the menu. Play!
  • When you finally feel comfortable enough to start coding the application you have in mind, you will need even more. As I said above, I was all fine with QML and JavaScript, but I needed XPath and regular expressions along the way; that's not something you need specifically for Sailfish, I just happened to need it for the one application I wrote. Also, you might eventually want to interact with the plumbings of Sailfish in a way that isn't covered by QML and JavaScript. Then you'll take the next step.

All in all, I think it's right to describe the whole journey as trial and error. While there is good documentation about most everything, for some reason it almost always only covers what you already know. It hardly ever contains the answer why your code doesn't behave the way you expect it.
 

The Following 12 Users Say Thank You to benny1967 For This Useful Post:
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#20
+1 to Copernicus. Compare every other programming book starting with a lot of theory with K&R, where the very first chapter starts with how to write a "Hello, world" program.

You need the theory and, most importantly, the mindset to begin developing software. But you can pick up most of them by example.
__________________
Русский военный корабль, иди нахуй!
 

The Following 2 Users Say Thank You to pichlo For This Useful Post:
Reply

Tags
developing, sailfish os


 
Forum Jump


All times are GMT. The time now is 19:16.