|
|
User login
Feeds |
application in background like a theme
|
|||||
| Fri, 2007-06-15 11:52 | |
|
Hi,
how can i send an application to run in the background but having it like a theme. in other words, i want to the application to appear (not hidden) when in the main menu and in the stand by replacing the theme in the background. is it possible to make something like this? i tried SetOrdinalPosition on the windowgroup but that sent the app totally offscreen. regs AF |
|
Forum posts: 286
Cheers,
Sri
Forum posts: 1271
And even if you could replace the app, the symbian wserv is currently not near advanced enough to support dynamic content in the background.
Forum posts: 123
But Sony Ericsson has managed to have this working on W950!!
when u have music playing in the background, and u return to the main page. you will have animation playing in the background... so window server can do it!!!
Forum posts: 1271
Sorry, its still not possible for a 3rd party.
Actually, that in the w950 was implemented by the company where I work, and I was personally involved in earlier projects building the base integration they are still using.
Since I am under NDA, I can't of course go into any details on this, but I can tell you this is unfortunatly nothing you can do as a 3rd party.
To get that to work we had to go deeper into the platform then the wserv, and had several new api:s implemented.... neither of which are public.
And... its far from as simple as creating an app and setting some flag to have it in background...
Forum posts: 122
Nokia have something similar, that the company I work for implemented. But again, it's not open to 3rd parties.
These leaves with two options
1. Write directly to the screen over the top of the currently running application - an example of how to do this was given in Symbian OS Internals. The chapter by Doug Feather describes why Direct Screen Access is a great API because it prevents you from over writting an other application, and then goes on to show you how to do it
But the down side of this is that it nukes the battery, and you have to write loads of code to watch what application is in the forground. Then you'll still end up overwritting any notification dialog popups.
2. Cheat : Change the wallpaper, draw to an off screen bitmap, save it to disk as a jpg, and then set it as wallpaper.
Down side here is that fast updates are not possible. So no animation, but you could display some information using it. Also you'll need to be model specific as each phone now has different screen sizes.
Forum posts: 123
thanx for the replies.
mc_woods, i tried implementing DSA but it was not doing what you mentioned:
i had several problems and i posted them in this thread. This shows that when DSA was moved on screen it did not update the background content automatically. i have to do the dirty work myself. But, regarding the chapter, i guess Douglas has done great job in there
I dont remember reading the part about DSA but will give it a try.
cheers
AF
Forum posts: 1271
Well, as I always have to re-iterate, you don't need DSA to overwrite other apps output on the screen.
You need it to prevent yourself from overdrawing other apps
If you don't care if you overdraw, there is no need for DSA.
But it will give you drawing artifacts...
Because its the wserv that owns the screen framebuffer, and it relies on it being the same as it left it. If some other guy writes in the framebuffer, you will end up with garbage on the screen when wserv decides to update something that is just partially "under" what you wrote there.
And it will in no way help you with drawing _under_ window server content. (Like the background in appshell as abolfoooud wants)
Forum posts: 122
Alh, quite right.
Sorry I wasn't clear in my original post. Doug explains that DSA prevents over writting screen contents. DSA was created specifically because the old way ( which he explains how to implement ) allows a developer to write directly to the screen on top of whatever application is running at the time.
I have done it myself, it works. You end up creating a timer to update the image on the screen because it will corrupt if you don't ( due to window server updates ) I had some text which faded in, then scrolled. It worked ok, but it did nuke the battery completely*. - And then I needed extra code to check for screen saver, is the phone app the currently running application, etc... is there a new message popup... blah.. blah.... it got really hacky.....
It worked great for a demo ( I used it for a job interview ). But in a production environment it's far from ideal.
As for drawing __under__... of course it would be nice if you could, but you don't have to... as with all things graphical, you only need to give the appearance of drawing under something. In my example I used by handle to the screen to grab a screen shot, then blend in my text using some hand coded alpha blending code. One day I'll post this up on my blog ( mind-flip.blogware.com ).... I just need the time to do it.
*Battery Nuking
This is because when no screen draws occur the microprocessor controlling the screen is put to sleep, clocks are turned off and power is saved. But because I was drawing to the screen with a timer it was keeping the screen alive which drew extra power and the battery life of the phone dropped something silly. ( was a 6630 at the time ).
Forum posts: 123
mc_woods,
i tried a similar approch to ur timer to update the screen behind my DSA content regularly. but instead of using a timer, i was calling-back DrawNow() to update the screen, but as expected that caused alot of flickering because of the sweitching between the WServ and DSA (at least on the emulator).
an byt hte way, did you get the job with your fading text demo
cheers
Forum posts: 1271
Yeah, it gets hacky very quick..
With your description you will still draw "on top"... unless you find some way to mask what you draw so it doesn't overdraw those select parts of the framebuffer content that you want to look like you are "behind".
And you will have big problems looking like you are behind for example text, which is anti-aliased. (you wont get it to work)
The original post was about drawing animations behind the icons and text in the AppShell background, like on the w950.
Forum posts: 123
yeah yeah alh. it is about W950 like behaviour. But i was just commenting on mc_woods' timer practice that i tried to use (in a similar fashion). But that is off our topic here.
i dont need more pain to what i already have 
so to conclude: third party guys will not be able to achieve this unless with un-easy hacks and pain in the neck which also could lead to filure... so forget it
thanx for ur contributions guys
AF