LightBlog

vendredi 31 mars 2017

How to Add Page Scroll Keys to the Navigation Bar while using Chrome in Android O

We've been having a lot of fun at XDA with the new navigation bar customizer this week. From custom keys to control music playback, toggle picture-in-picture mode while using YouTube, and finally add keys to move through your e-mail conversation list, there's a ton of ways you can take advantage of the nav bar customizer to enhance your favorite apps. Most recently, we also showed you how to add custom icons to your nav bar keys so you can more easily identify what your custom keys actually represent in your Tasker Profiles. And now, we'll show you an example that takes advantage of that to add page scroll keys to the navigation bar while using Google Chrome.

Thanks to Eli Irvin for testing out my script and capturing this screen recording.

As you can see in the video above, when my tester opened up Google Chrome, two new keys were added to the navigation bar that when pressed, scroll the page up or down. The keycodes that are sent are KEYCODE_PAGE_DOWN (#93) and KEYCODE_PAGE_UP (#92). The icons that pop up are fairly self-explanatory as to which one represents scrolling downwards versus upwards, thanks to the fact that I used custom icons from the Icons Database.

We'll show you how to replicate this setup on your own device so you can learn how to make your own custom nav bar configurations, but we'll also provide a download link at the end of the article if you would rather skip to that.


Adding Nav Bar Scroll Keys while using Google Chrome

Requirements:

Tasker is necessary because it is the automation app we're using to detect what application we're in and send commands through the SecureTask plug-in, which is what will handle changing our navigation bar. Once you've installed both applications, we need to set both of them up.

In order for Tasker to detect what application we're in, we need to grant its Accessibility Service. Doing so is very quick, simply go to Settings –> Accessibility and look for "Tasker" on the list of Services. Enable the Accessibility Service.

Next, we need to grant SecureTask the ability to modify system settings on our device. In order to do so, we have to grant SecureTask a special permission known as WRITE_SECURE_SETTINGS which is normally inaccessible to regular applications, but can be granted manually by a user through the use of ADB. Thus, you'll need to have ADB up and running on your machine to get this working. Fortunately, granting this permission is only a one-time thing, and we'll be using SecureTask in future Android O-related tutorials (of which there are a couple more), so it's definitely worth doing it.

Setting up ADB

The first thing you'll need to do is download the ADB binary for your particular OS. You can do so here. Once you've downloaded them, you need to then make sure you have the proper driver if you're on Windows.

Once you've extracted the binary to a separate folder and have installed the driver, we need to next enable USB Debugging on the smartphone. In order to do so, open up Settings and go to About Phone. Tap on Build Number 7 times until you get a dialog telling you that you've unlocked Developer Options. You can access Developer Options in Settings now. Apparently in Android O, you have to enter your pin/password before you can open Developer Options. Do so and look for USB Debugging, then enable it.

Now plug in your phone and open up a command prompt in the same directory where you extracted the ADB binary. (Windows users, hold shift+right-click in that folder and select "open command prompt here.") Type adb devices into the command prompt. You'll see a message that the ADB server is being started, then on your phone you'll see a prompt asking you to grant your computer ADB access. Accept it. Now when you enter adb devices into the command prompt, you should see your device's serial number, if so then you were successful.

Granting WRITE_SECURE_SETTINGS to SecureTask

With an ADB command prompt opened up, enter the following command to grant SecureTask the requisite permission.

  adb shell pm grant com.balda.securetask android.permission.WRITE_SECURE_SETTINGS  

SecureTask will now have the ability to modify system settings without root access! Now we're ready to move on to Tasker.

Setting up the Tasker Profile

Before we begin with Tasker, you'll need to download a down arrow and an up arrow icon to use as custom icons for the scroll keys. Download the custom icons that are the appropriate size for your device's screen density and store them in /NavIcons. Name these icons down.png and up.png. Now we're ready to make our Tasker Profile.

Open up Tasker and create a new Profile by pressing the + button in the bottom right. Select the Application Context and then in the App Selection screen select all the apps you want to have the scroll keys show up in (such as Chrome).

Next, Tasker will ask you to either select an existing Task or create a new one. Create a new Task but don't bother giving it a name. Once you're in the Task creation screen, we'll need to add two Actions to it:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: key(93:file:///storage/emulated/0/NavIcons/down.png)
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: key(92:file:///storage/emulated/0/NavIcons/up.png)

These two Actions will add two nav bar keys that correspond to KEYCODE_PAGE_DOWN and KEYCODE_PAGE_UP with a down arrow and up arrow icon that you downloaded off the Internet. These keys will only show up when you're in the app that you've chosen, in my case Chrome, so we'll need to disable them when we exit Chrome by adding an Exit Task.

You can add an Exit Task by long-pressing on the Task that you just made (while on the main screen of Tasker) and pressing "add exit task" on the pop-up. Once you've in, add the following two Actions:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: null
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: null

And with the addition of this Exit Task, Tasker will now automatically remove these scroll keys when you exit the Chrome app. That way, you'll only have these scroll keys show up when they're useful.

Download and Import

As with all Tasker related tutorials, we will be providing the XML file you can download and import. Download the .prf.xml file from AndroidFileHost below and save it to your internal storage. Open up Tasker and long-press on the Profiles tab up top until you see an Import button. Tap on that and look for the XML file you just saved, then select it to import it. Make sure you have Tasker's Accessibility Service enabled and have granted the WRITE_SECURE_SETTINGS to SecureTask as mentioned in my article, otherwise this Profile will not do anything on your phone!

Download the "Toggle Scroll Keys in Chrome" Profile from AndroidFileHost

Note: if you download the above Profile, you'll need to make sure you have already downloaded the up arrow and down arrow icons and have saved them to /NavIcons as up.png and down.png. Otherwise you'll need to manually edit the Actions in the Entry Task to point to these new icons.

If you're wondering what other useful keys we can add to the navigation bar to make browsing Chrome a more enjoyable experience, we'll show you an alternative setup in a future tutorial. Stay tuned to the portal for more tutorials!



from xda-developers http://ift.tt/2nFdrH8
via IFTTT

How to Add Page Scroll Keys to the Navigation Bar while using Chrome in Android O

We’ve been having a lot of fun at XDA with the new navigation bar customizer this week. From custom keys to control music playback, toggle picture-in-picture mode while using YouTube, and finally add keys to move through your e-mail conversation list, there’s a ton of ways you can take advantage of the nav bar customizer to enhance your favorite apps. Most recently, we also showed you how to add custom icons to your nav bar keys so you can more easily identify what your custom keys actually represent in your Tasker Profiles. And now, we’ll show you an example that takes advantage of that to add page scroll keys to the navigation bar while using Google Chrome.

Thanks to Eli Irvin for testing out my script and capturing this screen recording.

As you can see in the video above, when my tester opened up Google Chrome, two new keys were added to the navigation bar that when pressed, scroll the page up or down. The keycodes that are sent are KEYCODE_PAGE_DOWN (#93) and KEYCODE_PAGE_UP (#92). The icons that pop up are fairly self-explanatory as to which one represents scrolling downwards versus upwards, thanks to the fact that I used custom icons from the Icons Database.

We’ll show you how to replicate this setup on your own device so you can learn how to make your own custom nav bar configurations, but we’ll also provide a download link at the end of the article if you would rather skip to that.


Adding Nav Bar Scroll Keys while using Google Chrome

Requirements:

Tasker is necessary because it is the automation app we’re using to detect what application we’re in and send commands through the SecureTask plug-in, which is what will handle changing our navigation bar. Once you’ve installed both applications, we need to set both of them up.

In order for Tasker to detect what application we’re in, we need to grant its Accessibility Service. Doing so is very quick, simply go to Settings –> Accessibility and look for “Tasker” on the list of Services. Enable the Accessibility Service.

Next, we need to grant SecureTask the ability to modify system settings on our device. In order to do so, we have to grant SecureTask a special permission known as WRITE_SECURE_SETTINGS which is normally inaccessible to regular applications, but can be granted manually by a user through the use of ADB. Thus, you’ll need to have ADB up and running on your machine to get this working. Fortunately, granting this permission is only a one-time thing, and we’ll be using SecureTask in future Android O-related tutorials (of which there are a couple more), so it’s definitely worth doing it.

Setting up ADB

The first thing you’ll need to do is download the ADB binary for your particular OS. You can do so here. Once you’ve downloaded them, you need to then make sure you have the proper driver if you’re on Windows.

Once you’ve extracted the binary to a separate folder and have installed the driver, we need to next enable USB Debugging on the smartphone. In order to do so, open up Settings and go to About Phone. Tap on Build Number 7 times until you get a dialog telling you that you’ve unlocked Developer Options. You can access Developer Options in Settings now. Apparently in Android O, you have to enter your pin/password before you can open Developer Options. Do so and look for USB Debugging, then enable it.

Now plug in your phone and open up a command prompt in the same directory where you extracted the ADB binary. (Windows users, hold shift+right-click in that folder and select “open command prompt here.”) Type adb devices into the command prompt. You’ll see a message that the ADB server is being started, then on your phone you’ll see a prompt asking you to grant your computer ADB access. Accept it. Now when you enter adb devices into the command prompt, you should see your device’s serial number, if so then you were successful.

Granting WRITE_SECURE_SETTINGS to SecureTask

With an ADB command prompt opened up, enter the following command to grant SecureTask the requisite permission.

adb shell pm grant com.balda.securetask android.permission.WRITE_SECURE_SETTINGS

SecureTask will now have the ability to modify system settings without root access! Now we’re ready to move on to Tasker.

Setting up the Tasker Profile

Before we begin with Tasker, you’ll need to download a down arrow and an up arrow icon to use as custom icons for the scroll keys. Download the custom icons that are the appropriate size for your device’s screen density and store them in /NavIcons. Name these icons down.png and up.png. Now we’re ready to make our Tasker Profile.

Open up Tasker and create a new Profile by pressing the + button in the bottom right. Select the Application Context and then in the App Selection screen select all the apps you want to have the scroll keys show up in (such as Chrome).

Next, Tasker will ask you to either select an existing Task or create a new one. Create a new Task but don’t bother giving it a name. Once you’re in the Task creation screen, we’ll need to add two Actions to it:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: key(93:file:///storage/emulated/0/NavIcons/down.png)
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: key(92:file:///storage/emulated/0/NavIcons/up.png)

These two Actions will add two nav bar keys that correspond to KEYCODE_PAGE_DOWN and KEYCODE_PAGE_UP with a down arrow and up arrow icon that you downloaded off the Internet. These keys will only show up when you’re in the app that you’ve chosen, in my case Chrome, so we’ll need to disable them when we exit Chrome by adding an Exit Task.

You can add an Exit Task by long-pressing on the Task that you just made (while on the main screen of Tasker) and pressing “add exit task” on the pop-up. Once you’ve in, add the following two Actions:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: null
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: null

And with the addition of this Exit Task, Tasker will now automatically remove these scroll keys when you exit the Chrome app. That way, you’ll only have these scroll keys show up when they’re useful.

Download and Import

As with all Tasker related tutorials, we will be providing the XML file you can download and import. Download the .prf.xml file from AndroidFileHost below and save it to your internal storage. Open up Tasker and long-press on the Profiles tab up top until you see an Import button. Tap on that and look for the XML file you just saved, then select it to import it. Make sure you have Tasker’s Accessibility Service enabled and have granted the WRITE_SECURE_SETTINGS to SecureTask as mentioned in my article, otherwise this Profile will not do anything on your phone!

Download the “Toggle Scroll Keys in Chrome” Profile from AndroidFileHost

Note: if you download the above Profile, you’ll need to make sure you have already downloaded the up arrow and down arrow icons and have saved them to /NavIcons as up.png and down.png. Otherwise you’ll need to manually edit the Actions in the Entry Task to point to these new icons.

If you’re wondering what other useful keys we can add to the navigation bar to make browsing Chrome a more enjoyable experience, we’ll show you an alternative setup in a future tutorial. Stay tuned to the portal for more tutorials!



from xda-developers http://ift.tt/2nFdrH8
via IFTTT

Magisk Receives an Update to v12, Fixes Samsung Bugs, Adds Core Only Mode, and More

It's been close to two months since the last big stable update was released for Magisk, and the developer actually received a lot of complaints about that update. At the time, Magisk Manager was at version 4.25 and it had begun crashing on a lot of Samsung devices. The issue was so widespread on Samsung devices that XDA Recognized Developer topjohnwu reached out to the community to ask for help regarding the issue. Thanks to the community, the developer was able to figure out the issue and fixed it in some test builds.

Thus the big update here is that Samsung devices should no longer see Magisk crash on their devices like it did before, and they were even able to add in some Samsung specific features too. For example, version 12 of Magisk adds support for Samsung permissive kernels, and it will even fake KNOX to 0x0 if MagiskHide is enabled. topjohnwu also made some changes to the sepolicy live patcher, and has moved it from the post-fs-data mode to the service mode.

This change was mainly done for Samsung devices as well and requires 20-80KB of ramdisk size (where it was previously 1-4KB), but that still isn't very large. Another big addition here is choice of setting Magisk to More Only Mode. This was added to address the complaints about Magisk having too many features. It can be enabled in Magisk Manager and will limit the modification to root + boot scripts, as well as MagiskHide.

Here's a summary of the more important changes listed below, but you can find the full change-log here.

  • [General] Move most binaries into magisk.img (Samsung cannot run su daemon in /data).
  • [General] Move sepolicy live patch to late_start service This shall fix the long boot times, especially on Samsung devices
  • [General] Add Samsung RKP hexpatch back, should now work on Samsung stock kernels.
  • [General] Fix installation with SuperSU.
  • [MagiskHide] Support other logcat am_proc_start patterns.
  • [MagiskHide] Change /sys/fs/selinux/enforce(policy) permissions if required Samsung devices cannot switch selinux states, if running on permissive custom kernel, the users will stuck at permissive If this scenario is detected, change permissions to hide the permissive state, leads to SafetyNet passes.
  • [MagiskHide] Add built in prop rules to fake KNOX status Samsung apps requiring KNOX status to be 0x0 should now work (Samsung Pay not tested).
  • [MagiskHide] Remove all ro.build props, since they cause more issues than they benefit…
  • [MagiskBoot] Add lz4 legacy format support (most linux kernel using lz4 for compression is using this).
  • [MagiskBoot] Fix MTK kernels with MTK headers.
Check out our Magisk forum!



from xda-developers http://ift.tt/2nIDvTo
via IFTTT

Magisk Receives an Update to v12, Fixes Samsung Bugs, Adds Core Only Mode, and More

It’s been close to two months since the last big stable update was released for Magisk, and the developer actually received a lot of complaints about that update. At the time, Magisk Manager was at version 4.25 and it had begun crashing on a lot of Samsung devices. The issue was so widespread on Samsung devices that XDA Recognized Developer topjohnwu reached out to the community to ask for help regarding the issue. Thanks to the community, the developer was able to figure out the issue and fixed it in some test builds.

Thus the big update here is that Samsung devices should no longer see Magisk crash on their devices like it did before, and they were even able to add in some Samsung specific features too. For example, version 12 of Magisk adds support for Samsung permissive kernels, and it will even fake KNOX to 0x0 if MagiskHide is enabled. topjohnwu also made some changes to the sepolicy live patcher, and has moved it from the post-fs-data mode to the service mode.

This change was mainly done for Samsung devices as well and requires 20-80KB of ramdisk size (where it was previously 1-4KB), but that still isn’t very large. Another big addition here is choice of setting Magisk to More Only Mode. This was added to address the complaints about Magisk having too many features. It can be enabled in Magisk Manager and will limit the modification to root + boot scripts, as well as MagiskHide.

Here’s a summary of the more important changes listed below, but you can find the full change-log here.

  • [General] Move most binaries into magisk.img (Samsung cannot run su daemon in /data).
  • [General] Move sepolicy live patch to late_start service This shall fix the long boot times, especially on Samsung devices
  • [General] Add Samsung RKP hexpatch back, should now work on Samsung stock kernels.
  • [General] Fix installation with SuperSU.
  • [MagiskHide] Support other logcat am_proc_start patterns.
  • [MagiskHide] Change /sys/fs/selinux/enforce(policy) permissions if required Samsung devices cannot switch selinux states, if running on permissive custom kernel, the users will stuck at permissive If this scenario is detected, change permissions to hide the permissive state, leads to SafetyNet passes.
  • [MagiskHide] Add built in prop rules to fake KNOX status Samsung apps requiring KNOX status to be 0x0 should now work (Samsung Pay not tested).
  • [MagiskHide] Remove all ro.build props, since they cause more issues than they benefit…
  • [MagiskBoot] Add lz4 legacy format support (most linux kernel using lz4 for compression is using this).
  • [MagiskBoot] Fix MTK kernels with MTK headers.
Check out our Magisk forum!



from xda-developers http://ift.tt/2nIDvTo
via IFTTT

Guide to Build Your Own Custom Kernel for ARM Smartphones

XDA Senior Member 3lambda has posted a noob friendly guide on building your own custom kernel for ARM devices.



from xda-developers http://ift.tt/2ok2UEu
via IFTTT

Guide to Build Your Own Custom Kernel for ARM Smartphones

XDA Senior Member 3lambda has posted a noob friendly guide on building your own custom kernel for ARM devices.



from xda-developers http://ift.tt/2ok2UEu
via IFTTT

Easy Android Signer Tool for Windows Brings Single and Batch Signing with v1 and v2 Signing Scheme Support

Easy Android Signer allows you to zipalign, sign and verify multiple APK files in one step. This tool for Windows supports v1 and v2 signing schemes, support for multiple signatures for one apk as well as batch signing.



from xda-developers http://ift.tt/2oqj3Fb
via IFTTT

Easy Android Signer Tool for Windows Brings Single and Batch Signing with v1 and v2 Signing Scheme Support

Easy Android Signer allows you to zipalign, sign and verify multiple APK files in one step. This tool for Windows supports v1 and v2 signing schemes, support for multiple signatures for one apk as well as batch signing.



from xda-developers http://ift.tt/2oqj3Fb
via IFTTT

TWRP v3.1.0 Unofficially Released for the Galaxy Tab S3

It hasn’t been long since the Samsung Galaxy Tab S3 was announced, but we now have a build of TWRP v3.1.0 released unofficially by XDA Recognized Contributor ashyx. The build works for both the SM-T820 and SM-T825 models running on the Qualcomm MSM8966 SoC.



from xda-developers http://ift.tt/2nnHmSo
via IFTTT

TWRP v3.1.0 Unofficially Released for the Galaxy Tab S3

It hasn't been long since the Samsung Galaxy Tab S3 was announced, but we now have a build of TWRP v3.1.0 released unofficially by XDA Recognized Contributor ashyx. The build works for both the SM-T820 and SM-T825 models running on the Qualcomm MSM8966 SoC.



from xda-developers http://ift.tt/2nnHmSo
via IFTTT

Get the Galaxy S8’s Updated Launcher on the Galaxy S7 running Nougat

Samsung officially unveiled the Galaxy S8 to the public 2 days ago, and with the new phone came new Samsung apps. If you’re looking to try out the newest version of the Samsung Experience Launcher, then check out this thread by XDA Senior Member takerhbk. This app can be installed on Samsung devices running official Nougat builds, but your mileage may vary in whether or not it functions properly.



from xda-developers http://ift.tt/2oHJmpF
via IFTTT

Get the Galaxy S8’s Updated Launcher on the Galaxy S7 running Nougat

Samsung officially unveiled the Galaxy S8 to the public 2 days ago, and with the new phone came new Samsung apps. If you're looking to try out the newest version of the Samsung Experience Launcher, then check out this thread by XDA Senior Member takerhbk. This app can be installed on Samsung devices running official Nougat builds, but your mileage may vary in whether or not it functions properly.



from xda-developers http://ift.tt/2oHJmpF
via IFTTT

How to Add Custom Icons to the Navigation Bar in Android O

If you’ve been following our coverage of Android O, then you might have seen our tutorials on how to modify the navigation bar to toggle picture-in-picture mode, enable media control keys while playing music, and today how to add forward/previous buttons to quickly browse through your e-mails. The possible uses of a customizable navigation bar are huge, and our first three tutorials only scrape the surface. But while we do have a couple of more useful tutorials to share with our readers, there’s one thing we had to cover before we can move on to our next tutorials: how to add custom icons to the navigation bar keys in Android O.

Android O’s new navigation bar customizer, accessible through SystemUI Tuner, allows you to set a keycode to a navigation key. (Reminder: in order to access SystemUI Tuner, you have to pull down the status bar and long-press on the gear icon in the top right until you see a toast message telling you that SystemUI Tuner is now accessible.) Because there are so many keycodes, Android O does not offer an icon for each keycode you can place on the nav bar, but instead allows you to select from 6 icons: circle, plus, minus, left, right, and menu.

Since we figured out how to manually set keycodes from shell commands, we also wanted to figure out what icon possibilities were available. We first discovered that the two navigation bar keys are defined as two system properties under the Settings.Secure class. These two properties are named sysui_nav_bar_left and sysui_nav_bar_right, corresponding to the left nav bar key and the right nav bar key respectively. The properties take a string value, one of either clipboard, menu_ime, or key(KEYCODE_KEY:ICON_RESOURCE).

Using a test Google Pixel device running the Android O Developer Preview, we discovered that the 6 icons shown by default correspond to particular content resources contained in the SystemUI, represented by a URI.

  1. com.android.systemui/2131230944 (circle)
  2. com.android.systemui/2131230848 (plus)
  3. com.android.systemui/2131231002 (minus)
  4. com.android.systemui/2131230907 (left)
  5. com.android.systemui/2131231004 (right)
  6. com.android.systemui/2131230913 (menu)

Since these values were pulled from the Google Pixel, it’s possible that these icon resources won’t be the same on other Google devices running the Android O Developer Preview. But since the icon resource is a content URI, we are able to replace this with a file URI scheme to point to any icon stored on our device.

How to set Custom Nav Bar Icons in Android O

A file URI looks like the following:

file:///storage/emulated/0/PATH/TO/FILE

Combining this with our knowledge of setting custom keycodes above, we can now set any arbitrary image as our icon to be shown in the nav bar. For instance, if I want to set my left navigation bar key to KEYCODE_DPAD_DOWN (#20) with a custom down arrow icon saved as down.png and my right navigation bar key to KEYCODE_DPAD_UP (#19) with a custom up arrow icon saved as up.png, both icons stored on the root of my internal storage, my commands would look like these:

settings put secure sysui_nav_bar_left key(20:file:///storage/emulated/0/down.png)
settings put secure sysui_nav_bar_right key(19:file:///storage/emulated/0/up.png)

You can enter these commands using either an ADB shell or by granting the WRITE_SECURE_SETTINGS permission to SecureTask and then using Tasker to trigger nav bar changes based on certain conditions, as I’ve outlined in my previous tutorials (and will also showcase in another tutorial).

How to get Custom Icons for your Nav Bar

Of course, given the size of your nav bar, you can’t just place any image you download off of the Internet. The image needs to be the right size, otherwise it will either appear too small or most likely appear way too blown up. Getting your own image in the proper size can be a challenge if you don’t already have experience with PhotoShop or other image manipulation software, but luckily there are websites out there that offer many free icons that we can use.

The first thing you’ll need to do is determine your device’s display metrics, which is something you may already know, but in case you don’t, you can look it up on Material.io. Next, you’ll need to correlate your display density with an icon reference chart to determine what size icons you’ll need. Finally, use the free icons database to download the icon you’re looking for in the right size.

Make sure you save the icons you’ll be using in a particular folder such as /NavIcons, and name the icons something simple you can easily reference in your commands.


We hope you find this tutorial useful! For me, personally, one of my major qualms with the navigation bar customizer was the inability to select custom icons for nav keys so I would always immediately know what my nav keys are doing. But now that we’ve figured out how to place our own custom keys and custom icons on our own conditions, we can start making some real use out of our navigation bar.



from xda-developers http://ift.tt/2nr3iN9
via IFTTT

How to Add Custom Icons to the Navigation Bar in Android O

If you've been following our coverage of Android O, then you might have seen our tutorials on how to modify the navigation bar to toggle picture-in-picture mode, enable media control keys while playing music, and today how to add forward/previous buttons to quickly browse through your e-mails. The possible uses of a customizable navigation bar are huge, and our first three tutorials only scrape the surface. But while we do have a couple of more useful tutorials to share with our readers, there's one thing we had to cover before we can move on to our next tutorials: how to add custom icons to the navigation bar keys in Android O.

Android O's new navigation bar customizer, accessible through SystemUI Tuner, allows you to set a keycode to a navigation key. (Reminder: in order to access SystemUI Tuner, you have to pull down the status bar and long-press on the gear icon in the top right until you see a toast message telling you that SystemUI Tuner is now accessible.) Because there are so many keycodes, Android O does not offer an icon for each keycode you can place on the nav bar, but instead allows you to select from 6 icons: circle, plus, minus, left, right, and menu.

Since we figured out how to manually set keycodes from shell commands, we also wanted to figure out what icon possibilities were available. We first discovered that the two navigation bar keys are defined as two system properties under the Settings.Secure class. These two properties are named sysui_nav_bar_left and sysui_nav_bar_right, corresponding to the left nav bar key and the right nav bar key respectively. The properties take a string value, one of either clipboard, menu_ime, or key(KEYCODE_KEY:ICON_RESOURCE).

Using a test Google Pixel device running the Android O Developer Preview, we discovered that the 6 icons shown by default correspond to particular content resources contained in the SystemUI, represented by a URI.

  1. com.android.systemui/2131230944 (circle)
  2. com.android.systemui/2131230848 (plus)
  3. com.android.systemui/2131231002 (minus)
  4. com.android.systemui/2131230907 (left)
  5. com.android.systemui/2131231004 (right)
  6. com.android.systemui/2131230913 (menu)

Since these values were pulled from the Google Pixel, it's possible that these icon resources won't be the same on other Google devices running the Android O Developer Preview. But since the icon resource is a content URI, we are able to replace this with a file URI scheme to point to any icon stored on our device.

How to set Custom Nav Bar Icons in Android O

A file URI looks like the following:

  file:///storage/emulated/0/PATH/TO/FILE  

Combining this with our knowledge of setting custom keycodes above, we can now set any arbitrary image as our icon to be shown in the nav bar. For instance, if I want to set my left navigation bar key to KEYCODE_DPAD_DOWN (#20) with a custom down arrow icon saved as down.png and my right navigation bar key to KEYCODE_DPAD_UP (#19) with a custom up arrow icon saved as up.png, both icons stored on the root of my internal storage, my commands would look like these:

  settings put secure sysui_nav_bar_left key(20:file:///storage/emulated/0/down.png)  settings put secure sysui_nav_bar_right key(19:file:///storage/emulated/0/up.png)  

You can enter these commands using either an ADB shell or by granting the WRITE_SECURE_SETTINGS permission to SecureTask and then using Tasker to trigger nav bar changes based on certain conditions, as I've outlined in my previous tutorials (and will also showcase in another tutorial).

How to get Custom Icons for your Nav Bar

Of course, given the size of your nav bar, you can't just place any image you download off of the Internet. The image needs to be the right size, otherwise it will either appear too small or most likely appear way too blown up. Getting your own image in the proper size can be a challenge if you don't already have experience with PhotoShop or other image manipulation software, but luckily there are websites out there that offer many free icons that we can use.

The first thing you'll need to do is determine your device's display metrics, which is something you may already know, but in case you don't, you can look it up on Material.io. Next, you'll need to correlate your display density with an icon reference chart to determine what size icons you'll need. Finally, use the free icons database to download the icon you're looking for in the right size.

Make sure you save the icons you'll be using in a particular folder such as /NavIcons, and name the icons something simple you can easily reference in your commands.


We hope you find this tutorial useful! For me, personally, one of my major qualms with the navigation bar customizer was the inability to select custom icons for nav keys so I would always immediately know what my nav keys are doing. But now that we've figured out how to place our own custom keys and custom icons on our own conditions, we can start making some real use out of our navigation bar.



from xda-developers http://ift.tt/2nr3iN9
via IFTTT

Today Weather, with its Dark Theme, is Perfect for AMOLED

We love seeing apps come from the apps and games XDA community. This app is called Today Weather and it’s one of the best free weather app you’ll find on the Play store plus it looks fantastic on AMOLED displays thanks to its blacked-out look. Check out this video and download it for yourself for free.

Track multiple cities at once, each one with a unique photograph.

Beautiful high quality images makes this app unique from your average forecast apps.

Never miss the sunset or sunrise. Today Weather will always tell you exactly when the sun comes up and goes down.

Your weekly forecast is shown with awesome animated icons.

Get more information on one screen with a compact and easy to read sign.

Detailed notifications give you way more information so you don’t have to launch the full app.

Today Weather is giving away 50 ad-free vouchers to the first 50 people that comment on YouTube. Good Luck!

Play store linkXDA Thread

We thank TodayWeather.co for sponsoring this post. Our sponsors help us pay for the many costs associated with running XDA, including server costs, full time developers, news writers, and much more. While you might see sponsored content (which will always be labeled as such) alongside Portal content, the Portal team is in no way responsible for these posts. Sponsored content, advertising and XDA Depot are managed by a separate team entirely. XDA will never compromise its journalistic integrity by accepting money to write favorably about a company, or alter our opinions or views in any way. Our opinion cannot be bought.



from xda-developers http://ift.tt/2ojjHYp
via IFTTT

Today Weather, with its Dark Theme, is Perfect for AMOLED

We love seeing apps come from the apps and games XDA community. This app is called Today Weather and it's one of the best free weather app you'll find on the Play store plus it looks fantastic on AMOLED displays thanks to its blacked-out look. Check out this video and download it for yourself for free.

Track multiple cities at once, each one with a unique photograph.

Beautiful high quality images makes this app unique from your average forecast apps.

Never miss the sunset or sunrise. Today Weather will always tell you exactly when the sun comes up and goes down.

Your weekly forecast is shown with awesome animated icons.

Get more information on one screen with a compact and easy to read sign.

Detailed notifications give you way more information so you don't have to launch the full app.

Today Weather is giving away 50 ad-free vouchers to the first 50 people that comment on YouTube. Good Luck!

Play store linkXDA Thread

We thank TodayWeather.co for sponsoring this post. Our sponsors help us pay for the many costs associated with running XDA, including server costs, full time developers, news writers, and much more. While you might see sponsored content (which will always be labeled as such) alongside Portal content, the Portal team is in no way responsible for these posts. Sponsored content, advertising and XDA Depot are managed by a separate team entirely. XDA will never compromise its journalistic integrity by accepting money to write favorably about a company, or alter our opinions or views in any way. Our opinion cannot be bought.



from xda-developers http://ift.tt/2ojjHYp
via IFTTT

OxygenOS Open Beta 13 for OnePlus 3 and Open Beta 4 for OnePlus 3T Released

OnePlus has released a new Open Beta for the OnePlus 3 and OnePlus 3T, and no, it is not April just yet so we know this is for real. This Open Beta is numbered 13 for the OnePlus 3 and 4 for the OnePlus 3T, although the changelog for both the devices is the same. The download links are different, though, so it's a good idea to download the correct build for your device.

OnePlus details the following changelog:

  • All new launcher, added support for shortcuts on 7.1.1
  • Redesigned app drawer
  • Redesigned UI for launcher settings – Simplified the Settings options and added another gesture to get to them quickly, a pinch motion from the homepage of your launcher.
  • Added status bar icon option to display real time network speed
  • Added Notification Denoising – This is to allow priority levels to be assigned to peek notifications and will let you grant only the most important apps and their notifications the ability to interrupt you. This feature can be found under Settings>Device>Notifications
  • Added Gaming Do Not Disturb mode – This allows you to lock the capacitive and home buttons while gaming or in other apps where it's easy to hit those buttons buttons unintentionally. This feature can be found in Settings>Advanced>Gaming Mode
  • Added automatic Night Mode – You are now able to set Night Mode to activate and deactivate at a certain time or according to a specific cycle of day and night. This can be found under settings>Display>Night Mode
  • Added Secure Box for file encryption – This is for all files (including pictures and video) that should not be easily accessible to other people. It can be set up with its own pin, and once items are moved (by long pressing and selecting "set as secure" in the settings option) they can only be viewed in the secure box portion of the file manager. This can be found under Apps>File Manager>Secure Box
  • Optimized touch latency
  • Optimized camera EIS for videos
  • Improved contacts management with linking and merge functions
  • Added quick pay option for India – This will allow users to set up a QR-based quick pay feature that can be quickly accessed while the screen is either on or off with a long press of the home button. This will only activate right now if one of the following apps is installed: Paytm, Wechat, or Alipay. This can be found in Settings>Security & Fingerprint>Quick Pay
  • Bug fixes and general improvements

Some of these fixes and improvements are self-explanatory, and OnePlus has added more information to the ones which are not. Of particular interest is the claimed improvements to touch latency and Camera EIS for video — we'll have to see how much of an improvement we're talking here.

To try it out, download Open Beta 13 for OnePlus 3 and Open Beta 4 for OnePlus 3T. Users who are already on the Open Beta branch will receive this update as an OTA. Do note that moving back to the Stable branch from Open Beta will involve a full clean flash.

The changes that I am excited about is the Gaming DND mode and Quick Pay option. Quick Pay is interesting as I have started moving towards PayTM for payments throughout the day. PayTM is much less of a hassle than haggling for exact change and often quicker and more popular than card terminals with small vendors.

What are your thoughts on the new Open Beta? Which feature are you looking forward to? Let us know your thoughts in the comments below!

Source 1: OnePlus 3 Forums Source 2: OnePlus 3T Forums



from xda-developers http://ift.tt/2ohjm7P
via IFTTT

OxygenOS Open Beta 13 for OnePlus 3 and Open Beta 4 for OnePlus 3T Released

OnePlus has released a new Open Beta for the OnePlus 3 and OnePlus 3T, and no, it is not April just yet so we know this is for real. This Open Beta is numbered 13 for the OnePlus 3 and 4 for the OnePlus 3T, although the changelog for both the devices is the same. The download links are different, though, so it’s a good idea to download the correct build for your device.

OnePlus details the following changelog:

  • All new launcher, added support for shortcuts on 7.1.1
  • Redesigned app drawer
  • Redesigned UI for launcher settings – Simplified the Settings options and added another gesture to get to them quickly, a pinch motion from the homepage of your launcher.
  • Added status bar icon option to display real time network speed
  • Added Notification Denoising – This is to allow priority levels to be assigned to peek notifications and will let you grant only the most important apps and their notifications the ability to interrupt you. This feature can be found under Settings>Device>Notifications
  • Added Gaming Do Not Disturb mode – This allows you to lock the capacitive and home buttons while gaming or in other apps where it’s easy to hit those buttons buttons unintentionally. This feature can be found in Settings>Advanced>Gaming Mode
  • Added automatic Night Mode – You are now able to set Night Mode to activate and deactivate at a certain time or according to a specific cycle of day and night. This can be found under settings>Display>Night Mode
  • Added Secure Box for file encryption – This is for all files (including pictures and video) that should not be easily accessible to other people. It can be set up with its own pin, and once items are moved (by long pressing and selecting “set as secure” in the settings option) they can only be viewed in the secure box portion of the file manager. This can be found under Apps>File Manager>Secure Box
  • Optimized touch latency
  • Optimized camera EIS for videos
  • Improved contacts management with linking and merge functions
  • Added quick pay option for India – This will allow users to set up a QR-based quick pay feature that can be quickly accessed while the screen is either on or off with a long press of the home button. This will only activate right now if one of the following apps is installed: Paytm, Wechat, or Alipay. This can be found in Settings>Security & Fingerprint>Quick Pay
  • Bug fixes and general improvements

Some of these fixes and improvements are self-explanatory, and OnePlus has added more information to the ones which are not. Of particular interest is the claimed improvements to touch latency and Camera EIS for video — we’ll have to see how much of an improvement we’re talking here.

To try it out, download Open Beta 13 for OnePlus 3 and Open Beta 4 for OnePlus 3T. Users who are already on the Open Beta branch will receive this update as an OTA. Do note that moving back to the Stable branch from Open Beta will involve a full clean flash.

The changes that I am excited about is the Gaming DND mode and Quick Pay option. Quick Pay is interesting as I have started moving towards PayTM for payments throughout the day. PayTM is much less of a hassle than haggling for exact change and often quicker and more popular than card terminals with small vendors.

What are your thoughts on the new Open Beta? Which feature are you looking forward to? Let us know your thoughts in the comments below!

Source 1: OnePlus 3 Forums Source 2: OnePlus 3T Forums



from xda-developers http://ift.tt/2ohjm7P
via IFTTT

New Tools Make it Easier to Build Games with Actions on Google

Google Now has been the company's predictive assistant for years now, but they didn't turn it into a commercial product until last year with Google Home. This is being powered by Google Assistant, and it is Google's answer to Amazon's Echo devices that have become quite popular since their launch. Having a product in the same market is one thing, but the success of Google Home and Google Assistant will rely on 3rd-party developer support.

Amazon recently announced Alexa has over 10,000 skills, which are aided by the wide number of 3rd-party developers who are supporting the platform. The company has even gone as far as to offer free AWS services to developers who create new skills. It's clear that Google has a long way to go in order to catch up here, but Google Home and Google Assistant does offer some important features that Amazon Alexa has yet to leverage.

We recently talked about how Google Home will now defer to Google Assistant for tasks such as making a phone call, sending a text message, and setting a reminder. This is a great step in the right direction and we hope to see some additional news about Google Home and Google Assistant at I/O 2017 in May. This week though, Google announced they're offering some tools for developers who want to create more immersive games using the platform.

The first tool here is a brand new sound effect library that should help to make your game more engaging. The second tool that Google announced was a guide on how to bring text adventures to the platform. With many of them being public domain now, Google is encouraging developers to re-introduce these classics to Google Assistant users on Google Home. Lastly, Google just announced an expanded list of tool and consultant companies who have integrated their development solutions with Actions on Google.

These collaborators are there to help you bring your ideas to the platform.

Source: Google Developers Blog



from xda-developers http://ift.tt/2nr0M9N
via IFTTT

New Tools Make it Easier to Build Games with Actions on Google

Google Now has been the company’s predictive assistant for years now, but they didn’t turn it into a commercial product until last year with Google Home. This is being powered by Google Assistant, and it is Google’s answer to Amazon’s Echo devices that have become quite popular since their launch. Having a product in the same market is one thing, but the success of Google Home and Google Assistant will rely on 3rd-party developer support.

Amazon recently announced Alexa has over 10,000 skills, which are aided by the wide number of 3rd-party developers who are supporting the platform. The company has even gone as far as to offer free AWS services to developers who create new skills. It’s clear that Google has a long way to go in order to catch up here, but Google Home and Google Assistant does offer some important features that Amazon Alexa has yet to leverage.

We recently talked about how Google Home will now defer to Google Assistant for tasks such as making a phone call, sending a text message, and setting a reminder. This is a great step in the right direction and we hope to see some additional news about Google Home and Google Assistant at I/O 2017 in May. This week though, Google announced they’re offering some tools for developers who want to create more immersive games using the platform.

The first tool here is a brand new sound effect library that should help to make your game more engaging. The second tool that Google announced was a guide on how to bring text adventures to the platform. With many of them being public domain now, Google is encouraging developers to re-introduce these classics to Google Assistant users on Google Home. Lastly, Google just announced an expanded list of tool and consultant companies who have integrated their development solutions with Actions on Google.

These collaborators are there to help you bring your ideas to the platform.

Source: Google Developers Blog



from xda-developers http://ift.tt/2nr0M9N
via IFTTT

Google I/O 2017 Agenda Page Updated with Scheduled Sessions

A little more than a month ago Google started taking applications for those who wanted to attend their Google I/O developer conference this year. It took less than a week for the company to start sending out confirmation emails to the first batch of lucky applicants who were selected to attend the event. Tickets are currently priced at $1150 for general attendees, and $375 for students, but you can only go if you are selected and receive an email from Google.

Until now, we didn't truly know what was going to be talked about at Google I/O 2017. We can assume there will be some talks about Android O, Android Wear 2.0 and possibly Android Auto. But there hadn't been any formal announcement as to what will be talked about at the event in May. That changed yesterday when Google finally posted the first batch of sessions that are currently scheduled for Google I/O 2017. This takes place from May 17th through to May 19th, and Google has an Agenda website up for you to pick out the sessions you want to be part of.

The big draw here will be the keynote, which will likely be given by the CEO of Google Sundar Pichai again. And we're told that this keynote address will be a full 2 hours long. Throughout the first day, talks will be given about Firebase, Google IoT platform, what is new in Android, the mobile web, the newest additions to Android's accessibility features, and the latest changes to ads on the mobile platform. This is just a taste of what is going on as talks will continue all the way until 7PM that night.

On days 2 and 3, talks will begin at 8:30AM and will continue on until 6:30PM and 3:30PM respectively. This will include more sessions about Firebase, mobile ads, the mobile web,  accessibility, Google Assistant, Android and more. Google also reminds us that this schedule will be regularly updated until Google I/O 2017 takes place, so be sure to visit it regularly to see if any talks have been moved or added.

Source: Google I/O 2017



from xda-developers http://ift.tt/2nHn7CA
via IFTTT

Google I/O 2017 Agenda Page Updated with Scheduled Sessions

A little more than a month ago Google started taking applications for those who wanted to attend their Google I/O developer conference this year. It took less than a week for the company to start sending out confirmation emails to the first batch of lucky applicants who were selected to attend the event. Tickets are currently priced at $1150 for general attendees, and $375 for students, but you can only go if you are selected and receive an email from Google.

Until now, we didn’t truly know what was going to be talked about at Google I/O 2017. We can assume there will be some talks about Android O, Android Wear 2.0 and possibly Android Auto. But there hadn’t been any formal announcement as to what will be talked about at the event in May. That changed yesterday when Google finally posted the first batch of sessions that are currently scheduled for Google I/O 2017. This takes place from May 17th through to May 19th, and Google has an Agenda website up for you to pick out the sessions you want to be part of.

The big draw here will be the keynote, which will likely be given by the CEO of Google Sundar Pichai again. And we’re told that this keynote address will be a full 2 hours long. Throughout the first day, talks will be given about Firebase, Google IoT platform, what is new in Android, the mobile web, the newest additions to Android’s accessibility features, and the latest changes to ads on the mobile platform. This is just a taste of what is going on as talks will continue all the way until 7PM that night.

On days 2 and 3, talks will begin at 8:30AM and will continue on until 6:30PM and 3:30PM respectively. This will include more sessions about Firebase, mobile ads, the mobile web,  accessibility, Google Assistant, Android and more. Google also reminds us that this schedule will be regularly updated until Google I/O 2017 takes place, so be sure to visit it regularly to see if any talks have been moved or added.

Source: Google I/O 2017



from xda-developers http://ift.tt/2nHn7CA
via IFTTT

How to Add Forward/Backward Keys to Android O’s Nav Bar to Quickly Read Emails

If your time spent on your smartphone consists of going through a ton of e-mails, then you may find it annoying to accidentally switch messages when you're trying to see your entire e-mail message. Thanks to the new navigation bar customizer in Android O, we can add new keys to the navigation bar to perform custom actions. In this case, we'll be adding two new keys to the navigation bar that will move forward/backward in your e-mail list whenever we are using the Gmail app.

Thanks to Eli Irvin for (again) testing this out for me, and capturing the above screen recording.

If you've been following our previous Android O tutorials, then you'll know how we'll be tackling this problem. This tutorial is fairly similar to our picture-in-picture button tutorial, so if you've read through that then this one should be a breeze.


Add Forward/Backward Keys to Nav Bar while in Gmail

Requirements:

Tasker is necessary because it is the automation app we're using to detect what application we're in and send commands through the SecureTask plug-in, which is what will handle changing our navigation bar. Once you've installed both applications, we need to set both of them up.

In order for Tasker to detect what application we're in, we need to grant its Accessibility Service. Doing so is very quick, simply go to Settings –> Accessibility and look for "Tasker" on the list of Services. Enable the Accessibility Service.

Next, we need to grant SecureTask the ability to modify system settings on our device. In order to do so, we have to grant SecureTask a special permission known as WRITE_SECURE_SETTINGS which is normally inaccessible to regular applications, but can be granted manually by a user through the use of ADB. Thus, you'll need to have ADB up and running on your machine to get this working. Fortunately, granting this permission is only a one-time thing, and we'll be using SecureTask in future Android O-related tutorials (of which there are a couple more), so it's definitely worth doing it.

Setting up ADB

The first thing you'll need to do is download the ADB binary for your particular OS. You can do so here. Once you've downloaded them, you need to then make sure you have the proper driver if you're on Windows.

Once you've extracted the binary to a separate folder and have installed the driver, we need to next enable USB Debugging on the smartphone. In order to do so, open up Settings and go to About Phone. Tap on Build Number 7 times until you get a dialog telling you that you've unlocked Developer Options. You can access Developer Options in Settings now. Apparently in Android O, you have to enter your pin/password before you can open Developer Options. Do so and look for USB Debugging, then enable it.

Now plug in your phone and open up a command prompt in the same directory where you extracted the ADB binary. (Windows users, hold shift+right-click in that folder and select "open command prompt here.") Type adb devices into the command prompt. You'll see a message that the ADB server is being started, then on your phone you'll see a prompt asking you to grant your computer ADB access. Accept it. Now when you enter adb devices into the command prompt, you should see your device's serial number, if so then you were successful.

Granting WRITE_SECURE_SETTINGS to SecureTask

With an ADB command prompt opened up, enter the following command to grant SecureTask the requisite permission.

  adb shell pm grant com.balda.securetask android.permission.WRITE_SECURE_SETTINGS  

SecureTask will now have the ability to modify system settings without root access! Now we're ready to move on to Tasker.

Setting up the Tasker Profile

Open up Tasker and create a new Profile. Name it "Gmail Scroll Keys." Select the Application Context, and look for the e-mail app you want to enable the navigation bar keys in (eg. Gmail). Select the app(s) that you want, then back out to next create a Task.

Tasker will ask you to attach a Task to this new Profile. Create a new Task when asked, and name it (or don't). We will create two Actions in this Entry Task, as follows:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: key(21:com.android.systemui/2131230907)
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: key(22:com.android.systemui/2131231004)

That's it for the Entry Task (the one that runs when you enter the e-mail app), now we need to add an Exit Task to disable the two keys when we leave the e-mail app. Create an Exit Task by long-pressing on the Entry Task and selecting the "add exit task" option when it pops-up. We will also create two Actions in this Task, as follows:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: null
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: null

That's it! Now when you enter the Gmail app (or whatever other e-mail app you've chosen), you'll now see the two navigation bar keys to allow you to move forwards or backwards in your e-mail list.


Download and Import

As with all Tasker related tutorials, we will be providing the XML file you can download and import. Download the prf.xml file from AndroidFileHost below and save it to your internal storage. Open up Tasker and long-press on the Profiles tab up top until you see an Import button. Tap on that and look for the XML file you just saved, then select it to import it. Make sure you have Tasker's Accessibility Service enabled and have granted the WRITE_SECURE_SETTINGS to SecureTask as mentioned in my article, otherwise this Profile will not do anything on your phone!

Download the "Gmail Scroll Keys" Profile from AndroidFileHost

If you're wondering what else we can accomplish with SecureTask and Android O, stay tuned to the XDA Portal because we have more to share. Expect more tutorials on how you can make your navigation bar in Android O accomplish many useful functions!



from xda-developers http://ift.tt/2ohc04v
via IFTTT

How to Add Forward/Backward Keys to Android O’s Nav Bar to Quickly Read Emails

If your time spent on your smartphone consists of going through a ton of e-mails, then you may find it annoying to accidentally switch messages when you’re trying to see your entire e-mail message. Thanks to the new navigation bar customizer in Android O, we can add new keys to the navigation bar to perform custom actions. In this case, we’ll be adding two new keys to the navigation bar that will move forward/backward in your e-mail list whenever we are using the Gmail app.

Thanks to Eli Irvin for (again) testing this out for me, and capturing the above screen recording.

If you’ve been following our previous Android O tutorials, then you’ll know how we’ll be tackling this problem. This tutorial is fairly similar to our picture-in-picture button tutorial, so if you’ve read through that then this one should be a breeze.


Add Forward/Backward Keys to Nav Bar while in Gmail

Requirements:

Tasker is necessary because it is the automation app we’re using to detect what application we’re in and send commands through the SecureTask plug-in, which is what will handle changing our navigation bar. Once you’ve installed both applications, we need to set both of them up.

In order for Tasker to detect what application we’re in, we need to grant its Accessibility Service. Doing so is very quick, simply go to Settings –> Accessibility and look for “Tasker” on the list of Services. Enable the Accessibility Service.

Next, we need to grant SecureTask the ability to modify system settings on our device. In order to do so, we have to grant SecureTask a special permission known as WRITE_SECURE_SETTINGS which is normally inaccessible to regular applications, but can be granted manually by a user through the use of ADB. Thus, you’ll need to have ADB up and running on your machine to get this working. Fortunately, granting this permission is only a one-time thing, and we’ll be using SecureTask in future Android O-related tutorials (of which there are a couple more), so it’s definitely worth doing it.

Setting up ADB

The first thing you’ll need to do is download the ADB binary for your particular OS. You can do so here. Once you’ve downloaded them, you need to then make sure you have the proper driver if you’re on Windows.

Once you’ve extracted the binary to a separate folder and have installed the driver, we need to next enable USB Debugging on the smartphone. In order to do so, open up Settings and go to About Phone. Tap on Build Number 7 times until you get a dialog telling you that you’ve unlocked Developer Options. You can access Developer Options in Settings now. Apparently in Android O, you have to enter your pin/password before you can open Developer Options. Do so and look for USB Debugging, then enable it.

Now plug in your phone and open up a command prompt in the same directory where you extracted the ADB binary. (Windows users, hold shift+right-click in that folder and select “open command prompt here.”) Type adb devices into the command prompt. You’ll see a message that the ADB server is being started, then on your phone you’ll see a prompt asking you to grant your computer ADB access. Accept it. Now when you enter adb devices into the command prompt, you should see your device’s serial number, if so then you were successful.

Granting WRITE_SECURE_SETTINGS to SecureTask

With an ADB command prompt opened up, enter the following command to grant SecureTask the requisite permission.

adb shell pm grant com.balda.securetask android.permission.WRITE_SECURE_SETTINGS

SecureTask will now have the ability to modify system settings without root access! Now we’re ready to move on to Tasker.

Setting up the Tasker Profile

Open up Tasker and create a new Profile. Name it “Gmail Scroll Keys.” Select the Application Context, and look for the e-mail app you want to enable the navigation bar keys in (eg. Gmail). Select the app(s) that you want, then back out to next create a Task.

Tasker will ask you to attach a Task to this new Profile. Create a new Task when asked, and name it (or don’t). We will create two Actions in this Entry Task, as follows:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: key(21:com.android.systemui/2131230907)
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: key(22:com.android.systemui/2131231004)

That’s it for the Entry Task (the one that runs when you enter the e-mail app), now we need to add an Exit Task to disable the two keys when we leave the e-mail app. Create an Exit Task by long-pressing on the Entry Task and selecting the “add exit task” option when it pops-up. We will also create two Actions in this Task, as follows:

  1. A1: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_left. Value: null
  2. A2: Plugin –> SecureTask –> Secure Settings. Action: Write. Setting: secure sysui_nav_bar_right. Value: null

That’s it! Now when you enter the Gmail app (or whatever other e-mail app you’ve chosen), you’ll now see the two navigation bar keys to allow you to move forwards or backwards in your e-mail list.


Download and Import

As with all Tasker related tutorials, we will be providing the XML file you can download and import. Download the prf.xml file from AndroidFileHost below and save it to your internal storage. Open up Tasker and long-press on the Profiles tab up top until you see an Import button. Tap on that and look for the XML file you just saved, then select it to import it. Make sure you have Tasker’s Accessibility Service enabled and have granted the WRITE_SECURE_SETTINGS to SecureTask as mentioned in my article, otherwise this Profile will not do anything on your phone!

Download the “Gmail Scroll Keys” Profile from AndroidFileHost

If you’re wondering what else we can accomplish with SecureTask and Android O, stay tuned to the XDA Portal because we have more to share. Expect more tutorials on how you can make your navigation bar in Android O accomplish many useful functions!



from xda-developers http://ift.tt/2ohc04v
via IFTTT