Fading Coder

One Final Commit for the Last Sprint

Exploring PDF Capabilities in Android Development with libPDF

PDF documents are a ubiquitous format for information exchange, and incorporating PDF functionality directly into Android applicatoins significantly enhances their utility. Developers often need to create, display, modify, or extract information from PDF files. This guide focuses on integrating a co...

Detecting Android Soft Keyboard Visibility Changes

Overview Detecting when the soft keyboard appears or disappears on Android devices can be achieved by monitoring changes in the root view's layout through ViewTreeObserver.OnGlobalLayoutListener. This approach avoids the need for adding custom layout overlays or complex configuration. Implementation...

Android Activity Core Concepts: Layout, Lifecycle, Navigation, and Data Passing

An Android project typically involves three key files working together: a Java/Kotlin controller, an XML layout definition, and the app manifest. Understanding their roles forms the foundation of Activity development. Structuring the User Interface The XML layout file dictates the visual arrangement...

Android UI Components: ToggleButton and Switch Implementation Guide

Core Attributes ToggleButton The ToggleButton widget provides a straightforward two-state interface. Key configurable properties include: android:disabledAlpha: Controls the opacity level when the widget is in a disabled state. android:textOn: Defines the label displayed when the control is activate...

Implementing Persistent Data Storage in Android 12 Using MTK NVRAM

Overview During a recent project, a client requested a feature to store a block of data persistent on a MediaTek (MTK) Android 12 device, such that the data remains intact even after a factory reset. This requirement led to the use of NVRAM (Non-Volatile Random Access Memory), a MediaTek-specific st...

Learning and Using Retrofit in Android

Overview Retrofit is a RESTful network request framework for Android. Under the hood, it relies on OkHttp for actual HTTP communication while providing a clean abstraction layer for API interface definitions. Retrofit handles request parameters, headers, URLs, and response parsing through annotated...

Integrating Icon Fonts in Mobile App Development

Scalable Vector Graphics in Mobile UI Mobile interface design is becoming increasingly complex due to the wide range of screen sizes and pixel densities. Achieving pixel-perfect icons across native platforms can be tedious—designers often spend excessive time slicing assets, organizing files, and ma...

Implementing Memory Caching and Performance Optimization for Android ListViews

Data Storage Strategies Data caching in mobile applications generally falls in to two categories based on persistence and performance requirements: Persistent Storage (ROM/SD Card): Data is saved to the /data/data/ directory or external storage. This is suitable for long-term storage but might be re...

Android Binder Inter-Process Communication Mechanism

To implement a Binder-based service, first define an interface using AIDL. For example, create IMyService.aidl: package com.example; interface IMyService { int calculateSum(int first, int second); } The Android build system automatically generates a Java stub class from this AIDL file, which include...

Android Serial Port Development with Google's Serial Port API

Preparation Android Studio Google android-serialport-api Background There are many approaches to serial port development on Android using C-based methods such as JNI or CMake, but they are often complex. Google's API provides a simpler method for basic read/write operations (default setting: N81, no...