JsonFactory; import com. JacksonFactory; import com. ExponentialBackOff; import com. YouTubeScopes; import com. Manifest; import android. AccountManager; import android. Activity; import android. Dialog; import android. ProgressDialog; import android. Context; import android. Intent; import android.
SharedPreferences; import android. ConnectivityManager; import android. NetworkInfo; import android. AsyncTask; import android. Bundle; import android. NonNull; import android. TextUtils; import android. ScrollingMovementMethod; import android. View; import android. ViewGroup; import android.
Button; import android. LinearLayout; import android. TextView; import java. IOException; import java. ArrayList; import java. Arrays; import java. List; import pub. AfterPermissionGranted; import pub. LayoutParams LinearLayout. LayoutParams ViewGroup. Never null. Builder transport, jsonFactory, credential. You will be prompted to select a connected device recommended or emulation to run the app on. If you run on an emulation, make sure it is configured to use one of the with Google APIs system images.
If you attempt to run the quickstart on a device that does not currently have Google Play services installed, the quickstart produces a dialog from which you can install it. If running on an emulator, allow it to fully start and establish its network connection. If starting the emulator for the first time, you may need to unlock its screen. Regardless, the quickstart app should start automatically. The first time that you run the app, it prompts you to specify an account.
Complete the sign-in flow to choose an account to connect to. After selecting an account, the app prompts you to authorize access. Click OK to authorize. It worked! I got an error. You can also register event listeners to get callbacks for certain events, such as the player loading a video or the player state changing.
Finally, the API has helper functionality to support orientation changes as well as transitions to fullscreen playback. The API client library interacts with a service that is distributed as a part of the YouTube app for the Android platform. The client library has a light footprint, meaning it won't adversely impact your app's file size, if you use ProGuard as part of your build process. However, upgrading is not necessary if you do not care about new features or bug fixes.
Generally, devices running Android 2. Note: Users need to run version 4. The sample applications overview describes the sample applications included in the API download.
0コメント