Firefox OS Tricorder

Video in TIB AV-Portal: Firefox OS Tricorder

Formal Metadata

Firefox OS Tricorder
Reading device sensor data in JavaScript
Alternative Title
Mozilla - Firefox OS Tricodrer
Title of Series
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Release Date
Production Year

Content Metadata

Subject Area
Slide rule Functional (mathematics) Scripting language Link (knot theory) Software developer Image resolution Plotter Water vapor Web browser Mereology Firefox <Programm> Power (physics) Cross-site scripting Authorization Software testing Form (programming) Link (knot theory) Touchscreen Slide rule Image resolution Projective plane Java applet Data management Arrow of time Speech synthesis Key (cryptography)
Scripting language Code Multiplication sign Java applet Code Electronic visual display Counting Bit Discrete element method
Point (geometry) Area Module (mathematics) Functional (mathematics) Scripting language Module (mathematics) Code Interface (computing) Multiplication sign Execution unit Java applet Water vapor Bit rate Different (Kate Ryan album) Video game Quicksort Endliche Modelltheorie Object (grammar) Electronic visual display Error message Position operator Physical system
Scripting language Beta function Confidence interval Orientation (vector space) Direction (geometry) Multiplication sign Sheaf (mathematics) Parameter (computer programming) Endliche Modelltheorie Error message Position operator Mapping Namespace File format Bit Measurement Position operator Web application Category of being Arithmetic mean Exterior algebra Angle Uniformer Raum Chain Website Alpha (investment) Navigation Row (database) Point (geometry) Metre Slide rule Functional (mathematics) Module (mathematics) Service (economics) Cellular automaton Event horizon Depiction Automatic differentiation Number Gamma function Alpha (investment) Window Mobile Web Module (mathematics) Domain name Matching (graph theory) Wave function Cellular automaton Java applet Code Database Cartesian coordinate system Equivalence relation Uniform resource locator Word Event horizon Software Personal digital assistant Function (mathematics) Gravitation Object (grammar) Window
Functional (mathematics) Scripting language Java applet Code Insertion loss Cartesian coordinate system Event horizon System call Loop (music) Event horizon Function (mathematics) Hybrid computer Calculation Gravitation Gamma function Alpha (investment) Spacetime Window
Functional (mathematics) Scripting language Module (mathematics) Event horizon Function (mathematics) Java applet Code Summierbarkeit Motion capture Gamma function Alpha (investment) Window
Point (geometry) Group action Functional (mathematics) Context awareness Scripting language Multiplication sign View (database) Source code Motion capture Set (mathematics) Student's t-test Streaming media Parameter (computer programming) Mereology Event horizon Wave packet Web 2.0 Connected space Goodness of fit Hypermedia Different (Kate Ryan album) String (computer science) Videoconferencing output Associative property Window Module (mathematics) Area Metropolitan area network Standard deviation Scaling (geometry) Java applet Mathematical analysis Variance Streaming media Bit Volume (thermodynamics) Variable (mathematics) System call Frame problem Category of being Personal digital assistant Function (mathematics) Website Musical ensemble
Group action Scripting language Code Confidence interval Euler angles Multiplication sign Orientation (vector space) Decimal 1 (number) Water vapor Parameter (computer programming) Vibration Neuroinformatik Wiki Web 2.0 Inference Connected space Mathematics Bit rate Daylight saving time Electronic visual display Multiplication Metropolitan area network Flash memory Data storage device Infinity Streaming media Bit Maxima and minima Arithmetic mean Angle Normal (geometry) Energy level Freeware Asynchronous Transfer Mode Point (geometry) Web page Trail Slide rule Module (mathematics) Login Distance Event horizon 2 (number) Number Frequency Finite element method Subdifferential Energy level Integrated development environment output Window Module (mathematics) Complex analysis Standard deviation Java applet Code Planning Line (geometry) System call Mathematics Event horizon Game theory
I'm 3 so hire everybody but and this talk will be about the power from the arrest strike or uh which only huge each amounts of forms of I use the amount of speech of the leaders of up it's the middle part of the talk will be about how you actually as my sensors on fire so the nicest I mean as is 1 already mentioned them Carol Robert Kaiser and not maintaining some anymore that that was the past I have a better over other people in the community and working from the as a project manager at the end of the slides for for is already up flights of Cairo the which is my the main for all slides that I ahead but there are a lot of links in there in the in the eyes and to the actual function documentation of the functions on Indian so if you're interested in that stuff you you can look at that and the slides and they should working modern web browsers that is at least in Firefox didn't test anywhere else so 1st let us attract water but it's the same survivors in Star Trek and it's this plays the there is just no way for the story in the screen so it takes them at top speeds and accuracies in In resolutions just whatever the plot for authorities a so the that whatever soon screening is usually pretty useless but it looks like the nice I the Firefox OS strike
on actually has real data on it a bit displays displays data from provides citizens as exposed by the the by the API but it's available from the marketplace just under the name Tricorder and the code is up on my heat the count as well the you can look it up there I will have very important pieces of code and we're in where we want to see how it actually little together I just look it up at the time I hope it's not made well enough that you actually can understand so this is how it works just just so you see what's the thing uh on the on the phone itself so the most important thing for Star Trek have a start date a which
is usually pretty nonsensical and this this 1 is just
taking every year as thousand units and starting with the point that the 1st this sort so of errors in the US but then it has hasn't area for the
title but the whole interface is based on
the target next-generation voyages he's really variants of the Al cars system and it has those navigation items with of water molecules that explains different kinds of sensors and it has a fullscreen button so you can get the experience with out the at the the time bar it on the phone which just mercifully more in the experience so a talk about those modules and and our our recently the interfaces our model by mother you know what I'm calling module here is some HTML that exposes the the that's much but in the end you get current life I mean ends JavaScript object that has 2 methods activating the activates so that's those are automatically cold up by the functions when you when you switch between the modules that 1 is the activated the other 1 is activated so we probably shut down everything that we had a active from the last module so let's go into the actual code here are the position module is the first one in the list because of the first one I did
I have already had played with an application with some GPS stuff of maps of OpenStreetMap based the GPS threat recording application at for Firefox OS saying little bit about that my main reason for doing this striker apples I wanted to play with the with the the eyes the equivalent of what better than to do just something and exposes all the sensor data and as that which is the right word where come from so position is just a GPS or our Wi-Fi fire herself mobile cell locations that's all hidden behind location API so so if we don't have GPS we just think of it we just send the request all to the was a location service that includes what will sell using what Wi-Fi and networks purchasing using and if we have data for debts the point so we can send you back to where you are if we don't have data for point before that point it's good using the most there what some more apt to actually help us collect data for that are databases with more privacy-sensitive than the alternatives out there from Google Apple so anyone who can help us there's this welcome the of so reducing the chain location API and we need to specify the 2 locations permission in the AP manifest of a Firefox OS steps model that's that's just can use it but for webapps we want to have those 2 things that fear using that could be sensitive to be mentioned but it will prompt the user in any case so if you make sure you want to expose this is how it looks in this case such a depiction patient pairs 2 wavefunctions not 1 to get the current position and want to continue is and get the position when you move and this is the 1 I'm using here so that's much position of the navigator the geo-location object is assumed to be there that's uh on the slides that section of the meaning to the mutation ends we get a cloak of political backing there that has the the the 1 argument which is the physician and that you have acquired the clearance our property and the bonds has the edge of the of the errors latitude and the currencies and the number of others the the support a function in the face of doesn't work which can happen that a lot if due to if the user does not acknowledge the prompt or something like that it will enable the person there to shortest UPS position of it's available the and some sometime lots looking at names on those examples I have that are at the hands out to clear up but because this will continue this is equal to that co back uh as soon as we have a location so many to stop that at some point in the activates the matching of demand the Tricorder and the cold weather watch and that's the reason why above the overlap so I put it in the the but at the the uniforms were not make for microphones but this is about enough this watch idea there that that was signed in the beginning because we needed to actually I know what we're clearing having rejected the 2nd thing I did was I call with credit module because it actually measured that measures 1st gravity sigh function from what is going on in its the excesses the accelerometer intimate meter so magnetic on us i in 3 D with the players for that are actually invents the device orientation and the best motion events those we don't need any position at all you can even use that in that sites uh without any problems or anything the of the confidence is as a Senator Bentsen you need to edit and this in their own the window of ends it just at the event listener for this event uh with which function is being called Nancy L. have by have this the adults in in all of this those things as they're sent the money using JavaScript Object some setting there's this all along the JavaScript Object of that module so that I'm going to the namespace of anything else the the but then event that's being called of that the function that's been comforted that events i in I never remember about the true but everybody's
specifies it reverses that have lower sitting in their efforts so we have orientation that section would be meters so the orientation of of the device of with angles and ultimately 3 directions in motion is the accelerometer the audience and and so that this is that standard or in demand function on the of you that takes the events considers soaring data in so is that you have in known as an argument on the function ends and then alpha beta domain walls increase their the directions of those angles that's a pretty good page and in the end it describes how the how this work which directions using those are it's best to look them up there because I we will take over a longer time to describe that here spent look it up the of graphics for ads and to illustrate things like that of formation and it's pretty similar but it's on the events you have actually been a a property you have 2 properties 1 is acceleration this is acceleration will be the acceleration of gravity is the 1 that always works the acceleration along only works if you have a gyroscope so that the the phone actually knows how to sub subtract the the Earth's gravity from the value that it's measuring so the acceleration including gravity is the 1 that all those words and for tricorder and if you go to a foreign planet you want to know what the for gravity of this so it's it sounds funds have been included in this case anyhow the standard on
this acceleration including gravity you get x
y and z coordinates in meters per 2nd 2nd squared and of course if you prefer these the calculation in the space to even those out to get around 9 . 1 meters per 2nd squared or and honestly it's been mostly accurate it depends on how good the accelerator use a hybrid used you get lots of calls for those events so we if you're using that in in in an application you might want to figure out how to use the wordnets for a or something like that because you get really tons of those events and handling everyone just displaying it but another thing you might want to to deal with that differently about some of the losses it of course entirely mapping to remove those again there's otherwise you would call those functions of a never ending loop until the batteries gone or whatever or if you also have of course the thank you for that
listeners just this excitement and
then the function just need to care that you're doing it of the next 1 is probably the most complicated example and this is the sum of money the it but in a sense the uh the microphone microphone is something that every phone has and that has to be easy right getting the microphone is easy that's what I'm
doing is I'm displacing graphically and the analysis of the data that are getting from the microphone that's not that easy but I'm there's if you find things in there so forget microcephalic itself and using web artist seniority media a piece of get art than of men are to see up for analyzing uh using Web Audio which is a pretty standard this extremely powerful so what you're seeing is that very small piece of of what it can do of the politicians in his honor capture forward RTC getUserMedia parts of actually French the audio data from the microphone and the group that looks like this as a set of probably the most complicated the piece I have been there evidence whatever year student you you don't you can
see that completely all so this is a part is that it didn't go belts goodness in call that itself we said all you true because we only want to have 2 microphones it is you could fetch the video from the camera as well but I already got a single picture from the from the camera then London audio streams so that we have an overall view of your true and then come pick function that is actually I called with the string get as an argument so inside of that means that up the only context from volume that's where it's a little bit more difficult and 1st we decided that the constrained to property that's because of the clean up of course we want to turn off the microphone so when we're when reading the module so we need to stop the string at that point I then created no all your account texts of connect the trading but the variance from infants stream sources and that's the stream of interest the President analyzes we can actually analyze the data that is coming in there and who some there's um spelling differences and Americans value variables but this can produce British spelling EPI so that's all it careful when you write that the training analyzer to actually to set up the 15 sites and stuff like that of the of the analyzer but I don't want to going into those details here and and then connected analyzer to the and then the set up basically of then so we can still have to do is in my case I'm and displayed graphically so I'm I'm doing it not request of animation frames events on every time we are able to display in uh a frame we are calling this function to actually display something is in there the actually created in an area all of its time varying scales bands this association inspired EPI so it has those strange things that you actually have a lower area to the function which is something we usually don't do it in JavaScript of you can already that the data will be putting as an argument function
yes something that people doing since impossible called do all the time but each us but it's it's a bit of a strange prospect and then you have this data action populated and you can do something and meaning that our and all the display because this piece that is complicated enough for a short time that we have here so if if you wanted to see more details on that and how the code works in detail just look at the look up the talk page and you get more of its you saw that that is actually working so I have all the bits and pieces to collect the I had some sensors that there are interesting that that would have been in there and that might I have some craters creative uses that I hadn't covered with any other modules I like the light sensor and the proximity sensor and that was just 2 lines on there so I I realize that foods maybe put an on off for a flashlight on the on the camera in there as well it doesn't work on anymore my nightly builds but it works and so on all the bills so at just so that you try it on the track yeah 1 and 2 . 4 also works on on my the that change something in the world yeah yeah so that's to investigate and about slide the best proximity the perpendicular API for the flashlights and that we would need permission the attitude on I don't have to come for a flashlight on here because became API is kind of strange as well so it's basically the same thing is that those are the 2 events with the accelerator and evidently some those and then you get of the arguments innovations again evaluating logs for the lights In against of proximity data about in centimeters and the minimum and maximum these the flames only can can tell if it's more than 5 centimeters or less than 5 centimeters but you get the minimum and maximum wells that tell you what the maximum value is who gets and minimum value and you on the plane you always will give you 5 which is equal to the max 4 0 which is equal to the mean but another devices you might get more about if they have better sense president 2 of those and as a said of the flesh are toj rates so that the generate API came around and so on I'm going to this but you can look it up in the code of the the camera API also subject to change as we are trying to get it into standards and trying and discussing with other players on the web how to do stuff correctly that the last thing I want do this very fast because of I was also get into the hands of the device mode you is reasonableness I only have the battery status API there's so the I want to at some point and free storage there but I didn't get to that that's the confidence you you don't know what to do any complex functions there you just have the value at mitigated of better we don't level which is between 0 and 1 Soon multiplied by half a 100 if you want to get a sense of you get a better and don't charging that is true or false depending on if a charger is the on there or not if it's charging you get the charging time in seconds if it's discharging it charging time in seconds along it still will last probably of because of those have us your infinity values when it's unknown due to different reasons otherwise again valiant seconds and that's I don't have time for 1 or 2 questions that's Mr. quarter if you ever saw him we and so do we have
any any questions I think water so we can do that the the if the the the the so the question is need to repeat them for a recording of if we can change the frequency of that device orientation and probably by motion events I haven't seen anything to change its so you probably just need to be you select which ones you actually angle but you get you get tons of them I think it's time that value changes and that time goes into a number of decimal places I think any time changes if you get something and those sensors of noisy so you actually get multiple calls up as the 2nd I think even for millisecond or whatever it's pretty fast the use of of the the the I haven't tried it but this and use it to save for a labyrinth game or something in the high frequency I saw it in a game like that the decently but yet it I'm sure for display it's good enough for uh for other courses I've been actually try so yeah and is 1 of the so the the question is what spent pages have those capabilities as well what it will help for for web pages and so the for a normal of web page I don't think there's too much well in number of bills the battery API can have some value if you were doing some inference stuff and say hey this Britain on battery let's let's try to scaling down to save the there are well let's say messaging and that would slow down the refresh rate for something to the safe there are something like that might be useful from the battery PI stuff like orientation and motion for a desktop computer it doesn't change so it's not not really helpful the but for for doing as as he said games but it can be quite interesting thing there is also a vibration at the item that not using it as a subgradient and the that you can make the device would break if you the front most with visual and for example when it jumps all work of something in a game and the short preparation things like that so especially for games and things like that but I think it's really helpful for a normal web page is it depends for the the lab the light sensor might be interesting to actually change contrasts of like that the so yeah we're we're out of time make you fusion and live long and prosper thank you