若要确保应用的稳健性、可测试性和可维护性,应用架构设计是一项重要的考量因素。Android 提供了一组库和组件,可帮助您根据最佳做法组建应用。
指南
最新资讯和视频
Unit Testing Lifecycle and State in ViewModels
Updated 2025年3月13日
You can test a ViewModel by simply creating an instance using its constructor in your test code. However, this approach has limitations — there is no straightforward way to: With ViewModelScenario, these are now easy to test, helping you catch errors
Google Maps improved download reliability by 10% using user initiated data transfer API
Updated 2024年9月3日
In Android 14 we introduced user-initiated data transfer jobs, or UIDT. You can use the new API setUserInitiated in JobScheduler to specify that the job is a user-initiated data transfer job. This API is helpful for use cases that require
Prepare your app to support predictive back gestures
Updated 2022年7月29日
Since we introduced gesture navigation in Android 10, users have signaled they want to understand where a back gesture will take them before they complete it. As the first step to addressing this need, we've been developing a predictive back gesture.
MAD Skills WorkManager : Wrap-Up
Updated 2021年4月2日
In case you missed it, we’ve just finished a MAD Skills series on WorkManager. We started by introducing WorkManager for those new to the library and then proceeded to talk more about advanced usages including how to test and debug your WorkManager
Improving urban GPS accuracy for your app
Updated 2020年12月7日
At Android, we want to make it as easy as possible for developers to create the most helpful apps for their users. That’s why we aim to provide the best location experience with our APIs like the Fused Location Provider API (FLP). However, we’ve
MAD Skills Navigation Wrap-Up
Updated 2020年10月30日
It’s a Wrap! We’ve just finished the first series in the MAD Skills series of videos and articles on Modern Android Development. This time, the topic was Navigation component, the API and tool that helps you create and edit navigation paths through
What’s New in Navigation 2020
Updated 2020年7月23日
The latest versions of the Jetpack Navigation library (2.2.0 and 2.3.0) added a lot of requested features and functionality, including dynamic navigation, navigation back stack entries, a library for navigation testing, additional features for deep
Getting on the same page with Paging 3
Updated 2020年7月21日
The Paging library enables you to load large sets of data gradually and gracefully, reducing network usage and system resources. You told us that the Paging 2.0 API was not enough - that you wanted easier error handling, more flexibility to implement
Unifying Background Task Scheduling on Android
Updated 2019年11月19日
Android users care a lot about the battery life on their phones. In particular, how your app schedules deferrable background tasks play an important role in battery life. To help you build more battery-friendly apps, we introduced WorkManager as the
Gesture Navigation: A Backstory
Updated 2019年8月8日
One of the biggest changes in Android Q is the introduction of a new gesture navigation. Just to recap - with the new system navigation mode - users can navigate back (left/right edge swipe), to the home screen (swipe up from the bottom), and trigger
What’s New with Android Jetpack and Jetpack Compose
Updated 2019年5月8日
Last year, we launched Android Jetpack, a collection of software components designed to accelerate Android development and make writing high-quality apps easier. Jetpack was built with you in mind -- to take the hardest, most common developer
Android Jetpack Navigation Stable Release
Updated 2019年3月14日
Today we're happy to announce the stable release of the Android Jetpack Navigation component. The Jetpack Navigation component's suite of libraries, tooling and guidance provides a robust, complete navigation framework, freeing you from the
Android Jetpack WorkManager Stable Release
Updated 2019年3月5日
Simplify how you manage background work with WorkManager Today, we're happy to announce the release of Android Jetpack WorkManager 1.0 Stable. We want to thank so many of you in our dev community who have given us feedback and logged bugs along the
Modern background execution in Android
Updated 2018年10月16日
This is the third in a series of blog posts in which outline strategies and guidance in Android with regard to power. Over the years, executing background tasks on Android has evolved. To write modern apps, it's important to learn how to run your
#31DaysOfKotlin — Week 4 Recap
Updated 2018年4月26日
An article summarizing the last week of tweets from #31DaysOfKotlin.
#31DaysOfKotlin — Week 3 Recap
Updated 2018年4月17日
An article summarizing the third week of tweets from #31DaysOfKotlin.
#31DaysOfKotlin — Week 2 Recap
Updated 2018年4月12日
An article summarizing the second week of tweets from #31DaysOfKotlin.
#31DaysOfKotlin — Week 1 Recap
Updated 2018年4月3日
An article summarizing the first week of tweets from #31DaysOfKotlin.
Build an App with Architecture Components
Updated 2018年3月1日
Walks you through the different architecture levels that comprise an Android app.
ViewModels and LiveData: Patterns + AntiPatterns
Updated 2017年9月12日
Some do's and dont's when using LiveData and ViewModels.
Testing Room migrations
Updated 2017年7月24日
What you need to know to test migrating a database to Room.
Understanding migrations with Room
Updated 2017年7月18日
How database migration to Room works under the hood.
ViewModels: Persistence, onSaveInstanceState(), Restoring UI State and Loaders
Updated 2017年7月17日
This post is the second in a series exploring the ins and outs of ViewModel.
ViewModels : A Simple Example
Updated 2017年6月28日
This post is the first in a series exploring the ins and outs of ViewModel.