koying / SPMC

fork of xbmc/kodi
Other
635 stars 257 forks source link

Can't open app in leanback mode from SPMC, log attached #644

Open pettergul opened 7 years ago

pettergul commented 7 years ago

Hi

I have now tried this for some time, I have also tried asking in XDA forums.

From there I tried to use a link made from another developer, that links directly to the app. That does not work either.

If I open the app from the Android Leanback Launcher, it works as it should. So the app is ok I think. Link to my thread in XDA: https://forum.xda-developers.com/shield-tv/help/app-kodi-spmc-dont-start-t3511076

And here is a log, of trying to open the favorite made in SPMC and the shortcut made from the other thread: http://pastebin.com/UKkAyW7U

Hope there is an solution for this :-)

Petter

pettergul commented 7 years ago

Got an hint about adding this as the start of activity, but it did not help. Maybe it would help people here

StartAndroidActivity(“no.nrk.tv.view.androidtv.AndroidTvMainActivity”)

dadaz commented 7 years ago

I have the same problem with one app on my Mi Box. The app is Mycanal a french TV app which recently gain android TV version. What I understand is that it's the same apk for phone-tablet and TV.

When I launch it from leanback launcher it launches in TV Mode. If I launch it from Kodi or SPMC it doesn't launch because it says I must launch Android TV Version.

I've Installed HALauncher and disabled Leanback. In HALauncher we can launch Android TV apps and handled apps. We can also choose which "version" of an app we want to launch (handled or TV) So I choose TV version for Mycanal app.

After that I go to shortcut details in HALauncher for Mycanal and see that it lauch the app and a particular activity : For TV mode : app : com.canal.android.canal activity : com.canal.android.tv.activities.TvSplashActivity

for handled mode : app : com.canal.android.canal activity : com.canal.android.canal.MainActivity

After that I install Package Browser to se what's in mycanal package.

I search for activities and see in com.canal.android.tv.activities.TvSplashActivity :

And in com.canal.android.canal.MainActivity :

some other launchers....

So my understand is for some apps. TV mode is based on which launcher start the app. I think it's a bad method ! But I'm not a dev.

So maybe there is a way to trick the app and let it "think" it's start from LEANBACK Launcher.

Can you try what I made to see if it's the same for you ? Maybe SPMC devs can fix this easily !

pettergul commented 7 years ago

So based on what you have found, I think Kodi/SPMC "launcher" is set up as it is on a phone, not an TV. Maybe it then is possible for the devs to do something with that, but that's not something I know anything about.

I will try to see if I can find anything with the Package Browser.

pettergul commented 7 years ago

With the Package Browser I found the "activity" that NRK self asked me to use/try, with no help. The mention over ("no.nrk.tv.view.androidtv.AndroidTvMainActivity") I also found "no.nrk.tv.view.MainTvActivity", and with that I understand that the way Kodi/SPMC is starting the last one. With the code: StartAndroidActivity("no.nrk.tv")

I have as mentioned tried to add the first one instead, but did not help. Maybe it is something in what dadaz writes, that it's the right way that Kodi/SPMC tried to start the activity, but it has to add which activity to start. Now it just starts the normal activity, without any parameter like: app: com.canal.android.canal <- like it is now activity : com.canal.android.tv.activities.TvSplashActivity <- but a way to add how to start it.

Or is I way off?