Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-30-2012, 02:05 PM   #16
hberntsen
Member
hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.
 
Posts: 10
Karma: 1358
Join Date: Jan 2012
Device: PRS-T1
I made an app to enable the no-refresh mode, see norefreshenabler.zip attached to this post for the apk file and sourcecode. Once installed, just run the app and the no-refresh mode is enabled automatically. With no-refresh mode i mean the black and white mode you get when you zoom in the browser. With this app you do not need to do that trick anymore, just run it.

It is based on the code of Morkl, I edited the EinkListView.java so that it doesn't need a modified android sdk to compile. It now uses reflection, so the app searches at runtime for the right method and calls it. For example:
Morkl's code:
Code:
	@Override
	public void invalidate() {
		super.invalidate(mUpdateMode);
	}
New:
Code:
	@Override
	public void invalidate() {
		try {
			Method invalidateMethod = super.getClass().getMethod("invalidate", int.class);
			invalidateMethod.invoke(this, mUpdateMode);
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
I tried to install/run the app on my phone and that works, it just prints a stacktrace because the method does not exist.

EDIT 7 feb: You might want to check out version 2 in post #33
Attached Files
File Type: zip norefreshenabler.zip (76.5 KB, 705 views)

Last edited by hberntsen; 02-07-2012 at 02:59 PM.
hberntsen is offline   Reply With Quote
Old 01-30-2012, 02:31 PM   #17
m3l7d0wN
Zealot
m3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolatem3l7d0wN is generous with chocolate
 
Posts: 102
Karma: 33708
Join Date: Apr 2011
Device: Sony PRS-T1
very nice! I've added it to the bar shortcuts and it's very useful!
m3l7d0wN is offline   Reply With Quote
Old 01-30-2012, 02:51 PM   #18
robyshot
Enthusiast
robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'robyshot knows the difference between 'who' and 'whom'
 
robyshot's Avatar
 
Posts: 32
Karma: 10040
Join Date: Jan 2012
Device: Sony Prs T1
great! very very well done!
robyshot is offline   Reply With Quote
Old 01-30-2012, 03:35 PM   #19
hberntsen
Member
hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.
 
Posts: 10
Karma: 1358
Join Date: Jan 2012
Device: PRS-T1
Thank you m3l7d0wN and robyshot.

I've also dug in the framework, webbrowser and pictureviewer and I found something relevant to this topic.

In the webbrowser(WebView):
Code:
    private static final int UPDATE_MODE_A2 = 5;
    private static final int UPDATE_MODE_AUTO = 4;
    private static final int UPDATE_MODE_GC16 = 34;
In the picture viewer(PictureCommonView):
Code:
    public static final int UPDATE_MODE_NOWAIT_A2 = 1061;
    public static final int UPDATE_MODE_NOWAIT_DU = 1;
    public static final int UPDATE_MODE_NOWAIT_GC16 = 34;
    public static final int UPDATE_MODE_WAIT_A2 = 1125;
    public static final int UPDATE_MODE_WAIT_DU = 65;
    public static final int UPDATE_MODE_WAIT_GC16 = 98;
In the framework, view/View
Code:
    public static final int EINK_AUTO_MODE_AUTOMATIC = 16;
    public static final int EINK_AUTO_MODE_MASK = 16;
    public static final int EINK_AUTO_MODE_REGIONAL = 0;
    public static final int EINK_COMBINE_MODE_COMBINE = 128;
    public static final int EINK_COMBINE_MODE_MASK = 128;
    public static final int EINK_COMBINE_MODE_NOCOMBINE = 0;
    public static final int EINK_CONVERT_MODE_CONVERT = 1024;
    public static final int EINK_CONVERT_MODE_MASK = 1024;
    public static final int EINK_CONVERT_MODE_NOCONVERT = 0;
    public static final int EINK_DITHER_MODE_DITHER = 256;
    public static final int EINK_DITHER_MODE_MASK = 256;
    public static final int EINK_DITHER_MODE_NODITHER = 0;
    public static final int EINK_INVERT_MODE_INVERT = 512;
    public static final int EINK_INVERT_MODE_MASK = 512;
    public static final int EINK_INVERT_MODE_NOINVERT = 0;
    public static final int EINK_UPDATE_MODE_FULL = 32;
    public static final int EINK_UPDATE_MODE_MASK = 32;
    public static final int EINK_UPDATE_MODE_PARTIAL = 0;
    public static final int EINK_WAIT_MODE_MASK = 64;
    public static final int EINK_WAIT_MODE_NOWAIT = 0;
    public static final int EINK_WAIT_MODE_WAIT = 64;
    public static final int EINK_WAVEFORM_MODE_ANIM = 5;
    public static final int EINK_WAVEFORM_MODE_AUTO = 4;
    public static final int EINK_WAVEFORM_MODE_DU = 1;
    public static final int EINK_WAVEFORM_MODE_GC16 = 2;
    public static final int EINK_WAVEFORM_MODE_GC4 = 3;
    public static final int EINK_WAVEFORM_MODE_INIT = 0;
    public static final int EINK_WAVEFORM_MODE_MASK = 15;
All these constants seem to relate to the updatemode of the screen. I think it is some kind of bitfield, the UPDATE_MODE_WAIT_GC16 is a combination of EINK_WAVEFORM_MODE_GC16 + EINK_WAIT_MODE_WAIT + EINK_UPDATE_MODE_FULL

To try the different modes, I used this tutorial to create an app where i could scroll some images. I edited the EinkListView into it and included the source as an attachment to this post(IconizedListView.zip).

I've tried differend modes, but could not find a mode where the scrolling is as smooth as the 'no-refresh mode' and the screen is greyscale instead of black and white(maybe someone else can?).

I looked around in the framework and I saw that once you call methods like invalidate() without the updatemode argument, the updatemode automatically got set to 4, which makes the screen keep flashing when you scroll. I changed that value to 3 at various placed and that helped! It looks like my changes only affect scrolling things, like adwlauncher or a web page in readitlater. Things like launching an app, pulling down the status bar, a popup still refresh the screen. Maybe the updatemode needs to be changed from 4 to 3 at more places in the code.

I edited the framework.jar/framework.dex with this tutorial. I included my changes/updated framework in framework.rar.

This is a video showing my hack and app from my previous post:


About the framework.rar file: The root contains the original files from my device at version 1.0.00.09010. The folder "framework files currently on my device" contains the edited files you can put on your device.
Attached Files
File Type: zip IconizedListView.zip (87.4 KB, 237 views)
File Type: rar framework.rar (17.61 MB, 244 views)

Last edited by hberntsen; 02-09-2012 at 06:35 AM.
hberntsen is offline   Reply With Quote
Old 01-31-2012, 07:37 AM   #20
giosa
Connoisseur
giosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcovergiosa exercises by bench pressing the entire Harry Potter series in hardcover
 
Posts: 90
Karma: 16056
Join Date: Dec 2011
Device: Sony PRS T1
Quote:
Originally Posted by hberntsen View Post
I tried to install/run the app on my phone and that works, it just prints a stacktrace because the method does not exist.
How do I install it?
giosa is offline   Reply With Quote
Old 01-31-2012, 08:23 AM   #21
hberntsen
Member
hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.
 
Posts: 10
Karma: 1358
Join Date: Jan 2012
Device: PRS-T1
Eh download norefreshenabler.zip attached to my post(#16), unzip it and copy the apk file to your device and run it.
hberntsen is offline   Reply With Quote
Old 01-31-2012, 09:12 AM   #22
entodoays
Zealot
entodoays will become famous soon enoughentodoays will become famous soon enoughentodoays will become famous soon enoughentodoays will become famous soon enoughentodoays will become famous soon enoughentodoays will become famous soon enoughentodoays will become famous soon enough
 
entodoays's Avatar
 
Posts: 139
Karma: 706
Join Date: Oct 2011
Device: Sony Reader PRS-T1
Thanks for your work.
Unfortunately installing the apk does not enable the grayscale mode; only the Sony browser scrolling mode. It does not replicate the results in the video. Hberntsen, could you post instructions on how to install the framework changes, please?
Also, are there any negative effects on the system, like battery drain for example, or something worse?
entodoays is offline   Reply With Quote
Old 01-31-2012, 09:30 AM   #23
vortigern
Member
vortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enough
 
Posts: 13
Karma: 662
Join Date: Jan 2012
Device: PRS-T1
The app is great but the setting of the updatemode like in your vid looks ideal ....the refreshing is mainly a problem when scrolling - Gives me motion sickness!
vortigern is offline   Reply With Quote
Old 01-31-2012, 10:18 AM   #24
hberntsen
Member
hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.
 
Posts: 10
Karma: 1358
Join Date: Jan 2012
Device: PRS-T1
Post #16 was about the app that makes the pinch to zoom trick in the browser easier. Post #19 was about the framework files I edited so the scrolling does not flash.

What i did was editing the framework files of the android os. If you do this wrong the ereader will not boot into android anymore and you will have to use the restore package(which resets/reinstalls everything) to make it work again. Since it worked the first time I tried the hack I did not have to use that .

How to install:
In order to install it you can download the framework.rar from my previous post and copy the 2 files(framework.jar and framework.odex) from the "framework files currently on my device" folder to your /system/framework folder. I am not sure if you need to change the permissions of that files afterwards.

Maybe an expert can confirm that this installation guide is correct? I am new to android development(this is actually my first hack/app) so be careful and backup everything. My firmware version is 1.0.00.09010, I don't know if that matters.

If you want to see for yourself how the scrolling looks like without hacking the framework you can download IconizedListView.zip from my previous post. Look in the bin folder for an apk you can install on your ereader. So you do not need a hacked framework for this app to run, only the list in this app has that smooth scrolling.

I dont know if there is any negative effect, when I was playing angry birds(you have to put it in 2 color black and white mode or else it keeps flashing) I noticed you have to touch the screeen every 5 seconds or else the screen will freeze. As soon as you touch it again it enables itself for like 5 seconds again. So the screen will autmatically pause itself so I think this hack has no negative effect on the battery life

Last edited by hberntsen; 01-31-2012 at 01:19 PM.
hberntsen is offline   Reply With Quote
Old 01-31-2012, 11:00 AM   #25
vortigern
Member
vortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enough
 
Posts: 13
Karma: 662
Join Date: Jan 2012
Device: PRS-T1
Quote:
Originally Posted by hberntsen View Post
I looked around in the framework and I saw that once you call methods like invalidate() without the updatemode argument, the updatemode automatically got set to 4, which makes the screen keep flashing when you scroll.
Just a thought...
If calling it without an argument sets it to 4, then there might be somewhere this default is set.

If we're lucky it could even be set using the const name...
ie. What happens if you change:

public static final int EINK_WAVEFORM_MODE_AUTO = 3;
vortigern is offline   Reply With Quote
Old 01-31-2012, 12:44 PM   #26
hberntsen
Member
hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.
 
Posts: 10
Karma: 1358
Join Date: Jan 2012
Device: PRS-T1
As far as I can see that constant is never used in the framework. I think the compiler hardcoded the value everywhere in the code instead of referencing to that constant value.
hberntsen is offline   Reply With Quote
Old 01-31-2012, 03:18 PM   #27
vortigern
Member
vortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enough
 
Posts: 13
Karma: 662
Join Date: Jan 2012
Device: PRS-T1
Ah well it was worth a try. My firmware is 1.0.03.11140 which has a slightly different framework.odex
I used your script to pull it apart - There appears to be some difference between the invalidate functions when it has a parameter or not which may explain something.

It seemed your and my original smali files were the same for the ones you edited in android/view so I made the same changes and recompiled.

One thing before I upload and possibly brick my device though - Why is your framework.jar about 2MB when the originals are about 10k?
vortigern is offline   Reply With Quote
Old 01-31-2012, 03:26 PM   #28
hberntsen
Member
hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.hberntsen is no ebook tyro.
 
Posts: 10
Karma: 1358
Join Date: Jan 2012
Device: PRS-T1
Yes I had that too. We have put the new classes.dex in the jar file, that's why it is so big now. The tutorial does not say if you can remove the classes.dex so i left it there.
hberntsen is offline   Reply With Quote
Old 01-31-2012, 09:57 PM   #29
j0534ng31
Connoisseur
j0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheesej0534ng31 can extract oil from cheese
 
Posts: 83
Karma: 1224
Join Date: Dec 2011
Location: Gijon (Spain)
Device: Sony PRS-T1 black
Quote:
Originally Posted by hberntsen View Post
Yes I had that too. We have put the new classes.dex in the jar file, that's why it is so big now. The tutorial does not say if you can remove the classes.dex so i left it there.
If I'm not mistaken you don't need to remove it, but you have to 'reodex back'... You can follow the main guideline here

you can also read how it works here, in 'Step 3: run reodex script'

Last edited by j0534ng31; 01-31-2012 at 10:10 PM.
j0534ng31 is offline   Reply With Quote
Old 02-03-2012, 05:22 AM   #30
vortigern
Member
vortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enoughvortigern will become famous soon enough
 
Posts: 13
Karma: 662
Join Date: Jan 2012
Device: PRS-T1
I've still not managed to get abd working so haven't got this done yet but I was thinking some other way to do it.
It would be nice to have the brightness power control be able to change between modes and although there's no broadcast on brightness change, it might be possible to set a ContentObserver on it

From Here:
Quote:
Google's Power Control appwidget registers a ContentObserver in order to listens to changes to the brightness settings. Not quite the same as listening for actual screen brightness changes, but better than nothing: resolver.registerContentObserver(Settings.System.g etUriFor(Settings.System.SCREE*​N_BRIGHTNESS), false, this); resolver.registerContentObserver(Settings.System.g etUriFor(Settings.System.SCREE*​N_BRIGHTNESS_MODE) , false, this);
Although I guess it might just be easier to stick it in its own widget
vortigern is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Host Mode (Master Mode) on K3 ericepe Kindle Developer's Corner 1 01-24-2012 04:59 AM
Request Safe mode or recovery mode for Pocket Edge? felixblackcat enTourage eDGe 25 01-08-2012 05:07 PM
What Does Everyone think of the K3 refresh Scarpad Amazon Kindle 6 08-29-2010 10:00 PM
After refresh maxhyl iRex 1 11-23-2008 03:50 AM


All times are GMT -4. The time now is 12:41 PM.


MobileRead.com is a privately owned, operated and funded community.