per page
183 results
java
Fragment Transitions: RecyclerView to ViewPager

This Android project accompanies the Continuous Shared Element Transitions: RecyclerView to ViewPager article. The code here provides the implementation for a specific transition between Android Fragments. It demonstrates how to implement a transition from an image in a <code>RecyclerView</code> into an image in a <code>ViewPager</code> and back, using ‘Shared Elements’ to determine which views participate in the transition and how. It also handles the tricky case of transitioning back to the grid after paging to an item that was previously offscreen. <strong>This is not an officially supported Google product.</strong>

java
HdrViewfinder

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.

java
BeamLargeFiles

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. This feature requires Android 4.1 (Jelly Bean) or above. Unlike traditional Beam, your application will not receive an Intent on the receiving device. Instead, the system will save the file to disk and display a notification that the user can select to open the file using a standard ACTION_VIEW Intent.

java
BluetoothAdvertisements

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)

java
BluetoothLeGatt

This sample demonstrates how to use the Bluetooth LE Generic Attribute Profile (GATT) to transmit arbitrary data between devices.

java
AutofillFramework

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.

java
CommitContentSampleApp

This sample demonstrates how to write an application which accepts rich content (such as images) sent from a keyboard using the Commit Content API.

java
CommitContentSampleIME

This sample demonstrates how to write an keyboard which sends rich content (such as images) to text fields using the Commit Content API.

java
PictureInPicture

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.

