loading...

الکتروبو | علم به زبان ساده

first we need set KODI as Launcher for Android so we need these changes: you can do this with this helper text. MODIFY ANDROIDMANIFEST.XML.IN TO MAKE KODI DETEC...

بازدید : 1
پنجشنبه 17 بهمن 1403 زمان : 22:01
  • 1
  • 2
  • 3
  • 4
  • 5

الکتروبو | علم به زبان ساده

first we need set KODI as Launcher for Android so we need these changes:

you can do this with thishelper text.

MODIFY ANDROIDMANIFEST.XML.IN TO MAKE KODI DETECTED AS A LAUNCHER

Modify tools/android/packaging/xbmc/AndroidManifest.xml.into make Kodi a launcher so that:
Launcher intent filter is added to Main activity:

								
									
									
									
									
									
									
								
							

Splash and Main activities have android:launchMode="singleTop"
Splash and Main activities have android:documentLaunchMode="never"
Splash and Main activities have android:excludeFromRecents="true"
The developer guidelines suggest setting android:launchMode="singleTask" and androidConfusedtateNotNeeded="true" for launchers but this causes significant load times (as it starts from scratch every time you go to the home screen) and I have found no issues running with singleTop and no stateNotNeeded.

MODIFY XBMCAPP.CPP TO CATCH HOME BUTTON INTENT
To react to "Home button press" add handling for android.intent.action.MAIN/android.intent.category.HOME in void CXBMCApp::onNewIntent(CJNIIntent intent) (found on line 1076 in xbmc/platform/android/activity/XBMCApp.cpp):

if(action == "android.intent.action.MAIN" && intent.hasCategory("android.intent.category.HOME"))
  {
    CApplicationMessenger::GetInstance().PostMsg(TMSG_GUI_ACTIVATE_WINDOW, WINDOW_HOME, 0, nullptr); // Sets Home window as active
  } else // below is original code
  if (!targetFile.empty() &&  (action == "android.intent.action.VIEW" || action == "android.intent.action.GET_CONTENT"))
  {
    CLog::Log(LOGDEBUG, "-- targetFile: %s", targetFile.c_str());
    ...

The above will send Kodi to Home.xml when the Home button is pressed (the key press doesn't generate a key press event, it only generates a MAIN/HOME intent). One could look at clearing the "Kodi window stack" as well (so that back button press after pressing home goes nowhere).

نظرات این مطلب

تعداد صفحات : -1

آمار سایت
  • کل مطالب : 0
  • کل نظرات : 0
  • افراد آنلاین : 1
  • تعداد اعضا : 0
  • بازدید امروز : 2
  • بازدید کننده امروز : 3
  • باردید دیروز : 0
  • بازدید کننده دیروز : 1
  • گوگل امروز : 0
  • گوگل دیروز : 0
  • بازدید هفته : 4
  • بازدید ماه : 4
  • بازدید سال : 7
  • بازدید کلی : 27
  • کدهای اختصاصی