10

I can't figure out a usable way of scrolling page by page. I'm using Android 4.1 (stock Android from Google). I have root access if needed. I want this especially in the default browser, but a solution that works in all applications would be better.

I've found three ways to scroll down by one page.

  • Set my finger down at the bottom of the page, drag it to the top in a vertical line, raise my finger. This is clumsy because it requires a long finger gesture.
  • A flicking motion in the up direction. This is clumsy because it requires flicking by the exact amount, otherwise the text scrolls by more or less than one page. I just can't manage that much precision.
  • A sufficiently forceful flicking motion, then set my finger down when the text has reached the point where I want it to be. This requires more finger strength than I would like and a lot of visual concentration; my finger-eye coordination is nowhere near enough to succeed with reasonably high probability.

Given how common the “page down” task is, there must be a better way that I'm missing. What is it?

  • Something that "works in all applications" will almost certainly be impossible. Unlike desktop apps, which generally tap into a standard UI framework that can handle HID pageup/down events, Android apps can be developed with custom UI setups, and I don't even think that there is a pageup/down event in Android (I could definitely be wrong there). However, this is a really interesting question. I bet there are some browsers or browser addons that can give you this functionality, and I'd also love to know if Chrome or the stock browser can do this. – dotVezz Nov 7 '13 at 22:22
  • 1
    Actually, I take my "will almost certainly be impossible" comment back. If you can spoof a touch event that swipes from bottom to top, that would work in almost any app. – dotVezz Nov 7 '13 at 22:24
  • You mean to scroll from top to bottom(and vice versa) of a page in single vertical scroll/swipe? – Lucky Aug 10 '15 at 18:14
  • @Lucky No, not from top to bottom. One screenful at a time. Like the PageUp/PageDown keys on a PC-style computer. And a swipe isn't a convenient UI, ideally this would be what the Volume Up/Down keys do in a text viewer such as a web browser. – Gilles Aug 10 '15 at 18:16
  • @Firelord I'm currently on Cyanogenmod 10 based on Android 4.3. Please make that an answer, this seems to be exactly what I want! – Gilles Aug 10 '15 at 21:31

10 Answers 10

4

You can use LMT Launcher's PIE navigation feature to achieve your objective. LMT wouldn't replace your current home launcher which means you can rest assured that your home screen would stay untouched.

Let's come to business. Here is the XDA thread about LMT Launcher. It's a freeware app and needs to be sideloaded into the system (not available on Play Store). Make sure that Unknown Sources is enabled before you try installing its APK.

It can be activated along the edges of the screen (I prefer at bottom) like this:

(Click image to enlarge; Source: Droid Life)

IMG:

This navigation is called PIE and each of the blue section is referred as a pie.

How does it help?

You can configure a pie to execute a script. The script would be nothing more than:

su; input touchscreen swipe X1 Y1 X2 Y2

where the X1, Y1 and X2, Y2 coordinates can be obtained from my answer here (see step 1 or step 2 under Instructions for Tasker and Xposed Additions there).

You can also configure a pie to execute a KeyEvent. The keycode for Page Up and Page Down are 92 and 93 respectively. See more keycodes here.

Usage Instructions

  1. Launch LMT launcher and activate it.
  2. Go to Pie → Pie Item 1 → Script and enter:

    su; input touchscreen swipe X1 Y1 X2 Y2
    

    Replace the coordinates with the one you produced as ideal to simulate Scroll Down.

  3. Configure another pie in the manner noted above but interchange the coordinates to X2 Y2 X1 Y1 to simulate Scroll Up.
  4. In place of Script you may select Key option and enter the keycode you want to be executed.
  5. Under Settings tab you can configure the settings of navigation system such as the place where you want the bar to show up, size of PIE's inner/outer radius, its color and so on.

(Click image to enlarge)

IMG: IMG: IMG: IMG:


