EDIT: I just noticed that there is a reference to https in one place and http in another. I actually have an intent for both, just pasted one to save space.
I'm trying to create an android app that is just a bunch of buttons, one for each of a handfull of channels. When my 91 year old parent clicks on the "Discovery Channel" button, it opens youtubeTV and changes to the Discovery Channel. Seems like this should be super simple, and maybe it is, but I'm new to trying to create an android app.
It seems like deep links should do the trick. I've gone down the rabbit hole far enough to find out I can use adb to test the links, and I do have working adb commands, at least from my desktop to the firestick:
adb shell am start -a android.intent.action.VIEW -d https://tv.youtube.com/watch/vEqGX-86yMg?vp=0gEEEgIwAQ%3D%3D -n com.amazon.firetv.youtube.tv/dev.cobalt.app.MainActivity
actually starts YTTV on a firestick and brings up the channel I want.
My problem is I have tried all sorts of stuff in my intent filters but can't replicate what works in the adb command. I think I'm getting tripped up on not being able to do whatever the android app equivalent is to
adb connect 10.0.0.20
before trying to start the action.
If you are with me this far, is what I'm trying to do even possible? What should the intents look like? How do I connect to the firestick device to open the proper channel?
My parents directTV bill is pushing $200 and I tried to show them how to use YTTV, but they just aren't getting the hang of it. They currently change channels by putting in the channel number, they don't even use the guide on directTV. A tablet with links to the channel is the best idea I could come up with. If someone has a better idea, I'm all ears.
Thanks in advance!
Please don't laugh, this is one of the many things I've tried. I expected the tv to change the channel, Instead I got the error message
PID: 11126 android.content.ActivityNotFoundException: Unable to find explicit activity class {com.amazon.firetv.youtube.tv/dev.cobalt.app.MainActivity}; have you declared this activity in your AndroidManifest.xml?
Which makes sense because I have not declared this activity since when I tried that it complained about not being able to find it.
AndroidManifest.xml
<intent-filter>
<action android:name=""
android:exported="true"/>
<category android:name="android.intent.category.MAIN"/>
<data android:host="10.0.0.20"
android:scheme="http" />
</intent-filter>
MainActivity.kt
val data = Uri.parse ("https://tv.youtube.com/watch/vEqGX-86yMg?vp=0gEEEgIwAQ%3D%3D")
val packName : String = "com.amazon.firetv.youtube.tv"
val className : String = "dev.cobalt.app.MainActivity"
val i : Intent = Intent()
val btn: Button = findViewById\<Button\>(R.id.btn)
btn.setOnClickListener {
i.setData(data)
i.setClassName("$packName","$className")
startActivity(i)
}