Seems to me that what you are trying to do is to connect to a device and add a service on that remote device. That is not have it works and you will not be able to create an app that does this.
In BLE, both sides have a Gatt server. The addService API call in BluetoothGattService is only for adding services to your local Gatt server, not the remote server.
This is how it needs to work:
- Your phone is called the central (or master), the device you are connecting to are the peripheral (or slave).
- Both sides can define their local Gatt server (typically before they connect). The local Gatt server is mandatory for both sides.
- If you can write the firmware running on the peripheral you can certainly create the services and characteristics you need to make your application work (again this is usually as the devices is starting, not after a connection has been made)
- Your phone will connect to the peripheral and can read from or write to the Gatt server running on the remote device using the Android Gatt client. The structure however remains unchanged.
To be able to answer more detailed a lot more information on the setup is necessary.