android-slideshow icon indicating copy to clipboard operation
android-slideshow copied to clipboard

How to make the slideshow auto-start on device power on

Open Vaelatern opened this issue 5 years ago • 10 comments

Let's say you want to, without the Google Play Store, without another app, and without having the ability to manage fleet of android devices, run a device as a dedicated slideshow device.

Turns out you apply the below patch, and the android-slideshow app becomes a viable "Launcher" which you can select instead of your regular home screen. Then, when your device starts, instead of seeing your listing of apps, you see your slideshow.

This doesn't belong anywhere in this repo, but I wanted to share what I learned and have deployed. Now I can trust my digital picture frames won't be broken if some cloud service dies.

diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index d66c5f2..4ade8f6 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -23,6 +23,8 @@
                                <action android:name="android.intent.action.VIEW"/>

                                <category android:name="android.intent.category.LAUNCHER"/>
+                               <category android:name="android.intent.category.HOME" />
+                               <category android:name="android.intent.category.DEFAULT" />
                        </intent-filter>
                </activity>
                <activity

Vaelatern avatar Jul 24 '19 02:07 Vaelatern

Wow that's really cool. Would this break normal use?

I imagine it enables the app to be selected as a launcher when selecting launchers, but does it default to acting as a launcher when opened? This would be an awesome feature if it doesn't break traditional app use. I know many people are using this app to do exactly what you are doing so would be great to include for them too.

ScreamingHawk avatar Jul 24 '19 03:07 ScreamingHawk

It does not default to acting as a launcher, nor does it break normal app use.

It does mean that I'd ship two versions of this: one with this enabled and one without, since strictly speaking when you press Home you only expect to find genuine Launchers.

Vaelatern avatar Jul 24 '19 05:07 Vaelatern

By the way, if you are shipping this on F-Droid (Someone is, that's how I found this app), that'd be where I'd love to see two varieties.

Vaelatern avatar Jul 26 '19 02:07 Vaelatern

I've seen reference in #130 to build flavors in Fdroid, which could be a good solution to this.

Vaelatern avatar Jul 28 '19 09:07 Vaelatern

I think you can dynamically register as a launcher, then it could be controled by a preference.

eighthave avatar Jul 29 '19 08:07 eighthave

That would be the ideal solution. Do you know how?

Vaelatern avatar Jul 29 '19 14:07 Vaelatern

@eighthave I'd happily accept a pull request for this if you know how

ScreamingHawk avatar Jul 29 '19 19:07 ScreamingHawk

@eighthave if you have a code snippet to do the needful I can play with that too. It escaped a quick google search.

Vaelatern avatar Jul 29 '19 20:07 Vaelatern

This has gone nowhere. I have added this to my todo list. It will happen, but might take over a year. If someone can please find this API, that'd be appreciated.

Vaelatern avatar Dec 01 '19 19:12 Vaelatern

I'm in the position of building this app again. It seems there is a partial hint of an answer here https://stackoverflow.com/questions/16446615/set-intents-category-programmatically

Vaelatern avatar Mar 30 '21 04:03 Vaelatern