Android Samples
easypermissions | googlesamples |
android-instant-apps/hello-feature-module | googlesamples |
android-instant-apps/multi-feature-module | googlesamples |
android-instant-apps/cookie-api | googlesamples |
android-instant-apps/hello-java | googlesamples |
android-instant-apps/analytics | googlesamples |
android-instant-apps/flavors | googlesamples |
android-instant-apps/hello-kotlin | googlesamples |
android-instant-apps/service | googlesamples |
android-instant-apps/configuration-apks | googlesamples |
android-instant-apps/install-api | googlesamples |
android-instant-apps/storage-api | googlesamples |
android-AutofillFramework | googlesamples |
android-AutofillFramework/kotlinApp | googlesamples |
android-WatchFace | googlesamples |
android-testing/integration/ServiceTestRuleSample | googlesamples |
android-testing/runner/AndroidJunitRunnerSample | googlesamples |
android-testing/ui/espresso/BasicSample | googlesamples |
android-testing/ui/espresso/CustomMatcherSample | googlesamples |
android-testing/ui/espresso/DataAdapterSample | googlesamples |
android-testing/ui/espresso/IdlingResourceSample | googlesamples |
android-testing/ui/espresso/IntentsAdvancedSample | googlesamples |
android-testing/ui/espresso/IntentsBasicSample | googlesamples |
android-testing/ui/espresso/MultiWindowSample | googlesamples |
android-testing/ui/espresso/RecyclerViewSample | googlesamples |
android-testing/ui/espresso/WebBasicSample | googlesamples |
android-testing/ui/uiautomator/BasicSample | googlesamples |
android-testing/unit/BasicSample | googlesamples |
android-testing/unit/BasicUnitAndroidTest | googlesamples |
android-testing/ui/espresso/MultiProcessSample | googlesamples |
android-vision/visionSamples/FaceTracker | googlesamples |
android-vision/visionSamples/barcode-reader | googlesamples |
android-vision/visionSamples/multi-tracker | googlesamples |
android-vision/visionSamples/photo-demo | googlesamples |
android-vision/visionSamples/googly-eyes | googlesamples |
android-vision/visionSamples/ocr-codelab/ocr-reader-complete | googlesamples |
android-vision/visionSamples/ocr-codelab/ocr-reader-start | googlesamples |
android-vision/visionSamples/ocr-reader | googlesamples |
android-UniversalMusicPlayer | googlesamples |
android-play-safetynet/client/java/SafetyNetSample | googlesamples |
android-play-safetynet/server/java | googlesamples |
android-architecture-components/BasicSample | googlesamples |
android-architecture-components/GithubBrowserSample | googlesamples |
android-architecture-components/PersistenceContentProviderSample | googlesamples |
android-architecture-components/BasicRxJavaSample | googlesamples |
android-architecture-components/PersistenceMigrationsSample | googlesamples |
android-architecture-components/BasicRxJavaSampleKotlin | googlesamples |
android-architecture-components/PagingSample | googlesamples |
android-play-location/ActivityRecognition | googlesamples |
android-play-location/BasicLocationSample | googlesamples |
android-play-location/Geofencing | googlesamples |
android-play-location/LocationAddress | googlesamples |
android-play-location/LocationUpdates | googlesamples |
android-play-location/LocationUpdatesForegroundService | googlesamples |
android-play-location/LocationUpdatesPendingIntent | googlesamples |
android-play-location | googlesamples |
android-fit/BasicHistoryApi | googlesamples |
android-fit/BasicHistorySessions | googlesamples |
android-fit/BasicRecordingApi | googlesamples |
android-fit/BasicSensorsApi | googlesamples |
android-fit/StepCounter | googlesamples |
android-nearby/messages/NearbyBackgroundBeacons | googlesamples |
android-nearby/messages/NearbyDevices | googlesamples |
android-nearby/connections/walkietalkie | googlesamples |
android-Camera2Basic | googlesamples |
android-play-places/PlaceCompleteActivity | googlesamples |
android-play-places/PlaceCompleteAdapter | googlesamples |
android-play-places/PlaceCompleteFragment | googlesamples |
android-play-places/PlacePicker | googlesamples |
android-play-billing/TrivialDrive | googlesamples |
android-play-billing/TrivialDrive_v2 | googlesamples |
android-RuntimePermissions | googlesamples |
android-RuntimePermissions/kotlinApp | googlesamples |
android-BluetoothChat | googlesamples |
android-FingerprintDialog | googlesamples |
android-Camera2Video | googlesamples |
android-testdpc | googlesamples |
android-testing-templates/AndroidTestingBlueprint | googlesamples |
android-unsplash | googlesamples |
android-BluetoothLeGatt | googlesamples |
android-ads/admob/BannerExample | googlesamples |
android-ads/admob/InterstitialExample | googlesamples |
android-ads/admob/NativeAdvancedExample | googlesamples |
android-ads/admob/NativeExpressExample | googlesamples |
android-ads/advanced/APIDemo | googlesamples |
android-ads/advanced/NativeExpressRecyclerViewExample | googlesamples |
android-ads/advanced/NativeListViewExample | googlesamples |
android-ads/doubleclick/BannerExample | googlesamples |
android-ads/doubleclick/CustomRenderingExample | googlesamples |
android-ads/doubleclick/InterstitialExample | googlesamples |
android-ads/admob/RewardedVideoExample | googlesamples |
android-PictureInPicture | googlesamples |
android-PictureInPicture/kotlinApp | googlesamples |
android-Geofencing | googlesamples |
android-Notifications | googlesamples |
android-ScreenCapture | googlesamples |
android-RecyclerView | googlesamples |
android-credentials/credentials-quickstart | googlesamples |
android-credentials/credentials-signin | googlesamples |
android-credentials/sms-verification/android | googlesamples |
android-JobScheduler | googlesamples |
android-MultiWindowPlayground | googlesamples |
android-XYZTouristAttractions | googlesamples |
android-Timer | googlesamples |
android-PdfRendererBasic | googlesamples |
android-NavigationDrawer | googlesamples |
android-CardView | googlesamples |
android-ConstraintLayoutExamples | googlesamples |
android-Quiz | googlesamples |
android-EmojiCompat | googlesamples |
android-EmojiCompat/kotlinApp | googlesamples |
android-MessagingService | googlesamples |
android-MediaRecorder | googlesamples |
android-DisplayingBitmaps | googlesamples |
android-LNotifications | googlesamples |
android-MediaBrowserService | googlesamples |
android-Camera2Raw | googlesamples |
android-Interpolator | googlesamples |
android-ActiveNotifications | googlesamples |
android-BasicAndroidKeyStore | googlesamples |
android-BasicSyncAdapter | googlesamples |
android-SlidingTabsBasic | googlesamples |
android-gcmnetworkmanager | googlesamples |
android-NotificationChannels | googlesamples |
android-NotificationChannels/kotlinApp | googlesamples |
android-NetworkConnect | googlesamples |
android-BluetoothAdvertisements | googlesamples |
android-SpeedTracker | googlesamples |
android-SlidingTabsColors | googlesamples |
android-AsymmetricFingerprintDialog | googlesamples |
android-OurStreets | googlesamples |
android-AppUsageStatistics | googlesamples |
android-DirectBoot | googlesamples |
android-CustomNotifications | googlesamples |
android-SynchronizedNotifications | googlesamples |
android-custom-lint-rules/android-studio-2 | googlesamples |
android-custom-lint-rules/android-studio-3 | googlesamples |
android-Flashlight | googlesamples |
android-TextSwitcher | googlesamples |
android-RevealEffectBasic | googlesamples |
android-ConfirmCredential | googlesamples |
android-ScopedDirectoryAccess | googlesamples |
android-BasicManagedProfile | googlesamples |
android-DownloadableFonts | googlesamples |
android-DownloadableFonts/kotlinApp | googlesamples |
android-AppShortcuts | googlesamples |
android-RepeatingAlarm | googlesamples |
android-TextLinkify | googlesamples |
android-BasicNotifications | googlesamples |
android-SwipeRefreshMultipleViews | googlesamples |
android-BasicGestureDetect | googlesamples |
android-ActivitySceneTransitionBasic | googlesamples |
android-NfcProvisioning | googlesamples |
android-MediaEffects | googlesamples |
android-BasicNetworking | googlesamples |
android-FloatingActionButtonBasic | googlesamples |
android-SwipeRefreshListFragment | googlesamples |
android-StorageProvider | googlesamples |
android-CardEmulation | googlesamples |
android-DeviceOwner | googlesamples |
androidtv-sample-inputs | googlesamples |
android-CardReader | googlesamples |
android-BatchStepSensor | googlesamples |
android-DirectShare | googlesamples |
android-FindMyPhone | googlesamples |
android-ElevationDrag | googlesamples |
android-codelab-watchface | googlesamples |
android-HdrViewfinder | googlesamples |
android-GridViewPager | googlesamples |
android-AccelerometerPlay | googlesamples |
android-BasicMediaDecoder | googlesamples |
android-play-games-in-motion | googlesamples |
android-RuntimePermissionsBasic | googlesamples |
android-HorizontalPaging | googlesamples |
android-PermissionRequest | googlesamples |
android-DirectorySelection | googlesamples |
android-CustomTransition | googlesamples |
android-ActionBarCompat-ShareActionProvider | googlesamples |
android-SkeletonWearableApp | googlesamples |
android-StorageClient | googlesamples |
android-google-accounts/AutoManage | googlesamples |
android-google-accounts/QuickStart | googlesamples |
android-BasicAccessibility | googlesamples |
android-WatchViewStub | googlesamples |
android-ElevationBasic | googlesamples |
android-CustomChoiceList | googlesamples |
android-SwipeRefreshLayoutBasic | googlesamples |
android-ClippingBasic | googlesamples |
android-BasicMultitouch | googlesamples |
android-RecipeAssistant | googlesamples |
android-BeamLargeFiles | googlesamples |
android-BorderlessButtons | googlesamples |
android-BasicTransition | googlesamples |
android-RenderScriptIntrinsic | googlesamples |
android-ActionBarCompat-Styled | googlesamples |
android-DoneBar | googlesamples |
android-DocumentCentricApps | googlesamples |
android-BasicContactables | googlesamples |
android-MidiSynth | googlesamples |
android-ActionBarCompat-Basic | googlesamples |
android-BasicRenderScript | googlesamples |
android-media-controller | googlesamples |
android-WearSpeakerSample | googlesamples |
google-services/android/analytics | googlesamples |
google-services/android/gcm | googlesamples |
google-services/android/signin | googlesamples |
android-JumpingJack | googlesamples |
android-DataLayer | googlesamples |
android-WearCompanionLibrary | googlesamples |
android-DrawableTinting | googlesamples |
android-MediaRouter | googlesamples |
android-AppRestrictionEnforcer | googlesamples |
android-ElizaChat | googlesamples |
android-AutoBackupForApps | googlesamples |
android-WearDrawers | googlesamples |
android-AdvancedImmersiveMode | googlesamples |
android-AppRestrictionSchema | googlesamples |
android-play-awareness/basic-awareness-sample | googlesamples |
android-SimpleMediaPlayer | googlesamples |
android-ImmersiveMode | googlesamples |
android-ActivityInstrumentation | googlesamples |
android-MidiScope | googlesamples |
android-BasicMediaRouter | googlesamples |
android-BasicImmersiveMode | googlesamples |
android-RuntimePermissionsWear | googlesamples |
android-fido | googlesamples |
android-AgendaData | googlesamples |
android-ActionBarCompat-ListPopupMenu | googlesamples |
android-AppRestrictions | googlesamples |
android-WearNotifications | googlesamples |
android-AlwaysOn | googlesamples |
androidtv-GameController | googlesamples |
android-DelayedConfirmation | googlesamples |
android-WclDemoSample | googlesamples |
android-WearVerifyRemoteApp | googlesamples |
androidtv-VisualGameController | googlesamples |
android-CommitContentSampleIME | googlesamples |
android-ContentProviderPaging | googlesamples |
android-ContentProviderPaging/kotlinApp | googlesamples |
android-WearHighBandwidthNetworking | googlesamples |
leanback-showcase | googlesamples |
android-DragAndDropAcrossApps | googlesamples |
android-CommitContentSampleApp | googlesamples |
android-WearOAuth | googlesamples |
android-WearComplicationProvidersTestSuite | googlesamples |
android-DocumentCentricRelinquishIdentity | googlesamples |
android-WearStandaloneGoogleSignIn | googlesamples |
android-key-attestation/server | googlesamples |
android-ShareActionProvider | googlesamples |
leanback-assistant | googlesamples |
leanback-homescreen-channels | googlesamples |
EasyPermissions
EasyPermissions is a wrapper library to simplify basic system permissions logic when targeting Android M or higher.
Android Instant Apps - Feature Module sample
This sample introduces feature modules to the Hello World sample.
Android Instant Apps - Multi feature sample app
This sample app demonstrates building an installable and an instant app with the same behaviors. The functionality of the instant app is split in two features, which can be individually launched on a device.
Android Instant Apps - Cookie API Sample
This sample app demonstrates how to use the Cookie API.
Android Instant Apps - Hello World
This sample app demonstrates how to build an installed and an instant app with the same behaviors using the Java Programming Language.
Android Instant Apps - Google Analytics Example
This sample app demonstrates how to integrate Google Analytics for Firebase into an instant app.
Android Instant Apps - Flavors Sample
This sample introduces the usage of product flavors within an Instant App.
Android Instant Apps - Hello World (Kotlin)
This sample app demonstrates how to build an installed and an instant app with the same behaviors by using Kotlin. The functionality of the instant app is built in two features, which can be individually installed and launched on a device.
Android Instant Apps - Service Sample
This sample demonstrates how to create a started or a bound service within Android Instant Apps.
Android Instant Apps - Configuration APKs Sample
This sample displays the usage of Configuration APKs within gradle.
Android Instant Apps - Install API sample
This sample app demonstrates how to use the Install API.
Android Instant Apps - Storage API sample
This sample app demonstrates how to use the Storage API.
Android AutofillFramework Sample
This sample demonstrates the use of the Autofill Framework. It includes implementations of client Activities with views that should be autofilled, and a Service that can provide autofill data to client Activities.
Android AutofillFramework Sample
This sample demonstrates the use of the Autofill Framework. It includes implementations of client Activities with views that should be autofilled, and a Service that can provide autofill data to client Activities.
Android WatchFace Sample
A simple sample that demonstrates watch faces and complications for Wear 2.0.
Basic sample for ServiceTestRule
This rule provides a simplified mechanism to start and shutdown your service before and after the duration of your test. It also guarantees that the service is successfully connected when starting (or binding to) a service. The service can be started (or bound) using one of the helper methods. It will automatically be stopped (or unbound) after the test completes and any methods annotated with @After are finished.
AndroidJUnitRunner sample
The new android test runner brings Junit4 support to android testing. This samples gives a quick overview of some of the new features like test annotations, parameterized tests and test suite creation.
Custom matchers sample for Espresso
Extending Espresso is easy! This sample shows how to match the "hint" property of an EditText.
Data Adapter sample for Espresso
An AdapterView (like ListView, GridView, etc.) is a view bound to an Adapter that determines the view's children. In Espresso, you can match these children views using the onData() method instead of onView() as you would do normally. Instead of matching views, onData() matches the data that is bound to each view item.
Basic Idling Resource sample for Espresso
The centerpiece of Espresso is its ability to seamlessly synchronize all test operations with the application under test. By default, Espresso waits for UI events in the current message queue to be processed and default AsyncTasks* to complete before it moves on to the next test operation. This should address the majority of application/test synchronization in your application.
Advanced sample for Espresso Intents
Espresso Intents is a great way to do hermetic inter app testing. It works essentially like mockito and allows for Intent verification and stubbing. This sample shows how to stub an Intent and simulate that a picture is fetched from the camera without leaving the main app.
Basic sample for Espresso Intents
Espresso Intents is a great way to do hermetic inter app testing. It works essentially like mockito and allows for Intent verification and stubbing.
Multi-window sample for Espresso
Android's Window system allows multiple view hierarchies to layer on top of each other.
RecyclerView sample for Espresso
Espresso has a special entry point to interact with AdapterViews, onData(), however, RecyclerViews work differently than AdapterViews.
Basic sample for Espresso Web
Espresso Web is an API that can be used to write automated tests for hybrid applications which contain one or more WebViews. Similar to onData, WebView interactions are actually composed of several ViewActions, however ViewActions in Espresso Web are composed of Web Driver Atoms. Espresso Web takes care of synchronization and tries to minimize boilerplate to a bare minimum, while still giving you an Espresso-like feel to interacting with WebViews.
Basic sample for writing unit tests that mocks the Android framework
If you are new to unit testing on Android, try this sample first.
Basic sample for unit testing on device or emulator
An Unit Android Test is a test that needs an Android device or emulator but it's different from a UI test because it doesn't start any activities.
Multiprocess Espresso Sample
To test app components in a non-default processes, you can use the functionality of Multiprocess Espresso. This tool, available on Android O (API level 26) and higher, allows you to seamlessly test your app's UI interactions that cross your app's process boundaries while maintaining Espresso's synchronization guarantees.
android-vision/visionSamples/barcode-reader
Sample code for the Android Mobile Vision API.
android-vision/visionSamples/multi-tracker
Sample code for the Android Mobile Vision API.
android-vision/visionSamples/ocr-codelab/ocr-reader-complete
Sample code for the Android Mobile Vision API.
android-vision/visionSamples/ocr-codelab/ocr-reader-start
Sample code for the Android Mobile Vision API.
Universal Android Music Player Sample
This sample shows how to implement an audio media app that works across multiple form factors and provide a consistent user experience on Android phones, tablets, Android Auto, Android Wear, Android TV and Google Cast devices.
Java Android SafetyNet Sample
This sample demonstrates the SafetyNet API in Google Play Services. This API tests whether the device and software have passed Android compatibility testing. Use the option in the toolbar to make an API request. The next step is to read and verify the result of the compatibility check. This should be done on the server side as shown in the 'server' component of this sample. You can share the result of the API call from this app and use it as input into samples for the server component.
Java Server SafetyNet Samples
This sample demonstrates how to verify the response received from the SafetyNet service.
Android Architecture Components Basic Sample
This sample showcases the following Architecture Components:
Github Browser Sample with Android Architecture Components
This is a sample app that uses Android Architecture Components with Dagger 2.
Room with Content Providers Sample
This sample demonstrates how to expose data stored in the Room persistence library with Android's Content Provider framework.
Room & RxJava Sample
This is an API sample to showcase how to implement observable queries in Room, with RxJava's Flowable objects.
Room Migration Sample
This is an API sample to showcase how to deal with database migrations using Room. From docs:
Room & RxJava (Kotlin) Sample
This is an API sample to showcase how to use Room, with RxJava's Flowable objects in Kotlin.
Android Architecture Components Paging Sample
This sample showcases the following Architecture Components:
Recognizing the User's Current Activity
Demonstrates use of the ActivityRecognitionApi to recognize a user's current activity, such as walking, driving, or standing still.
Basic Location Sample
Demonstrates use of the Google Play services Location API to retrieve the last known location for a device.
Creating and Monitoring Geofences
Demonstrates how to create and remove geofences using the GeofencingApi. Monitor geofence transitions and creates notifications whenever a device enters or exits a geofence.
Location Updates
Demonstrates how to use the Geocode API and reverse geocoding to display a device's location as an address.
Location Updates
Demonstrates how to use the Fused Location Provider API to get updates about a device's location. The Fused Location Provider is part of the Google Play services Location APIs.
Google Play Location Samples
Samples that use Location APIs to help you make your applications location aware.
Android Fit History Api Sample
A simple example of how to use the History API on the Android Fit platform.
Android Fit History Api Sessions Sample
A simple example of how to use sessions with the History API on the Android Fit platform.
Android Fit Recording Api Sessions Sample
A simple example of how to use the Recording API on the Android Fit platform.
Android Fit Sensors Api Sample
A simple example of how to use the Sensors API on the Android Fit platform.
Google APIs for Mobile: Quickstarts
Demonstrates use of long-lived background subscription with the Nearby.Messages API to scan for beacons using Bluetooth Low Energy (BLE).
Google APIs for Mobile: Quickstarts
Demonstrates use of the Nearby.Messages API for communicating between devices within close proximity of each other.
Google APIs for Mobile: Quickstarts
Demonstrates streaming audio with the Nearby.Connections API to other nearby devices.
Android Camera2Basic Sample
This sample demonstrates how to use basic functionalities of Camera2 API. You can learn how to iterate through characteristics of all the cameras attached to the device, display a camera preview, and take pictures.
Android PlaceCompleteActivity Sample
This sample uses the PlaceAutocomplete Activity from the Places API for Android to open a fullscreen autocomplete widget when the button is pressed.
Android PlaceCompleteAdapter Sample
This sample uses the Google Places Geo Data API for Android to provide autocomplete suggestions. It shows how to use a custom Adapter to display suggestions in an AutocompleteTextView. Once selected, details about a place are retrieved based on its Place id from the Places Geo Data API.
Android PlaceCompleteFragment Sample
This sample uses the PlaceAutocompleteFragment from the Places API for Android within a CardView to provide an autocomplete powered search experience. Once a place is selected, its details are displayed.
Android PlacePicker Sample
This sample uses the PlacePicker.Builder to construct an Intent to launch the place picker dialog. Users can select a place or add a new place, which is then returned to the application.
Android RuntimePermissions Sample
This sample shows runtime permissions available in Android M and above. It shows how to check and request permissions at runtime, handle backwards compatibility using the support library and how to declare optional permissions for M-devices only.
Android BluetoothChat Sample
This sample shows how to implement two-way text chat over Bluetooth between two Android devices, using all the fundamental Bluetooth API capabilities.
Android FingerprintDialog Sample
A sample that demonstrates to use registered fingerprints to authenticate the user in your app
Android Camera2Video Sample
This sample shows how to record video using the new Camera2 API in Android Lollipop.
Test Device Policy Control (Test DPC) App
Test DPC is an app designed to help EMMs, ISVs, and OEMs to test their applications and platforms in a Android for Work managed profile (i.e. work profile). It serves as both a sample Device Policy Controller and a testing application to flex the APIs available for Android for Work. It supports devices running Android 5.0 Lollipop or later. As of Mar 24, 2017, it also includes support for devices running API level 26.
Android Testing Blueprint
A collection of Google's Android testing tools and frameworks, all integrated in a single application project.
Code used within the example section of the #io16 session "A window into transitions".
Android BluetoothLeGatt Sample
This sample demonstrates how to use the Bluetooth LE Generic Attribute Profile (GATT) to transmit arbitrary data between devices.
AdMob Banner Sample
This sample demonstrates how to request and display an AdMob banner ad in an Android application. The app contains a single, "Hello World" activity with a banner at the bottom of its layout.
AdMob Interstitial Sample
This sample demonstrates how to request and display an AdMob interstitial ad in an Android application. The code illustrates how to instantiate an InterstitialAd object, preload an interstitial, and then display it.
AdMob Native Advanced Sample
This sample demonstrates how to request and display an ad from AdMob Native Ads Advanced in an Android application. The app displays an ad at the top of its activity, and offers a few checkboxes and a button you can use to request different native ad formats.
AdMob Native Ads Express Sample
This sample demonstrates how to request and display an ad from AdMob Native Ads Express in an Android application. The app loads and displays a single ad at the bottom of its activity.
Advanced API Demos for Android
This is an advanced example application that covers a number of features in the AdMob and DoubleClick For Publishers APIs. It uses methods provided by the Mobile Ads SDK for targeting, sizing, exclusions, custom events, and more.
Native Ads Express RecyclerView Sample
This sample demonstrates how to request and display ads from AdMob Native Ads Express in an Android application using the RecyclerView widget.
DoubleClick For Publishers Advanced Native Example
This project is an advanced native ads example intended to show how publishers might construct a list-based user experience (such as a news feed might have) that incorporates multiple native ad formats.
DoubleClick Banner Sample
This sample demonstrates how to request and display a DoubleClick For Publishers banner ad in an Android application. The app contains a single, "Hello World" activity with a banner at the bottom of its layout.
DoubleClick Custom Rendering Sample
This sample demonstrates how to request and display an ad from DoubleClick for Publishers Custom Rendering in an Android application. The app displays an ad at the top of its activity, and offers a few checkboxes and a button you can use to request different native ad formats.
DoubleClick Interstitial Sample
This sample demonstrates how to request and display a DoubleClick For Publishers interstitial ad in an Android application. The code illustrates how to instantiate a PublisherInterstitialAd object, preload an interstitial, and then display it.
Android PictureInPicture Sample
This sample demonstrates basic usage of Picture-in-Picture mode for handheld devices. The sample plays a video. The video keeps on playing when the app is turned in to Picture-in-Picture mode. On Picture-in-Picture screen, the app shows an action item to pause or resume the video.
Android PictureInPicture Sample (Kotlin)
This sample demonstrates basic usage of Picture-in-Picture mode for handheld devices. The sample plays a video. The video keeps on playing when the app is turned in to Picture-in-Picture mode. On Picture-in-Picture screen, the app shows an action item to pause or resume the video.
Android Geofencing Sample
When the user enters the vicinity of the Android building (B44) or the Yerba Buena Gardens near the Moscone center in San Francisco, a notification silently appears on their wearable with an option to check in. This notification automatically disappears when they leave the area, and reappears the next time they are at one of these locations.
Android Notifications Sample
This sample showcases the available notification styles on a device and wearable.
Android ScreenCapture Sample
This sample demonstrates how to use Media Projection API to capture device screen in real time and show it on a SurfaceView.
Android RecyclerView Sample
Sample demonstrating the use of RecyclerView to layout elements with a LinearLayoutManager and with a GridLayoutManager. It also demonstrates how to handle touch events on elements.
credentials-quickstart
This is a quickstart sample for the Android Credentials API, which is part of Smartlock for Passwords on Android. Visit the following link for more information:
Credentials API + Google Sign In API Quickstart
This sample demonstrates how to use both the Credentials API (SmartLock for Passwords) and the Google Sign In API in the same application.
SMS Verify App
This sample demonstrates the use of Play Service's SMS Verification APIs to get access to specially-tagged text messages (the tags associate the message with the APK) without needing full SMS retrieval permission (SMS_READ).
Android JobScheduler Sample
Demonstration of the JobScheduler API, which provides an interface for scheduling background tasks when certain tasks apply.
Android MultiWindowPlayground Sample
This sample demonstrates the use of the multi-window API available in Android N. It shows the use of new Intent flags and AndroidManifest properties to define the multi-window behavior. Switch the sample app into multi-window mode to see how it affects the lifecycle and behavior of the app.
Android XYZTouristAttractions Sample
This sample aims to be as close to a real world example of a mobile and Wear app combination as possible. It has a more refined design and also provides a practical example of how a mobile app would interact and communicate with its wear counterpart.
Android Timer Sample
This simple wearable app allows the user to set a countdown timer. It runs independently on the wearable with no phone connection.
Android PdfRendererBasic Sample
This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.
Android Navigation Drawer Sample
This example illustrates a common usage of the DrawerLayout widget in the Android support library.
Android CardView Sample Sample
This sample demonstrates how to use CardView introduced in the support library in Android 5.0.
Constraint Layout Samples
This repository contains a list of layouts that showcases the various features and usage of ConstraintLayout
Android Quiz Sample
This sample uses Google Play Services Wearable Data APIs to communicate between applications on a phone and a paired wearable device. Users can create quiz questions on the phone, each of which has an associated DataItem. These DataItems are then received on the wearable, which displays them as notifications. Each notification contains the question as the first page, followed by answers as actions. When an answer is selected, the corresponding question's DataItem is updated, which allows the phone application to update the status of the question (i.e. did the user answer it correctly or not) and prompt the next question.
Android EmojiCompat Sample
This sample demonstrates usage of EmojiCompat support library. You can use this library to prevent your app from showing missing emoji characters in the form of tofu (â–¡). You can use either bundled or downloadable emoji fonts. This sample shows both usages.
Android EmojiCompat Sample (Kotlin)
This sample demonstrates usage of EmojiCompat support library. You can use this library to prevent your app from showing missing emoji characters in the form of tofu (â–¡). You can use either bundled or downloadable emoji fonts. This sample shows both usages.
Android MessagingService Sample
This sample shows a simple service that sends notifications using NotificationCompat. It also extends the notification with Remote Input to allow Android N devices to reply via text directly from the notification without having to open an App. The same Remote Input object also allows Android Auto users to respond by voice when the notification is presented there. Note: Each unread conversation from a user is sent as a distinct notification.
Android MediaRecorder Sample
This sample uses the camera/camcorder as the A/V source for the MediaRecorder API. A TextureView is used as the camera preview which limits the code to API 14+. This can be easily replaced with a SurfaceView to run on older devices.
Android DisplayingBitmaps Sample
Sample demonstrating how to load large bitmaps efficiently off the main UI thread, caching bitmaps (both in memory and on disk), managing bitmap memory and displaying bitmaps in UI elements such as ViewPager and ListView/GridView.
Android LNotifications Sample Sample
This sample demonstrates new features for notifications introduced in Android L. These features include heads-up notifications, visibility, people, category and priority metadata.
Android MediaBrowserService Sample
This sample shows how to implement a media app that allows background playback of audio, and provide a media library that is exposed to other apps.
Android Camera2Raw Sample
This sample demonstrates using the Camera2 API to capture a JPEG and RAW sensor frame. Check the source code to see a typical example of how to display the camera preview; run auto-focus, auto-exposure metering, and auto-white-balance; capture a JPEG and RAW image for the same sensor frame; and save these into MediaStore for use in other applications.
Android Interpolator Sample
This sample demonstrates the use of animation interpolators and path animations for Material Design.
Android ActiveNotifications Sample
Notification Groups and the Notification Manager can be used together to simplify how users experience notifications. This sample demonstrates how the NotificationManager can tell you how many notifications your application is currently showing. It also shows how to manage the notifications as a group and introduce a summary for the group, when supported by the platform.
Android BasicAndroidKeyStore Sample
An advanced sample displaying the creation and usage of data integrity mechanisms
Android BasicSyncAdapter Sample
This sample demonstrates using SyncAdapter to fetch background data for an app. It covers the creation of the required Service that the OS uses to initiate the background data sync as well as scheduling syncs with background data.
Android SlidingTabsBasic Sample
A basic sample which shows how to use SlidingTabLayout to display a custom ViewPager title strip which gives continuous feedback to the user when scrolling.
GcmNetworkManager Quickstart
This sample demonstrates how to use the GcmNetworkManager API.
Android NotificationChannels Sample
Demonstration of using channels to categorize notifications by topic. This feature was added in Android O, and allows users to have fine-grained control over their notification preferences.
Android NotificationChannels Sample (Kotlin)
Demonstration of using channels to categorize notifications by topic. This feature was added in Android O, and allows users to have fine-grained control over their notification preferences.
Android NetworkConnect Sample
This sample demonstrates how to connect to the network and fetch raw HTML using HttpsURLConnection. AsyncTask is used to perform the fetch on a background thread.
Android BluetoothAdvertisements Sample
Sample demonstrating how to advertise small amounts of data using the Bluetooth Low Energy API. Also demonstrates how to scan for those Advertisements. (requires 2 devices to see full operation)
Android SpeedTracker Sample
Sample demonstrates recording location and speed with a Wear device in mind. Location is retrieved via FusedLocatinProvider which retrieves coordinates from the phone or Wear depending on whether the phone is disconnected or not and whether the Wear device has a GPS chip.
Android SlidingTabsColors Sample
A more advanced sample which shows how to use SlidingTabLayout to display a custom ViewPager title strip, with custom coloring for each tab.
Android AsymmetricFingerprintDialog Sample
A sample that demonstrates to use registered fingerprints to authenticate the user in your app
OurStreets for Android
Visit StreetView galleries with delightful material design aspects.
Android AppUsageStatistics Sample
A basic app showing how to use App usage statistics API to let users collect statistics related to usage of the applications.
Android DirectBoot Sample
Sample demonstrating how to store data in a device protected storage which is always available while the device is booted both before and after any user credentials(PIN/Pattern/Password) are entered.
Android CustomNotifications Sample
This sample demonstrates notifications with custom content views. The use of collapsed and expanded notification views are shown.
Android SynchronizedNotifications Sample
A basic sample showing how to use simple or synchronized notifications. This allows users to dismiss events from either their phone or wearable device simultaneously.
See README.md in the parent directory for general information.
Sample Lint Checks
This project shows how Android Studio 3 (beta 5 and later) handles packaging of lint rules.
Android Flashlight Sample
Sample demonstrating the use of an Activity in a wearable application. The sample uses the screen as a flashlight.
Android TextSwitcher Sample
This sample illustrates the use of a TextSwitcher to display animations for text changes.
Android RevealEffectBasic Sample
Sample demonstrating circular reveal effect. It covers creating an Animator with ViewAnimationUtils as well as defining the parameters of the circular reveal including starting position and radius.
Android Confirm Credential Sample
A sample that demonstrates how to use device credentials (PIN, Pattern, Password) in your app
Android ScopedDirectoryAccess Sample
This sample demonstrates how to use the Scoped Directory Access API introduced in Android N to easily access to specific directories such as Pictures, Downloads instead of requesting READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE in your manifest.
Android BasicManagedProfile Sample
This sample demonstrates basic functionalities of Managed Profile API introduced in Android 5.0 Lollipop. You can set up this app as a profile owner, and use this app to enable/disable apps in the newly created managed profile. You can also set restrictions to some apps, enable/disable Intent forwarding between profiles, and wipe out all the data associated with the profile.
Android DownloadableFonts Sample
This sample demonstrates how to use the Downloadable Fonts feature introduced in Android O. Downloadable Fonts is a feature that allows apps to request a certain font from a provider instead of bundling it or downloading it themselves. This means, there is no need to bundle the font as an asset.
Android DownloadableFonts Sample (Kotlin)
This sample demonstrates how to use the Downloadable Fonts feature introduced in Android O. Downloadable Fonts is a feature that allows apps to request a certain font from a provider instead of bundling it or downloading it themselves. This means, there is no need to bundle the font as an asset.
Android AppShortcuts Sample
This sample demonstrates how to use the Launcher Shortcuts API introduced in Android 7.1 (API 25). This API allows an application to define a set of Intents which are displayed as when a user long-presses on the app's launcher icon. Examples are given for registering both links both statically in XML, as well as dynamically at runtime.
Android RepeatingAlarm Sample
Introductory text that explains what the sample is intended to demonstrate. Edit in template-params.xml.
Android TextLinkify Sample
This sample illustrates how links can be added to a TextView. This can be done either automatically by setting the "autoLink" property or explicitly.
Android BasicNotifications Sample
A basic app showing how to display events in the system's notification bar using the NotificationCompat API. NotificationCompat API is used for compatibility with older devices, running Android 1.6 (Donut) (API level 4) or newer.
Android SwipeRefreshMultipleViews Sample
A sample which shows how to use SwipeRefreshLayout to add the 'swipe-to-refresh' gesture to a layout with multiple children, enabling the ability to trigger a refresh from swiping down on the visible view. In this sample, SwipeRefreshLayout contains a scrollable GridView, along with a TextView empty view.
Android BasicGestureDetect Sample
This sample detects gestures on a view and logs them. In order to try this sample out, try dragging or tapping the text.
Android ActivitySceneTransitionBasic Sample
This sample shows how to use scene transitions from one Activity to another in Lollipop. Uses a combination of changeImageTransform and changeBounds to transition a grid of images to an Activity with a large image and detail text.
Android NfcProvisioning Sample
This sample demonstrates how to use NFC to provision a new device with a device owner. Device owner is a specialized type of device administrator that can control device security and configuration. This sample itself is not a device owner, but it is a programming app that sends NFC message to an unprovisioned peer device and tells it to set up the specified device owner app.
Android MediaEffects Sample
This sample shows how to use the Media Effects APIs that were introduced in Android 4.0.
Android BasicNetworking Sample
This sample demonstrates how to check network connectivity with Android APIs.
Android FloatingActionButtonBasic Sample
This sample shows the two sizes of Floating Action Buttons and how to interact with them.
Android SwipeRefreshListFragment Sample
A sample which shows how to use SwipeRefreshLayout to add 'swipe-to-refresh' gesture to a ListView, enabling the ability to trigger a refresh from swiping down on that view.
Android StorageProvider Sample
This sample shows how to implement a simple documents provider using the storage access framework available in Android 4.4.
Android CardEmulation Sample
This sample demonstrates how to emulate an NFC card, using the "host card emulation" feature added in Android 4.4. This sample makes the device appear as a loyalty card whenever the screen is on and the user taps their device on an appropriately configured NFC reader.
Android DeviceOwner Sample
This sample demonstrates how to use some device owner features. As a device owner, you can configure global settings such as automatic time and timezone. You can mandate a specific launcher by preferred intent handler.
Sample Android TV Channel App (TV Input) using TIF
This app is designed to show how to build live TV channel apps for Android TV using the TV Input Framework (TIF). The sample is a service that once installed, is recognized and run by the default TV app (e.g. Live Channels app).
Android CardReader Sample
This sample demonstrates how to implement a low-level NFC card reader, for reading cards that do not contain NDEF or Android Beam data. This sample is designed to read the virtual loyalty card implemented in the "CardEmulation" sample.
Android BatchStepSensor Sample
Sample demonstrating how to set up SensorEventListeners for step detectors and step counters.
Android DirectShare Sample
Sample demonstrating how to show some options directly in the list of share intent candidates.
Android FindMyPhone Sample
This sample application notifies you when you may have left your phone behind (specifically, when your companion and wearable disconnect). If you have misplaced your phone, but it is still connected to your wearable, you can also start an activity on the wearable to sound an alarm on your phone.
Android ElevationDrag Sample
This sample demonstrates a drag and drop action on different shapes. Elevation and z-translation are used to render the shadows and the views are clipped using different Outlines.
Android Wear watch face codelab
In this codelab you'll learn how to create an analog watch face and customize it to our needs, keeping best practices for the platform in mind.
Android HdrViewfinder Sample
This demo implements a real-time high-dynamic-range camera viewfinder, by alternating the sensor's exposure time between two exposure values on even and odd frames, and then compositing together the latest two frames whenever a new frame is captured.
Android GridViewPager Sample
Demonstrates how to implement a GridViewPager in your wearable app.
Android AccelerometerPlay Sample
Sample demonstrating how to use an accelerometer sensor as input for a physics-based view.
Android BasicMediaDecoder Sample
This sample shows how to use the MediaCoder to decode a video, use a TimeAnimator to sync the rendering commands with the system display frame rendering and finally render it to a TextureView.
Android RuntimePermissionsBasic Sample
This basic sample shows runtime permissions available in the Android M and above. It shows how to use the new runtime permissions API to check and request permissions through the support library.
Android HorizontalPaging Sample
This sample shows how to implement tabs, using Fragments and a ViewPager.
Android PermissionRequest Sample
This sample demonstrates how to use the PermissionRequest API to securely provide access to restricted system features (such as a camera or microphone) from within a WebView. In this example, a dialog is created to allow users to explicitly approve or reject each request.
Android DirectorySelection Sample
A basic app showing how to use Directory Selection API to let users select an entire directory subtree, which extends the Storage Access Framework introduced in Android 4.4 (API level 19).
Android CustomTransition Sample
This sample shows how to implement a custom Transition extending the standard Transition class.
Android ActionBarCompat-ShareActionProvider Sample
This sample shows you how a provide a context-sensitive ShareActionProvider with ActionBarCompat, backwards compatible to API v7.
Android SkeletonWearableApp Sample
This sample is a basic skeleton app which can be used as a starting point for wear development.
Android StorageClient Sample
Using the OPEN_DOCUMENT intent, a client app can access a list of Document Providers on the device, and choose a file from any of them.
Android BasicAccessibility Sample
This sample demonstrates how to create an accessible application, using a mix of different widgets demonstrating different ways of adding accessibility markup to a UI.
Android WatchViewStub Sample
This sample demonstrates how to specify different layouts for round and rectangular screens.
Android ElevationBasic Sample
This sample demonstrates ways to move a view in the z-axis using setTranslationZ(). This method was introduced in API Level 21 ('Lollipop').
Android CustomChoiceList Sample
This sample demonstrates how to create custom checkable layouts, for use with ListView's choiceMode attribute.
Android SwipeRefreshLayoutBasic Sample
A basic sample which shows how to use SwipeRefreshLayout to add the 'swipe-to-refresh' gesture to a View, enabling the ability to trigger a refresh from swiping down on the view. In this sample the View which can be refreshed is a ListView.
Android ClippingBasic Sample
A basic app showing how to clip on a View using ViewOutlineProvider interface, by which a View builds its outline, used for shadowing and clipping.
Android BasicMultitouch Sample
Sample demonstrates the use of MotionEvent properties to keep track of individual touches across multiple touch events.
Android RecipeAssistant Sample
This phone application uses the enhanced notifications API to display recipe instructions using paged notifications. After starting the application on your phone, you can browse from a short list of recipes and select one to view. Each recipe is broken down into a number of steps; when ready, you can click on the START action in the action bar to send the steps to the wearable. On the wearable device, the steps are displayed as a multi-page notification, with one page for each step in the recipe.
Android BeamLargeFiles Sample
This sample demonstrates how to transfer large files via Android Beam. After the initial handshake over NFC, file transfer will take place over a secondary high-speed communication channel such as Bluetooth or WiFi Direct.
Android BorderlessButtons Sample
This sample demonstrates the borderless button styling from the Holo visual language. Styling is applied in the XML resource layout definitions, referecing the styling attributes from the Holo theme.
Android BasicTransition Sample
A basic app showing how to use the Transition framework introduced in KitKat. The app shows radioboxes to select between different Scenes, and uses various ways to transition between them.
Android RenderScriptIntrinsic Sample
RenderScriptIntrinsic sample that demonstrates how to use RenderScript intrinsics. Creates several RenderScript intrinsics and shows a filtering result with various parameters. Also shows how to extends RedioButton with StateListDrawable.
Android ActionBarCompat-Styled Sample
This sample shows you how to use ActionBarCompat with a customized theme. It utilizes a split action bar when running on a device with a narrow display, and shows three tabs.
Android DoneBar Sample
This sample shows how to create a custom view in the ActionBar to show a done button, using 2 alternative layouts. This is well suited for simple data entry activities, where the only options for the user are to cancel or confirm the data changes.
Android DocumentCentricRecents Sample
Sample demonstrating the basic usage of the new 'Document Centric Apps' API. It let's you create new documents in the system overview menu and persists its state through reboots.
Android BasicContactables Sample
This sample shows how to search for contacts, displaying a SearchView in the Action Bar for user input and implementing a query Cursor with CommonDataKinds.Contactables.
Android MidiSynth Sample
Sample demonstrating how to use the MIDI API to receive and play MIDI messages coming from an attached input device (MIDI keyboard).
Android ActionBarCompat-Basic Sample
This sample shows you how to use ActionBarCompat to create a basic Activity which displays action items. It covers inflating items from a menu resource, as well as adding an item in code.
Android BasicRenderScript Sample
This sample demonstrates using RenderScript to perform basic image manipulation. Specifically, it allows users to dynamically adjust the saturation for an image using a slider. A custom RenderScript kernel performs the saturation adjustment, running the computation on the device's GPU or other compute hardware as deemed appropriate by the system.
Media Controller Test
Create a simple MediaController that connects to a MediaBrowserService in order to test inter-app media controls.
Android WearSpeakerSample Sample
A sample that shows how you can record voice using the microphone on a wearable and play the recorded voice or an mp3 file, if the wearable device has a built-in speaker.
Google Analytics Quickstart
Google Analytics Android Quickstart app demonstrates collecting app usage analytics via Tracker available in Google Play Services. HitBuilders.ScreenViewBuilder is used to send screen view analytics.
Google Cloud Messaging Quickstart
Google Cloud Messaging Android Quickstart app demonstrates registering an Android app for GCM and handling the receipt of a GCM message. InstanceID allows easy registration while GcmReceiver and GcmListenerService provide simple means of receiving and handling messages.
Google Sign-In Quickstart
The Google Sign-In Android quickstart demonstrates how to authenticate a user with GoogleSignInClient.
Android JumpingJack Sample
A basic sample showing how to use the Gravity sensor on the wearable device by counting how many jumping jacks you have performed.
Android DataLayer Sample
This sample demonstrates how to work with a WearableListenerService, to produce and consume DataEvents and effectively work with the DataLayer.
WearCompanionLibrary (WCL)
This is an evolving library to help Wear developers with those tasks that they need to deal with often. Features provided in this library will change over time while backward compatibility will be maintained as much as possible. This library can be added to your project as a module and can be used on your wear or mobile modules, as an added dependency (for certain features, it needs to be added to both).
Android DrawableTinting Sample
Sample that shows applying tinting and color filters to Drawables both programmatically and as Drawable resources in XML.
Android AppRestrictionEnforcer Sample
This sample demonstrates how to set restrictions to other apps as a profile owner. Use the AppRestrictionSchema sample to set restrictions.
Android ElizaChat Sample
A basic sample showing how to add extensions to notifications on wearable using NotificationCompat.WearableExtender API by providing a chat experience.
Android Automatic Backup Sample
Sample demonstrating how to selectively disable Automatic Backups in Android M, either by adjusting the location where data files are stored or by using a custom XML configuration file.
Android WearDrawers Sample
A simple sample that demonstrates Navigation and Action Drawers, part of Material Design for Wear.
Android AdvancedImmersiveMode Sample
Immersive Mode, added in Android 4.4, improves the "hide full screen" and "hide nav bar" modes by letting users swipe the bars in and out. This sample lets the user experiment with immersive mode by seeing how it interacts with some of the other UI flags related to full-screen apps.
Android AppRestrictionSchema Sample
A basic app showing how to allow a device administrator to restrict user activities using the Android Device Administration API. The app exports a custom policy that enables or disables a UI control. Device Administration applications are able to enforce a specific value for this policy, as directed by enterprise administrators.
Simple MediaPlayer Sample
This sample demonstrates the use of MediaPlayer. Here are some important things this sample highlights:
Android ImmersiveMode Sample
One of the features introduced in KitKat is "immersive mode". Immersive mode gives the user the ability to show/hide the status bar and navigation bar with a swipe.To try, click the "Toggle immersive mode" button, then try swiping the bar in and out!
Android ActivityInstrumentation Sample
This sample provides a basic example of using an InstrumentationTest to probe the internal state of an Activity.
Android MidiScope Sample
Sample demonstrating how to use the MIDI API to receive and process MIDI signals coming from an attached device.
Android BasicMediaRouter Sample
This sample demonstrates the use of the MediaRouter API to display content on a secondary display. Use the "Media Route Action Item" in the ActionBar to select an output device. If your device supports Miracast wireless displays, you may need to enable "Wireless Display" functionality in the system settings. Secondary screen simulation can also be enabled from the "Developer Options".
Android BasicImmersiveMode Sample
Sample demonstrating the use of immersive mode to hide the system and navigation bars for full screen applications.
Android RuntimePermissionsWear Sample
A sample that shows how you can handle remote data that requires permissions both on a wearable device and a mobile device.
Android FIDO U2F API Sample
A basic app showing how to register and authenticate FIDO U2F Security Keys using the FIDO U2F API.
Android AgendaData Sample
Sample demonstrating sync of calendar events to a wearable by the press of a button.
Android ActionBarCompat-ListPopupMenu Sample
This sample shows how to display a pop up menu using PopupMenu from the v7 appcompat library.
Android AppRestrictions Sample
A sample that demonstrates the use of the App Restriction feature on devices with multiuser support
Android WearNotifications Sample
Sample demonstrates best practices for using NotificationStyle Notifications (Inbox, BigPicture, BigText, and Messaging) for both Mobile apps and native/local Android Wear apps. It also covers Notifications on Wear 1.+ and Wear 2.0.
Android AlwaysOn Sample
A basic sample showing how to support ambient mode for native Android Wear apps.
Android DelayedConfirmation Sample
Demonstrates how to create a DelayedConfirmationView in your wearable app. In this sample, pressing a button on the phone app sends a message to the wearable to start a simple activity. This activity displays a DelayedConfirmationView that starts when the user presses "Start Timer." Then, callbacks are implemented on both the wearable and phone to show when the timer is selected or finishes. The activity on the wearable uses BoxInsetLayout to automatically apply appropriate margins based on whether the display is square or circular.
WclDemoSample
This is a sample app that shows how one can set up an application to use the WearCompanionLibrary. It has both a phone and a wear component. On your mobile, select a page from the drawer and there, you can open the corresponding page on your wear device by pressing on the FAB button at the lower right corner of the page. On your wear device, you can select an item form the list when you run the app. Features shown here include exchanging data, launching remote app, making HTTP calls from the wear device, showing variations of WearableListView activities and recording voice on the wear and streaming that to the mobile device and playing it there in real-time. In order for each feature to work properly, you have to be on that feature's page on both the mobile app and the wear app at the same time.
Android WearVerifyRemoteApp Sample
Sample demonstrates best practices for checking if connected mobile device has your app installed from an Android Wear 2.+ standalone app and the other way around.
VisualGameController
The Visual Game Controller app is designed to run on an Android TV device and displays visual feedback for the buttons of an attached game controller.
Android CommitContentSampleIME Sample
This sample demonstrates how to write an keyboard which sends rich content (such as images) to text fields using the Commit Content API.
Android ContentProviderPaging Sample
This sample demonstrates how to use the ContentProvider with paging support introduced in Android O. The ContentProvider now accepts additional arguments for the offset and the limit in the query method to support paging instead of fetching all the data in a single query method call.
Android ContentProviderPaging Sample (Kotlin)
This sample demonstrates how to use the ContentProvider with paging support introduced in Android O. The ContentProvider now accepts additional arguments for the offset and the limit in the query method to support paging instead of fetching all the data in a single query method call.
Android WearHighBandwidthNetworking Sample
Sample demonstrates how to determine if a high-bandwidth network is available for use cases that require a minimum network bandwidth, such as streaming media or downloading large files. In addition, the sample demonstrates best practices for asking a user to add a new Wi-Fi network for high-bandwidth network operations if the bandwidth of currently available networks is inadequate.
Leanback Support Library Showcase App for Android TV
This sample app showcases different components that come with Leanback library.
Android DragAndDropAcrossApps-new Sample
This sample contains two separate Android applications: DragSource and DropTarget. DragSource contains images and text that can be dropped into the DropTarget app. Images are shared between the two apps through a URI for which the receiving app must request permission first, before it can be used.
Android CommitContentSampleApp Sample
This sample demonstrates how to write an application which accepts rich content (such as images) sent from a keyboard using the Commit Content API.
Android WearComplicationProvidersTestSuite Sample
Complication Test Suite is a set of complication providers that provide dummy data and it can be used to test how different types of complications render on a watch face.
Android DocumentCentricRelinquishIdentity Sample
This sample shows how to relinquish identity to activities above it in the task stack.
Android Wear Google Sign-In Sample
Sample demonstrating Google Sign-In implementation on Wear 2.0, as well as a Google Sign-In button matching Wear material design.
Android Key Attestation Sample
This sample illustrates how to use the Bouncy Castle ASN.1 parser to extract information from an Android attestation data structure to verify that a key pair has been generated in an Android device. This sample demonstrates how to verify a certificate on a server.
Android ShareActionProvider Sample
This sample shows you how a provide a context-sensitive ShareActionProvider.
Assistant on Android TV sample
This sample is designed to run on an Android TV device that supports the assistant (such as the NVIDIA SHIELD). It demonstrates how to interact with the user through the assistant to control playback.
Android TV Home Screen Channel / Programs Sample
This sample is designed to run on an Android TV device that run Android Oreo (API 26) or higher. It demonstrates how to interact with the home screen to add channels and programs to increase user engagement.