I tested my solution successfully on CM12. Here is a short ripped video (~6MB) showing the answer in action.

  • This is an impressive answer. Could this be used to get Page Down to work properly android.stackexchange.com/questions/168500/… I'm not sure. – William Feb 5 '17 at 15:36
  • Sorry Liam, but I do not have an OTG cable or a bluetooth keyboard at my disposal to run tests. Have you tried my other solutions available on this very page? – Firelord Feb 5 '17 at 17:04
  • I'll mail you a bluetooth keyboard if you think you can get this to work. I have at least one extra one laying around. Alternatively you can even go into an Apple Store and reconfigure one of their bluetooth keyboards to work with your phone temporarily. – William Jun 15 '17 at 1:51
  • My apologies @William, as I'm nowdays short on time to do anything significant or useful for any Android related issue. However, I think I can offer my generosity through a bounty. Please send me a bounty note and all the details you would want in an answer and I will offer a bounty of +150, if that's okay with you. – Firelord Jun 15 '17 at 7:32
4

For the goal to be achieved precisely we need Xposed Additions Pro and Tasker installed, where the former requires root access and Xposed Framework (stable build) installed.

Once you install the Xposed Additions, you'll be asked to activate its module in Xposed Framework. Activate it.

We'll be using Xposed Addition's ability to intercept a key-press and would provide a condition and action to be performed for that key-press. We'll use Tasker to circumvent Xposed Addition's limited set of options.

Note: All sections tested on Android 4.4.2 and 5.0.2.

Instructions for Xposed Additions

  1. Launch Xposed Additions → tap Buttons
  2. Tap Add new key
  3. Press the device's button to be used as a keyboard's  ↑   key
  4. I chose Volume Up/+ button
  5. Tap the entry for the button you chose earlier
  6. Tap Add new Condition
  7. Tap Load Applications List
  8. Select the app where you want Volume Up button to simulate a keyboard's  ↑   key
  9. Tap your previously selected app's entry
  10. Check the box to activate Click
  11. Tap Click
  12. Choose DPad Up aka Directional Pad Up -- it's a KeyEvent

(Click image to enlarge; hover to know details)

(Order of images: Follow images from left to right in each row)

IMG: IMG: IMG: IMG: IMG: IMG: IMG: IMG: IMG: IMG: IMG: IMG:

  1. Now create an action for Volume Down/- button in aforesaid manner but choose DPad Down at final step.

    IMG: IMG:

It is time you launch the app you selected in the said steps and try pressing Volume Up and Volume Down buttons. They will work as a keyboard's  ↑    ↓   directional keys.

Note that contrary to a physical keyboard where if you hold a directional key the system will continue to scroll up/down, this is not the behavior you would observe if you long-press your (aforesaid selected) device's buttons.

Also, in place of choosing DPad Up and DPad Down, choose Page Up and Page Down to simulate a keyboard's Pg Up and Pg Dn key or assign them to a different action listed in step 10.

And, don't bother about ringtone or speaker sound level since they would be managed by long pressing those Volume Up and Volume Down buttons. This behavior is valid when your aforesaid selected app is launched.


I've tested successfully the aforesaid solution on Chrome, Firefox, and some text editors. So far so good!


Nope! The said solution is not good for all applications. We want to cover all applications, so why limit to web browsers and text editors only.

Unfortunately, there are apps on which the said solution doesn't work. The KeyEvents we used there seem to have no effect on apps like Foxit MobilePDF, WPS Office, BetterbatteryStats, and more in the wild.

Let's focus on a new solution now. Android allows sending swipes using input command; Xposed Additions allows using a custom shortcut as an action; Tasker can create a custom shortcut to use input swipe.

