I am looking for a way to find all devices (especially printers) on a local area network (LAN).
Is there a way to distinguish between printers and other devices (smartphones, laptops, computers, etc.)?
What if you try this? http://jmdns.sourceforge.net/
JmDNS is a Java implementation with multiple DNS sheets and can be used to register and discover services on local networks. JmDNS is fully compatible with Apple Bonjour.
you should use Network Services Discovery
https://developer.android.com/training/connect-devices-wirelessly/nsd.html