[INFO] Palm Pre (Cards-Like) Thumbnails

Search This thread

Wysie

Senior Member
Jul 4, 2009
1,122
6
Hi all,

@ruqqq (aka arctu, author of HelixLauncher) tweeted me a whole bunch of stuff this afternoon, and to be honest, this is 99% his credit, I only changed the required line in framework to help him test, so I get 1% :p. Anyway, @ruqqq did some searching online, and the one of most importance was this:

http://www.mail-archive.com/android-developers@googlegroups.com/msg21135.html

After looking at the code, we simply uncommented the following line in ActivityThread.java:

Code:
//info.thumbnail = createThumbnailBitmap(r);

With it commented, it thumbnail will always be null, with it uncommented, well, we may be able to get actual thumbnails. @ruqqq then went on to write a quick (and ugly :p) app to find out if thumbnails of running apps can be retrieved, and the result is, yes, it can be retrieved. The screenshot I posted only shows 2 apps cause of the lack of ScrollView, but I believe he's writing a better proof-of-concept as we speak, while I'm rushing to go out once I end this post (else the girlfriend's fury :p).

Screenshot: http://twitpic.com/1w1p6t
New Screenshot (Still ugly :p): http://twitpic.com/1w1v6k

So what's the point of this post? Nothing, really. It's just that the commented line has apparently been in there as early as 1.5, but it was always commented out. We removed the comment, and it actually does return thumbnails. With this, it means that if future ROMs are compiled with that line uncommented, it will be possible to actually write apps to emulate/simulate the cards system, possibly even on a system level (by overriding the recent applications dialog).

That's all :).

@ruqqq's concept app source: http://github.com/ruqqq/ActivityThumbnailPrototype-Application
framework source: Come on, it's just a line :p.
 
Last edited:

ruqqq

Senior Member
Oct 12, 2008
526
1,255
yay! experimentation succeed. :p

just to add on:

the idea is that third-party developers can implement this in their apps without any breaking codes. the api has always been official. if thumbnail doesn't exist, it returns a null. so, a dev simply has to write a code that checks for this property and carry out 'instructions' based on the availability of the thumbnail. ;)

implications:

what we learn is that the reason they disabled the code is to prevent wasteage of resource (CPU and Mem) as the thumbnail code runs everytime the onPause of an activity is performed. This means that enabling it may or may not cause slowness in the system. Conclusion? Need extensive testing. ;)
 

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Pretty cool stuff. Perhaps you can make it so only if the app is running is that variable on and generating thumbnails ? Regardless cant wait for what developers do with this, im sensing the app taskos with live thumbnails :) it already has the fling up to end task.

Also to prevent this from being rom specific, maybe you could compare the hexcodes of 2 framework-res.apk's one with uncommented and one without, that way it could be added to any existing rom ?
 
Last edited:

Daneshm90

Retired Recognized Developer
Jun 1, 2009
3,332
662
Daneshm90: This has to be baksmali/smali-ed in.. ^^

Is that even possible ? it doesnt have a classes.dex (Nvm, u have to push the classes.dex of framework.jar into framework-res and decompile)

can u give me a modded and unmodded framework-res ? just wanna do some digging :)
 
Last edited:

mykenyc

Senior Member
Jun 16, 2009
1,126
216
Phoenix
I agree is this became stable Activity closer and switcher in the format + ADW + cyan or any other great developer + froyo = greatness
 

lsim001

Senior Member
Aug 20, 2004
124
1
London
The bitmap can be used to make rotation and other screen changes faster. Load the bitmap before you load the real screen. This could be very important.
 

Geniusdog254

Retired Recognized Developer
Jan 2, 2009
1,110
169
St. Louis
The bitmap can be used to make rotation and other screen changes faster. Load the bitmap before you load the real screen. This could be very important.

Thats actually true. The iPhone OS takes a screenshot of each app on exit, and then when you open it again it displays that screenshot until the activity is fully loaded. Could be implemented as such on Android too, but would take a lot of back end work.

Also, theres one thing I'm worried about. Since it takes a screenie on every OnPause of the activity, how will you stop it from displaying a "card" for every activity of an application. I mean for instance my game has 3 activities, one for each the play surface, the start screen, and the score screen, wouldn't I see a "card" for each of those the way this is now?
 
D

diversificationied

Guest
Sounds like that was put in to future proof the OS.

At the time it was probably too gpu reliant, and they decided to forego it.
 

Waza_Be

Inactive Recognized Developer
Jul 22, 2009
822
234
Hello!

Please excuse my ignorance, but I have a few questions.
I am the developper of TaskOS and this feature is what I'm looking for months in my application.

Si, if I understand well this topic, the linecode to add must be done by ROM's developpers, is it true?

I really would like to have a list of compatible ROM's or please tell me if I am totally misunderstanding what you say.

Profete162
 

bcpk

Senior Member
Feb 11, 2010
460
19
Profete, I don't think that any ROMs have this yet because it has just been discovered.

Je crois qu'il n'y a pas de ROMs qui utilisent ce code car il vien d'etre decouvert
 

Wysie

Senior Member
Jul 4, 2009
1,122
6
Hi all, by uncommenting the line, you can then simply refer to the official API (oddly), and all the methods will work instead of returning null (for thumbnails). Check it out here: http://developer.android.com/reference/android/app/ActivityManager.RunningTaskInfo.html

According to Fede (developer of LauncherPro), the thumbnail resolution is 84dip by 63dip :(.

profete162: As of now, I doubt any ROMs include this. Hit me up on Twitter @Wysie_Soh :)!
 

ruqqq

Senior Member
Oct 12, 2008
526
1,255
Hello!

Please excuse my ignorance, but I have a few questions.
I am the developper of TaskOS and this feature is what I'm looking for months in my application.

Si, if I understand well this topic, the linecode to add must be done by ROM's developpers, is it true?

I really would like to have a list of compatible ROM's or please tell me if I am totally misunderstanding what you say.

Profete162

this is at discussion stage currently and the first post is just my prototype to show it works. ;)

basically, the current plan is to improvise the code to:
1. higher resolution + optimization (perhaps: a bit sensitive issue)
2. orientation detection (discussed with Fede on twitter, it's quite simple)
3. incorporate in custom rom (e.g. cyanogenmod)

...if you're using CyanogenMod, get in touch with Wysie to get his framework or .. you can compile yourself to test it.

i don't have my N1 with me right now and hence can't develop this any further than now. *irritated*