There's nothing wrong with using UPnP for this. There's two questions here -- related but still independent:
- How do you discover services? SSDP is a valid technology but so is zeroconf: I'm not aware of an Android implementation but I assume one would exist.
- How do you expose your API once the uri is found? UPnP is a bit old school by now but works fine and if you use a decent library it's easy yet quite powerful. Depending on your needs you could go with something like a normal REST webservice as well, or use SOAP without bothering with UPnP.
Whether the questions really are unrelated depends on the libraries you use -- I have no idea if e.g. Cling lets you use just SSDP for a non-UPnP use case.
For the UPnP questions:
(a) I'm not very familiar with the Android side but for linux UPnP I would suggest GUPnP (I'm biased though, as I'm involved in its development): it's a stable and well tested library. Python bindings aren't as well documented as they should be but they exist:
from gi.repository import GUPnP
. GUPnP also let's you do just SSDP if you want: see the GSSDP library.(b) Definitely custom device if you can't find a good existing match, that's what UPnP was designed for. In the GUPnP case you would write the device and service descriptions (in xml, see examples in the source) and load them with a RootDevice. That takes care of device/service discovery and hosting the description docs. Then you'd just need to implement the actions you have in your service description.