-
RecyclerView optimization using RecycledViewPool
In the previous post we have looked at how to clean up resources in RecyclerView.ViewHolder which makes sure we don’t waste memory unnecessarily. But that’s not all of the things you can do to make RecyclerView scrolling more smooth, there are number of things we can still improve. In this...
-
Cleaning up resources in RecyclerView ViewHolder
In your journey you might have often wondered when exactly to clean up resources in a RecyclerView ViewHolder. The topic isn’t easy and like most you probably tried to use onViewAttachedToWindow & onViewDetachedFromWindow, only to find it’s not working and gave up hoping you’ll get away with no resource freeing...
-
Unit Testing objects with Android API references
In an ideal world every class in the old codebase would be ready for testing - the dependencies would be provided via the constructor, there would be no Android APIs used inside Presenters… Sorry to wake you up just now but you’re not living in an ideal world… The Global...
-
Improving TextView setText performance
In previous post we have looked at how we can improve performance when working with TextView and Spannables. In this post we will explore ways to make setting of text on TextView faster. If you look at the source code of setText method you can see that it does a...
-
Improving TextView & Spannable Performance
You probably encountered Spannables at some point in your android journey but just to remind you, they are used in order to apply styling to text. A fact that you might not have known is that there are a lot of span types such as ForegroundColorSpan ImageSpan ClickableSpan and many...
-
Hexadecimal color code for transparency
During the lifetime of every android developer there comes a time when he has to use color transparency on android. Whether it’s to add an overlay to bring something into focus or simply create an ugly custom view that is a part of business requirements. In this post we’ll cover...
-
Indie Dev App Launch Checklist
This post will be a little different… I won’t make this a secret - I am an indie developer. In my lifetime I have created probably around 35 apps. You can have a look at my developer account - right now I have closer to 10 apps since not all...
-
Room Database - Backup & Restore Features
Not that long ago I wanted to implement Backup & Restore features in my new application called Notably Notepad. I thought such basic features will be well-documented and supported - I mean every app containing a database would want to allow the user to move his data to a new...
-
Android 11 Scoped Storage - Saving Files To Shared Storage
By now probably all of you had to hear about the dreaded changes to file storage on Android 11. So what exactly changed? According to Google apps now “have access only to the app-specific directory on external storage, as well as specific types of media that the app has created.”...
-
Editing AndroidManifest.xml File
In this article we will look at something that is not that commonly done - editing of the merged manifest file. You might wonder why would you need to do that in the first place? If you’re working just on your simple app and do not use many 3rd party...
-
Webview Dark Theme Support
In the previous post we’ve looked at how we can add Dark Theme support to our app. Full of hope you tried to test your app and everything went well until you stumble upon a Webview… By default Webview will assume Light theme version, breaking your dark theme user experience....
-
Dark Theme Support
In this article I’ll try to explain how to support Dark Theme in your Android App. Dark Theme has been introduced starting with Android 10 (API level 29) According to Google it has many benefits: reduced power consumption easier usage to use in low-light environment reduced eye strain for users...
-
Strandhogg Vulnerability
Mobile malware becomes increasingly difficult to protect against, with hackers trying more subtle approaches to gain access to user’s phone or steal his data. Probably we have all heard stories of someone we know that got hacked loosing access to his accounts and even money. One of the vulnerabilities that...
-
Editing Website HTML On Android
I know this might not be strictly related to android development but hopefully some of you might find this post useful as well. As a person who has to deal with websites a lot I often struggled to find a way check to out my website on android phone while...