[Android Software Development] AndroidON:
[HOWTO]More smooth scroll & volume step increase for MOST android phones[Poweramp OK]

※Do this when you completely understand this.

This is not for people who are noob to phone and computer things.

This is a framework.jar mod which will affect on overall scrolling and volume steps.

I've searched through several references and found some modification.

By following steps below, you will modify your rom's framework.jar.

And it will make your phone's volume control more precise and scroll to be more smooth.

Some phones may have different structure in framework.jar so I'm not sure.

(I've tested this on HTC desire and Motorola Atrix. I'm an Atrix user.)

Ok, so here's everything you need before start.

1. framework.jar of your phone. (Deodexed ROM needed)

2. Java software Development Kit

http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html

3. smali/baksmali tool (Thanks to the Korean guy, 'vorcot')

http://api2.ge.tt/0/9LvgHdB/0/blob/download

4. Text editor - Window basic text editor can be used..but I recommend Notepad++

http://notepad-plus-plus.org/

5. Program which can extract .jar file. (I prefer 7zip)

6. File manager which can access to phone's internal system.

(Like root explorer)

7. Your rom's original zip under SDcard for in case of bootloop.

A. Basic steps.

1. Unzip the smali/baksmali tool to certain folder and put the framework.jar in same folder.

2. Run baksmali manager.bat.

3. Select framework.jar by pressing 4 -> 2 in main menu.

4. Press 1 to Baksmali the framework.jar.

5. Wait.

6. Make it sure that new 'framework' folder is created and files inside it. (Don't close the baksmali manager window yet!)

B. Modification Steps

Volume steps mod

- Since I saw some people are complaining about android's volume control is jumping to large amount, I made some mod.

This will adjust your phone volume steps.

Sorry for not showing you by English, but you can recognize the media volume counts increased from 15 to 30.

Here's what you have to modify:

1. Open the framework/android/media/AudioService.smali with text editor.

2. Press Ctrl + F to open the search window and serch for 'max_'

3. Continue search until you find the line below.

4. You can see the 'array_1ba' in screenshot. This may vary for roms. (But usually only '1ba' changes.)

This will lead you to data of max volume.

Search for 'array_1ba' again.

5. You will see like this:

This data's meaning is same with this. (From CM7 source)

6. So if you want modify your music or movie volume, you have to modify 4th line's 'f'.

(This 'f' means 15 by hexadecimal number)

If you use bluetooth, modify 7th line too.

I changed 'f' to '1e', which means 30 in hexadecimal number.

7. Press the text editor's save button if you finished.

Smooth scroll mod

Add - This tweak will be included in CM7 officially. Editing smali manually will not needed.

So you can find the option in performance setting. Thanks cyanogenmod team!

(But other stock based roms still can do this like 'Sense','Blur','Touchwiz',etc)

- Some android applications have some lag when they scroll.

I found in logcat that garbage collector is working to much when I do some scroll in application.

I googled about it and found the 'scrollingcache' function inside android making problem.

Some application developers recommend disable 'scrollingcache' in app's internal config.

But not all applications have disabled scrollingcache.

So the mod I'll do will disable the scrollingcache throughout the Android OS.

All apps will have no problem with scrollingcache.

I've had scrolling improvements with facebook,playerpro,poweramp,gallery apps , etc.

It is simillar with volume step mod but different value to change.

Here's what you have to modify:

1. Open the framework/android/widget/AbsListView.smali with text editor.

2. Search through 'ScrollingCache' and change it like below screenshot.

-----------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------

3. Press the text editor's save button if you finished.

C. Finishing steps.

1. Come back to baksmali manager window.

2. Press 2 to smali.

3. Wait. (It will create classes.dex file after finish)

4. Open the framework.jar file with 7zip.

5. Overwrite the classes.dex file inside the framework.jar.

(You can just drag&drop the classes.dex file to 7zip window.)

D. Installing steps.

1. Put modified framework.jar to your phone's sdcard.

2. Open the phone's file manager which have root access and copy the modified framework.jar to /system.

3. Set permission to rw-r--r-- or like this:

4. Move it to /system/framework. (Select yes for overwrite.)

5. Reboot.

I've used a lot of time for searching this.

You can use this for your own rom but please tell me before you use it.

And any bug reports or impressions will be appriciated.

Enjoy :)

EDIT - Some people are complaining about volume mod that it is not working with poweramp.

You can use it by changing your setting.

Power Amp settings - Audio Engine - Advanced Tweaks - Uncheck 'Direct Volume Control'

This will solve the problem.

This info is by 'wd2347' from Korean Atrix forum.