Closed Wisawing closed 6 years ago
Hi, just copy the BleManager, BleManagerCallback, and some other classes and interfaces that you'll find required. If you don't need/want the logger you may use normal Log instead of DebugLogger (?) or remove all lines with Logger class. Logger is used to log to the nRF Logger app while your app is running, if such app is installed.
However, you are right, this should be easier. I'll try to move it to a module when find some time.
Thank you for the reply. I have successfully copied over the BleManager by manually selecting only part that it is needed.
The error I posted was actually because I tried to make an application module depended on another application module. After I changed BleManager module to feature module it worked out.
To change module type I have to change the following line in build.gradle
From :
apply plugin: 'com.android.application'
To :
apply plugin: 'com.android.feature'
Hi, I am a beginner developer in Android app so before I start I want to state that it is highly likely that the problem I am encountering is due to my lack of knowledge on application development and not this project itself.
I am trying to use BleManager in my own application to connect to nRf51-DK. So far I have accomplished in doing :
From what I understand, I should only use the BleManager part and it's dependency( Which should exclude the interfaces/logic/control of nRFToolbox itself ). So for starters in order to not mix up my own code with this project I tried importing the whole "app" module of this project into my own project. I got these errors.
Unable to resolve dependency for ':myproject@debug/compileClasspath': Could not resolve project :app.
After try googling and reading about Android studio dependency settings I still could not resolve the issue so then I tried creating a new module in this project instead. But as soon as I add "app" module as a dependency to my own module, the same errors occur.
Would the correct way to cleanly use BleManager be copying part of the source code of this project? Any help or pointer is appreciated. Thank you.