Skip to content
Showing 1-42 of 42 items.
@renovate
Admin 09/03/2021 18:10
Kotlin dễ ẹc - Lớp vs đối tượng: Object expression và Object declaration

Khi nào dùng Khi muốn tạo một đối tượng với những sự thay đổi nhỏ của lớp mà không phải khai báo tường minh lớp con của lớp đó. Object expression Tạo một đối tượng của một lớp ẩn danh kế thừa từ một hoặc nhiều kiểu khác. Đối tượng như thế được gọi là đối tượng ẩn danh (tên bên bển là anonymous object), cú pháp:window.addMouseListener(object : MouseAdapter() { override fun...

Kotlin android kotlin kotlin basic
@renovate
Admin 19/03/2021 23:40
Android Kotlin dễ dàng hơn với Higher Order Funcion

Giới thiệu Bài viết với chủ đề Higher Order Functions dành cho những người mới tiếp cận với Kotlin. Nếu như các bạn là một lập trình viên Android đi lên từ Java, chắc chắn sẽ nhận xét rằng Kotlin thật sự rất "kool ngầu". Một trong những thứ tạo nên điều diệu kỳ này chính là việc hỗ trợ lập trình hàm. Tức là các hàm (functions) có thể được truyền vào như một biến của hàm...

Happy New Year android kotlin
@renovate
Admin 22/03/2021 02:20
Migrating deprecated Kotlin Android Extensions

Kể từ Kotlin 1.4.20-M2 JetBrains không còn dùng compiler plugin Kotlin Android Extensions nữa. Thực ra điều này đã được mong đợi từ lâu, trong commit này, bạn có thể thấy ở phần Replaced kotlinx synthetic with findViewById: kotlinx.android.synthetic is no longer a recommended practice. Removing in favour of explicit findViewById. Lý do? Có một số vấn đề lớn với kotlinx synthetic: Để lộ ra một global namespace gồm các id không...

android kotlin
@renovate
Admin 22/03/2021 08:00
Navigation Component

Introduction Navigation Component are in simple terms, components required to perform navigations and Navigation refers to the interactions that allow users to navigate across various areas within the app. Android Jetpack's Navigation component helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer. The Navigation component also ensures a consistent and predictable user experience by adhering to an established set of...

Happy New Year android kotlin Android Android Navigation Component
@renovate
Admin 01/05/2021 03:50
Áp dụng SOLID trong Android

1. SOLID là gì Thử tưởng tượng bạn đang ở trong một thư viện sách. Bạn muốn tìm một cuốn sách nào đó. Nếu như thư viện được sắp xếp gọn gàng, phân loại sách tốt thì bạn sẽ dễ dàng tìm được cuốn mình cần. Ngoài ra, nếu như thư viện mà được thiết kế nội thất tốt, bạn sẽ có hứng thú hơn khi đọc sách. Cũng giống như ví dụ trên, khi bạn xây dựng một ứng dụng, bạn phải...

android kotlin SOLID MobileTeam Education May Fest
@renovate
Admin 08/05/2021 00:00
Higher-order Function & Lambda

1. Higher-order function là gì ? Thuật ngữ "Functional programming" là một dạng lập trình mà ta có thể truyền các hàm như 1 tham số hay return 1 hàm , Higher-order function là một dạng như vậy Dưới đây là hai kiểu thể hiện cơ bản của Higher-order function : 1. Higher-order function được truyền như tham số Ta có ví dụ một Higher-order function như sau : fun printPerson(name: String , printName: (Int?) -> String) { ...

android kotlin May Fest
@renovate
Admin 14/05/2021 17:30
Android demo app: Code một app chuyển đổi đơn vị tiền tệ sử dụng MVVM và Jetpack cơ bản

Trong bài viết này mình sẽ cùng viết một app chuyển đổi đơn vị tiền tệ, sử dụng những công cụ trong gói JetPack và sử dụng mô hình MVVM nhé ! Cụ thể sẽ gồm có : Kotlin MVVM (Model View ViewModel Pattern) Hilt (For Dependency Injection) Retrofit Live Data Data Binding Kotlin Flow Kotlin Coroutine.... 1. Add thư viện cho project: Thêm đoạn code này vào build.gradle (Module App) , apply plugin: 'com.android.application' apply...

android kotlin Android Android Jetpack Hilt
@renovate
Admin 18/06/2021 06:40
Voice to Text Speech Recognition

The SpeechRecognizer class provides access to the speech recognition service. Its a google Api service that allows access to the speech recognizer. So to but it in simplier terms, this api allows you to talk to your devices and converts your speech into text. In order for this service to run its methods have to be invoked only from thr main application thread. Now lets create and app to demo how it works. Note: In this demo we will use our own interface and not that of the google's...

Kotlin android kotlin Android SpeechRecognition
@renovate
Admin 16/10/2021 17:10
Học Android trong 1000 từ - Bước 1: Kotlin cơ bản

Xin chào mọi người, đây là bài viết mở màn của mình trong series Học Android trong 1000 từ. Đây là một series mang tính chất mì ăn liền, dùng để làm guideline cho các bạn beginner giống mình, để không bị lạc lối trong rất nhiều nội dung ngoài kia. Sau mỗi bài viết mình sẽ dẫn thêm các link để mọi người nghiên cứu sâu hơn. Bài viết này sẽ phù hợp nhất với những ngoài đã từng làm việc...

#AppMobile android kotlin Android Android App Android For Beginner
@renovate
Admin 17/12/2021 14:40
Khởi tạo ViewModel sao cho hợp thời đại

Bài viết này tôi sẽ sử dụng Kotlin để khởi tạo ViewModel và AndroidViewModel. Nếu bạn chưa biết Delegation trong Kotlin thì hãy đọc bài viết này trước nhé. Nếu đã ok rồi thì hay đưa tay cho tôi, tôi sẽ dẫn các bạn đi qua từng ngóc ngách của chủ đề này Đây là một ví dụ minh họa ViewModel và AndroidViewModel kiểu mẫu =]]. class MyViewModel: ViewModel() { } class MyAndroidViewModel (app: Application) :...

android kotlin Android Clean Architecture ViewModel MVVM