{"id":711,"date":"2016-04-04T07:24:10","date_gmt":"2016-04-04T12:24:10","guid":{"rendered":"https:\/\/fieldscience.cs.earlham.edu\/?p=711"},"modified":"2016-04-04T07:24:10","modified_gmt":"2016-04-04T12:24:10","slug":"handlers-handling-handles","status":"publish","type":"post","link":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/","title":{"rendered":"Handlers handling handles"},"content":{"rendered":"<p>After some testing of the Handler implementation in Field Day, I&#8217;ve determined that it is actually working! I was finally able to look at the data that I had been writing to the database.<\/p>\n<p>Databases in Android are stored in internal (private) memory. There are Android apps that let you look at the files on your device, but only for external storage. The internal storage is private. What I ended up doing was adding a function to write the database from internal storage to external storage. Once it was on external storage, I used a SQLite Viewer Android app to look at the database and it looks good!<\/p>\n<p>I did some research into the application state when the device screen is turned off. In our old application, Seshat, the activities would die when the screen was off. That&#8217;s not good. We want to be able to turn off the screen and hang the Android device from our person some how. It&#8217;s useful to have our hands free. After a couple hours of research, I determined the libraries we want to look at are in the PowerManager library on Android, particularly the PARTIAL_WAKE_LOCK state. I wrap the methods I want to happen when the screen is off in what are essentially &#8216;start&#8217; and &#8216;stop&#8217; methods. The methods were not executing with the screen off, so I researched some more. I think what will ultimately happen is switching the SensorSampleActivity to a Service. A Service in Android is one of the top priority processes. It&#8217;s one of the last to die to if the device needs more memory. It can continue running even if the Activity the started it has died. Since the Activity is now working, I&#8217;m going to hold off in converting it to a Service.<\/p>\n<p>The last thing I worked on this week was Bluetooth LE in Android. Tara gave me a BLE shield with an Arduino attached to test my code with those devices. Android provides a BLE example in Android Studio so I&#8217;ve been working with that. However, the example they provide has deprecated code so I&#8217;m working on modifying it to the new setup. It&#8217;s not working yet, but I&#8217;ve only been working on it for a couple of hours!<\/p>\n<figure id=\"attachment_713\" class=\"thumbnail wp-caption alignnone\" style=\"width: 300px\"><a href=\"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-medium wp-image-713\" src=\"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite-300x261.png\" alt=\"sqlite-fieldday\" width=\"300\" height=\"261\" srcset=\"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite-300x261.png 300w, https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite-1024x890.png 1024w, https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png 1200w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption class=\"caption wp-caption-text\">Sample of sqlite database on Field Day<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>After some testing of the Handler implementation in Field Day, I&#8217;ve determined that it is actually working! I was finally able to look at the data that I had been writing to the database. Databases in Android are stored in &hellip; <a href=\"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":713,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"kt_blocks_editor_width":"","footnotes":""},"categories":[67,1,11],"tags":[15,17,27,20,28,16,53,51],"class_list":["post-711","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-appdev","category-kristin","category-progress-reports","tag-android","tag-app","tag-application","tag-bluetooth","tag-code","tag-development","tag-fieldday","tag-software-architecture"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Handlers handling handles - fieldscience @ earlham<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Handlers handling handles - fieldscience @ earlham\" \/>\n<meta property=\"og:description\" content=\"After some testing of the Handler implementation in Field Day, I&#8217;ve determined that it is actually working! I was finally able to look at the data that I had been writing to the database. Databases in Android are stored in &hellip; Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/\" \/>\n<meta property=\"og:site_name\" content=\"fieldscience @ earlham\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-04T12:24:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"1043\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kristin Muterspaw\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kristin Muterspaw\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/\"},\"author\":{\"name\":\"Kristin Muterspaw\",\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/#\\\/schema\\\/person\\\/2559340425ea97e18ee79c40f3365222\"},\"headline\":\"Handlers handling handles\",\"datePublished\":\"2016-04-04T12:24:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/\"},\"wordCount\":402,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/image\\\/pngapks\\\/fieldday-sqlite.png\",\"keywords\":[\"android\",\"app\",\"application\",\"bluetooth\",\"code\",\"development\",\"fieldday\",\"software architecture\"],\"articleSection\":[\"App Development\",\"Kristin\",\"Progress Reports\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/\",\"url\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/\",\"name\":\"Handlers handling handles - fieldscience @ earlham\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/image\\\/pngapks\\\/fieldday-sqlite.png\",\"datePublished\":\"2016-04-04T12:24:10+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/#\\\/schema\\\/person\\\/2559340425ea97e18ee79c40f3365222\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/image\\\/pngapks\\\/fieldday-sqlite.png\",\"contentUrl\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/image\\\/pngapks\\\/fieldday-sqlite.png\",\"width\":1200,\"height\":1043,\"caption\":\"Sample of sqlite database on Field Day\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/2016\\\/04\\\/handlers-handling-handles\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Handlers handling handles\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/#website\",\"url\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/\",\"name\":\"fieldscience @ earlham\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/#\\\/schema\\\/person\\\/2559340425ea97e18ee79c40f3365222\",\"name\":\"Kristin Muterspaw\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7c298ecf2dd418cede9d8bbea149b1fd9aa9135a540aef28db205ac8749c8f2?s=96&d=wavatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7c298ecf2dd418cede9d8bbea149b1fd9aa9135a540aef28db205ac8749c8f2?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7c298ecf2dd418cede9d8bbea149b1fd9aa9135a540aef28db205ac8749c8f2?s=96&d=wavatar&r=g\",\"caption\":\"Kristin Muterspaw\"},\"url\":\"https:\\\/\\\/fieldscience.cs.earlham.edu\\\/index.php\\\/author\\\/kmmuterspaw\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Handlers handling handles - fieldscience @ earlham","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:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/","og_locale":"en_US","og_type":"article","og_title":"Handlers handling handles - fieldscience @ earlham","og_description":"After some testing of the Handler implementation in Field Day, I&#8217;ve determined that it is actually working! I was finally able to look at the data that I had been writing to the database. Databases in Android are stored in &hellip; Read More","og_url":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/","og_site_name":"fieldscience @ earlham","article_published_time":"2016-04-04T12:24:10+00:00","og_image":[{"width":1200,"height":1043,"url":"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png","type":"image\/png"}],"author":"Kristin Muterspaw","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kristin Muterspaw","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#article","isPartOf":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/"},"author":{"name":"Kristin Muterspaw","@id":"https:\/\/fieldscience.cs.earlham.edu\/#\/schema\/person\/2559340425ea97e18ee79c40f3365222"},"headline":"Handlers handling handles","datePublished":"2016-04-04T12:24:10+00:00","mainEntityOfPage":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/"},"wordCount":402,"commentCount":1,"image":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#primaryimage"},"thumbnailUrl":"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png","keywords":["android","app","application","bluetooth","code","development","fieldday","software architecture"],"articleSection":["App Development","Kristin","Progress Reports"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/","url":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/","name":"Handlers handling handles - fieldscience @ earlham","isPartOf":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#primaryimage"},"image":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#primaryimage"},"thumbnailUrl":"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png","datePublished":"2016-04-04T12:24:10+00:00","author":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/#\/schema\/person\/2559340425ea97e18ee79c40f3365222"},"breadcrumb":{"@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#primaryimage","url":"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png","contentUrl":"https:\/\/fieldscience.cs.earlham.edu\/wp-content\/uploads\/2016\/04\/image\/pngapks\/fieldday-sqlite.png","width":1200,"height":1043,"caption":"Sample of sqlite database on Field Day"},{"@type":"BreadcrumbList","@id":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/2016\/04\/handlers-handling-handles\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fieldscience.cs.earlham.edu\/"},{"@type":"ListItem","position":2,"name":"Handlers handling handles"}]},{"@type":"WebSite","@id":"https:\/\/fieldscience.cs.earlham.edu\/#website","url":"https:\/\/fieldscience.cs.earlham.edu\/","name":"fieldscience @ earlham","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fieldscience.cs.earlham.edu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/fieldscience.cs.earlham.edu\/#\/schema\/person\/2559340425ea97e18ee79c40f3365222","name":"Kristin Muterspaw","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e7c298ecf2dd418cede9d8bbea149b1fd9aa9135a540aef28db205ac8749c8f2?s=96&d=wavatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e7c298ecf2dd418cede9d8bbea149b1fd9aa9135a540aef28db205ac8749c8f2?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e7c298ecf2dd418cede9d8bbea149b1fd9aa9135a540aef28db205ac8749c8f2?s=96&d=wavatar&r=g","caption":"Kristin Muterspaw"},"url":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/author\/kmmuterspaw\/"}]}},"_links":{"self":[{"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/posts\/711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/comments?post=711"}],"version-history":[{"count":1,"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/posts\/711\/revisions"}],"predecessor-version":[{"id":714,"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/posts\/711\/revisions\/714"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/media\/713"}],"wp:attachment":[{"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/media?parent=711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/categories?post=711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fieldscience.cs.earlham.edu\/index.php\/wp-json\/wp\/v2\/tags?post=711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}