How to detect if one of my apps is already installed on the device?

I was doing it with the following code:

in which I used “display.newImage(“android.app.icon://”…PackageName)” to find out if the app existed, but in android 13 that doesn’t work for me

function libreriasUI:AppInstalada(PackageName)
	local appIcon = display.newImage("android.app.icon://"..PackageName)
	if appIcon then
	   -- App is installed.
	   appIcon.isVisible = false
	   display.remove(appIcon)
	   return true
	else
	   -- App is not installed.
	   display.remove(appIcon)
	   return false
	end
end

I’ve never tried to do this procedure, but wouldn’t it be easier to list the names of installed apps and check if yours exists? maybe trying to get the icon image, doesn’t have permission on android.

That still works, but you now need to add the PackageName of each app you want to query in the build.settings file.

android =
{
  manifestChildElements =
    {
        [[
            <queries>
                <package android:name="PackageName here inside the quotes" />
            </queries>
        ]],
    },
},

Great, it worked!
thank you