{"id":1249,"date":"2015-12-23T09:41:23","date_gmt":"2015-12-23T08:41:23","guid":{"rendered":"https:\/\/www.inovex.de\/\/?p=1249"},"modified":"2025-01-06T11:42:02","modified_gmt":"2025-01-06T10:42:02","slug":"android-sensor-integration-part-4-the-android-sensor-framework","status":"publish","type":"post","link":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/","title":{"rendered":"Android Sensor Integration Part 4: The Android Sensor Framework"},"content":{"rendered":"<p>In this conclusion\u00a0of our series on Android Sensor Integration we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor. Click to dive right in or read <a href=\"https:\/\/www.inovex.de\/\/android-sensor-integration-part-1-sensor-stack-and-kernel-module\/\" target=\"_blank\" rel=\"noopener\">the<\/a> <a href=\"https:\/\/www.inovex.de\/\/android-sensor-integration-part-2-sensor-readings\/\" target=\"_blank\" rel=\"noopener\">previous<\/a> <a href=\"https:\/\/www.inovex.de\/\/android-sensor-integration-part-3-hal\" target=\"_blank\" rel=\"noopener\">parts<\/a> first for context.<!--more--><\/p>\n<p><span style=\"font-weight: 300;\">Let&#8217;s go\u00a0on to the second part in HAL, implementing the sensors.cpp file. This is\u00a0where we connect our implementation to the existing Sensor Framework. Google published <a href=\"https:\/\/source.android.com\/devices\/sensors\/hal-interface.html\" target=\"_blank\" rel=\"noopener\">good documentation<\/a>\u00a0for most of the functions in sensors.cpp.\u00a0But as the Pandaboard I used for this project\u00a0has no sensors itself,\u00a0my\u00a0Android sources are missing\u00a0the libsensors file\u2014we&#8217;re gonna have to write it\u00a0ourselves. Most of the\u00a0functions and parts are standard implementations so they can be adopted from others. <\/span><\/p>\n<p><span style=\"font-weight: 300;\">If however your device has\u00a0something like a libsensors file \u00a0there is no need to write a new one\u2014Just add the new entries. Below we\u00a0will take a look at the parts we need to add.<\/span><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\"><\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#The-sensor-t-structure-letting-Android-know-about-the-new-sensor\" >The sensor_t structure: letting Android know about the new sensor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#What-about-the-sensors-poll-context-t-structure\" >What about the\u00a0sensors_poll_context_t structure?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#Sources-Parts-3-and-4\" >Sources (Parts 3 and 4)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#Get-in-touch\" >Get in touch<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#The-Whole-Story\" >The Whole Story<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"The-sensor-t-structure-letting-Android-know-about-the-new-sensor\"><\/span>The sensor_t structure: letting Android know about the new sensor<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 300;\">For starters\u00a0we look at an ordinary structure of particular importance. The sensors_t structure lets Android know about all available sensors. For each sensor we need to add an entry with a name, vendor, version, handle, type, maximum range, resolution, power, minimum delay and a few more properties. In the sensor.h<\/span><span style=\"font-weight: 300;\">\u00a0all parameters and their meanings are described in more detail.<\/span><\/p>\n<pre class=\"lang:c decode:true \">struct sensor_t sSensorList[] = {\r\n\r\n               {\"Proximity Sensor\", \"SRF\", 1, SENSORS_PROXIMITY_HANDLE, SENSOR_TYPE_PROXIMITY,\r\n\r\n                700.0f, 1.0f, 0.23f, 10000000, 0, 0, 0, 0, 0 },\r\n\r\n    };\r\n\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"What-about-the-sensors-poll-context-t-structure\"><\/span>What about the\u00a0sensors_poll_context_t structure?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 300;\">Most interesting in the sensors.cpp file is a\u00a0strange structure called <span class=\"lang:c decode:true crayon-inline\">sensors_poll_context_t<\/span>. It can be misused\u00a0as a class as it\u00a0defines both public and private variables and functions.<\/span><\/p>\n<p><span style=\"font-weight: 300;\"><span style=\"color: #000000;\">We use these\u00a0functions accessing the ProximitySensor class as a layer between the sensor itself\u00a0and the functions in the sensors.h interface we need to define.<\/span>\u00a0<\/span><span style=\"font-weight: 300;\">The private declarations inside the this structure start with the definition of enumerations. We need to add one for the proximity sensor:<\/span><\/p>\n<pre class=\"lang:c decode:true\">    enum {\r\n\r\n                proximity = 0,\r\n\r\n                numSensorDrivers,\r\n\r\n                numFds,\r\n\r\n        };<\/pre>\n<p><span style=\"font-weight: 300;\">In the private part of this struct the function <span class=\"lang:c decode:true crayon-inline \">handleToDriver<\/span>\u00a0is defined. We need to add a classification from the proximity handle <span class=\"lang:c decode:true crayon-inline \">ID_PX<\/span>\u00a0to the enum we defined. In the sensors library of the Pandaboard\u00a0we just have this one sensor, so it is returned as default.<\/span><\/p>\n<pre class=\"lang:c decode:true \">int handleToDriver (int handle) const {\r\n\r\n                switch (handle) {\r\n\r\n                        default:\r\n\r\n                                return proximity;\r\n\r\n                }\r\n\r\n                return -EINVAL;\r\n\r\n        }\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 300;\">Let&#8217;s take a look at the functions declared in this structure. For each function sensors.h is requesting, we have a corresponding function\u00a0defined in it. Except for the <span class=\"lang:c decode:true crayon-inline \">batch()<\/span>\u00a0and <span class=\"lang:c decode:true crayon-inline \">flush()<\/span>\u00a0functions there is no\u00a0equivalent. <\/span><\/p>\n<p><span style=\"font-weight: 300;\">Batching means storing sensor events in a hardware FIFO stack before reporting, but our sensor&#8217;s hardware does not support this. Other than that\u00a0each call to a <span class=\"lang:c decode:true crayon-inline\">poll__<\/span>\u00a0function is forwarded to the <span class=\"lang:c decode:true crayon-inline\">sensors_poll_context_t<\/span>\u00a0functions. The <span class=\"lang:c decode:true crayon-inline\">open_sensors()<\/span>\u00a0function <span style=\"color: #000000;\">corresponds\u00a0to the structure&#8217;s constructor.<\/span><\/span><\/p>\n<p><span style=\"font-weight: 300;\">So let&#8217;s continue\u00a0to this constructor. In this part we create a new instance of the ProximitySensor class as an entry in the SensorBase typed array. We also set the entries for our sensor in <span class=\"lang:c decode:true crayon-inline\">mPollFds<\/span>, an array based on the structure <span class=\"lang:c decode:true crayon-inline\">pollfd<\/span>. Its member <span class=\"lang:c decode:true crayon-inline \">fd<\/span>\u00a0holds\u00a0the file descriptor of the ProximitySensor instance. While the member <span class=\"lang:c decode:true crayon-inline\">events<\/span>\u00a0stands for an input event flag, <span class=\"lang:c decode:true crayon-inline \">revents<\/span>\u00a0 names output event flags. Thus\u00a0<span class=\"lang:c decode:true crayon-inline\">POLLIN<\/span>\u00a0allows\u00a0data or high-priority data to\u00a0be read without blocking.<\/span><\/p>\n<pre class=\"lang:c decode:true \">       mSensor[proximity] = new ProximitySensor();\r\n\r\n        mPollFds[proximity].fd = mSensor[proximity]-&gt;getFd();\r\n\r\n        mPollFds[proximity].events = POLLIN;\r\n\r\n        mPollFds[proximity].revents     = 0;\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 300;\">Finally we look at the <span class=\"lang:c decode:true crayon-inline\">pollEvents()<\/span>\u00a0function. We have nothing to add to it but it is still an interesting part, as the\u00a0values are fed\u00a0into the framework here. This function reads\u00a0the events of every registered sensor\u00a0and stores the data\u00a0in the data-pointer. In the first part\u2014in the do-while-loop\u2014, we look for data we have\u00a0left over from\u00a0the last call of the <span class=\"lang:c decode:true crayon-inline\">poll()<\/span>\u00a0function. With <span class=\"lang:c decode:true crayon-inline\">if (count)<\/span><\/span>\u00a0<span style=\"font-weight: 300;\">we are able to find out whether\u00a0there is space to store a few more values. If there is\u00a0we try to fetch some events immediately. Or we wait if there is nothing to return.<\/span><\/p>\n<p><span style=\"font-weight: 300;\">As long as we have events and space to save them, this loop goes on.<\/span><\/p>\n<pre class=\"lang:c decode:true \">int sensors_poll_context_t::pollEvents(sensors_event_t *data, int count) {\r\n\r\n        int nbEvents = 0;\r\n\r\n        int n = 0;\r\n\r\n        int nb, polltime = -1;\r\n\r\n        do {\r\n\r\n                for (int i = 0; count &amp;&amp; i &lt; numSensorDrivers; i++) {\r\n\r\n                        SensorBase* const sensor(mSensor[i]);\r\n\r\n                   nb = sensor-&gt;readEvents(data, count);\r\n\r\n                                if (nb &lt; count) {\r\n\r\n                                        mPollFds[i].revents = 0;\r\n\r\n                                }\r\n\r\n                                count -= nb;\r\n\r\n                                nbEvents += nb;\r\n\r\n                                data += nb;\r\n\r\n                }\r\n\r\n                if (count) {\r\n\r\n                        do {\r\n\r\n                                n = poll(mPollFds, numFds, nbEvents ? 0 : polltime);\r\n\r\n                        }\r\n\r\n                        while (n &lt; 0 &amp;&amp; errno == EINTR);\r\n\r\n                        if (n &lt; 0) {\r\n\r\n                                return -errno;\r\n\r\n                        }\r\n\r\n                        if (mPollFds[wake].revents &amp; (POLLIN | POLLPRI)) {\r\n\r\n                                char msg;\r\n\r\n                                int result = read(mPollFds[wake].fd, &amp;msg, 1);\r\n\r\n                                mPollFds[wake].revents = 0;\r\n\r\n                        }\r\n\r\n                }\r\n\r\n        } while (n &amp;&amp; count);\r\n\r\n    return nbEvents;\r\n\r\n}\r\n\r\n<\/pre>\n<p>If everything works correctly, every single app with permissions for the\u00a0proximity sensor can now also access\u00a0our\u00a0new sensor.<\/p>\n<figure id=\"attachment_12370\" aria-describedby=\"caption-attachment-12370\" style=\"width: 1280px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-12370\" src=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app.png\" alt=\"Android proximity sensor app\" width=\"1280\" height=\"720\" srcset=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app.png 1280w, https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app-300x169.png 300w, https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app-1024x576.png 1024w, https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app-768x432.png 768w, https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app-400x225.png 400w, https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app-720x406.png 720w, https:\/\/www.inovex.de\/wp-content\/uploads\/2015\/12\/android-proximity-test-app-360x203.png 360w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><figcaption id=\"caption-attachment-12370\" class=\"wp-caption-text\">A simple app I wrote to test the sensor&#8217;s readings. It works!<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Sources-Parts-3-and-4\"><\/span><span style=\"font-weight: 300;\">Sources (Parts 3 and 4)<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/source.android.com\/devices\/sensors\/hal-interface.html\"><span style=\"font-weight: 300;\">https:\/\/source.android.com\/devices\/sensors\/hal-interface.html<\/span><\/a><\/li>\n<li><a href=\"https:\/\/developer.android.com\/guide\/topics\/sensors\/sensors_overview.html\"><span style=\"font-weight: 300;\">https:\/\/developer.android.com\/guide\/topics\/sensors\/sensors_overview.html<\/span><\/a><\/li>\n<li><span style=\"font-weight: 300;\">http:\/\/processors.wiki.ti.com\/index.php\/Android_Sensor_PortingGuide<\/span><\/li>\n<li><span style=\"font-weight: 300;\">https:\/\/source.android.com\/devices\/halref\/sensors_8h_source.html<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Get-in-touch\"><\/span>Get in touch<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>And that&#8217;s a wrap! I hope you enjoyed our deep dive into Android Sensor Integration and you got a good impression of the complexity of such a diminutive device as well as the roles the kernel and HAL play in its\u00a0integration. If you have any questions feel free to leave a comment below. If you liked our articles please share them. For more <a href=\"https:\/\/www.inovex.de\/en\/our-services\/mobile\/internet-of-things-smart-devices\/\" target=\"_blank\" rel=\"noopener\">information on embedded development and the IoT<\/a> visit our website or call us at\u00a0<a href=\"tel:+497216190210\" target=\"_blank\" rel=\"noopener\">+49 721 619 021-0<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The-Whole-Story\"><\/span>The Whole Story<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/www.inovex.de\/\/android-sensor-integration-part-1-sensor-stack-and-kernel-module\/\" target=\"_blank\" rel=\"noopener\">Part 1:\u00a0Sensor Stack and Kernel Module<\/a><\/li>\n<li><a href=\"https:\/\/www.inovex.de\/\/android-sensor-integration-part-2-sensor-readings\/\">Part 2: Sensor Readings<\/a><\/li>\n<li><a href=\"https:\/\/www.inovex.de\/\/android-sensor-integration-part-3-hal\/\">Part 3: HAL<\/a><\/li>\n<li><a href=\"https:\/\/www.inovex.de\/\/android-sensor-integration-part-4-the-android-sensor-framework\/\">Part 4: The Android Sensor Framework<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this conclusion\u00a0of our series on Android Sensor Integration we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor. Click to dive right in or read the previous parts first for context.<\/p>\n","protected":false},"author":35,"featured_media":13054,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"ep_exclude_from_search":false,"footnotes":""},"tags":[74],"service":[420],"coauthors":[{"id":35,"display_name":"Anna-Lena Marx","user_nicename":"amarx"}],"class_list":["post-1249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-iot","service-apps"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Android Sensor Framework<\/title>\n<meta name=\"description\" content=\"In this conclusion\u00a0of our series we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Android Sensor Framework\" \/>\n<meta property=\"og:description\" content=\"In this conclusion\u00a0of our series we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/\" \/>\n<meta property=\"og:site_name\" content=\"inovex GmbH\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inovexde\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-23T08:41:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-06T10:42:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2300\" \/>\n\t<meta property=\"og:image:height\" content=\"876\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Anna-Lena Marx\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting-1024x390.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:site\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anna-Lena Marx\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"6\u00a0Minuten\" \/>\n\t<meta name=\"twitter:label3\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data3\" content=\"Anna-Lena Marx\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/\"},\"author\":{\"name\":\"Anna-Lena Marx\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/person\\\/b7d6fd8c3ec8972f3b14f0205e25d022\"},\"headline\":\"Android Sensor Integration Part 4: The Android Sensor Framework\",\"datePublished\":\"2015-12-23T08:41:23+00:00\",\"dateModified\":\"2025-01-06T10:42:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/\"},\"wordCount\":857,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/android-embedded-porting.jpg\",\"keywords\":[\"IoT\"],\"articleSection\":[\"Applications\",\"English Content\",\"General\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/\",\"name\":\"The Android Sensor Framework\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/android-embedded-porting.jpg\",\"datePublished\":\"2015-12-23T08:41:23+00:00\",\"dateModified\":\"2025-01-06T10:42:02+00:00\",\"description\":\"In this conclusion\u00a0of our series we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/android-embedded-porting.jpg\",\"contentUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/android-embedded-porting.jpg\",\"width\":2300,\"height\":876,\"caption\":\"Porting an Android Embedded Setup\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/android-sensor-integration-part-4-the-android-sensor-framework\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android Sensor Integration Part 4: The Android Sensor Framework\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\",\"name\":\"inovex GmbH\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#organization\",\"name\":\"inovex GmbH\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/inovex-logo-16-9-1.png\",\"contentUrl\":\"https:\\\/\\\/www.inovex.de\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/inovex-logo-16-9-1.png\",\"width\":1921,\"height\":1081,\"caption\":\"inovex GmbH\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inovexde\",\"https:\\\/\\\/x.com\\\/inovexgmbh\",\"https:\\\/\\\/www.instagram.com\\\/inovexlife\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inovex\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UC7r66GT14hROB_RQsQBAQUQ\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/#\\\/schema\\\/person\\\/b7d6fd8c3ec8972f3b14f0205e25d022\",\"name\":\"Anna-Lena Marx\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/44ab0d3916e62a17054b8e4cea92702db304b9dcb6dd28fb9915484c1830409b?s=96&d=retro&r=ga8cfb531252ec2ef604ef3033c45111b\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/44ab0d3916e62a17054b8e4cea92702db304b9dcb6dd28fb9915484c1830409b?s=96&d=retro&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/44ab0d3916e62a17054b8e4cea92702db304b9dcb6dd28fb9915484c1830409b?s=96&d=retro&r=g\",\"caption\":\"Anna-Lena Marx\"},\"url\":\"https:\\\/\\\/www.inovex.de\\\/de\\\/blog\\\/author\\\/amarx\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Android Sensor Framework","description":"In this conclusion\u00a0of our series we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/","og_locale":"de_DE","og_type":"article","og_title":"The Android Sensor Framework","og_description":"In this conclusion\u00a0of our series we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor.","og_url":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/","og_site_name":"inovex GmbH","article_publisher":"https:\/\/www.facebook.com\/inovexde","article_published_time":"2015-12-23T08:41:23+00:00","article_modified_time":"2025-01-06T10:42:02+00:00","og_image":[{"width":2300,"height":876,"url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting.jpg","type":"image\/jpeg"}],"author":"Anna-Lena Marx","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting-1024x390.jpg","twitter_creator":"@inovexgmbh","twitter_site":"@inovexgmbh","twitter_misc":{"Verfasst von":"Anna-Lena Marx","Gesch\u00e4tzte Lesezeit":"6\u00a0Minuten","Written by":"Anna-Lena Marx"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#article","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/"},"author":{"name":"Anna-Lena Marx","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/b7d6fd8c3ec8972f3b14f0205e25d022"},"headline":"Android Sensor Integration Part 4: The Android Sensor Framework","datePublished":"2015-12-23T08:41:23+00:00","dateModified":"2025-01-06T10:42:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/"},"wordCount":857,"commentCount":7,"publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting.jpg","keywords":["IoT"],"articleSection":["Applications","English Content","General"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/","url":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/","name":"The Android Sensor Framework","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#primaryimage"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting.jpg","datePublished":"2015-12-23T08:41:23+00:00","dateModified":"2025-01-06T10:42:02+00:00","description":"In this conclusion\u00a0of our series we finally arrive at the Android Sensor Framework to which we are going to\u00a0connect\u00a0our ultrasonic range sensor.","breadcrumb":{"@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#primaryimage","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting.jpg","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2017\/06\/android-embedded-porting.jpg","width":2300,"height":876,"caption":"Porting an Android Embedded Setup"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inovex.de\/de\/blog\/android-sensor-integration-part-4-the-android-sensor-framework\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inovex.de\/de\/"},{"@type":"ListItem","position":2,"name":"Android Sensor Integration Part 4: The Android Sensor Framework"}]},{"@type":"WebSite","@id":"https:\/\/www.inovex.de\/de\/#website","url":"https:\/\/www.inovex.de\/de\/","name":"inovex GmbH","description":"","publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inovex.de\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.inovex.de\/de\/#organization","name":"inovex GmbH","url":"https:\/\/www.inovex.de\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","width":1921,"height":1081,"caption":"inovex GmbH"},"image":{"@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inovexde","https:\/\/x.com\/inovexgmbh","https:\/\/www.instagram.com\/inovexlife\/","https:\/\/www.linkedin.com\/company\/inovex","https:\/\/www.youtube.com\/channel\/UC7r66GT14hROB_RQsQBAQUQ"]},{"@type":"Person","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/b7d6fd8c3ec8972f3b14f0205e25d022","name":"Anna-Lena Marx","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/secure.gravatar.com\/avatar\/44ab0d3916e62a17054b8e4cea92702db304b9dcb6dd28fb9915484c1830409b?s=96&d=retro&r=ga8cfb531252ec2ef604ef3033c45111b","url":"https:\/\/secure.gravatar.com\/avatar\/44ab0d3916e62a17054b8e4cea92702db304b9dcb6dd28fb9915484c1830409b?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/44ab0d3916e62a17054b8e4cea92702db304b9dcb6dd28fb9915484c1830409b?s=96&d=retro&r=g","caption":"Anna-Lena Marx"},"url":"https:\/\/www.inovex.de\/de\/blog\/author\/amarx\/"}]}},"_links":{"self":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/1249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/comments?post=1249"}],"version-history":[{"count":4,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/1249\/revisions"}],"predecessor-version":[{"id":60284,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/1249\/revisions\/60284"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media\/13054"}],"wp:attachment":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media?parent=1249"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/tags?post=1249"},{"taxonomy":"service","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/service?post=1249"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/coauthors?post=1249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}