Alpha 5 Background monitoring help

First of all alpha-5 is the sdk i am using.

I read the docs about that you can monitor even when the app is force closed.

I wand to create a AAR sdk that embeds your sdk in mine.

So next step is I want to have a sample app that uses my AAR sdk to always be monitoring.

What is the best approach.

  1. for example in a sample app i wrote in my gradle i compile ‘mysdk:1.0.0’ which has yours embedded in it.

  2. i create a Home Activity that creates a notification and passes that to your startInForegroundBlah(notification) class. I forget the name.

  3. i kill the app and most likely it stops monitoring.

Q; should i create a service?
or, should If the sample app starts monitoring using the startFor…(notification) how does your sdk keep monitoring the exit enters.

I hope you understand what I am trying to do. Basically always be able to walk into a room with beacons and I get exit enters.

Thanks

Note: i am on android and I read this
To scan even after the user has killed your app (swipe in app manager) put start/stop in onCreate()/onDestroy() of your CLASS EXTENDING APPLICATION CLASS. You will also need to handle stopping scan through the notification, because even though the user will destroy the activity, the notification (foregrounbd service) will still remain visible. You can play with it and see the behaviour by yourself. Please, read more in official android documentation about managing notification objects.

QUESTION re the above: what is “put start/stop” in the onCreate/ondestroy of your applicatton class
SO for example

I have extended Application

public class MyApplication extends Application

public onCreate() {

i would start what here
.startWithScannerInForegroundService(notificaiton); <-- this?

public onDestroy()
i would stop what here.
the observationHandler.stop(); ?

in on create do i define the notification in here? and then OS will see there is always a reference to the app and will not kill it?
is that what you mean?
thank you