Setting up android cast sdk

2019-09-04 12:07发布

问题:

I can't quite seem to get the cast SDK set up in eclipse. I'm supposed to import the project, then add it to my application project. I tried that, but I still can't access classes like CastContext. Any tips? I'm excited to get working on this thing!

回答1:

  • Download the Android Support package with the SDK Manager. It should include mediarouter and appcompat.
  • Should also download the actual cast api: https://developers.google.com/cast/downloads/GoogleCastSdkAndroid-1.0.0.zip ... You can miss this link when reading the downloads page (at least that's what happened to me).
  • Then import them all into Eclipse (File->Import), the support packages should be under sdk/extras/android/support/v7/mediarouter and sdk/extras/android/support/v7/appcompat. The cast package is wherever you saved it (I just put it in the sdk/ directory).
  • The mediarouter depends on the appcompat, so you want to add it to the mediarouter project as a library.
  • Head over to your application project and add the newly created mediarouter, appcompat and GoogleCastSdkAndroid packages.

That should take care of it all for you.