📜 ⬆️ ⬇️

About Sailfish OS Summer School 2016

In this article, I would like to tell you about the wonderful event that took place from July 27 to July 30 - the Sailfish OS summer school, organized by an “open mobile platform” with the support of Innopolis University. If you are interested in the prospect of Sailfish OS development, of real Linux on smartphones or just another area of ​​QML / C ++ application is interesting - I ask for a habrak.




')


First of all I would like to say that for me this story with Sailfish OS began on April 1, 2016. No kidding, it was on this day that I received my long-awaited Jolla in my arms. And it started ... Digging into the OS, reading manuals, publishing a couple of articles on geektimes and the first own application in the official store.

Once, sitting at home, reading Habr, I saw a post-announcement about the Sailfish OS Summer School and immediately decided that I should be there. A couple of weeks later I was standing in the city of Innopolis on their main street, Universitetskaya.


Pictures are clickable.

What was this place! What a community of developers! That was incredible! Hmm ... Okay, let's drop the emotions, let's go in order.

July 27


It was a day of dating, a day of opening speeches, a day of accommodation ...



Settled participants in comfortable rooms for two:



The rooms had everything necessary for small breaks between coding “portions”: beds, shower, air conditioning, and a table. The only thing in my room was 4 bedside tables for two and zero (!) Chairs, I think you guessed how we used 2 "extra" bedside tables.

Why there were no chairs
As the representative of the University Innopolis explained to us that this campus is not yet fully prepared for students. Hmm, and I would live in this "unfinished".

I was especially lucky with my neighbor, I lived with all the respected, the lord of the patches for Sailfish OS , Andrey Kozhevnikov, better known by the nickname CodeRus. Sailfish OS has just a little problem with the documentation, in particular, its structure and insufficient coverage of some details, and here I was settled with a walking knowledge base on Sailfish OS, I hope that my joy is clear at that moment? :) Thank you, Andrew, for all the comprehensive answers to my questions.

By 15.00, everyone gathered in the audience â„–307, where we actually lived the next 48 hours.



We listened to introductory speeches, general words about Sailfish OS, its prospects in Russia, about the role of the Open Mobile Platform. The rector called to study at Innopolis.

Then came the partners:

Alexander Kiselev - Embedding VipNet Solutions in Sailfish OS . It is said that a very popular solution for the corporate market.

Georgy Martirosov - Safe browser Satellite . It turned out to be interesting, they did a search, but in the end they make a browser ... Well, personally, I will not mind if a competitor to a standard browser appears on Sailfish OS.

Egor Levichev, Alexander Serzhantov - Active Sync on the Sailfish OS platform . Very interesting guys. As for the quality of implementation, I heard from users that it is very stable, eats little battery, everything is integrated into the system, natively and “Android users are jealous.”

Petr Barbanyaga - Mobile payment terminal (Sailfish OS) .

In the evening we were taken on a tour of the city of Innopolis:





About the city of Innopolis
In order not to overload the article, I will answer briefly: the city is still developing, about 2,000 people live there now, but there is everything necessary for comfortable living: cheap housing, a supermarket, a football field, a swimming pool, a medical center, a nursery, a kindergarten, a school and so on. We will see what this “project” will take in the future, but we wish him good luck and return to our main topic.

July 28 - 29


From this day, the tension begins to increase exponentially!



From 09.00 lectures began, before us were:

Kirill Chuvilin (representative of the Open Mobile Platform for Community Relations, founder of MaemoWorld.ru) - Sailfish OS SDK Review + Master-class GUI application development for Sailfish OS . He talked about the features of the SDK, about how to do the right interfaces for Sailfish OS, since the OS compares favorably with others: almost everything here is done by svaypami, and not by tapping the screen, which requires some skill from the developer.

Andrei Vasiliev ( FRUCT representative) - Master class on working with the main API Sailfish OS . It was an interesting report on how to "jerk" GPS, control various sensors, play sounds, take pictures.

Pavel Goryansky (representative of the Open Mobile Platform) - hardware adaptation of Sailfish OS . Pavel talked about how to start Sailfish OS on unsupported devices, what is needed for this, etc.

Andrei Kozhevnikov (aka CodeRus, representative of the community) - no matter how much the wolf feeds, he is watching a master class on modifying the Sailfish OS in the forest . Oh, it was a very entertaining speech, on the topic “How to make MyOwn OS from Sailfish OS”. Seriously, thanks to QML you can almost completely rewrite the original interface for yourself! I hope that in the future, Andrew will cover this topic personally, as it is worthy of a separate article.

Peter Vytovtov (aka Osanwe, developer of native client for Vkontakte and Wi-Fi networks analyzer, community representative) - a master class on working with speech recognition services . Informed how you can use Yandex Speechkit on Sailfish OS.

