This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can I modify 'access modifier' of mService instance in the BleProfileServiceReadyAcvitiy?

I'm building an android application using BleProfile classes in the nrftoolbox.

I want to request characteristic write to a peer(nRF51) in MyApplicationActivity inheriting BleProfileServiceReadyActivity.

To do this, MyApplicationBinder inherit LocalBinder in the MyApplicationService and I added new methods to it. (MyApplicationService inherit BleProfileService, which return Ibinder to mServiceConnection's method in the BleProfileServiceReadyActivity and it is populated to 'mService' field and then BleProfileService's methods are used in the BleProfileServiceReadyActivity.)

But 'mService' field's access modifier is 'private' so it was impossible to use mService in MyApplicationActivity.

Adding custom methods to MyApplicationActivity.MyApplicationBinder was meaningless.

I wonder if the nRFToolbox app developer made a mistake.

Isn't right that mService's 'access modifier' have to be changed from 'private' to 'protected' at least? Or are there another methods to use MyApplicationManager's information(Service/Characteristic instances ...) throught MyApplicationService in MyApplicationActivity?

Related