Getting an app to use both flip open and flip closed view

Login to reply to this topic.
Mon, 2005-08-01 16:10
Joined: 2004-11-05
Forum posts: 57
I have read several posts about this, but none seems to get any to the point suggestions. The best suggestion so far is to study a programme which does this. That is EChess. I have started study the code, and have now acomplished the first step towards a fuly fledged flip open flip closed app.

First: The environment must be told that my app uses both flip closed and flip open views. This must happen befoure the app starts, because (among other things?) we want the app to be visiblie under the menue "applications" in flip closed menue.

So we cant look in the code for the app to find the solution.

AIF file is the solution.

In the mmp file, you need something like this:
Code:
AIF HelloWorld.aif . HelloWorldAIF.RSS c8 icons\echess20x16.bmp icons\echess20x16m.bmp
(AIF <target> <source path> <source> <color depth> <icon> ..... )
In the HelloWorldAif.rss, we need this, which is actually where the magic takes place:

Code:
#include <aiftool.rh>
RESOURCE AIF_DATA
{
app_uid=0xSOMTEHING;    // your app ID
caption_list=
{
CAPTION { code=ELangEnglish; caption="HelloWorld"; }
};
num_icons=1;
embeddability=KAppNotEmbeddable;
newfile=KAppDoesNotSupportNewFile;
datatype_list=
view_list =
{
VIEW_DATA
{
view_uid = 0x00000117;     // YOUR view ID
screen_mode = 0;         // this tells the environment that this view uses FLIP OPEN view
caption_list =
{
CAPTION {caption="FO view"; }
};
},
VIEW_DATA
{
view_uid = 0x00000118;
screen_mode = 1;   // and this that this view uses FLIP CLOSED view
caption_list =
{
CAPTION { code= ELangEnglish; caption="FC view"; }
};
}
};
}

Dont forget to include a line like this in your pkg-file
Code:
"C:\Symbian\UIQ_21\Epoc32\data\z\system\apps\HelloWorld\HelloWorld.aif"-"!:\System\Apps\HelloWorld\HelloWorld.aif"
------------

So far so good. The app showes up where we want.

This is so far I have got now. To switch betwen the views at runtime is way ahead. But i promise you all, I will succeed with this.
I will post as soon as I reach next milestone.

Stay tuned, and PLEASE give me comments.


Wed, 2005-08-03 07:57
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
Thanks to all that have read the first part of this thread.

Now, I have managed to get my app to launch and draw itself in flip closed mode.

In my class CSmallView I must have this method:

Code:
TBool CSmallView::ViewScreenModeCompatible(TInt aScreenMode)
{
return (aScreenMode == 1);    // 1 is flip closed, 0 is flip open
}

If I search for "ViewScreenModeCompatible" in my SDK, i get nothing.


Thanks in advance for comments.
Thu, 2005-08-04 15:49
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
Well, I have now managed. I can flip up and down and all that shit.

The details are so many, so I skip continuing writing about this.


Thanks anyway  Smiley
Fri, 2005-09-23 11:01
Joined: 2005-07-30
Forum posts: 17
Re: Getting an app to use both flip open and flip closed view
Hi magsus,
Can you please post the remaining part on the forum ,it would be of great help to all of us who are struggling with this.
Otherwise can you mail it to me at jitendra.chhajed@magnet-i.com.
Any pointers will also be greatly appreciated.

Awaiting your reply.

Jitendra Chhajed
Tue, 2005-09-27 08:19
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
I would like do to that. But it is so many things.

Do you have a spesific question?
Tue, 2005-09-27 08:30
Joined: 2005-07-30
Forum posts: 17
Re: Getting an app to use both flip open and flip closed view
hi magsus,

Thanks for your reply.
I have a simple application which has an active object and a list box in the view.
Right now the screen size is not hardcoded listbox is drawn using
CEikonEnv::Static()->ScreenDevice()->SizeInPixels()
And the application works only in flip open mode.
My question is that I want my application to work in flip open and flip closed mode,it is ok if I am not
able to switch the mode in between.
If I   change only  the aif.rss file file as per your instructions will my application work in both modes.

Awaiting your reply,

