TL;DR: A WITHOUT ROWID table can reduce DB size and perform query faster than an ordinary rowid table.
A good strategy is to simply not worry about WITHOUT ROWID optimization until near the end of development, then go back and run tests to see if adding it helpul or not.
By default, every row in SQLite has a special column — usually called rowid.
rowid can be used to uniquely identifies a row within the table.
For example, create a new table:
CREATE TABLE TopRatedFilm(
As a result, SQLite creates rowid beginning with…
TL;DR: To write JVM unit test for Android build version, you can: Modify the build version field at runtime or Create a wrapper for build version checking.
By the arrival of Android Q last year, Google has released 17 Android versions with many different APIs — that need to be checked during runtime execution to implement corresponding behavior.
To fetch information about the version that your device is running on, you need to access Build.VERSION class:
SDK_INT: The SDK version of the software currently running on this hardware device.
Look at the code, you will see that it gets the…
TL;DR: The plus sign in “@+id/” tells Android build tools that you are declaring a new resource. And if it does not exist, add to R.java file.
But basically, you don’t have to think, just use “@+id/” anywhere you want!
In Android, when dealing with XML layouts, we come across the ID attribute in the View or Layout tags. From the beginning, we learn that it will assign or refer the id of this View/Layout. However, you might have noticed that they are different variations:
So in what cases are they used?
Recently, I often get questions from university students like:
TL;DR: You can create utils class by putting methods inside an
object, or use package-level functions.
If you’re integrating with Java code and need a true
staticutils method, you can put this method inside an
objectand annotate it with
For those who don’t know, Kotlin is a cross-platform, statically typed language with type inference. Kotlin is designed to interoperate fully with Java, and the JVM of its standard library depends on the Java Class Library.
Kotlin is sponsored by JetBrains and Google through the Kotlin Foundation. Now is a good time to consider to use Kotlin for…
Today when preparing for the Computer Network exam, I would like to share some basic things about Private IP and Public IP.
Today I’m working on a school project of Software Design which need to use OOP, so I decide to write a small article about Constructor and Inheritance in C#
When initializing new object of a subclass, constructor of the parent class will be called first, after that constructor of the subclass will be called.
For example, I have Base and Child class (inherited from Base) as follows:
Run the program, you’ll see the constructor of the Base has been called first!
TL;DR: You can manage your resources XML files (layout, drawable,..) better, by grouping them into separate subfolders corresponding to app’s features.
Today when optimizing the codebase of my school project, I saw this:
If you can read this:
If you are a software developer:
A virtual machine is based on computer architectures to provide functionality of a computer.
There are 2 main types of Virtual Machine (VM):
Software Engineer, also a Runner and Guitarist.