December 2018
Intermediate to advanced
274 pages
7h 46m
English
In this section, we will see the key flows of the source code to understand how the Google Vision API works from an Android mobile application.
The Vision class represents the Google API Client for Cloud Vision. The first step is to initialize the Vision class. We do it through the Builder, to which we specify the transport mechanism and the JSON factory to be used:
Vision.Builder builder = new Vision.Builder(httpTransport, jsonFactory, null);
The next step is to assign the API key to the Vision Builder so it can start interacting with the cloud APIs. The key we have created is given here:
VisionRequestInitializer requestInitializer = new VisionRequestInitializer(CLOUD_VISION_API_KEY)builder.setVisionRequestInitializer(requestInitializer); ...
Read now
Unlock full access