Ido Ran
Ido Ran

Reputation: 11374

Add DayDream (screen saver) for Android TV to exists Android project

I'm trying to add Android TV support to an existing Android project I have, specifically adding Day Dream service to show a screen saver.

I've seems to add all the required things for the app to run on Android TV and I can even see my Dream Service under Screen Saver in settings but when I select it - it is not selected and under Screen saver, there is no name.

Any ideas what I've might be missing?

Upvotes: 0

Views: 990

Answers (1)

Ido Ran
Ido Ran

Reputation: 11374

I've found a 3 years-old example for Android TV DayDream and in there was my missing piece: In the manifest, under the service description I had to add android:permission="android.permission.BIND_DREAM_SERVICE".

Full service XML piece:

    <service
        android:name=".bouncer.BouncerDreamService"
        android:exported="true"
        android:label="Bouncing Logo"
        android:permission="android.permission.BIND_DREAM_SERVICE">
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
            <action android:name="android.service.dreams.DreamService" />
        </intent-filter>
    </service>

Upvotes: 1

Related Questions