kotlin
PictureInPicture (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.

java
RuntimePermissionsBasic

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.

java
RuntimePermissionsBasicKotlin

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.

java
DirectBoot

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.

java
AppShortcuts

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.

java
DocumentCentricRecents

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.

java
DownloadableFonts

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.

kotlin
DownloadableFonts (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.

java
EmojiCompat

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.

kotlin
EmojiCompat (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.

java
Notifications

Sample demonstrates best practices for using NotificationStyle Notifications (Inbox, BigPicture, BigText, and Messaging) for both Mobile apps and native/local Wear apps. It also covers Notifications on Wear 1.+ and Wear 2.0.

java
CardView

This sample demonstrates how to use CardView introduced in the support library in Android 5.0.

kotlin
CardView (Kotlin)

This sample demonstrates how to use CardView introduced in the support library in Android 5.0.

java
RecyclerView

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.

kotlin
RecyclerView (Kotlin)

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.

java
RuntimePermissionsWear

A sample that shows how you can handle remote data that requires permissions both on a wearable device and a mobile device.

java
WatchFace

A simple sample that demonstrates watch faces and complications for Wear 2.0.

java
WearDrawers

A simple sample that demonstrates Navigation and Action Drawers, part of Material Design for Wear.

java firebase
Firebase Quickstarts for Android

A collection of quickstart samples demonstrating the Firebase APIs on Android. For more information, see https://firebase.google.com.

java firebase
Firebase Quickstarts for Android

A collection of quickstart samples demonstrating the Firebase APIs on Android. For more information, see https://firebase.google.com.

java
ActivitySceneTransitionBasic

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.

java
BasicTransition

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.

java
CustomTransition

This sample shows how to implement a custom Transition extending the standard Transition class.

java
Interpolator

This sample demonstrates the use of animation interpolators and path animations for <code>Material Design</code>.

java
Motion

A collection of demos for Material Design Motion. Material Design provides a lot of examples about motion design. This sample shows how to implement them on Android. <li>Understanding motion</li> <li>Speed</li> <li>Choreography</li> <li>Customization</li> Animations and Transitions explains how to use various animation APIs on Android. All the source codes for demos are in the demo package. Layout &gt; Dissolve <img src="screenshots/dissolve.gif" height="400" alt="dissolve" /> Layout &gt; Fade through <img src="screenshots/fadethrough.gif" height="400" alt="fadethrough" /> Layout &gt; FAB transformation <img src="screenshots/fabtransformation.gif" height="400" alt="fab" /> List &gt; Reorder <img src="screenshots/reordering.gif" height="400" alt="reorder" /> List &gt; Stagger <img src="screenshots/stagger.gif" height="400" alt="stagger" /> List &gt; Oscillation <img src="screenshots/oscillation.gif" height="400" alt="oscillation" /> Navigation &gt; Shared element <img src="screenshots/sharedelement.gif" height="400" alt="sharedelement" /> Navigation &gt; Fade through <img src="screenshots/navigationfadethrough.gif" height="400" alt="navfadethrough" />

java
RevealEffectBasic

Sample demonstrating circular reveal effect. It covers creating an ViewAnimationUtils as well as defining the parameters of the circular reveal including starting position and radius.

java
Instant Apps - Google Analytics Example

This sample app demonstrates how to integrate Google Analytics for Firebase into an instant app.

kotlin
Instant Apps - Cookie API

This sample app demonstrates how to use the Cookie API. It contains storage and retrieval of values using both, the Android Framework API and the InstantApps Play Services API. Usage This API is available to both, the Instant App as well as the Installed App, and allows to migrate user-generated data from an instant app to an installed app. The flow for this API is as follows: <li>Check whether the cookie fits the allowance.</li> <li>Store data within the instant app.</li> <li>Retrieve data from the installed app.</li> <p>This API is available for API 26 or higher via PackageManagerCompat.</p> Build Variants This sample has two build variants: <li><code>framework</code> -&gt; Android 8.0 (API level 26) or higher</li> <li><code>playServices</code> -&gt; Any API level</li> The two build variants provide the same features, but one uses the Framework API whereas the other one uses the InstantApps Play Services API. Testing the API with this sample <li>Run the application by checking the &quot;deploy as instant app&quot; in the run configuration</li> <li>Store some data</li> <li>Run the application by unchecking the &quot;deploy as instant app&quot; in the run configuration</li> <li>Retrieve the data stored earlier</li>

kotlin
Instant Apps - Install API sample

This sample app demonstrates how to use the [Install API](https://developers.google.com/android/reference/com/google/android/gms/instantapps/InstantApps.html#showInstallPrompt(android.app.Activity,%20android.content.Intent,%20int,%20java.lang.String)). The API triggers Intent to install the app on device. The call also accepts Intent, which is triggered after the installation is complete. If an app wants to utilize this API, it needs an installable app on the Google Play Store. Also the applicationIds on both the instant as well as the application module have to match.

java
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.

java
Instant Apps - Service

This sample demonstrates how to create a started or a bound service within Android Instant Apps.

kotlin
Instant Apps - Storage API sample

This sample app demonstrates how to use the Storage API. It is relevant to devices running on Android versions <strong>lower than API level 26</strong>. On devices running on API level 26 or higher, the Android framework takes care of migrating user data from instant app to installed app. After installation is completed, the installed app transfers the stored data from the instant app by using this API, providing a seamless experience for the user. Usage In the installed app, call the [Storage API](https://developers.google.com/android/reference/com/google/android/gms/instantapps/InstantAppsClient.html#getInstantAppData()). The API lets you access the data stored in the instant app. For more information about data storage, see [the documentation](https://developers.google.com/android/reference/com/google/android/gms/instantapps/InstantAppsClient.html#getInstantAppData()).

java
Room & RxJava

This is an API sample to showcase how to implement observable queries in Flowable objects.

kotlin
Room & RxJava (Kotlin)

This is an API sample to showcase how to use Flowable objects in Kotlin.

java
Architecture Components Basic

This sample showcases the following Architecture Components: <li>Room</li> <li>ViewModels</li> <li>LiveData</li>

java
Github Browser with Architecture Components

This is a sample app that uses Android Architecture Components with Dagger 2. <strong>NOTE</strong> It is a relatively more complex and complete example so if you are not familiar with Architecture Components, you are highly recommended to check other examples in this repository first.

java
Kotlin Coroutines with Architecture Components (LiveData, ViewModel, Lifecycle)

This sample showcases the following Architecture Components: <li>LiveData</li> <li>ViewModels</li> <li>Data Binding</li> And the following artifacts: <li>androidx.lifecycle.lifecycle-livedata-ktx</li> This project shows how to integrate them with Kotlin's coroutines using the <code>liveData</code> builder.

kotlin
Architecture Components Advanced Navigation

Features This sample showcases the behavior of a bottom navigation view following the Principles of Navigation. <li>Fixed start destination</li> <li>Navigation state should be represented via a stack of destinations</li> <li>The Up button never exits your app</li> <li>Up and Back are identical within your app's task</li> <li>Deep linking and navigating to a destination should yield the same stack</li> Check out the UI tests to learn about specific scenarios.

java
Architecture Components Paging

This sample showcases the following Architecture Components: <li>Paging</li> <li>Room</li> <li>ViewModels</li> <li>LiveData</li>

java
Room with Content Providers

This sample demonstrates how to expose data stored in the Room persistence library with Android's Content Provider framework.

kotlin
Jetpack WorkManager

This is a simple image processing application written in Kotlin that shows how to use WorkManager to do background work.

kotlin
Crane sample

Jetpack Compose. The goal of the sample is to showcase Material components, draggable UI elements, Android Views inside Compose, and UI state handling. To try out this sample app, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here.

kotlin
Jetnews sample

Jetnews is a sample news reading app, built with Jetpack Compose. The goal of the sample is to showcase the current UI capabilities of Compose. To try out this sample app, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here.

kotlin
Jetcaster sample 🎙️

Jetcaster is a sample podcast app, built with Jetpack Compose. The goal of the sample is to showcase dynamic theming and full featured architecture. To try out this sample app, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here. Status: 🚧 In progress 🚧 Jetcaster is still in the early stages of development, and as such only one screen has been created so far. However, most of the app's architecture has been implemented, as well as the data layer, and early stages of dynamic theming.

kotlin
Jetchat sample

Jetchat is a sample chat app built with Jetpack Compose. To try out these sample apps, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here. This sample showcases: <li>UI state management</li> <li>Integration with Architecture Components: Navigation, Fragments, LiveData, ViewModel</li> <li>Back button handling</li> <li>Text Input and focus management</li> <li>Multiple types of animations and transitions</li> <li>Saved state across configuration changes</li> <li>Basic Material Design theming</li> <li>UI tests</li> <img src="screenshots/jetchat.gif" /> Status: 🚧 In progress Jetchat is still in under development, and some features are not yet implemented.

kotlin
Jetsnack sample

Jetsnack is a sample snack ordering app built with Jetpack Compose. To try out these sample apps, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here. This sample showcases: <li>How to implement a custom design system</li> <li>Custom layout</li> <li>Animation</li> <img src="screenshots/jetsnack.gif" /> Status: 🚧 In progress 🚧 Jetsnack is still under development and some screens are not yet implemented.

kotlin
Jetsurvey sample

Jetsurvey is a sample survey app, built with Jetpack Compose. The goal of the sample is to showcase text input, validation and state capabilities of Compose. To try out these sample apps, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here.

kotlin
Owl sample

This sample is a Owl, a Material Design study. To try out these sample apps, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here. This sample showcases: <li>Material theming &amp; light/dark themes</li> <li>Custom layout</li> <li>Animation</li>

kotlin
Rally sample

This sample is a Rally, a Material Design study. To try out these sample apps, you need to use the latest Canary version of Android Studio 4.2. You can clone this repository or import the project from Android Studio following the steps here. This sample showcases: <li>Material theming</li> <li>Custom layouts and reusable elements</li> <li>Charts and tables</li> <li>Animations</li> <img src="screenshots/rally.gif" /> Status: 🚧 In progress This sample is still in under development, and some features are not yet implemented.

java
BluetoothChat

This sample shows how to implement two-way text chat over Bluetooth between two Android devices, using all the fundamental Bluetooth API capabilities.

java
NetworkConnect

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.

java
WifiRttScan

Sample demonstrates best practices for using WifiRTT APIs in Android. Also, this is a a useful application for testing Wifi-RTT enabled phones and access points and validating the estimated distance is close to the actual distance between them.

kotlin
Data Binding Basic

This sample showcases the following features of the Data Binding library: <li>Layout variables and expressions</li> <li>Observability through Observable Fields, LiveData and Observable classes</li> <li>Binding Adapters, Binding Methods and Binding Converters</li> <li>Seamless integration with ViewModels</li> It shows common bad practices and their solutions in two different screens.

kotlin
Data Binding Advanced

This sample showcases the following features of the Data Binding library with an app that shows a workout timer. <li>Two-way Data Binding</li> <li>Alternatives to Two-way Data Binding</li> <li>Binding adapters with multiple parameters</li> <li>Animations with Binding Adapters</li> <li>Binding converters and inverse converters</li> <li>Data Binding with ViewModels and Kotlin</li> <li>No UI framework calls in activity</li> <li>Testing</li>

java
AppRestrictionEnforcer

This sample demonstrates how to set restrictions to other apps as a profile owner. Use the AppRestrictionSchema sample to set restrictions.

java
AppRestrictionSchema

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.

java
AppRestrictions

A sample that demonstrates the use of the App Restriction feature on devices with multiuser support

java
BasicManagedProfile

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.

java
DeviceOwner

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.

java
NfcProvisioning

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.

java
DisplayingBitmaps

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.

java
DrawableTinting

Sample that shows applying tinting and color filters to Drawables both programmatically and as Drawable resources in XML. Tinting is set on a nine-patch drawable through the &quot;tint&quot; and &quot;tintMode&quot; parameters. A color state list is referenced as the tint color, which defines colors for different states of a View (for example disabled/enabled, focused, pressed or selected). Programmatically, tinting is applied to a Drawable through its &quot;setColorFilter&quot; method, with a reference to a color and a PorterDuff blend mode. The color and blend mode can be changed from the UI to see the effect of different options.

java
MediaEffects

This sample shows how to use the Media Effects APIs that were introduced in Android 4.0.

java
PdfRendererBasic

This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.

kotlin
PdfRendererBasic (Kotlin)

This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.

java
Account Transfer Api App

A sample app demonstrating how to use AccountTransferApi to transfer accounts during the setup of a new device.

java
credentials-quickstart

java
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. For more information, visit https://developers.google.com/identity/

java
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).

kotlin
Warning: This sample is currently outdated and you should reference the Java version instead.

Android AutofillFramework Sample (Kotlin) 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.

java
BasicGestureDetect

This sample detects gestures on a view and logs them. In order to try this sample out, try dragging or tapping the text.

java
BasicMultitouch

Sample demonstrates the use of MotionEvent properties to keep track of individual touches across multiple touch events.

java
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. Introduction Demonstrates use of the ActivityRecognitionApi to recognize a user's current activity, such as walking, driving, or standing still. Users can request activity updates by pressing the &quot;Request Updates&quot; button, and stop receiving updates using the &quot;Remove Updates&quot; button. The sample uses an <code>IntentService</code> to process detected activity changes, which are sent using DetectedActivity class for a list of DetectedActivity types. Each <code>DetectedActivity</code> is associdated with a confidence level, which is an int between 0 and 100. To run this sample, <strong>location must be enabled</strong>.

java
Basic Location (Java)

Demonstrates use of the Google Play services Location API to retrieve the last known location for a device. Introduction This sample shows a simple way of getting a device's last known location, which is usually equivalent to the device's current location. The accuracy of the location returned is based on the location permissions you've requested and the location sensors that are currently active for the device. To run this sample, <strong>location must be enabled</strong>. This sample uses FusedLocationProviderClient. Also see the Kotlin version of this sample.

kotlin
Basic Location (Kotlin)

Demonstrates use of the Google Play services Location API to retrieve the last known location for a device. Introduction This sample shows a simple way of getting a device's last known location, which is usually equivalent to the device's current location. The accuracy of the location returned is based on the location permissions you've requested and the location sensors that are currently active for the device. To run this sample, <strong>location must be enabled</strong>. This sample uses FusedLocationProviderClient.

java
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. Introduction Geofencing combines awareness of the user's current location with awareness of nearby features, defined as the user's proximity to locations that may be of interest. To mark a location of interest, you specify its latitude and longitude. To adjust the proximity for the location, you add a radius. The latitude, longitude, and radius define a geofence. You can have multiple active geofences at one time. Location Services treats a geofences as an area rather than as a points and proximity. This allows it to detect when the user enters or exits a geofence. For each geofence, you can ask Location Services to send you entrance events, exit events, or both. You can also limit the duration of a geofence by specifying an expiration duration in milliseconds. After the geofence expires, Location Services automatically removes it. To run this sample, <strong>location must be enabled</strong>.

java
Location Updates (Java)

Demonstrates how to use the Geocode API and reverse geocoding to display a device's location as an address. Introduction This sample builds on the BasicLocationSample and the LocationUdpates samples included in this repo. Those samples work with latitude and longitude values only. While latitude and longitude are useful for calculating distance or displaying a map position, in many cases the address of the location is more useful. The Android framework location APIs provide a Geocode API which contains a [getFromLocation()](http://developer.android.com/reference/android/location/Geocoder.html#getFromLocation(double, double, int)) method that returns an estimated street address corresponding to a given latitude and longitude. This sample uses the <code>getFromLocation()</code> method to do location address lookup, an IntentService to fetch the location address, and a ResultReceiver to process results sent by the IntentService. To run this sample, <strong>location must be enabled</strong>.

kotlin
Location Updates (Kotlin)

Demonstrates how to use the Geocode API and reverse geocoding to display a device's location as an address. Introduction This sample builds on the BasicLocationSample and the LocationUdpates samples included in this repo. Those samples work with latitude and longitude values only. While latitude and longitude are useful for calculating distance or displaying a map position, in many cases the address of the location is more useful. The Android framework location APIs provide a Geocode API which contains a [getFromLocation()]http://developer.android.com/reference/android/location/Geocoder.html#getFromLocation(double, double, int)) method that returns an estimated street address corresponding to a given latitude and longitude. This sample uses the <code>getFromLocation()</code> method to do location address lookup, an IntentService to fetch the location address, and a ResultReceiver to process results sent by the IntentService. To run this sample, <strong>location must be enabled</strong>.

java
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. Introduction This sample builds on the BasicLocationSample sample included in this repo, and allows the user to request periodic location updates. In response, the API updates the app periodically with the best available location, based on the currently-available location providers such as WiFi and GPS (Global Positioning System). The accuracy of the location is also determined by the location permissions you've requested (we use the ACCESS_FINE_LOCATION here) and the options you set in the location request. This sample uses the FusedLocationProviderClient. To run this sample, <strong>location must be enabled</strong>.

java
BasicMediaDecoder

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.

java
BasicMediaRouter

This sample demonstrates the use of the MediaRouter API to display content on a secondary display. Use the &quot;Media Route Action Item&quot; in the ActionBar to select an output device. If your device supports Miracast wireless displays, you may need to enable &quot;Wireless Display&quot; functionality in the system settings. Secondary screen simulation can also be enabled from the &quot;Developer Options&quot;. Once connected, use the &quot;Change Color&quot; button to change the background color of the secondary screen.

java
MediaRecorder

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.

java
MediaRouter

Demonstrates how to create a custom media route provider.

java
MidiScope

Sample demonstrating how to use the MIDI API to receive and process MIDI signals coming from an attached device.

java
MidiSynth

Sample demonstrating how to use the MIDI API to receive and play MIDI messages coming from an attached input device (MIDI keyboard).

java
ScreenCapture

This sample demonstrates how to use Media Projection API to capture device screen in real time and show it on a SurfaceView.

kotlin exoplayer
Video Player

This sample shows how to implement a media app that allows playback of video from local storage (assets folder in the APK) or remote sources over HTTP(S). 1. It supports playlists, so that multiple videos can be strung together to play one after the other, and skip between them. 2. It supports <code>MediaSession</code> so that external Bluetooth headphones can control your media (play, pause, skip to next, etc), and see what media is currently playing (like from a car's Bluetooth head unit). 3. It supports Audio Focus, so that you can respect Android's audio focus system and pause playback if something else is playing. 4. It supports picture in picture (PIP) so that the app's video playback can continue in a minimized window while the user is in other apps. To learn more about <code>ExoPlayer</code>, <code>MediaSession</code>, Audio Focus, and PIP, please read this series of articles on Medium that goes into the details of these APIs.

c++ , java ndk
Audio-Echo

The sample demos how to use OpenSL ES to create a player and recorder in Android Fast Audio Path, and connect them to loopback audio. On most android devices, there is a optimized audio path that is tuned up for low latency purpose. The sample creates player/recorder to work in this highly optimized audio path(sometimes called native audio path, low latency path, or fast audio path). The application is validated against the following configurations: * Android L AndroidOne * Android M Nexus 5, Nexus 9 This sample uses the new Android Studio with CMake support, and shows how to use shared stl lib with android studio version 2.2.0, see CMakeLists.txt for details <strong><em>Note that OpenSL ES is Oboe library instead.</em></strong>

c++ , java ndk
Bitmap Plasma

Bitmap Plasma is an Android sample that uses JNI to render a plasma effect in an Android Bitmap from C code. This sample uses the new Android Studio CMake plugin with C++ support.

c++ ndk
Endless Tunnel

Endless Tunnel is a sample game that shows how to: - use the Android Studio C++ support - implement a game using Android native glue - implement joystick support, including robust DPAD navigation for non-touch screens It is NOT the goal of this sample to show the best way to write the game logic, load resources, etc. The game itself was intentionally kept rudimentary in order to keep the focus on the Android Studio C++ integration. For example, this game contains textures and geometry hard-coded in code, which works for small demo games like this one, but doesn't scale well to real games. This sample uses the new Android Studio CMake plugin with C++ support.

c++ , java ndk
gles3jni

gles3jni is an Android C++ sample that demonstrates how to use OpenGL ES 3.0 from JNI/native code. The OpenGL ES 3.0 rendering path uses a few new features compared to the OpenGL ES 2.0 path: - Instanced rendering and vertex attribute divisor to reduce the number of draw calls and uniform changes. - Vertex array objects to reduce the number of calls required to set up vertex attribute state on each frame. - Explicit assignment of attribute locations, eliminating the need to query assignments. This sample uses the new Android Studio CMake plugin with C++ support.

c++ , java ndk
Hello GL2

Hello GL2 is an Android C++ sample that draws a triangle using GLES 2.0 API. It uses JNI to do the rendering in C++ over a GLSurfaceView created from a regular Android Java Activity. This sample uses the new Android Studio CMake plugin with C++ support.

c++ , java ndk
Hello JNI

Hello JNI is an Android sample that uses JNI to call C code from a Android Java Activity. This sample uses the new Hello-CMake codelab

c++ , java ndk
Hello JNI Callback

This sample is an Aadd-on to Hello JNI sample to demonstrate calling back to Java from C code - create a java class instance from C code - call java class static and non-static member functions This sample uses the new Android Studio CMake plugin with C++ support.

c++ , java ndk
hello-libs

hello-libs is a sample that shows you how to manage 3rd party C/C++ libraries with Android Studio.

c++ ndk
Hello Oboe

Hello Oboe is an Android sample that uses the Oboe library to play audio natively. Oboe wraps both AAudio and OpenSLES to help developers play and record audio in performance sensitive contexts across Android versions. The Oboe repository has more information about how to fully take advantage of the Oboe API, as well as more in-depth examples and documentation. This sample uses the Studio Prefab feature to download pre-built Oboe library from Google Maven, feel free to checkout Prefab steps in - gradle.properties - app/build.gradle - app/src/main/cpp/CMakeLists.txt If you like to build your app with the Oboe library source code, refer to the examples in the Oboe repository.

c++ ndk
Native Activity

Native Activity is an Android sample that initializes a GLES 2.0 context and reads accelerometer data from C code using Native Activity. This sample uses the new Android Studio CMake plugin with C++ support.

c++ , java ndk
Native Audio

Native Audio is an Android sample that plays and records sounds with the C++ OpenSLES API using JNI. The recorder / players created are not in fast audio path. This sample uses the new Android Studio CMake plugin with C++ support. <strong><em>Note that OpenSL ES is Oboe library instead.</em></strong>

c++ ndk
Native Plasma

Native Plasma is an Android sample that renders a plasma effect in a Bitmap from C code using Native Activity. This sample uses the new Android Studio CMake plugin with C++ support.

c++ , java ndk
San Angeles

San Angeles is an Android port of a demo that uses GLES C/API to render a procedural scene. See the original README for more details about the original GLES port. The sample demos: - ABI APK split

c++ , java ndk
Sensor-Graph

Sensor graph is a C++ Android sample that read current accelerometer values and draw them using OpenGL. It demonstrate usage of the following Native C++ API: - Assets This sample uses the new Android Studio CMake plugin with C++ support.

c++ , java ndk
Teapots

Teapots is an collection of Android C++ samples that uses a Teapot rendering to demostrate Android NDK platform features: - classic-teapot: Rendering classic teapot mesh using GLES 2.0 API and NativeActivity. - more-teapots: Rendering multiple instances of Classic Teapot with GLES 3.0 Instance Rendering - choreographer-30fps: demonstrates multiple frame rate throttoling techniques based on API level using Choreographer API and EGL Android presentation time extension. - textured-teapot: Rendering classic teapot plus textures - image-decoder: Same as textured-teapot, except that texture decoding is done with the ImageDecoder API introduced in Android 11 (Android NDK r21b) This sample uses the new Android Studio CMake plugin with C++ support.

c++ ndk
WEBP

Webp is an Android sample including a small app to demo usage of webp in Native Activity<br />view: - rotate decoding 3 webp images and load them into on-screen buffer. Decoding is in its own thread This sample uses the new Android Studio CMake plugin.

java
BasicRenderScript

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.

java
RenderScriptIntrinsic

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.

kotlin
BiometricAuthentication (Kotlin)

A sample that demonstrates to use registered fingerprints to authenticate the user in your app

kotlin
BiometricLogin (Kotlin)

Sample for the Androidx Biometrics Library

java
FIDO2 API

A sample app showing how to register and authenticate with Public Key Credentials using the FIDO2 API. FIDO2 API is used for devices running Android N (API level 24) or newer.

kotlin
File Locker

A sample that demonstrates how to use the Jetpack Security library to encrypt and decrypt files by implementing a simple note taking app. <img src="screenshots/notes-list.png" height="400" alt="Screenshot showing a list of notes. The notes say 'Secret Note' and 'Encrypted Todo List'." />

java
BatchStepSensor

Sample demonstrating how to set up SensorEventListeners for step detectors and step counters.

kotlin storage access framework
ACTION_OPEN_DOCUMENT

<img src="screenshots/icon-web.png" height="256" alt="App Icon" /> This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.

kotlin storage access framework
ACTION_OPEN_DOCUMENT_TREE

A proof of concept file manager utilizing the Android 5.0, API level 21.

java
ContentProviderPaging

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.

java
ContentProviderPaging (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.

kotlin media store
Media Store

<img src="screenshots/icon-web.png" height="256" alt="App Icon" /> This sample demonstrates how to use Android's MediaStore to locate and display the users images in a RecyclerView.

java
StorageClient

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.

java
StorageProvider

This sample shows how to implement a simple documents provider using the storage access framework available in Android 4.4.

kotlin
Sunflower

A gardening app illustrating Android development best practices with Android Jetpack. Android Sunflower is currently under heavy development. Note that some changes (such as database schema modifications) are not backwards compatible and may cause the app to crash. In this case, please uninstall and re-install the app.

java
Basic sample for writing unit tests that mocks the framework

<em>If you are new to unit testing on Android, try this sample first.</em> This project uses the Gradle build system and the Android gradle plugin support for unit testing. You can either benefit from IDEs integration such as Android studio or run the tests on the command line. Unit tests run on a local JVM on your development machine. The Android Gradle plugin will compile your app's source code and execute it using gradle test task. Tests are executed against a modified version of android.jar where all final modifiers have been stripped off. This lets you use popular mocking libraries, like Mockito. For more information see http://tools.android.com/tech-docs/unit-testing-support

kotlin
Basic sample (in Kotlin) for writing unit tests that mocks the framework

<em>If you are new to unit testing on Android, try this sample first.</em> This project uses the Gradle build system and the Android gradle plugin support for unit testing. You can either benefit from IDEs integration such as Android studio or run the tests on the command line. Unit tests run on a local JVM on your development machine. The Android Gradle plugin will compile your app's source code and execute it using gradle test task. Tests are executed against a modified version of android.jar where all final modifiers have been stripped off. This lets you use popular mocking libraries, like Mockito. For more information see http://tools.android.com/tech-docs/unit-testing-support

kotlin
Topeka for Android

A fun to play quiz that showcases material design on Android Introduction Material design is a new system for visual, interaction and motion design. The Android version of Topeka demonstrates that the same branding and material design principles can be used to create a consistent experience across platforms. We originally launched the Topeka web app as an Open Source example of material design on the web. The current release of Topeka is available to users down to API level 14 aka design support library play important roles. Topeka also features a set of Espresso tests which can be executed with the <code>connectedAndroidTest</code> gradle task. You can read more about the project on the Android Developers blog. Screenshots <img src="screenshots/categories.png" width="30%" /> <img src="screenshots/category_history.png" width="30%" /> <img src="screenshots/quiz_shakespeare.png" width="30%" /> Getting Started Clone this repository, enter the top level directory and run <code>./gradlew tasks</code> to get an overview of all the tasks available for this project. Some important tasks are: <code> bundleDebug - Assembles all Debug builds. installDebug - Installs the Debug build. connectedAndroidTest - Installs and runs the tests for Debug build on connected devices. test - Run all unit tests. </code> Support <li>Stack Overflow: http://stackoverflow.com/questions/tagged/android</li> If you've found an error in this sample, please file an issue: https://github.com/googlesamples/android-topeka/issues Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. License ``` Copyright 2015 Google, Inc. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```

java
AdvancedImmersiveMode

Immersive Mode, added in Android 4.4, improves the &quot;hide full screen&quot; and &quot;hide nav bar&quot; 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.

java
BasicImmersiveMode

Sample demonstrating the use of immersive mode to hide the system and navigation bars for full screen applications.

java
ClippingBasic

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.

java
DarkTheme

Sample demonstrating the different ways to support Dark Mode on Android. Uses the Material Design Components Library.

java
DragAndDropAcrossApps-new

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. It also demonstrates the use of the DragStartHelper from the v13 support library to easily handle drag and drop events.

java
ElevationBasic

This sample demonstrates ways to move a view in the z-axis using <code>setTranslationZ()</code>. This method was introduced in API Level 21 ('Lollipop').

java
ElevationDrag

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.

java
ImmersiveMode

One of the features introduced in KitKat is &quot;immersive mode&quot;. Immersive mode gives the user the ability to show/hide the status bar and navigation bar with a swipe.To try, click the &quot;Toggle immersive mode&quot; button, then try swiping the bar in and out!

java
TextLinkify

This sample illustrates how links can be added to a TextView. This can be done either automatically by setting the &quot;autoLink&quot; property or explicitly.

java
Drawing a rounded corner background on text

This sample shows how to draw a <strong>rounded</strong> corner background on text. It supports the following cases: <li>Set the background on <strong>one line</strong> text</li> <img src="../TextRoundedBackgroundKotlin/screenshots/single.png" width="30%" /> <li>Set the background on text over <strong>two or multiple lines</strong></li> <img src="../TextRoundedBackgroundKotlin/screenshots/multi.png" width="30%" /> <li>Set the background on <strong>right-to-left</strong> text</li> <img src="../TextRoundedBackgroundKotlin/screenshots/rtl.png" width="30%" />

java
Text Styling

This sample shows how to style text on Android using spans, in Java.

java
Text Styling

This sample shows how to style text on Android using spans, in Kotlin, using Android KTX.

java
Interpolator Playground

This application shows how the various Interpolator implementations in the platform work. You can vary the duration of the animation as well as the constructor parameters of any of the variable interpolators and use the values in the UI to inform how to write your code that uses that interpolator. Changes to the animation parameters will be reflected dynamically in the blue curve and running the animation will show the animation in action (with the red circles on the curve as well as in the open area at the bottom). To use: * Select any of the built-in interpolators from the drop-down list at the top * Use the slider(s) to change the animation duration and/or any of the variable parameters for the selected interpolator * For Quadratic and Cubic Path interpolators, drag the green handle(s) to position the control points of the curve * Click the 'Run' button to see the animation in action * Note the values of the duration and other parameters to use in your animation code <img src="screenshot.png" alt="InterolatorPlayground screenshot" "="" />

java
MotionLayout / Constraint Layout

This repository contains a list of layouts that showcases the various features and usage of MotionLayout

java
MultiWindowPlayground

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.

java
MultiWindowPlayground (Kotlin)

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.

java
Transitions

This application shows how to use the Transitions API in the Android Support Library. While transitions have worked on the platform since the KitKat release (API level 19), there was previously no way to use transitions on devices running earlier releases. Now you can use the Support Library API instead to run on Android releases back to Ice Cream Sandwich (API level 14). Note that the Support Library APIs have the following limitations, compared to transitions in the framework APIs: <li>The Support Library API is specifically about view transitions, the same as we offered in the KitKat release. Later capabilities such as Activity Transitions, depend on platform capabilities that cannot be supported on earlier releases.</li> <li>KitKat transitions offer the ability to use XML resource files to define transitions, scenes, and transition graphs. Support Library transitions, on the other hand, only allow setting up transitions from code; there are no such resource files available in the Support Library.</li> To use the transitions demo application: <li>Click on one of the buttons to move the entire group of buttons to the location specified in the button text. Note how the buttons animate into place (via the single call to TransitionManager.beginDelayedTransition()).</li> <li>Check the &quot;Stagger&quot; checkbox to indicate whether the transitions should run in a staggered fashion, one after the other. When this happens, the buttons will start one at a time, by creating a custom TransitionSet of child transitions with different target views and startDelays.</li> <img src="TransitionsOnJbEmulator.png" alt="Transitions screenshot" "="" /> For more information on transitions, see the following resources: <li>Support Library versions (use version 24.2.0+ for the transitions API)</li> <li>android.support.transitions reference documentation</li> <li>Developer training on Transitions</li>

java
SwipeRefreshLayoutBasic

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.

java
SwipeRefreshMultipleViews

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.

kotlin
ViewPager2 samples

This sample shows how to use ViewPager2 with either Views or Fragments as pages, how to perform page transformations, how to link ViewPager2 to a TabLayout, and demonstrates handling modifications of an underlying page adapter collection. ViewPager2 is the replacement of ViewPager, addressing most of its predecessor's pain-points, including right-to-left layout support, vertical orientation and modifiable Fragment collections. Samples <li>ViewPager2 with Views - shows how to set up a ViewPager2 with Views as pages</li> <li>ViewPager2 with Fragments - shows how to set up a ViewPager2 with Fragments as pages</li> <li>ViewPager2 with a Mutable Collection (Views) - demonstrates usage of ViewPager2 with Views as pages and mutations in a page adapter</li> <li>ViewPager2 with a Mutable Collection (Fragments) - demonstrates usage of ViewPager2 with Fragments as pages, and mutations in a page adapter</li> <li>ViewPager2 with a TabLayout (Views) - shows how to set up a ViewPager2 with Views as pages, and link it to a TabLayout</li>

java
AlwaysOn

A basic sample showing how to support ambient mode for native Wear apps.

java
DataLayer

This sample demonstrates how to work with a WearableListenerService, to produce and consume DataEvents and effectively work with the DataLayer.

java
WearAccessibilityApp

Sample demonstrates how to include accessibility support for your wearable app.

java
WearComplicationProvidersTestSuite

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.

java
Wear OAuth

java
WearSpeakerSample

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. This sample doesn't have any companion phone app so you need to install this directly on your watch (using &quot;adb&quot;).

java
Wear Google Sign-In

java
WearVerifyRemoteApp

Sample demonstrates best practices for checking if connected mobile device has your app installed from a Wear 2.+ standalone app and the other way around.

java android things
Cloud Doorbell

The Android Things Doorbell sample demonstrates how to create a “smart” doorbell. The sample captures a button press from a user, obtains an image via a camera peripheral, processes the image data using Google’s Cloud Vision API, and uploads the image, Cloud Vision annotations and metadata to a Firebase database where it can be viewed by a companion app.

java android things
Peripheral Driver

Samples for Android Things peripheral drivers located in the contrib-drivers repository.

java android things
Bluetooth Audio

This sample demonstrates the use of Android Bluetooth APIs for audio from an Android Things app.

java android things
Bluetooth GATT Server (Java)

This application demonstrates accessing the <code>BluetoothGattServer</code> Android API from within an Android Things application. The sample application advertises the Time Profile.

kotlin android things
Bluetooth GATT Server (Kotlin)

This application demonstrates accessing the <code>BluetoothGattServer</code> Android API from within an Android Things application. The sample application advertises the Time Profile.

java android things
Button and LED (Java)

This Android Things sample demonstrates how to use a button input UserDriver to listen to GPIO pin changes, generate and listen for key events and change the state of an LED accordingly. Follow the Peripheral I/O Codelab for step-by-step instructions on how to build a similar sample.

kotlin android things
Button and LED (Kotlin)

This Android Things sample demonstrates how to use a button input UserDriver to listen to GPIO pin changes, generate and listen for key events and change the state of an LED accordingly.

java android things
Google Assistant SDK for devices - Things

This sample shows how to call the Google Assistant Service from Android Things using gRPC. It records a spoken request from the connected microphones, sends it to the Google Assistant API and plays back the Assistant's spoken response on the connected speaker.

java android things
Things LoWPAN

This sample shows how to use LoWPAN to connect multiple Android Things devices in the same network and wirelessly transfer data. There are three modules in this sample which demonstrate how to scan for networks, transmit data, and receive data. To learn more about LoWPAN networks, see the LoWPAN API guide.

c++ android things
Native Peripheral I/O

This Android Things app runs basic code that exercises the Native PIO APIs from C++. Each sample is an Android module that can be run independently.

java android things
Simple Peripheral I/O (Java)

This Android Things app runs basic code that exercises the Peripheral I/O APIs. Each sample is an Android module that can be run independently.

kotlin android things
Simple Peripheral I/O (Kotlin)

This Android Things app runs basic code that exercises the Peripheral I/O APIs. Each sample is an Android module that can be run independently.

java android things
Simple Peripheral UI (Java)

This utility exposes the GPIO of an Android Things device as switch widgets in a graphical UI. You review the state of inputs, and click the switches to control the state of outputs.

kotlin android things
Simple Peripheral UI (Kotlin)

This utility exposes the GPIO of an Android Things device as switch widgets in a graphical UI. You review the state of inputs, and click the switches to control the state of outputs.

java android things
TensorFlow Lite IoT Image Classifier

This sample demonstrates how to run TensorFlow Lite inference on Android Things. Push a button to capture an image with the camera, and TensorFlow Lite will tell you what it is! Follow the Image Classifier Codelab step-by-step instructions on how to build a similar sample.

java android things
UART Loopback (Java)

This sample demonstrates basic data read and write operations over a UART. The application creates a loopback interface that immediately echoes any data read from the receive (RX) buffer to the transmit (TX) buffer.

kotlin android things
UART Loopback (Kotlin)

This sample demonstrates basic data read and write operations over a UART. The application creates a loopback interface that immediately echoes any data read from the receive (RX) buffer to the transmit (TX) buffer.

java android things
Things Device Updates

This application demonstrates how to interact with the device update service on Android Things through the <code>UpdateManager</code> API. By default, the system checks for new OTA updates every few hours and applies them automatically. This example shows you how to configure the update policy to allow an app to take more control over the update process and monitor progress.

java android things
USB Enumerator (Java)

This application demonstrates accessing the <code>UsbManager</code> Android API from within an Android Things application. The sample application iterates over all the USB devices discovered by the host and prints their interfaces and endpoints.

kotlin android things
USB Enumerator (Kotlin)

This application demonstrates accessing the <code>UsbManager</code> Android API from within an Android Things application. The sample application iterates over all the USB devices discovered by the host and prints their interfaces and endpoints.

java android things
Cloud IoT Core Sensor Hub

This sample shows how to implement a sensor hub on Android Things that collects sensor data from connected sensors and publish as telemetry events to Google Cloud IoT Core.

java android things
Weather Station

This sample integrates multiple Android Things peripheral drivers together to build a connected Weather Station.

java
ActivityInstrumentation

This sample has been deprecated/archived meaning it's read-only and it's no longer actively maintained (more details on archiving can be found here). For other related samples, check out the new github.com/android/testing-samples repo. Thank you!

java
AppUsageStatistics

A basic app showing how to use App usage statistics API to let users collect statistics related to usage of the applications.

java
Material Components Catalog App

The Android version of the Material Design Components Catalog, intended to demonstrate Material Design principles and provide component demonstrations and code examples.

per page
183 results