senseobservationsystems / sense-android-library

Sense Platform library for Android
Apache License 2.0
12 stars 8 forks source link

Feature/hybrid state sensor #143

Closed orhan89 closed 6 years ago

orhan89 commented 9 years ago

@tedschmidt could you check for this one if you have time? it might not fully completed yet, but i want to make sure that i'm writing the sensor in the right direction.

orhan89 commented 9 years ago

one thing that i think still missing is to get incoming number without using event listener.

tedschmidt commented 9 years ago

@orhan89 The structure you're using with getting/sending the latest state in doSample() is the right one. I think it's good that it also sends the data when there is an event.

orhan89 commented 9 years ago

@tedschmidt i think the data is sended when there is an event already. https://github.com/senseobservationsystems/sense-android-library/blob/74f364fb1323327540db73e3288b64946e98d2e8/sense-android-library/src/nl/sense_os/service/phonestate/SensePhoneState.java#L81-L108 (event based)

https://github.com/senseobservationsystems/sense-android-library/blob/74f364fb1323327540db73e3288b64946e98d2e8/sense-android-library/src/nl/sense_os/service/phonestate/SensePhoneState.java#L295-L330 (polling based)

but i will refactor this so event-based and polling-based sensor will call a shared function.

EDITED: Oh, or do you mean for PhoneActivitySensor? yes, it also send the data when there is an event already. https://github.com/senseobservationsystems/sense-android-library/blob/74f364fb1323327540db73e3288b64946e98d2e8/sense-android-library/src/nl/sense_os/service/phonestate/PhoneActivitySensor.java#L54-L69

tedschmidt commented 9 years ago

@orhan89 Oh I meant, that it's good that you still also send the data with an event, as it used to do it, and that the polling based is added as extra.

tedschmidt commented 9 years ago

@orhan89 I see this is not merged yet...is this finished?

orhan89 commented 9 years ago

@tedschmidt no, it's not. Even the card for this still in backlog i think