Alexey Andreev (winner of the Sailfish OS hackathon in St. Petersburg, participant of semiot.ru ) - a master class on working with IoT devices . It was nice to meet the “soul mate” - a person who also deals with the Semantic Web.

At 7.30 pm presentations of ideas for the hackathon began, and of course the following projects turned out to be viable:
FriendlyARM port - Sailfish OS adaptation project for developers;
MyFirstProgram - tools for interaction between smartphones and robot designers, such as TRIK and Lego NXT;
Battery Stats is a utility for monitoring battery consumption;
GEO-location share - the exchange of location data between devices;
Guitar Tuner - Guitar Tuner ;
CryptoFish - password encryption of files;
Suburban Trains - electric train schedule based on Yandex data;
Weather - information about the weather, taking into account the location;
Killer - role-playing game based on the psychological game "Killer";
AppCleaner - delete unnecessary data and applications;
WatchFox - encryption of the user's home section;
CryptoContainer - secure file storage in a container;
Timelapse is an application for taking interval photos and videos.

Yes, nowadays the themes with the prefix "crypto" are fashionable, but seriously, many were concerned about the topic of security.

My team decided to make a game based on the role-playing game Killer. Decided on the implementation features:

- The choice of the victim occurs on the server (in the team was one of the creators of "Killer" under android, so the server was already ready);
- Requests and authorization in Vkontakte for receiving photos and the name of the victim;
- “Murder” of a “victim” using a “shot” via Bluetooth;
- using GPS, the program points the victim to Google Maps;
- demon to track the location of the player.

In general, the plans were great ...

What we did or how we didn’t win the hackathon, but gained great experience


In my team, I was responsible for the UI, so part of the article will be devoted to him. First of all, we sketched an approximate image of all the pages (as in Sailfish OS every “window” is called) and the ways of transition between them:



The first test started from the victim selection page, for this the Dialog component was best suited, it turns out that the developers of the Silica framework did not assume that the page with Dialog would be the first page of the application and because of this Cancel (from left to right worked and did not look quite right) . Therefore, I had to cheat: the first page would be a blank page, from which a quick transition to DialogPage would be (a blank page is drawn very quickly, so the user will not see such a “hoax”).



First page source code:

