KotlinPref is a library that provides delegation functionality for Android's SharedPreferences in Kotlin. It allows accessing SharedPreferences values via synthetic properties rather than directly calling getString, getInt etc. This reduces boilerplate and makes the code more readable. The document provides examples of how to use KotlinPref to store and retrieve values from SharedPreferences in a simpler way compared to the traditional Android approach.
Say Goodbye To Java: Getting Started With Kotlin For Android DevelopmentAdam Magaña
Â
Kotlin is officially endorsed by Google for Android development but what is all the fuss about? Why should accomplished Java developers care? Here I explore some of the history, fundamentals, and tools that Kotlin provides for Android developers.
Will talk about kotlin the language and new concepts introduced in the language including functional programming.
And how to use your springframework knowlege to write more concise and elegant backend systems.
We will demo a backend written in spring boot and kotlin and will see how it is so easy to interoperate between java and kotlin code.
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017Hardik Trivedi
Â
The presentation was given in Ahmedabad GDG DevFest 2017. It has introduction to Kotlin for Android App Development.
Talk will is specially designed for beginners, who has heard about Kotlin but couldnât explore it till date. The talk will take attendees to the journey where they can know Kotlin as a programming language. What Kotlin offers for Android? How to start the development using Kotlin, Features of Kotlin, Some of the disadvantages of Kotlin.
I will be discussing about following topics
- Whatâs Kotlin
- Why Kotlin
- Setting up Kotlin
- Features of Kotlin
- Syntax crash course
- Classes
- Features of function programming like Lamdabs and Higher order functions
- Usage of Anko
- Migrating from Java project to Kotlin
- Future of Kotlin
- Disadvantages of Kotlin
Kotlin advanced - language reference for android developersBartosz Kosarzycki
Â
StxNext Lightning Talks - Mar 11, 2016
Kotlin Advanced - language reference for Android developers
This presentation contains the 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.
We present real-world example based on Stx-Insider project written in Kotlin which incorporates Dagger 2, Kotterknife, Retrofit2 and is composed of 5+ Activities.
Full agenda
Live templates
Enum translation
Calling extension functions from Kotlin/Java
Constructors with backing fields
Warnings
F-bound polymorphism
Variance (Covariance/Contravariance)
Variance comparison in Kotlin/Java/Scala
Annotation processing - KAPT
SAM conversions
Type equality
Lambda vs Closure
Reified generics
Fluent interfaces
Infix notation
Static extension methods in Kotlin
Generic types
Sealed classes
Dokka - documentation in Kotlin
J2K converter
Real-world example
Reflection
Presentation is accompanied with an example project (StxInsider):
https://github.com/kosiara/stx-insider
Say Goodbye To Java: Getting Started With Kotlin For Android DevelopmentAdam Magaña
Â
Kotlin is officially endorsed by Google for Android development but what is all the fuss about? Why should accomplished Java developers care? Here I explore some of the history, fundamentals, and tools that Kotlin provides for Android developers.
Will talk about kotlin the language and new concepts introduced in the language including functional programming.
And how to use your springframework knowlege to write more concise and elegant backend systems.
We will demo a backend written in spring boot and kotlin and will see how it is so easy to interoperate between java and kotlin code.
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017Hardik Trivedi
Â
The presentation was given in Ahmedabad GDG DevFest 2017. It has introduction to Kotlin for Android App Development.
Talk will is specially designed for beginners, who has heard about Kotlin but couldnât explore it till date. The talk will take attendees to the journey where they can know Kotlin as a programming language. What Kotlin offers for Android? How to start the development using Kotlin, Features of Kotlin, Some of the disadvantages of Kotlin.
I will be discussing about following topics
- Whatâs Kotlin
- Why Kotlin
- Setting up Kotlin
- Features of Kotlin
- Syntax crash course
- Classes
- Features of function programming like Lamdabs and Higher order functions
- Usage of Anko
- Migrating from Java project to Kotlin
- Future of Kotlin
- Disadvantages of Kotlin
Kotlin advanced - language reference for android developersBartosz Kosarzycki
Â
StxNext Lightning Talks - Mar 11, 2016
Kotlin Advanced - language reference for Android developers
This presentation contains the 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.
We present real-world example based on Stx-Insider project written in Kotlin which incorporates Dagger 2, Kotterknife, Retrofit2 and is composed of 5+ Activities.
Full agenda
Live templates
Enum translation
Calling extension functions from Kotlin/Java
Constructors with backing fields
Warnings
F-bound polymorphism
Variance (Covariance/Contravariance)
Variance comparison in Kotlin/Java/Scala
Annotation processing - KAPT
SAM conversions
Type equality
Lambda vs Closure
Reified generics
Fluent interfaces
Infix notation
Static extension methods in Kotlin
Generic types
Sealed classes
Dokka - documentation in Kotlin
J2K converter
Real-world example
Reflection
Presentation is accompanied with an example project (StxInsider):
https://github.com/kosiara/stx-insider
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
Kotlin Bytecode Generation and Runtime Performanceintelliyole
Â
In this talk, we'll dive into the details of how various language features supported by Kotlin are translated to Java bytecode. We'll use the JMH microbenchmarking tool to study the relative performance of various constructs and to understand how we can ensure top performance of the Kotlin code that we write.
Kotlin provides a lot of features out of the box even though those are not supported by JVM. Have you ever wondered how Kotlin does it? If yes, then this presentation is for you.
Kotlin compiler tweaks our code in such a way that, JVM can execute it. this deck goes through lots of Kotlin features and explains how it looks at runtime for JVM compatibility. Of course we are not going to look into bytecode, instead we will look into the decompiled version of the bytecode generated by Kotlin compiler.
NOTE: This was presented at DevFest Kolkata 2019.
Kotlin is a JVM language developed by Jetbrains. Its version 1.0 (production ready) was released at the beginning of the year and made some buzz within the android community. This session proposes to discover this language, which takes up some aspects of groovy or scala, and that is very close to swift in syntax and concepts. We will see how Kotlin boosts the productivity of Java & Android application development and how well it accompanies reactive development.
It's 2017. Kotlin, a great language for the JVM, has been around for more than 6 years now and has changed the way a lot of developers look at the features and evolutionary progress of Java. Kotlin has become a very popular alternative to Java for Android developers and with Kotlin 1.1 being on its way, thing are going to become more exciting.
This talk will start with a brief introduction into Kotlin and its core language features. After this brief foray into concepts like Kotlin's immutable variables, null behaviour and other smarts like the syntactic sugar it provides for dealing with types and properties we'll have a look into what in store for Android developers and into new features in Kotlin 1.1, such as Kotlin Coroutines, Jack support for Android and lots of improvements to the standard library.
The Jetbrain's Kotlin language cheat sheet, created by ekito and launched for the Toulouse's devfest - https://www.ekito.fr/people/kotlin-cheat-sheet/
This paper helps you keep the main feature of the Kotlin language, under the hand. Just download it & print it !
From object oriented to functional domain modelingCodemotion
Â
"From object oriented to functional domain modeling" by Mario Fusco
Malgrado l'introduzione delle lambda, la gran parte degli sviluppatori Java non Ăš ancora abituata agli idiomi della programmazione funzionale e quindi non Ăš pronta a sfruttare a pieno le potenzialitĂ di Java 8. In particolare non Ăš ancora comune vedere dati e funzioni usate insieme quando si modella un dominio di business. Lo scopo del talk Ăš mostrare come alcuni principi di programmazione funzionale quali l'impiego di oggetti e strutture dati immutabili, l'uso di funzioni senza side-effect e il loro reuso mediante composizione, possono anche essere validi strumenti di domain modelling.
Little Helpers for Android Development with KotlinKai Koenig
Â
Kotlin is a new language for the JVM that aims to be a "better Java". Made in-house by Jetbrains, the company behind IntelliJ IDEA and also Android Studio, it's been in development for more than 5 years. Just a few months ago the final version of Kotlin 1.0 saw the light of day.
Starting off with Kotlin for Java development and for Android is actually quite straight forward. There's a lot of well written documentation, there are the Kotlin Koans and blogs seem to pick up Kotlin-related topics more and more. What a lot of people are not aware of though is that there are a bunch of really useful libraries and tools for Kotlin developers, in particular on Android (the most common and well known one being Ando).
This session from Droidcon Germany 2016 in Berlin will start with a quick introduction into Kotlin and its benefits over Java. Then we'll dive into the Kotlin-Android-ecosystem and look at a variety of Kotlin tools and libraries that can make one's life much easier - even to a level going beyond what core Kotlin already has to offer.
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
Kotlin Bytecode Generation and Runtime Performanceintelliyole
Â
In this talk, we'll dive into the details of how various language features supported by Kotlin are translated to Java bytecode. We'll use the JMH microbenchmarking tool to study the relative performance of various constructs and to understand how we can ensure top performance of the Kotlin code that we write.
Kotlin provides a lot of features out of the box even though those are not supported by JVM. Have you ever wondered how Kotlin does it? If yes, then this presentation is for you.
Kotlin compiler tweaks our code in such a way that, JVM can execute it. this deck goes through lots of Kotlin features and explains how it looks at runtime for JVM compatibility. Of course we are not going to look into bytecode, instead we will look into the decompiled version of the bytecode generated by Kotlin compiler.
NOTE: This was presented at DevFest Kolkata 2019.
Kotlin is a JVM language developed by Jetbrains. Its version 1.0 (production ready) was released at the beginning of the year and made some buzz within the android community. This session proposes to discover this language, which takes up some aspects of groovy or scala, and that is very close to swift in syntax and concepts. We will see how Kotlin boosts the productivity of Java & Android application development and how well it accompanies reactive development.
It's 2017. Kotlin, a great language for the JVM, has been around for more than 6 years now and has changed the way a lot of developers look at the features and evolutionary progress of Java. Kotlin has become a very popular alternative to Java for Android developers and with Kotlin 1.1 being on its way, thing are going to become more exciting.
This talk will start with a brief introduction into Kotlin and its core language features. After this brief foray into concepts like Kotlin's immutable variables, null behaviour and other smarts like the syntactic sugar it provides for dealing with types and properties we'll have a look into what in store for Android developers and into new features in Kotlin 1.1, such as Kotlin Coroutines, Jack support for Android and lots of improvements to the standard library.
The Jetbrain's Kotlin language cheat sheet, created by ekito and launched for the Toulouse's devfest - https://www.ekito.fr/people/kotlin-cheat-sheet/
This paper helps you keep the main feature of the Kotlin language, under the hand. Just download it & print it !
From object oriented to functional domain modelingCodemotion
Â
"From object oriented to functional domain modeling" by Mario Fusco
Malgrado l'introduzione delle lambda, la gran parte degli sviluppatori Java non Ăš ancora abituata agli idiomi della programmazione funzionale e quindi non Ăš pronta a sfruttare a pieno le potenzialitĂ di Java 8. In particolare non Ăš ancora comune vedere dati e funzioni usate insieme quando si modella un dominio di business. Lo scopo del talk Ăš mostrare come alcuni principi di programmazione funzionale quali l'impiego di oggetti e strutture dati immutabili, l'uso di funzioni senza side-effect e il loro reuso mediante composizione, possono anche essere validi strumenti di domain modelling.
Little Helpers for Android Development with KotlinKai Koenig
Â
Kotlin is a new language for the JVM that aims to be a "better Java". Made in-house by Jetbrains, the company behind IntelliJ IDEA and also Android Studio, it's been in development for more than 5 years. Just a few months ago the final version of Kotlin 1.0 saw the light of day.
Starting off with Kotlin for Java development and for Android is actually quite straight forward. There's a lot of well written documentation, there are the Kotlin Koans and blogs seem to pick up Kotlin-related topics more and more. What a lot of people are not aware of though is that there are a bunch of really useful libraries and tools for Kotlin developers, in particular on Android (the most common and well known one being Ando).
This session from Droidcon Germany 2016 in Berlin will start with a quick introduction into Kotlin and its benefits over Java. Then we'll dive into the Kotlin-Android-ecosystem and look at a variety of Kotlin tools and libraries that can make one's life much easier - even to a level going beyond what core Kotlin already has to offer.
Design Summit - UI Roadmap - Dan Clarizio, Martin PovolnyManageIQ
Â
The UI, while fullty-features, is intimidating to new users. The roadmap for the UI is to make it more intuitive and navigable for new users.
For more on ManageIQ, see http://manageiq.org/
Speaker session taken by Mr. Adit Lal who is GDE Android and Individual Consultant. It was all about jetpack compose along with some hands-on application.
MOPCON 2014 - Best software architecture in app developmentanistar sung
Â
Talking about how to build smart design and architecture for app development. Let your app can easy develop and deploy components on your app. And more topic of version control and quality improvement.
With the introduction of the iPhone 6s and the iPhone 6s Plus, Apple added 3D Touch, a new dimension to the multi-touch user interface. This new technology senses how deeply users press the display and provides a new way to interact with the iPhone.
In iOS 9, Apple introduced several 3D Touch APIs. In this session I will explain in a practical way what is 3D Touch and how you can benefit from it in your app. I will cover home screen quick actions, peek and pop actions and also how to use the force properties of a UITouch event.
Python Code Camp (Professionals) is a whole day workshop that aims to enable professionals to learn Python Basics and Django.
Visit: http://devcon.ph/events/python-code-camp-professionals-2016
Jak vyvinout ĂșspÄĆĄnou aplikaci pro Google Glass (Martin Pelant, eMan)eMan s.r.o.
Â
PĆednĂĄĆĄka Martina Pelanta o vĂœvoji mobilnĂch aplikacĂch pro Google Glass se uskuteÄnila 19.8.2014 ve spoluprĂĄci s IDE Prague. Odkaz na FB udĂĄlost: https://www.facebook.com/events/912995792048693/
Large Language Models and the End of ProgrammingMatt Welsh
Â
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Â
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
RequirementâââCollecting the Requirements is the first Phase in the SSLC process.
Feasibility Studyâââafter completing the requirement process they move to the design phase.
Designâââin this phase, they start designing the software.
Codingâââwhen designing is completed, the developers start coding for the software.
Testingâââin this phase when the coding of the software is done the testing team will start testing.
Installationâââafter completion of testing, the application opens to the live server and launches!
Maintenanceâââafter completing the software development, customers start using the software.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Â
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges â from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
Â
JASMIN is the UKâs high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERCâs long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
E-commerce Application Development Company.pdfHornet Dynamics
Â
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Need for Speed: Removing speed bumps from your Symfony projects âĄïžĆukasz ChruĆciel
Â
No one wants their application to drag like a car stuck in the slow lane! Yet itâs all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. Weâll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Â
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
Â
In this second installment of our Essentials of Automations webinar series, weâll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
Weâll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether youâre tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Letâs turn complexity into clarity and make your workspaces work wonders!
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Â
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. Itâs here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Â
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
5. Kotlin for Android
â Reduce the amount of boilerplate code you need to write
â Make your code more readable and understandable
â No more errors such as NPE
â No more findViewById()
â One language for Android & Gradle
â Interoperability
â New languge -> Kotlin is fun
â Compatible with JDK 6 -> can run on older Android devices
6. Kotlin for Android / Android Extensions
Kotlin Android Extensions
â Compiler extension that allows to us replace findViewById() calls with
synthetic-generated properties
13. Anko
â Anko is a library that uses Kotlin and provides a lot of extension functions to
make our Android development easier.
â It contains wrappers around the Android APIs and DSL that allows to us to
replace layouts written in the XML file
14. Anko
Gradle
dependencies {
// Anko
compile "org.jetbrains.anko:anko-sdk15:$anko_version"
compile "org.jetbrains.anko:anko-support-v4:$anko_version"
compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
}
15. Anko - Layouts
val act = this
val layout = LinearLayout(act)
layout.orientation = LinearLayout.VERTICAL
val name = EditText(act)
val button = Button(act)
button.text = "Say Hello"
button.setOnClickListener {
Toast.makeText(act, "Hello, ${name.text}!",
Toast.LENGTH_SHORT).show()
}
layout.addView(name)
layout.addView(button)
verticalLayout {
val name = editText()
button("Say Hello") {
onClick { toast("Hello, ${name.text}!") }
}
}
20. Anko - Buttons and Toasts
With Kotlin we can add click listener and show toast like this:
buttonNext.setOnClickListener {
Toast.makeText(baseContext, "CLicked!!", Toast.LENGTH_LONG).show;
}
21. Anko - Buttons and Toasts
With Kotlin we can add click listener and show toast like this:
but with Anko we can do it better:
buttonNext.setOnClickListener {
Toast.makeText(baseContext, "CLicked!!", Toast.LENGTH_LONG).show;
}
buttonNext {
onClick {
toast("Hello ${username.text}")
}
}
or we can show LONG toast:
onClick { longToast("Hello ${username.text}") }
22. Anko - Asynchronous Tasks
fun authorizeUser(username: String, password: String) {
doAsync {
val authorized = signInBL.checkUserCredentials(AuthCredentials(username = username, password = password))
activityUiThread {
if (authorized) toast("Signed!!!") else view.showAccessDeniedAlertDialog()
}
}
}
23. Anko - Asynchronous Tasks
Since Anko 0.10-beta1 a new way Anko Coroutines
dependencies {
compile "org.jetbrains.anko:anko-coroutines:$anko_version"
}
24. Anko - Asynchronous Tasks
Since Anko 0.10-beta1 a new way Anko Coroutines suspend fun getData(): Data { ... }
class MyActivity : Activity() {
fun loadAndShowData() {
// Ref<T> uses the WeakReference under the hood
val ref: Ref<MyActivity> = this.asReference()
async(UI) {
val data = getData()
// Use ref() instead of this@MyActivity
ref().showData()
}
}
fun showData(data: Data) { ... }
}
25. Anko - Asynchronous Tasks
Since Anko 0.10-beta1 a new way Anko Coroutines fun getData(): Data { ... }
fun showData(data: Data) { ... }
async(UI) {
val data: Deferred<Data> = bg {
// Runs in background
getData()
}
// This code is executed on the UI thread
showData(data.await())
}
https://github.com/Kotlin/anko/wiki/Anko-Coroutines
27. Anko - Intents
Anko contains some useful wrappers for some common intents:
// Took it from original Anko documentation
// Make a call
makeCall(number) // Intent(Intent.ACTION_CALL, Uri.parse("tel:$number"))
// startActivity(intent)
// Send a text
sendSMS(number, [text])
//Browse the web
browse(url)
//Share some text
share(text, [subject])
//Send a email
email(email, [subject], [text])
Arguments in square brackets ([]) are optional
28. Anko - Intents
Start a new activity
val intent = Intent(this, SomeOtherActivity::class.java)
intent.putExtra("id", 5)
intent.setFlag(Intent.FLAG_ACTIVITY_SINGLE_TOP)
startActivity(intent)
29. Anko - Intents
Start a new activity
with Anko:
val intent = Intent(this, SomeOtherActivity::class.java)
intent.putExtra("id", 5)
intent.setFlag(Intent.FLAG_ACTIVITY_SINGLE_TOP)
startActivity(intent)
startActivity(intentFor<SomeOtherActivity>("id" to 5).singleTop())
startActivity<SomeOtherActivity>("id" to 5)
30. Anko - Logging
class SomeActivity : Activity(), AnkoLogger {
private fun someMethod() {
info("Prague is the capital of Czech Republic")
debug(5) // .toString() method will be executed
warn(null) // "null" will be printed
}
}
âŠ..
info { "Prague is the capital of Czech Republic" }
31. Anko
â Anko SQLite
â Provides lots of extension functions to simplify working with SQLite
dependencies {
compile
"org.jetbrains.anko:anko-sqlite:$anko_version"
}
class MySqliteOpenHelper : ManagedSQLiteOpenHelper {}
database.use {
// Here we have SQL
}
32. Anko
â Anko SQLite
â Provides lots of extension functions to simplify working with SQLite
val values = ContentValues()
values.put("id", 1)
values.put("name", "Vaclav")
values.put("email", "vaclav@email.com")
db.insert("User", null, values)
db.insert("User",
"id" to 1,
"name" to "Vaclav",
"email" to "vaclav@email.com"
)
33. Anko
â Anko SQLite
â Provides lots of extension functions to simplify working with SQLite
db.select("User", "name")
.whereArgs("(_id > {userId}) and (name = {userName})",
"userName" to "John",
"userId" to 42)
https://github.com/Kotlin/anko/wiki/Anko-SQLite
34. Modern SQL based query & persistance for Java / Kotlin / Android
https://github.com/requery/requery
35. Requery
â Object mapping and SQL generator for Java/Kotlin/Android
â RxJava and Java 8 support
â Create databases
â Perform queries and updates
36. Requery
â Features
â No Reflection
â Typed query language
â Table generation
â Supports JDBC and most popular databases (MySQL, Oracle, SQL
Server, Postgres and more)
66. KotlinPref
Android SharedPreferences delegation library for Kotlin
object UserInfoPrefModel : KotprefModel() {
var userId: Int by intPrefVar(default = -1)
var name: String by stringPrefVar()
}
Live Demo
https://github.com/chibatching/Kotpref