Posts

Barcode Scanning

Image
Some developer may be still using ZXing  to add barcode scanning function in their app. However, ML Kit on Android also provide barcode scanning function. And more important is, it is powered by Machine Learning. Making barcode scanning faster.

Notification

Image
Developer should always use NotificationCompat.Builder  to build an notification. Otherwise, the Notification may not be displayed property.

"Next" or "Skip" ?

Image
Think before you place any button in the UI. "Next" and "Skip" should behave differently.  

Display Cutouts

Image
Android support  Display Cutouts  since Android 9 (API 28). However, still many applications didn't consider Display Cutouts in their design, causing view components covered by the Status Bar. Display Cutouts used to be in the middle of the top edge. But there are more and more devices having the cutouts at the top corners. Developers should pay more attention when testing.

Quantity Strings

Image
Notification, Notifications, or Notification(s)? In Android, Quantity Strings could help you to display the correct singular and plural.  Why not let the system to help you? And why you are still displaying something like notification(s)?

Optimizing Images

Image
  Sometimes, if the image is simple, consider lower the color depth of the image. Squoosh is an online tool to help you to optimize the bitmap image. Android support multiple image format, JPEG, GIF, PNG, WebP, HEIF.  Choose the one which fits you most. Using VectorDrawable is also a good way to reduce the file size of the image.

Black on Black and Palette API

Image
While displaying text on an image, make sure the text is readable for user. Aovid "white on white", "black on black".  By  Selecting Colors with the Palette API , you can know the major colors in the image, can get the right color for the text overlay.