Search This Blog

Loading...

Tuesday, April 12, 2016

Kotlin during Android Developer Group Poznań (ADG) meetup


Last week I presented STX Insider project at Android Developer Group meetup in Poznań, Poland (ADG). It’s entirely written in JetBrains’ new programming language Kotlin. The presentation was focused on technical aspects of the code, mainly on nullpointer safety, interoperability with Java, final value preference, nullable types and extension functions. After the talk, participants had the chance to answer a few questions about the language.

One can draw the following conclusions from the survey:
  • developers are intersted in Kotlin but most of them haven’t written anything in it yet
  • they see the potential but aren’t ready to abandon Java just yet

Event details (ADG Poznań):
https://www.facebook.com/PoznanADG/posts/1458635877496012

Presentation slides:
http://www.slideshare.net/BartoszKosarzycki/adg-pozna-kotlin-for-android-developers






Thursday, April 7, 2016

Kotlin advanced - language reference for android developers


Kotlin - one of the popular programming languages built on top of Java that runs on JVM.

As a mobile team we got interested in Kotlin a few months before its final release which gave us time to test it thoroughly before production use. The language has some clear advantages for an Android programmer - it enables migration from Java projects that have been under development for some time already. Java&Kotlin coexistence simplifies Kotlin introduction as only new functionality is written in JetBrain’s new language leaving all the legacy code untouched.

Transitioning gives the developer an opportunity to use lambdas, new syntax for data objects, extension functions to easily expand Android SDK’s classes functionality and infix notation to write DSL-like structures. Almost all the libraries you use today will work with Kotlin thanks to 100% Java compatibility. The same is true for Android SDK classes - all of them will seamlessly work with the new programming language. Kotlin gives you more choice when it comes to reflection, creating documentation and being null-pointer safe. Android works great with it out of the box so you won’t need to change your development habits.

Our production project in Kotlin turned out to be a success after 4 months of development. We had 0 bugs related to Kotlin as a programming language. Our code footprint is almost 30% smaller thanks to JetBrain’s, we benefit from nullpointer safety, closures, translated enums, data objects and use infix notation for logging and displaying Snackbars.

Kotlin advanced - language reference for android developers

Second talk on Kotlin language we had at STXNext. We try go deeper into language specifics and look at the positive impact new syntax can have on boilerplate removal and readability improvement. Kotlin really shines in Android development when one looks at “Enum translation”, “Extension functions”, “SAM conversions”, “Infix notation”, “Closures” and “Fluent interfaces” applied to lists. The talk, however, compares language-specifics of Java & Kotlin in terms of “Type Variance”, “Generics” and “IDE tools” as well.



Monday, March 21, 2016

Zulip IM


Lately we've moved to Zulip as our main company IM app.
The story behind Zulip is that it was created as group chat application optimized for software development teams and later on (around 2014) acquired by Dropbox. The development of the core application ceased due to harsh competition from Slack. On Sept 25, 2015 the original Zulip team decided to open-source the project and make it publicly available.
Zulip has some clear advantages over the pure internal jabber server, the main of which is the web client access and no configuration to hassle with (other features are listed here - https://zulip.org/features.html)

Zulip's Android app has not been updated since Feb, 2015 and probably will never be so we took the code and refreshed it. On the plus side - it works with our internal IM server, the design has been slightly refreshed (although almost no material design is present there).
With the current version push-notifications are switched off so there is no battery drain and the IM doesn't bother you until you open the app to have a chat.
In future versions push notifications will be present ONLY as an option.

You can download the app here:
https://goo.gl/u8QU1x

The source code is available here:
https://github.com/kosiara/zulip-android





Tuesday, February 16, 2016

Kotlin Developer Starter in Android projects


During our STX Next's Lightning Talks I'd given a presentation about Kotlin. It's a quick starter about the language. The idea was to create a short talk that would fit in a timeframe of 45m-1h. I assumed that attendees had basic skills from Android development, functional programming, java JDK and some JVM languages like - scala, closure or groovy.



Slideshare presentation:
https://t.co/oVPJw1YIGa


Presentation summary:
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice for Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and keeping short compile times on the other.

This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up a kotlin-based Android project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin compilation is presented and the language is compared to SCALA and SWIFT.


Tuesday, December 8, 2015

Automated acceptance tests in Calabash

The Mobilengers team at StxNext has recently moved to Calabash as our automated acceptance testing framework. All tests are written in Gherkin - simple, descriptive language that Cucumber can understand. Gherkin gives the ability to describe the desired behaviour in plain text preserving the possibility to run such a test on real devices. It serves two purposes - as a documentation tool and as automated tests framework. It has been translated to over 60 spoken languages (with leading English) so that your team can use the keywords in their own language.

Automated tests follow two simple conventions - that source file should be saved as .feature and that one source file should only contain description of a single feature.

Calabash is the mobile implementation of Cucumber. It enables native apps testing and is cross-platform - Android/iOS. It’s also open-source with all the code available freely on GitHub.

With Calabash we’re able to implement simple gestures (like - swipe down, button-clicks, go back etc.), make assertions concerning displayed content as well as take screenshots whenever something goes wrong in the app.

Running tests in the cloud on the real devices gives us the possibility to cover more devices without buying every phone available on the market. We use Amazon AWS Device Farm which has the possibility to run Calabash tests and covers most popular device models. It also gives detailed tests results, takes screenshots as well as pinpoints references to lines of source code where specific errors have originated from. AWS has the option to test apps in different device locales, GPS locations and specific “other apps” dependencies.

Simple tutorial on how to install Calabash (OsX/Ubuntu) and run basic tests can be downloaded here.




Reference:
https://github.com/kosiara/calabash-android-example-projects
https://github.com/calabash/calabash-android
https://github.com/calabash/calabash-ios
https://cucumber.io/
https://github.com/cucumber/cucumber/wiki/Gherkin
http://www.slideshare.net/Codemotion/calabash-codemotion-2012 (ios)
http://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html

Books:
https://pragprog.com/book/hwcuc/the-cucumber-book












Sunday, May 10, 2015

PEKA - wirtualny monitor

Niedawno rozpoczęły się prace nad aplikacją umożliwiającą sprawdzanie dokładnego czasu przyjazdu tramwajów i autobusów.
Nareszcie możliwe jest wygodne korzystanie z wirtualnego monitora systemu PEKA na urządzeniach mobilnych.

Jeżeli mieszkasz w Poznaniu - wybierz ulicę, a następnie swój przystanek - aby zobaczyć dane, które pozwolą Ci DOKŁADNIE określić w którym momencie przyjedzie Twój tramwaj/autobus.

Funkcje:

- szukaj połączeń autobusowych/tramwajowych według ulicy/nazwy przystanku/nr linii

- dodawaj poszczególne przystanki do ulubionych, aby mieć do nich szybki dostęp

- połączenia z rzeczywistym czasem przyjazdu są oznaczone niebieskim "GPS"
- widget umożliwiający obserwowanie swojego ulubionego przystanku


Kliknij tutaj, aby przejść do Google Play.








Saturday, April 4, 2015

OsX - handful of shortcut key combinations

1. q: Where is the insert key  a: Apple's keyboard does not have an insert key
   emulate 'ins' key by pressing Ctrl + "t"

2. q: Where is the ~ key?  a: to the right of the left "shift" key

3. q: How to take a screenshot of the screen? a: press "ctrl" + 3 - to take the screenshot of the entire screen and "ctrl" + 4 - to take the screenshot of the selected screen area. Screenshots are saved on the desktop



Resources:
mac-os-x-and-midnight-commander-the-missing