{"author_name":"oolealealealea","cat":"October Challenge 2014","comments":[],"epoch":1412414100,"likes":3,"metadata":{"p_key":"26135","p_author":"oolealealealea","p_authorkey":"505330","p_urlkey":"61559","p_title":"Day 3: Enabling immersive mode on Android","p_cat":"October Challenge 2014","p_event":"LD30","p_time":"1412414100","p_likes":"3","p_comments":"0","p_status":"UPD5","us_key":"505330","us_name":"oolealealealea","us_username":"oolealealealea","event_start":"1408665600","event_key":"24","event_name":"LD30"},"text":"<p>While testing the math from my previous post, I noticed that wrong set of images gets picked up on some of the Android devices. Those devices have on-screen buttons (home, back, menu) which are shown inside the screen. Luckly, the solution is simple, just enable the <a title=\"Immersive mode docs\" href=\"https:\/\/developer.android.com\/training\/system-ui\/immersive.html\">immersive mode<\/a> and buttons would go away and you have the whole screen to your game.<\/p>\n <p>As a side-effect, players would be much less likely to hit the home button at the bottom of the screen and exit your game mid-play, as they would have to drag the finger to make the button appear at all.<\/p>\n <p>The immersive mode is available since KitKat. If you don&#8217;t want to bother with the docs, here&#8217;s the code you can simply copy\/paste into your project:<\/p>\n <p><a title=\"Enable immersive mode KitKat\" href=\"http:\/\/bigosaur.com\/blog\/32-handle-immersive-kitkat\">http:\/\/bigosaur.com\/blog\/32-handle-immersive-kitkat<\/a><\/p>\n <p>The code uses a 5 second delay before immersive mode is activated. This is useful in case user lanuches the app by mistake.<\/p>\n <p>If you&#8217;re making an Android game, please implement this.<\/p>\n <p>&nbsp;<\/p>","time":"October 4th, 2014 4:15 am","title":"Day 3: Enabling immersive mode on Android"}