Ensure the SDK is initialized according to instructions listed in the Android Initialization section.
Retrieve an Intent for displaying the SnapActivity with your desired (or the default) SnapConfiguration
Start the intent for the SnapActivity
The following code illustrates a SnapActivity with the default configuration.
If you do not want or need to customize the snapping configuration, you can also omit the configuration
parameter.
Once a sporting event is successfully snapped, the OddsResultsFragment
is automatically presented in the SnapActivity and the odds for the snapped game are presented.
If the sporting event is not successfully snapped, the values above are not returned, and an error message will appear in the viewfinder: "Your snap returned no results. Make sure your TV is visible in the viewfinder"
Applications must request user permission for camera access, and camera access is required for the app to function. For this reason, your application should be set to ask permission from the user to access the camera, and to receive said permission, before presenting the Snap UI. The following code will set your application to request and receive permission prior to opening Snap UI:
It is recommended that you present the SnapFragment as a separate Activity.
Currently the Snap UI is only optimized for portrait orientation. It is recommended to present and limit the Activity containing a SnapFragment be limited to portrait orientation.