New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensors API #227
Sensors API #227
Conversation
perhaps we can do some work on the interface I do know this exists @Pagey - can you check if any of this is supported by webkit? my guess is its not. |
@@ -11,24 +11,7 @@ | |||
|
|||
|
|||
<!-- include spec files here... --> | |||
<script type="text/javascript" src="spec/blackberry.app.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to remove all of these
@jeffheifetz @kwallis - need input on this-
|
|
They are really same spec just with different names For eg. interface AmbientTemperatureEvent : Event { Some have one value and other have more than 1. So can we define the interfaces now for each of the sensors, seems like You can look at the file below to see what all sensors are possible and what they return. Question is whether you want to ployfill like the Notifications APIs or do you want to provide all the APIs under It really doesn't matter much to me but a decision needs to be made. I think for the ones that defined we can simply meet the spec definition. There are APIs where we return more than the spec in that case we can append to it. |
updated the above comment to put proper link in there. |
I would like to meet the spec definitions if we can, and extend where we have additional features/requirements |
temperature, humidity,altimeter and pressure are not supported So the only overlap is proximity, ambient light, but we should have similar interfaces for all the sensors to make sure it doesn't go |
We have temperature, humidity, and altimeter listed as available in the original user story, with links to the PPS objects: |
updated |
I agree now that looking the w3c spec it should be better to align ourselves with it, when I originally designed this I wasn't aware of any of the events other than the devicemotion and deviceorientation events. I guess for holster we can have a deviceholstered event listener. I still find the w3c very cryptic to understand what exactly is supported and how to get the data you actually want. |
This is done refactoring and waiting for testing/code review, docs are forthcoming |
Docs are updated, please test and code review |
|
||
Sensors::Sensors(const std::string& id) : m_id(id) | ||
{ | ||
m_pSensorsController = new webworks::SensorsNDK(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this ever get deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch, I will fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now handled by destructor, should free everything now
r+ |
tested with packager build http://ci0000003863287:8080/hudson/job/BB10-Webworks-Packager/99/ and framework build http://ci0000003863287:8080/hudson/job/BB10-Webworks-Framework-next-sensors/34/: sensor events work as expected. |
@tracyli has this been tested on the simulator? |
not yet; as I said yesterday the simulator 1035 shows up as black screen for me and I'll try again. |
this is impossible to test on the simulator |
@Pagey why? |
there is no way to compile for it as there isn't a library for sensors, plus the simulator has no way of emulating them |
This implements the sensors on the BB10 device, all currently present sensors are supported.
Issue #301
Docs are here:
blackberry-webworks/WebWorks-API-Docs/pull/218