Instructions for Tasker and Xposed Additions

  1. We first need the swipe's start and end (X and Y) coordinates to use them in input command. We can record it using Getevent command.

    1. Setup in your PC, plug the device into PC, enable USB debugging in device, launch a shell on PC, and enter:

      adb shell su -c 'getevent -l'
      

      It would show some lines and then would wait indefinitely for output.

    2. It is time you decide the length of your swipe as an alternative to DPad Up / Page Up.

      E.g. The arrow length measuring a swipe in the two images is an alternative to scrolling length of DPad Up/Down and Page Up/Down respectively.

      IMG:              IMG:

      When you would make a swipe on the screen, the shell on PC would show output like:

      /dev/input/event0: EV_ABS       ABS_MT_TRACKING_ID   0000044c            
      /dev/input/event0: EV_KEY       BTN_TOUCH            DOWN                
      /dev/input/event0: EV_KEY       BTN_TOOL_FINGER      DOWN                
      /dev/input/event0: EV_ABS       ABS_MT_POSITION_X    00000300            
      /dev/input/event0: EV_ABS       ABS_MT_POSITION_Y    000006de            
      /dev/input/event0: EV_ABS       ABS_MT_PRESSURE      000000c0            
      /dev/input/event0: EV_ABS       ABS_MT_TOUCH_MINOR   00000004            
      /dev/input/event0: EV_SYN       SYN_REPORT           00000000            
      /dev/input/event0: EV_SYN       SYN_REPORT           00000000
      
      ...
      
      /dev/input/event0: EV_ABS       ABS_MT_POSITION_X    000002fb            
      /dev/input/event0: EV_ABS       ABS_MT_POSITION_Y    000004e3            
      /dev/input/event0: EV_ABS       ABS_MT_PRESSURE      000000cc            
      /dev/input/event0: EV_SYN       SYN_REPORT           00000000            
      /dev/input/event0: EV_ABS       ABS_MT_PRESSURE      000000c8
      

      After making an upward swipe of specific length, press Ctrl+C in PC to stop the command.

      In its output note the first ABS_MT_POSITION_X (00000300) and ABS_MT_POSITION_Y (000006de), and last ABS_MT_POSITION_X (000002fb) and ABS_MT_POSITION_Y (000004e3) entries. They are the start (X1,Y1) and end (X2,Y2) coordinates in hexadecimal form. Convert them into decimal form (try a converter here).

    3. In the shell, if you enter:

      adb shell input touchscreen swipe X1 Y1 X2 Y2
      

      (replace X1, Y1, and X2, Y2 with the now converted decimal coordinates) you would notice an upward swipe on the device effectively simulating scroll down. Manipulate those coordinates until you get your ideal scroll down.

  2. As an alternative of using Getevent, you can try a more friendly approach.

    1. Enable Pointer Location under Developer options. Once you enable it your device's status bar would get covered with a bar showing some coordinates which would change with the movement of your tap/swipe on screen.

    2. Time to record your swipe length. Touch and hold your finger on screen and note X: and Y: shown at the top. Start swiping up the finger to the desired length; stop but don't release the finger and note down the corresponding X: and Y: coordinates.

      Those are the X1, Y1 and X2, Y2 coordinates for your up swipe. They are in decimal form, so you can directly use them in input command.

      You can choose to disable the Pointer locations now.

Instructions specific to Tasker

We would now create a shortcut to simulate the swipe we manually performed in the last command, for the purpose of automating it.

  1. Launch Tasker and enable it. If its icon above Profiles tab is lit, then it's already active. Note that everything in Tasker is saved by pressing the back button, which would also change the active window.
  2. Create a task under Tasks via + (at the bottom) → name it (say Scroll Down).
  3. Create an action in it through +Code → Run Shell, and enter these details:

    • Command: input touchscreen swipe X1 Y1 X2 Y2

      Replace the X1, X2, and Y1, Y2 with the coordinates you noted earlier. E.g. input touchscreen swipe 768 1758 763 1251.

    • Check Use Root

    • Store Errors In: %sd_err -- this step is optional.
  4. Create a new task named Scroll Up, and create an action in it by following step 3. For swipe down simulation simply interchange the coordinates, so it would be input swipe X2 Y2 X1 Y1, and optionally use %su_err to store errors, if occur!

Instructions to use Task shortcuts in Xposed Additions

This is the final phase of the solution and would use those custom shortcuts in Xposed Additions.

  1. Follow the steps 1-11 in the first section dealing with the usage of Xposed Additions
  2. Choose Shortcut instead of DPad Up or Page Up
  3. Choose Task Shortcut → Scroll Up
  4. Choose 3x3 square boxes icon at the bottom
  5. Choose an icon and come back to Xposed Additions.
  6. Repeat the aforesaid steps 1-5 for Volume Down and select Scroll Down in it. You get the idea by now what to do every time.

IMG: IMG: IMG: IMG: IMG:


I've compiled a video showing the whole answer in action. Here it is. Mind the quality because it is heavily ripped from 100MB to 7.1MB.

