Download File
Download Project
Settings
Line Wrap
Themes
default
ambiance
bespin
dracula
eclipse
material
mbo
mdn-like
neat
solarized dark
ttcn
zenburn
strings.xml
Autofill Sample
Edge Cases
Common Cases
Sample Login Using a Custom Virtual View
Sample Credit Card Check Out Using EditTexts
Sample Credit Card Check Out Using Spinners
Sample Login Using EditTexts
Sample Login Using AutoCompleteTextViews
Sample Email Compose Using EditTexts
Sample Credit Card Check Out Using Compound Views
Sample Credit Card Check Out Using Date Picker
Sample Page with Multiple Data Partitions
Sample Login Using a WebView
Sample Credit Card Anti Pattern
Multi-Step Sign In
Multi-Step Credit Card Check Out
Username
Password
Success!
Sign in using standard views
Sign in using standard views that trigger AutoComplete dialogs when focused
CC Number
CC Expiration
CC Exp Date
CC Exp Day
CC Exp Month
CC Exp Year
CC Security Code
CSC
OK
/
Cancel
Clear
Login
To
Body
Submit
Credit Card Expiration Month
Credit Card Expiration Year
This is a sample login page that uses standard EditTexts from the UI toolkit. EditTexts are already optimized for autofill so extra autofill-specific code is almost never needed.
This is a sample login page that uses AutoCompleteTextViews instead of EditTexts. The AutoComplete dialogs can potentially interfere with the Autofill dialogs, so it is necessary to implement the AutofillCallback to disable AutoComplete when Autofill is working.
This is a sample login page that uses a custom View with virtual children. Since the Autofill framework does not know how to autofill the virtual children out of the box, it is necessary implement certain Autofill-specific methods and interface directly with AutofillManager.
This is a sample credit card checkout page that uses EditTexts to input data into the form.
This is a sample credit card checkout page that uses EditTexts and Spinners to input data into the form. While EditTexts are optimized out of the box, Spinners can require a small amount of work when using a custom array adapter. In that case, you need to tell the Autofill framework which values in the adapter map to which indices.
This is a sample email compose page that uses EditTexts to compose the email. Since none of the fields on the page are important to autofill, it is necessary to set the android:importantForAutofill XML property appropriately for each View. You can either set it to "no" on all non-autofillable Views, or set "noExcludeDescendants" on the root View if all Views in the hierarchy should not be autofilled. In this case, we did the latter.
This is a sample credit card checkout page that uses a custom compound View to input the credit card\'s expiration date and an EditText to input the credit card number. While the EditText is optimized out of the box for autofill, this example shows how to implement certain Autofill-specific methods and XML properties for the custom compound view.
This is a sample login page that uses a WebView to control the UI. The HTML on the web page uses standard W3C autofill hints that the autofill service recognizes. No extra code is needed other than these hints.
This is a sample credit card checkout page that uses a custom EditText and a DatePicker to input the credit card\'s expiration date and an EditText to input the credit card number. While the EditText is optimized out of the box for autofill, this example shows how to use it to autofill a date field.
This is a sample page that contains multiple partitions (login credentials, address, credit card info) and can be used to make sure that only one partition can be autofilled at time.
This is a sample credit card checkout page that uses a standard EditText fields to represent the full credit card expiration date (which is tagged with the View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE hint). This is an anti-pattern because its autofill type is View.AUTOFILL_TYPE_TEXT, which makes it harder for the autofill service to figure out how to fill them. For example, should a month/year date be represent as "04/2020", "4/2020" or "4/20"? Or perhaps the year comes first, so it could be "2020/04", "2020/4" or "20/4"? The proper way to represent a View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE field is through a View.AUTOFILL_TYPE_DATE value, which is what the other credit card sample activities use.
Credentials
Credit Card
Autofilled partition \'%1$s\'
No partition for id %1$d on %2$s
Blocked cross-partitions: %1$s
Ignoring autofill on read-only field %1$s
INVALID
Representing expiration dates as %1$s
Finished
Showing step %1$d
%1$s: %2$s
Prev
Next
Finish
Automatically return to main page in %d second.
Automatically return to main page in %d seconds.
user-1
user-2
1
2
3
4
5
6
7
8
9
10
11
12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27