A few days ago i had problems with an app and wanted to clear the app data. Usually you can do that under “Settings> Apps>”Name of the app” > STORAGE> CLEAR DATA” I don’t really remember why, but i clicked… Continue Reading →
In some of my Gradle based projects, i use libraries which have to be downloaded from many different Maven Repositories. To get a better overview of all used repos i wanted to group them in a list. Unfortunately it was… Continue Reading →
This is a small example on how to get started with Dagger 2. I will explain how to create a component that will provide an instance of an Retrofit Api. Please check out my example Github project If you have… Continue Reading →
What is a Companion Object? When you are new to Kotlin and you are familiar with Java, you may be wondering how you can create static methods and fields in Kotlin. Unlike Java, Kotlin doesn’t have a static keyword. Kotlin… Continue Reading →
In this post i want explain what is LiveData and how you can use it. 1) What is LiveData LiveData is an observable data holder class. Unlike a regular observable, LiveData is lifecycle-aware, meaning it respects the lifecycle of other… Continue Reading →
What is a Higher Order Function? A higher-order function is a function that can take other functions as parameters and returns other functions. How to create a Higher Order Function?
1 2 3 4 |
fun printIt(passedFunction: ()->Unit ) { passedFunction() println("bye, world!") } |
You can create a higher order function like any… Continue Reading →
What is a StateListDrawable? Let’s say you have a View like a Button. You want to set a background to the button, you use
1 |
android:background=”@drawable/ic_assignment_returned_black_24dp” |
But what can you do when you want to set a different background while the… Continue Reading →
At the moment i’m working on an App with a search function. This alone is nothing special. Every second App has a search function. As a standard component the Android SDK offers the class SearchView. You can add an SearchView.OnQueryTextListener… Continue Reading →
In this post i want to explain you how i use Gradle variables to keep my buildscript clearer. DefaultConfig and Dependencies The problem
1 2 3 4 5 6 7 |
dependencies { ... implementation 'com.android.support:appcompat-v7:27.0.2' implementation 'com.android.support:recyclerview-v7:27.0.2' implementation "com.jakewharton:butterknife:8.8.1" annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1" } |
By default you add your dependencies under dependencies in your build.gradle . But the more dependencies… Continue Reading →
This is an ongoing series of blog posts with small tipps and tricks that helped me at developing Android apps. Android LPT: 1 Use variables in Gradle
© 2022 Jensklingenberg.de — Powered by WordPress
Theme by Anders Noren — Up ↑