Cheers!

  • This looks really good. Unfortunately Xposed Additions Pro and Tasker are payware, and I haven't set up any payment method on my Google account nor do I currently intend to. XPosed Additions (the free version) doesn't allow setting button effects per application. – Gilles Aug 12 '15 at 9:13
2

The old but good question. Answering it to myself, I came up with using MacroDroid alone for this. At least now volume up/down scrolls one page in Chrome. The method might be applied either to another program or to other options inside MacroDroid, for example buttons on screen:

  • Trigger: Volume Up/Down, might reguire giving MacroDroid accessebility permissions.
  • Action: Gesture [300 ms, 500, 1850-> 500,340]. My device has 1980 pixel height, so this values should be adjusted to the device/application.
  • Constraint: Chrome appliction in foreground. Other application often also might be used for this macro, but different screen layout might prevent from working correctly. For example, Quora has a toolbar at the bottom of the page, so I will probably need to create a separate macro for it.
1

Hacker's Keyboard has Page Up/Down keys which default browser and Chrome handles properly. You can even make it appear outside of input context with "Use permanent notification" option. That doesn't help much since having keyboard open all the time is a bit absurd, but proves the point that an app for having global Page Up/Down could exist.

PS. Dolphin browser also has an option for mapping Volume Up/Down to scroll by page and that's what I'm trying to use right now.

1

It isn't available in the Stock Android Browser or not even in Chrome. But UC Browser provides this functinality of scrolling exactly one page at a time. You can use the "Scroll Buttons" or "Tap to scroll" or the "Volume keys" feature by installing UC Browser for Android. In the UC browser Settings page you can do configure the scroll style and it resembles the same Page Up & Page Down key actions like we do in our desktop keyboards.

Scroll Buttons: A virtual Page Up and Page Down arrow buttons are added at the right hand side of a webpage.

Tap to scroll: You can either tap at the top half of the screen or th bottom half of the screen to exactly scroll one screen page at a time.

Volume Keys: You can also use your volume rocker keys to scroll the screen page one by one. Pressing the Volume down scrolls the page once downwards and pressing Volume up scroll the page once upwards.

For enabling this feature,

  • Install UC browser - Surf it Fast from the Play Store
  • Goto Settings > Browsing Settings > Scroll Options
  • Either set it to "Scroll Buttons" or "Tap to scroll" or "Volume buttons" > Press Ok
  • Now open any scrollable webpage and do the desired action based on your scroll settings. For example:
    1. If you've enabled "Tap to Scroll", then click at the bottom half of the screen to scroll down by one screen page(similar to Page Down key).
    2. Similiarly you can scroll to the top by tapping once at the top half of the screen on any scrollable webpage.

UCBrowser_Scroll_Settings_options

Screenshot - UCBrowser Scroll Settings (Click to enlarge image)

Note: You can also enable all the three options at once. But I recommend to use the "Scroll Buttons" option as it is easy to use and works fine for all pages. In Tap to scroll, clicking link will open the links and will not scroll the page up/down. So tap an area where there are no links available.

1

The need of using an Xposed module can be removed from my answer here. We can use Tasker and a very useful plugin named AutoInput to simulate page up/down using Volume keys.

Instructions

  1. Install both the apps.
  2. Go to Settings → Accessibility and enable Services for both Tasker and AutoInput.
  3. Launch Tasker. Under Tasks, create a task named Scroll Up.
  4. Create following actions in that task (A implies an action):

    • A1:

      • Plugin → AutoInput → Modes → Configuration → Key Suppress → Enable → Keys → scroll to select Volume Up

      • Timeout: None

      We're suppressing the Volume Key so that you don't end up with system ringer volume dialog with a slider when you press that key.

    • A2:

      • Code → Run Shell:

      • Command: input touchscreen swipe X2 Y2 X1 Y1 or input keyevent 92

        If you choose the former command, then use my answer to get the coordinates.

      • Check Use Root
  5. Create another task named Scroll Down.
  6. Create following actions in that task:

    • A1:

      • Plugin → AutoInput → Modes → Configuration → Key Suppress → Enable → Keys → scroll to select Volume Down

      • Timeout: None

    • A2:

      • Code → Run Shell:

      • Command: input touchscreen swipe X1 Y1 X2 Y2 or input keyevent 93

      • Check Use Root
  7. Under Profiles tab, create two profiles named Autoinput Up Key and Autoinput Down Key.
  8. Link the tasks Scroll Up in Autoinput Up Key and Scroll Down in Autoinput Down Key profile.
  9. Create a third task named Launch Profiles and create following actions in it:

    • A1:

      • Tasker → Profile Status → choose using lens icon Autoinput Up Key
      • Set: On
    • A2:

      • Tasker → Profile Status → choose using lens icon Autoinput Down Key
      • Set: On
  10. Create the final task named Kill Profiles and create the identical actions of step 10. Change Set from On to Off in both actions for this step. We need this task so that the custom actions meant for Volume keys doesn't affect other apps where the keys should function as normal.

  11. Create a profile based on application context and select an app of your choice, such as Chrome.
  12. Link Launch Profiles task in Chrome profile.
  13. Link Kill Profiles as an exit task in Chrome profile.

