We will first learn about sending the metrics from Android:
- Over at Android Studio, let's grab an instance from the Firebase analytics:
private FirebaseAnalytics myMoviesAnalytics; myMoviesAnalytics = FirebaseAnalytics .getInstance(this);
- Now, let's suppose we have a Spinner dropdown where users can select their best movies of the year. Make sure your class implements the OnItemSelectedListener interface and then we need to override the onItemSelected method. This method will give us the index of the selected item from the list we provided to the ArrayAdapter when we created the Spinner list, it would look like this:
@Override
public void onItemSelected( AdapterView<?> parent, View view, position, long id) {
// [*] Getting ...