import QtQuick 2.0 import Sailfish.Silica 1.0 import "../js/server_request.js" as ServerRequest Dialog { id: dialogFirstPage property string name: "" property string surname: "" property string imagePath: "../images/avatarUnknown.png" property string uniqueKey: "Waiting..." onAccepted: { console.log("accepted") //        pageStack.push(Qt.resolvedUrl("SecondPage.qml"), { "name": name, "surname": surname, "imagePath": imagePath, "uniqueKey": uniqueKey}, PageStackAction.Animated) } onRejected: { console.log("declined") //      pageStack.push(Qt.resolvedUrl("FirstPage.qml"), {}, PageStackAction.Immediate) //    ,    "" ServerRequest.server_getNextRandomTargetId("34853940", callback_getNextRandomTargetId) } function callback_getNextRandomTargetId(responseText) { uniqueKey = responseText; } Column { anchors.fill: parent DialogHeader { acceptText: "Accept" cancelText: "Cancel" } Text { id: victimText width: parent.width horizontalAlignment: Text.Center color: Theme.highlightColor font.bold: true wrapMode: Text.Wrap font.pixelSize: Theme.fontSizeExtraLarge text: "Choose new victim:" } Image { id: avatar source: imagePath anchors.horizontalCenter: parent.horizontalCenter width: 400 height: 400 } Text { id: nameText width: parent.width horizontalAlignment: Text.Center color: Theme.highlightColor font.bold: false wrapMode: Text.Wrap font.pixelSize: Theme.fontSizeExtraLarge text: name } Text { id: surnameText width: parent.width horizontalAlignment: Text.Center color: Theme.highlightColor font.bold: false wrapMode: Text.Wrap font.pixelSize: Theme.fontSizeExtraLarge text: surname } Text { id: keyText width: parent.width horizontalAlignment: Text.Center color: Theme.highlightColor font.bold: false wrapMode: Text.Wrap font.pixelSize: Theme.fontSizeExtraLarge text: "Victim code:\n" + uniqueKey } } } 

Source code "tricks":

 import QtQuick 2.0 import Sailfish.Silica 1.0 import "pages" ApplicationWindow { //   ,   FirstEmptyPage.qml (    ,      ): initialPage: true ? Qt.createComponent(Qt.resolvedUrl("pages/FirstEmptyPage.qml")) : Qt.createComponent(Qt.resolvedUrl("pages/LoginPage.qml")) cover: Qt.resolvedUrl("cover/CoverPage.qml") allowedOrientations: Orientation.All _defaultPageOrientations: Orientation.All //            : Component.onCompleted: { // immediate ->   pageStack.push(Qt.resolvedUrl("pages/FirstPage.qml"), {}, PageStackAction.Immediate) } } 

Then everything went easier, the authorization in Vkontakte made using WebView.

 import QtQuick 2.0 import QtQuick.LocalStorage 2.0 import Sailfish.Silica 1.0 import "../js/auth.js" as AuthJS import "../js/storage.js" as StorageJS Dialog { id: loginPage function checkUrl(url) { if (AuthJS.checkUrl(url) !== 1) { console.log(AuthJS.accessToken) StorageJS.storeSettingsValue("access_token", AuthJS.accessToken) StorageJS.storeSettingsValue("user_id", AuthJS.userId) loginView.stop() loginPage.close() } } SilicaWebView { id: loginView anchors.fill: parent url: "https://oauth.vk.com/authorize?" + "client_id=4803503" + "&scope=messages,video,wall,audio,friends,photos,offline" + "&redirect_uri=https://oauth.vk.com/blank.html" + "&display=mobile" + "&response_type=token" onUrlChanged: checkUrl(url) } } 

In the WebView implementation, the code from the client for VK - Kat helped a lot. Thanks to the author for the wonderful application!

Then, on the queue, there was a “Wanted” page, in content it is very similar to DialogPage, but the PullDownMenu component is used to open the map and PullUpMenu is used to “kill”. Using PullDownMenu and PullUpMenu:

 import QtQuick 2.0 import Sailfish.Silica 1.0 Page { // ... // PullDownMenu  PushUpMenu     SilicaFlickable, SilicaListView  SilicaGridView SilicaFlickable { anchors.fill: parent PullDownMenu { //  : backgroundColor: "green" highlightColor: backgroundColor //      option: quickSelect: true MenuItem { text: "Open map" onClicked: { console.log(qsTr("Option <Open map> clicked")) pageStack.push(Qt.resolvedUrl("MapPage.qml")) } } } contentHeight: column.height Column { // ... } PushUpMenu { backgroundColor: "red" highlightColor: backgroundColor quickSelect: true MenuItem { text: "Kill!" onClicked: { console.log(qsTr("Option <Kill!> clicked")) pageStack.push(Qt.resolvedUrl("EnterCodePage.qml"), {"uniqueKey": uniqueKey}) } } } } } 




Swipe from the bottom up we get to the “murder” page, unfortunately, we did not have time to deal with Bluetooth, so we came up with the following: the server sends a unique code to the victim, and the “killer” had to read it directly from the “victim” screen and enter it.


If the code is not correct, then we give an attempt to enter it again, otherwise we congratulate with the "murder" and make a transition to the victim selection page.

Thus, by the end of the hackathon we did not have time to do:

- Requests in Vkontakte for receiving photos and the name of the victim;
- “Murder” of a “victim” using a “shot” via Bluetooth;
- demon to track the location of the player.

And also we didn’t have the best presentation of the application ... But we had a UI, which, at least, I was really proud of myself (even though it was with some bugs ...). It was a huge step forward for me. Before the trip, I could only create a 1-2 page application with very primitive logic, for example, the “Chance.” Application:


After the hackathon, I felt the strength to create much more interesting multi-page programs.

July 29. Evening


After the hackathon was completed, they were taken to a bowling club, where a banquet, chatting and rewarding awaited us all. After bowling, we did not go to sleep for a long time, we discussed the results of the hackathon, thought about Sailfish OS, talked heart to heart.

July 30


Immediately after breakfast, the organizers discussed with the participants wishes and ideas for the development of Sailfish OS. Then, at parting, "taken to the people" - organized an excursion to the island-town Sviyazhsk. After a really great tour, it's time to say goodbye - Sailfish OS Summer School has come to an end.

Conclusion


This fascinating adventure ended, because it was a little sad, but at the same time, my heart was warming from the memories with how many incredibly interesting people met, how many emotions and experiences received. And how interesting this world is! You can not win the hackathon, make a presentation of the application is not the most successful way, lose, but get tremendous experience in return, much more experience than winning!
In general, I was driving home with the firm conviction that it would be my great IT hobby.



Bonus number 1


A couple of tips for those who have not yet participated in the hackathons:

- Think over and make presentations of your ideas / creations as best you can and speak out more effectively. Much really depends on this (!);

- Clearly state for yourself and the audience the task minimum and maximum.

Bonus number 2


Video of all speeches.

useful links


» Link to the group in VK.
» Chat developers in telegrams.
» Timelapse
Suburban Trains

PS Thanks to my friends for the first reviews and proofreading of this article.

UPD: I would like to add that the code published in this article should not be taken strictly, it was written on the hackathon and published with minor corrections, the application itself will develop, very slowly, but it will. So do not scold much :)

Source: https://habr.com/ru/post/307834/


All Articles