Jitendra
Tue, 2005-09-27 08:58
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
The bove code makes the application startable from flip closed mode.
That means it is included in the #Applications menu when flip is closed.

M
Fri, 2005-09-30 04:00
Joined: 2005-07-30
Forum posts: 17
Re: Getting an app to use both flip open and flip closed view
Hi magsus,

Thanks for replying to my mail.

Is it possible to bring an application in foreground in flip closed mode?
And is it possible to use dnl for dialing a call in flip closed mode I have read on sonyerricsson forum that ,
TVwsViewId id(KUidPhoneApp,KUidPhoneAppView) that I am using for flip open  mode is not available in  flip open mode.

Awaiting your reply.

Jitendra
Fri, 2005-09-30 08:17
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
I guess everything is possible.

In order to help you, I need a more closer description of what you want to do.


M
Fri, 2005-09-30 08:39
Joined: 2005-07-30
Forum posts: 17
Re: Getting an app to use both flip open and flip closed view
Hi Magsus,

I am amazed with you response time and attitude.Great!

I have an application in which I am capturing the dialing event and  my application comes to foreground and then I dial a number from my application.
It is working in flip open mode and now I want it work  in flip closed mode.
But I have read on sonyerricsson that it is not possible to bring an application in foreground when the phone is in flip closed mode and also the DNL of phoneapp that is dialing one is not supported in flip closed mode.

Awaiting your reply,

Jitendra
Fri, 2005-09-30 09:27
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
My app is comming to foreground the way you describes with the flip closed.

In your AppUi class you need something like this:

Code:
  if (iCoeEnv->ScreenDevice()->CurrentScreenMode() == 0)
    {
      AddToStackL(*iOpenView, iOpenView);
      RegisterViewL(*iOpenView); 
      AddToStackL(*iClosedView, iClosedView);
      RegisterViewL(*iClosedView);
    }
  else
    {
      AddToStackL(*iClosedView, iClosedView);
      RegisterViewL(*iClosedView);
      AddToStackL(*iOpenView, iOpenView);
      RegisterViewL(*iOpenView); 
    }

Fri, 2005-09-30 09:55
Joined: 2005-07-30
Forum posts: 17
Re: Getting an app to use both flip open and flip closed view
Hi magsus,

Thanks a lot!
Can you tell me whether it is possible to dial a call using DNL in flip closed mode.

Awaiting your reply,

Jitendra
Fri, 2005-09-30 15:13
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
What is DNL ?
Mon, 2005-10-03 07:47
Joined: 2005-07-30
Forum posts: 17
Re: Getting an app to use both flip open and flip closed view
Hi magsus,

DNL(Dynamic Navigational link) is used to switch between views.
I am using this  function to make a call from my application

void CExampleAppView::DnlToPhoneL(const TDesC& aNumber)
{
TVwsViewId id(KUidPhoneApp,KUidPhoneAppView);
TNumDnlPhone dnl;
dnl.iNumber = aNumber.Right(KPhoneNumMaxLength);
TNumDnlPhoneBuf dnlBuf(dnl);
CEikAppUi* appUi = iEikonEnv->EikAppUi();
appUi->ActivateViewL(id, KUidNumDnlPhone, dnlBuf);
}

where KUidPhoneApp,KUidPhoneAppView
in TVwsViewId id(KUidPhoneApp,KUidPhoneAppView)

provides the phone application for dialing a number and I have read in sonyericcsson forum that it is not available in flip closed
mode.

Besides have a look at these links.

http://developer.sonyericsson.com/viewSolution.do?id=5373

http://developer.sonyericsson.com/viewSolution.do?id=5382

Mon, 2005-10-03 10:09
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
I have looked at those links. I really wonder what this one means:
Quote
"Neither should you place your application between the flip and the application picker, when the flip is opened."


This is proven to be false.
Quote
Sony Ericsson only supports application developed for the flip open mode on the P800.
Mon, 2005-10-03 10:34
Joined: 2004-11-05
Forum posts: 57
Re: Getting an app to use both flip open and flip closed view
The view
Code:
KUidPhoneAppView
is (probably) for flip-open mode.

Maybe there is no corresponding flip-closed-view for that function.
(The flip-closed-view (if it exists) has another view-UID)


Magnus
  • Login to reply to this topic.