The extension should work on Android. How are you using it? You need to bundle a version of the APK. You can’t use dmengine.apk from d.defold.com since it doesn’t contain the native extension. You can bundle a debug variant and use that as a target in the project menu.
Once you have taken a screenshot you can save it as a file like this:
local png, w, h = screenshot.png()
local f = io.open("screenshot1.png", "wb")
f:write(png)
f:flush()
f:close()
The problem is that you need to figure out a path to a folder that is accessible by the Photos app. @sergey.lerg has this extension that gives you paths to various system directories:
It does however not provide a path to any Pictures directory. I would suggest that you collaborate with @sergey.lerg to add this as a new path.
On Android the are several standard paths to the DCIM folder, but you need write external storage permission to access them.
But it’s all a bit tricky since Android devices are kinda unpredictable.