You may now launch Chrome. Use Volume Up/Down to find that they would not change the ringer volume but would scroll up/down the page you've opened up in Chrome. Switch to another app not selected in above steps or close Chrome and those hardware keys would function as normal.


Note: It's not butter smooth as my linked answer but it's not sluggish either. If you're not comfortable with Xposed framework or modules then this answer would help for sure.

We're good to go!

1

Nobody brought up a physical keyboard. So that.

If you have root access, Tasker can do down button presses even without auto-input. This is still relevant for Android 4.4.4. I could get this to send a page down button, but it has peculiar triggers, like headset volume or media buttons.

The Button Savior (Root) app is promising, but I don't have a rooted device. Did not go anywhere with this, because it seems to not send the keystrokes to the active app.

Firelord's Aug 25 solution is better.

  • I hadn't brought up a physical keyboard because I do not consider carrying one in my pocket to be a viable option. What's “tasker”? – Gilles Aug 10 '15 at 18:13
  • Tasker is an android automation app. Has all sorts of triggers you could use to do this, and it has function that can send a sequence of down keystrokes, if you have root. I think you should start with button savior.(I can't yet because I don't have root) sorry I realize this is a two year old question and you might have the answer, but I can't find it yet. It's annoying to not be able to do something so basic. – Mark Ifi Aug 10 '15 at 19:43
  • Not fair! All of my solutions are good here. :) – Firelord Sep 2 '15 at 10:17
  • I have tried an external keyboard and page down buttons don't work – William Aug 29 '17 at 19:36
1

Historical note: this answer no longer works since Firefox changed its add-on API to the WebExtension API in November 2017. The add-on is not compatible with modern versions of Firefox (≥57) and has been abandoned.

I've finally switched to Firefox as my main web browser on Android. My current partial solution to scroll by page is the PageDown PageUp Buttons Firefox extension.

Pressing the white-on-gray button on the left with an upward pointing arrow scrolls up by one page. Pressing the white-on-gray button on the right with a downward pointing arrow scrolls down by one page.

screenshot of Firefox with PageDown PageUp Buttons

  • "This add-on has been removed by its author." – larry909 Jun 19 '18 at 15:43
  • @larry909 Indeed, a victim of WebExtension. I'm still looking for a replacement. – Gilles Jun 19 '18 at 22:41
  • keep us updated here if you find something – larry909 Jun 19 '18 at 22:48
0

UC Browser has two kinds of tap scrolling. You can configure it to scroll up if you hit a non-link portion in the upper half of the screen or vice versa to scroll down. You can also elect to display two arrow buttons (that you can drag around the screen so you can position them to your liking) for tap to scroll.

You can get it here: https://play.google.com/store/apps/details?id=com.UCMobile.intl

Note: As I write this, the UC Browser HD (specifically for tablets) does NOT have this capability.

0

Tasker allows creation of Scenes. We can use scenes to create virtual buttons on the screen which can work as navigational keys to scroll up/down/left/right on the screen.

This answer would make good use of all of my earlier answers written on this page. It goes without saying that root access would be needed than.

(Some mundane scenes I created; click image to enlarge)

IMG: IMG: IMG: IMG:

(Excuse the drawing because I'm no good in it and neither I've tasted the power of scenes yet. Nevertheless, you can see how they are acting as navigational keys.)

