There isn’t. But if you scan your “main.lua” file’s launch arguments via “…”, it should provide an “androidIntent” category field named “android.intent.category.LEANBACK_LAUNCHER”. That’ the best clue that I can think of that lets your app know it is running on Android TV. Just note that this does not apply to non-AndroidTV devices such as the Amazon TV, Ouya, GameStick, etc. The LEANBACK_LAUNCH is purely an Android TV thing.
If you add the following code to your “main.lua” file, it will print all of the contents in the Lua “…” launch arguments table. It’ll give you an idea on how to access the “androidIntent” table within it. You can view the log via the Android SDK’s “adb logcat” command line tool.
-- Prints all contents of a Lua table to the log. local function printTable(table, stringPrefix) if not stringPrefix then stringPrefix = "### " end if type(table) == "table" then for key, value in pairs(table) do if type(value) == "table" then print(stringPrefix .. tostring(key)) print(stringPrefix .. "{") printTable(value, stringPrefix .. " ") print(stringPrefix .. "}") else print(stringPrefix .. tostring(key) .. ": " .. tostring(value)) end end end end -- Prints all launch arguments local launchArguments = ... if launchArguments then print("### --- Launch Arguments ---") printTable(launchArguments) end
I hope this helps!