If you're providing a local service, you need to register it for service discovery. Once your local service is registered, the framework automatically responds to service discovery requests from peers.
To create a local service:
Create a WifiP2pServiceInfo object.
Populate it with information about your service.
Call addLocalService() to register the local service for service discovery.