Motorola’s MotoMAGX Linux platform is based on three things: an open source Linux operating system, kick ass J2ME support and something they call “WebUI.” [HTTP + CSS + AJAX + WebKit].

The Purpose of this Blog is to spread the less known facts to the Mobile developers. If you want to post any article on the Blog please send it to me my email ID is skumar.mobiledev@gmail.com
_LIT8(KSomeConstString,"first,second,third,fourth");
TLex8 lex(KSomeConstString);
TChar ch;
TBuf8<50> token;
while((ch = lex.Get()) != 0 )
{
while ((ch = lex.Peek()) != ',')
lex.Inc();
token.Copy(lex.MarkedToken());
/*
Now we have the string in token,
do something..
*/
lex.Inc();
lex.Mark();
}
RESOURCE APP_REGISTRATION_INFO
{
app_file="projectname";
localisable_resource_file="\\resource\\apps\\projectname_loc";
hidden = KAppIsHidden;
embeddability = KAppNotEmbeddable;
newfile = KAppDoesNotSupportNewFile;
// Launches the application in background.
launch =KAppLaunchInBackground;
}
Why we require to launch a application in Background ?
void CSWF2SISAppUi::LaunchSwfL( const TDesC &aFlashAppName )
{
iHandler = CDocumentHandler::NewL( NULL );
iHandler->SetExitObserver(this);
TUid KUidFlash21 = { 0x200077D6 };
TDataType dtype(KUidFlash21);
TInt error = iHandler->OpenFileEmbeddedL( aFlashAppName, dtype );
}
void CSWF2SISAppUi::HandleServerAppExit (TInt /* aReason */)
{
Exit();
}
void CSWF2SISAppUi::LaunchSwfL( const TDesC &aFlashAppName )
{
iHandler = CDocumentHandler::NewL( NULL );
iHandler->SetExitObserver(this);
TUid KUidFlash21 = { 0x200077D6 };
TDataType dtype(KUidFlash21);
TInt error = iHandler->OpenFileEmbeddedL( aFlashAppName, dtype );
}
void CSWF2SISAppUi::NotifyExit (TExitMode aMode)
{
Exit();
}
Header: w32std.h
Library: ws32.lib
TPixelsAndRotation ScreenSize;
iCoeEnv->ScreenDevice()->GetDefaultScreenSizeAndRotation(ScreenSize);
TInt width = ScreenSize.iPixelSize.iWidth;
TInt height = ScreenSize.iPixelSize.iHeight;
iLogger.WriteFormat(_L("Width : %d, Heigth : %d"), width, height);
CMsvEntry *inbox=iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
CMsvEntrySelection *children=inbox->ChildrenWithMtmL(KUidMsgTypeSMS); // KUidMsgTypeMultimedia
for(TInt i=0;i<children->Count();i++)
{
CMsvEntry *child=inbox->ChildEntryL((*children)[i]);
const TMsvEntry &entry=child->Entry();
...
}
TBool noneExist = EFalse;
TBool noneChosen = EFalse;
TRgb colour = KRgbDarkGray;
CArrayFixFlat<TRgb>* colours = new(ELeave) CArrayFixFlat<TRgb>(6);
colours->AppendL(KRgbBlack);
colours->AppendL(KRgbDarkGray);
colours->AppendL(KRgbRed);
colours->AppendL(KRgbSymbianOrange);
colours->AppendL(KRgbBlue);
colours->AppendL(KRgbWhite);
colours->AppendL(KRgbCyan);
colours->AppendL(KRgbYellow);
colours->AppendL(KRgbGreen);
CAknColourSelectionGrid *d = CAknColourSelectionGrid::NewL( colours, noneExist, noneChosen, colour);
if(d->ExecuteLD())
{
///Here you get the selected color..this you can use in your draw method.
//selectedColor = colour;
DrawNow();
}
BYTE hidden = KAppIsHidden;
This application will be a hidden application, and it will not be shown in Applications list.
#include <appinfo.rh>
#include <uikon.rh>
RESOURCE APP_REGISTRATION_INFO
{
...
opaque_data = r_startup_detect;
}
RESOURCE NUMBER_INT8 r_startup_detect
{
value = 1;
}
The opaque_data and other launch parameters will be ignored by the startup list when launching the application. Thus, detecting whether they are present or not allows to differentiate whether the application has been launched at boot time or by the user.TBool CMyAppUi::ProcessCommandParametersL( CApaCommandLine &aCommandLine )
{
if(aCommandLine.OpaqueData().Length() > 0)
{
// Opaque data exists,
// app. has been manually started from the menu
}
else
{
// Opaque data not present,
// App. has been auto-started from start up
// or after Installation !!!
}
return CEikAppUi::ProcessCommandParametersL( aCommandLine );
}
LaunchAppWithUIDL(const TUid aAppUid)
{
RApaLsSession apaLsSession;
User::LeaveIfError(apaLsSession.Connect());
CleanupClosePushL(apaLsSession);
TApaAppInfo appInfo;
TInt retVal = apaLsSession.GetAppInfo(appInfo, aAppUid);
if(retVal == KErrNone)
{
CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
//cmdLine->SetLibraryNameL(appInfo.iFullName); // Pre Symbian V9
cmdLine->SetExecutableNameL(appInfo.iFullName);
cmdLine->SetCommandL(EApaCommandRun);
User::LeaveIfError( apaLsSession.StartApp(*cmdLine) );
CleanupStack::PopAndDestroy(cmdLine);
}
else
{
// Application with UID can't be found!
}
CleanupStack::PopAndDestroy(&apaLsSession);
}