{"id":1021,"date":"2014-06-22T21:29:09","date_gmt":"2014-06-22T21:29:09","guid":{"rendered":"http:\/\/www.trivedigaurav.com\/blog\/?p=1021"},"modified":"2014-08-23T03:39:17","modified_gmt":"2014-08-23T03:39:17","slug":"mid-summer-progress-on-kivy-and-plyer","status":"publish","type":"post","link":"https:\/\/www.trivedigaurav.com\/blog\/mid-summer-progress-on-kivy-and-plyer\/","title":{"rendered":"Mid-summer Progress on Kivy and Plyer"},"content":{"rendered":"<p>This week I worked on retrieving a <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/66\">Unique ID<\/a> depending the the hardware your program is running on. This involves querying some platform specific unique IDs that are suitable for this purpose. For example, you could use the IMEI number on an Android device or the serial number of the machine when running on a desktop. While none of these methods are foolproof and can be spoofed, they can still be useful in primitive fingerprinting and probably even seeding a random number generator. You can check out my pull request <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/66\">here<\/a>.<\/p>\n<p>The week also marks the end of <a title=\"Kivy for all your GUI (or NUI) needs!\" href=\"http:\/\/www.trivedigaurav.com\/blog\/kivy-for-all-your-gui-or-nui-needs\/\">five weeks<\/a> since I have started working on the <a href=\"https:\/\/github.com\/kivy\/kivy\/\">Kivy<\/a> project. I have been making steady progress towards improving <a href=\"https:\/\/github.com\/kivy\/plyer\/\">Plyer<\/a>, a cross-platform library to handle all the common platform dependent things you need while writing python applications that can run on Android \/ iOS \/ Linux \/ Mac or Windows.<\/p>\n<p>Here are the links to my previous blog posts describing my progress each week:<\/p>\n<ol>\n<li><a title=\"Kivy for all your GUI (or NUI) needs!\" href=\"http:\/\/www.trivedigaurav.com\/blog\/kivy-for-all-your-gui-or-nui-needs\/\">Kivy for all your GUI (or NUI) needs!<\/a><\/li>\n<li><a title=\"Kivy Updates from the First Week\" href=\"http:\/\/www.trivedigaurav.com\/blog\/kivy-updates-from-the-first-week\/\">Kivy Updates from the First Week<\/a><\/li>\n<li><a title=\"Mid-Midterm Activities on Kivy\" href=\"http:\/\/www.trivedigaurav.com\/blog\/mid-midterm-activities-on-kivy\/\">Mid-Midterm Activities on Kivy<\/a>, and<\/li>\n<li><a title=\"PyJnius to rule them all!\" href=\"http:\/\/www.trivedigaurav.com\/blog\/pyjnius-to-rule-them-all\/\">PyJnius to rule them all!<\/a><\/li>\n<\/ol>\n<p>I started my work with a <a href=\"https:\/\/github.com\/kivy\/python-for-android\/issues\/234\">critical bug<\/a> that was blocking further progress in the first week. Although it is only recently that <a href=\"https:\/\/github.com\/inclement\">Inclement<\/a> has been able to propose a fix for it, we were able to find a quick work-around that did not stop the development on Android platforms.<\/p>\n<p>I also did some <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/49\">review<\/a> of <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/52\">existing<\/a> <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/47\">pull<\/a> <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/48\">requests<\/a> in Plyer that were <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/49\">pending<\/a> to be merged. I also implemented the <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/55\">accelerometer facade on MacOS<\/a> by writing a small library using <a href=\"https:\/\/docs.python.org\/2\/library\/ctypes.html\">ctypes<\/a> to make the API calls. I then re-wrote some of the <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/63\">existing sensor facades<\/a> on Android using the support provided by the <a href=\"https:\/\/github.com\/kivy\/pyjnius\">PyJnius<\/a> project. This made access to the platform specific APIs more simple and very clean. We decided against using the sl4a compatibility layer and stick with using Pyjnius for accessing Java classes on Android.<\/p>\n<p>You can find a list of all the pull requests in Plyer <a href=\"https:\/\/github.com\/kivy\/plyer\/pulls\">here<\/a>. In summary, these are the facades that were either added, modified or reviewed since the beginning of the project:<\/p>\n<table class=\"table table-bordered table-striped\">\n<thead valign=\"bottom\">\n<tr>\n<th>Platform<\/th>\n<th>Android<\/th>\n<th>iOS<\/th>\n<th>Windows<\/th>\n<th>OSX<\/th>\n<th>Linux<\/th>\n<\/tr>\n<\/thead>\n<tbody valign=\"top\">\n<tr>\n<td>Accelerometer<\/td>\n<td>X<\/td>\n<td><\/td>\n<td><\/td>\n<td>\u00a0X<\/td>\n<td>\u00a0X<\/td>\n<\/tr>\n<tr>\n<td>Camera (taking picture)<\/td>\n<td>X<\/td>\n<td><\/td>\n<td>X<\/td>\n<td>\u00a0X<\/td>\n<td>\u00a0X<\/td>\n<\/tr>\n<tr>\n<td>GPS<\/td>\n<td>X<\/td>\n<td>X<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Email (open mail client)<\/td>\n<td>X<\/td>\n<td><\/td>\n<td>X<\/td>\n<td>X<\/td>\n<td>X<\/td>\n<\/tr>\n<tr>\n<td>Vibrator<\/td>\n<td>X<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>SMS<\/td>\n<td>X<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Play Sound<\/td>\n<td>X<\/td>\n<td><\/td>\n<td>X<\/td>\n<td>X<\/td>\n<td>X<\/td>\n<\/tr>\n<tr>\n<td>Compass<\/td>\n<td>X<\/td>\n<td>X<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Gyroscope<\/td>\n<td>X<\/td>\n<td>X<\/td>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Unique ID<\/td>\n<td>X<\/td>\n<td><\/td>\n<td>X<\/td>\n<td>X<\/td>\n<td>X<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>I also added some <a href=\"https:\/\/github.com\/kivy\/plyer\/tree\/master\/examples\/accelerometer\">example<\/a> <a href=\"https:\/\/github.com\/kivy\/plyer\/blob\/master\/examples\/text2speech\/\">applications<\/a> <a href=\"https:\/\/github.com\/kivy\/plyer\/pull\/41\">using Kivy<\/a> to demonstrate the use of these facades. And also made a point to include one with most of the new facades that I wrote.<\/p>\n<p>I believe that I have made some significant progress till now but there are still some tricky facades that are left to be implemented before the end of summer. I hope to carry this momentum forward and add many more facades in the coming weeks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I worked on retrieving a Unique ID depending the the hardware your program is running on. This involves querying some platform specific unique IDs that are suitable for this purpose. For example, you could use the IMEI number on an Android device or the serial number of the machine when running on a &hellip; <a href=\"https:\/\/www.trivedigaurav.com\/blog\/mid-summer-progress-on-kivy-and-plyer\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Mid-summer Progress on Kivy and Plyer<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[22,23,24],"tags":[],"class_list":["post-1021","post","type-post","status-publish","format-standard","hentry","category-projects","category-python","category-updates"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p46eol-gt","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts\/1021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/comments?post=1021"}],"version-history":[{"count":14,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts\/1021\/revisions"}],"predecessor-version":[{"id":1505,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/posts\/1021\/revisions\/1505"}],"wp:attachment":[{"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/media?parent=1021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/categories?post=1021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trivedigaurav.com\/blog\/wp-json\/wp\/v2\/tags?post=1021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}