DevCon 2025: Harness What's New in Android for Optimal Development
Presented by Rajeev Varma (Sr. Manager, Software Engineering) and Nicola De Zolt L. (Software Engineer) at Zebra.
Agenda
- Security Features in Android 14/15
- Zebra MX, Android Core and Performance Features
- Migrating, Debugging, Optimizing
- Memory Optimization & Power Management Guidelines
- Availability of Android 14 & 15 for Zebra devices
Security Features in Android 14/15
Android Security & Privacy Features
New OS features can impact apps in three ways: impacting all apps, apps targeting specific API levels, or new features.
Minimum Installable Target API: Android 14 requires a minimum target API level of 23, and Android 15 requires 24. Apps targeting older SDK versions may face compatibility issues or be blocked.
Credential Manager: A unified system for sign-in, supporting multiple methods like traditional passwords, Passkeys (FIDO Alliance standard), and federated sign-in solutions (Google, Apple, OAuth). It offers backward compatibility and a consistent user experience.
Screenshot Detection: A new API, Activity.ScreenCaptureCallback
, allows apps to detect screenshots within their own bounds. This feature is relevant for privacy and prevents indiscriminate tracking. Note: This does not capture screenshots via Media Projection APIs. A method to block screenshots using activity.getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE)
is available.
Screen Recording Detection: A callback is invoked when an app transitions between visible and invisible states during screen recording. An app is considered visible if its activities are being recorded.
Partial Screen Sharing: Users can share or record specific app windows instead of the entire screen. This feature includes MediaProjection
callbacks for customization and enhances multitasking by allowing users to restrict content sharing to a single app.
Key Management for End-to-End Encryption: Android 15 introduces E2eeContactKeysManager
for storing cryptographic public keys, enabling secure, end-to-end encrypted communication. Keys are identified by ownerPackageName
, deviceId
, and accountId
.
Overlay Restrictions: For Zebra Android 13+, getWindow().setHideOverlayWindows(true)
prevents non-system overlay windows from drawing on top of the calling window. Requires Manifest.permission.HIDE_OVERLAY_WINDOWS
.
Zebra MX, Android Core and Performance Features
MX: A Closer Look at Zebra's Value Add
MX is an abstraction layer for application developers, providing access to over 300 Enterprise Grade APIs. Developers interface with well-defined Configuration Service Providers (CSPs) that remain stable.
MX Features:
- Application Lockout
- Certificate Management
- Silent Application Management (Installation/Uninstallation)
- Secure Storage (Encrypt Phone Data & SD card)
- Default Home Screen
- Privileged Command Runner
- Event Injection Service
- Peripheral Device Management (Bluetooth, NFC, USB, Camera, Imager)
- Threat Counter Measure Service
- ...and more
Android Core and Performance Features
Exact Alarms:
Impacts all apps running on Android 14+. Starting with Android 12, setting exact alarms through the Alarm Service class is restricted. Android 13 introduced the USE_EXACT_ALARM
permission, granted automatically but not revokable. Android 14 denies this permission by default, requiring explicit user consent. Backup and restore operations will not persist this permission.
Typed Foreground Services:
Impacts apps targeting API Level 34+. Android 14 requires apps to declare specific foreground service types (e.g., mediaPlayback
, camera
, location
) for clarity and control. For use cases not fitting these types, migrating to WorkManager or user-initiated data transfer jobs is recommended.
Runtime Broadcast Receivers Export Behavior:
Impacts apps targeting API Level 34+. API Level 33 made the export specification optional for context-registered receivers. Receivers must specify RECEIVER_EXPORTED
or RECEIVER_NOT_EXPORTED
, unless only receiving system broadcasts.
Restrictions on BOOT_COMPLETED Broadcast Receivers:
Impacts apps targeting API Level 35+. BOOT_COMPLETED
receivers cannot launch certain foreground services (e.g., dataSync
, camera
, mediaProjection
, microphone
), or a ForegroundServiceStartNotAllowedException
will be thrown.
Loudness Control:
New feature in API 35. Android 15 introduces loudness standardization for a better user experience, aiming to avoid audio loudness inconsistencies. The LoudnessCodecController
class provides recommended loudness parameter updates for audio decoders, optimizing audio for different output devices.
Improved Large Screen Multitasking:
New features in API 35. Android 15 enhances multitasking on large screen devices, allowing users to save split-screen app combinations and pin the taskbar for quick app switching.
Migrating, Debugging, Optimizing
Reduce Your Anxiety in Moving to the next Android Dessert
Key Points: Understand requirements for mobile devices and apps on Android 14, identify the best migration methods, and recognize the reasons for timely migration. Android 14 offers latest security patches, bug fixes, and new features.
Get your Team Up and Running on Android 14: Learn about OS changes, their impact on applications, and establish a periodic update plan.
Migration Roadmap
CASE #1: App targeting API 33/34, running on Android 13/14
- Review code for gaps against changes affecting all apps.
- Optionally upgrade
targetSDK
to 34/35. The Compatibility Framework assists in identifying gaps. - Optionally leverage new Android 14/15 features.
CASE #2: App targeting API 29, running on Android 11
- Align
targetSDK
to 34/35. - Address requirements for Android 14/15, working backward from Android 14/15.
- Optionally leverage new Android 14/15 features.
Debugging Tools
Compatibility Framework: Helps identify compatibility changes impacting an app. For example, an app targeting API 29 (Android 10) running on Android 14 shows no issues.
Emulating API 34 can help identify runtime exceptions.
Memory Optimization & Power Management Guidelines
Memory Optimization
- Understand the Android Memory Model: Be aware of memory limits and lifecycles to prevent crashes (OutOfMemoryError).
- Minimize Memory Usage: Avoid memory leaks by releasing references to activities/views. Use weak references where applicable.
- Efficient Resource Management: Use efficient data structures (arrays/ArrayLists), reuse bitmaps, and consider libraries like Glide or Picasso for image loading.
- Manage Activity and Fragment Lifecycles: Release resources (bitmaps, cursors) in
onPause()
oronStop()
and cancel tasks/threads. - Use Memory Profiler Tools: Utilize Android Studio's Memory Profiler to monitor usage and detect leaks.
- Optimize Data Handling: Use paging or lazy loading for large datasets. Use databases (SQLite, Room) instead of keeping data in memory.
- Garbage Collection: Be mindful of GC behavior; avoid unnecessary object creation and use object pooling.
- Background Services: Limit background services; prefer WorkManager, JobScheduler, or Firebase Cloud Messaging.
- Optimize UI Components: Use ViewHolder pattern and avoid complex view hierarchies.
- Consider Low-Memory Devices: Test apps on devices with lower memory to ensure performance.
Power Management
- Use foreground services judiciously and stop them promptly.
- Use WorkManager for background job execution, respecting battery optimization.
- Minimize wake locks and release them upon task completion.
- Leverage Android's Doze mode and App Standby by scheduling jobs with JobScheduler, AlarmManager, or WorkManager.
- Limit broadcast receivers and unregister them when not needed.
- Request only necessary permissions.
- Choose efficient data formats (e.g., JSON over XML) to reduce data transmission.
- Avoid files for IPC; use standard Android constructs (binders, intents).
- Limit nested activities in app design.
- Request location updates only when necessary and at the lowest required frequency.
Availability of Android 14 & 15 for Zebra Devices
Android 14
Currently available for platforms including:
- QC SD660: MC3300ax, MC20, RZ-H271, CC600, CC6000, EC30, EC50, EC55, ET51, ET56, L10A, MC2200, MC2700, MC3300x, MC3300xR, MC9300, TC21, TC21 HC, TC26, TC26 HC, TC52, TC52 HC, TC52x, TC52x HC, TC52AX, TC52AX HC, TC57, TC57x, TC72, TC77, TC8300, VC8300 & WT6300
- QC 6490/QC 5430: TC22, TC27, TC53, TC58, TC73, TC78, ET60, ET65, HC20, HC25, HC50, HC55, EM45
- QC 6375: ET40/45, TC15
- QC 4490: MC34, MC94, TC53e/58e, WT54/64, PS30
Android 15
To be released by Q3/Q4 2025.
Online References
Summary
Today we covered:
- Security features in Android 14/15.
- MX and the most relevant Core and Performance features in Android 14/15.
- Guidelines for migration, memory, and power optimization.
- Availability of Android 14 and 15 for Zebra devices.