MlKit
Stay organized with collections
Save and categorize content based on your preferences.
Public entry point to manually initialize ML Kit.
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public static void initialize (Context
context)
Initializes ML Kit with the given context
.
It is only necessary to call this method if you disable the content provider
declared in the manifest(e.g. when you want to use ML Kit feature in Application
).
Under normal circumstances the content provider will automatically initialize ML Kit at
application startup.
How to disable ML Kit initialization content provider:
<provider
android:name="com.google.mlkit.common.internal.MlKitInitProvider"
android:authorities="${applicationId}.mlkitinitprovider"
tools:node="remove" />
Parameters
context |
a Context
used to initialize ML Kit. This does not have to be the application context
itself. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`MlKit` is the public entry point for manual initialization of ML Kit functionalities within your Android application."],["It provides a static `initialize()` method that requires an Android `Context` for setup, typically necessary when the automatic initialization via content provider is disabled."],["Disabling the default content provider initialization, achieved by removing the `MlKitInitProvider` from your manifest, might be desirable for scenarios like using ML Kit features within your application class."],["In typical cases, ML Kit automatically initializes during application startup thanks to its content provider, eliminating the need for manual calls to `MlKit.initialize()`."]]],[]]