Skip to main content

Posts

Showing posts from January, 2025

Basics of Room Persistence Library in Android #RP1

Room is a library built on top of SQLite that provides a more convenient and structured way to manage your app's local database. It lets you work with your data as Kotlin objects (data classes) instead of manually formulating them using SQL queries, which itself is a tedious task prone to many errors.   It also simplifies interactions with the database with many great features like validating the queries, seamless integration with Kotlin Flow, paging, LiveData, and many more. These features make Room the most preferred option for offline-first apps, as it expedites the process and helps us to avoid issues early in the development cycle. Since Google has the best article for setting up, I will be skipping the setup Dependency setup: Official Guide on Setting up Room Dependencies and plugins   Please do ensure you follow the above guide and then sync and build your project successfully, as it will help you to try out the components yourself. In t...

KotlinBytes: The Spread(*) Operator

I have posted a similar article on a different style on linked-in which is a 2 min read, and it tries to cut to the point without any jibber jabbers ;) feel free to check it out ( here is the link ). Since you have taken the long path with interest to the full story lets dive in, The current item of the sprint at work was offline-implementation for the feature i am already working on, so i had an implementation already for bulk get call for the list screen, and i wanted is same exact implementation but this time for the detail screen so a single get call, Like most people i started to duplicate the function and modify the param and tweek the implementation to match the new requirement but then i kinda realised that i will have to modify this later as i  move further, so i kinda looked around the internet and couldn't find any right solution except passing it as a list with only one item, this felt really wrong.  I tried asking ChatGPT and she gave me complicated solutions whic...