Instructions for creating Scenes

  1. Install and launch Tasker
  2. Go to Scenes tab and create a new scene named Nav Buttons.
  3. See Image 1, 2, 3, 4, 5. Note that you need not to bother about where the scene would show up on the screen since we would configure it later. Simply decide how much space your Scene should be taking on the screen.
  4. Under Tap create an action that you want to execute when the associated element is touched. You may choose to select an already existing task which may page up or swipe down the displayed app's page. See my answer here to know how to create swipe up/down tasks or see this answer to see KeyEvents which can do page up/down.
  5. Optional: If you want to destroy the scene from inside the scene then you may consider adding an action under Long Tap to kill the scene or the app.

    • Scene can be destroyed using the action Scene → Destroy Scene → select the Scene using lens icon.
    • Alternatively, if you decide to create an app from this Scene (later on the app creation part) then create the action Code → Run Shell,

      • Command: am force-stop <PKG_NAME>

        Create a unique <PKG_NAME>, such as com.user.android.se and keep it noted somewhere since we would need it in app creation.

      • Check Use Root
  6. See Image 8, 9, 10, 11.

(Click image to enlarge; hover to know details)

IMG: 1 IMG: 2 IMG: 3 IMG: 4 IMG: 5 IMG: 6 IMG: 7 IMG: 8 IMG: 9 IMG: 10 IMG: 11 IMG: 12 IMG: 13 IMG: 14


Now, at this point we have multiple choices to proceed with the scene. You may,

  1. Continue to use Tasker and create a profile where you want the scene to show up,
  2. Use LMT Launcher's PIE navigation to use the Tasker shortcut in a pie. See my answer here to know how to use LMT Launcher. This approach would allow you to show/hide the scene at your will, at any place in system, and doesn't need a Tasker profile to work.
  3. Use Xposed Additions Pro or AutoInput or QuickClick to show/hide that scene based on a Volume key press. See my answer for Xposed Additions Pro's usage or try AutoInput using this answer.
  4. Use an app like GMD Gesture Control to show/hide the scene based on screen gestures. The freedom is same as one granted for LMT Launcher. See this answer to know its usage.
  5. You can use some automation apps like MacroDroid to show/hide the scene if they allow launching a Tasker shortcut (I know, why bother doing that, but wait for more!)

Or

You may use Tasker App Factory to transform a task into a full-fledged standalone app (read: Tasker independent) which can be sideloaded into system just like any other app and would work as if you're executing a task using Tasker itself.

The good part is that app creation using Tasker and Tasker App Factory is legal, so one can distribute it at his/her own will.

You want more! Right. The biggest hurdle of depending upon commercial apps is pretty much solved in this particular case. If you do not own or do not want to buy Tasker but a person known to you has it, then you may kindly request that person to create an app for you. You may stick to the basic approach needed for navigational buttons mentioned in the current answer or give a chance to your own imagination.

Also, one more goodie. You can use that new app with any of the five options that I've listed for a Tasker scene. I've successfully tested all of them.

Create an app from a task in Tasker

  1. Install Tasker App Factory
  2. Under Tasks tab touch and hold your task entry and tap the three dotted line → Export → As App.
  3. Create a unique package name for the app, such as com.unique.package.name.

    Note that if you completed Long Tap step during Scene creation then you must use the same package name here.

  4. You would see app creation detail. Try the icons at the bottom. The Android icon would initiate sideloading the newly created app using Android's Package Installer.

    The app, once created, would be saved under Tasker/factory/kids/ which is located in your default storage.

    Also, the name of the app (seen in launcher after installation) and its icon would be same as the name of the Task and icon you selected in the task creation under Tasker.

IMG: 1 IMG: 2 IMG: 3


I've created a demo app based on the current answer, hosted on my Google Drive. Find it here. The permissions it require are:

(Superuser permission isn't listed but is definitely required.)

IMG: 1

(App icon made by Freepik from Flaticon, is licensed under CC BY 3.0)

There's is a slight problem here. While I was able to successfully test my app independently on my secondary Lollipop ROMs on the same device with same resolution, the app didn't work satisfactorily on my other but low resolution device. Oh well, what can I do!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.