Friday, August 31, 2007

Motorola MotoMAGX

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].

Thursday, August 30, 2007

Types of Phones

1. Any mobile phone
-Voice calls
-SMSs
-Contacts

2. Feature phone
-Voice calls
-SMSs
-Contacts
-MMSs
-Email
-WAP
-Camera
-Colour Display

3. Smartphone
-Voice calls
-SMSs
-Contacts
-MMSs
-Email
-WAP
-Camera
-Colour Display
-Access to OS
-Application background execution
Compatibility aspects to the S60 platform:

1. Source compatibility: means that the application or a client code can be rebuilt without a need to modify the code.

2. Binary compatibility: means that no rebuild is needed and the application or a client code thus runs on the S60 phone. Potential issues come along when there is a new compiler and tool chain; The S60 3rd Edition introduces new compilation tools (RVCT, GCC EABI), which cause a full binary break.
Symbian Run Modes

Symbian runs in 2 Modes.

1. User mode – kernel services can only be accessed through the EUSER.DLL. The lack of a proper kernel port does not stop the development of user-side components because the platform provides a complete Kernel Port for the PC environment under the Windows Operating System. This is called the emulator.

2 Kernel mode – EUSER.DLL is an interface between common code and hardware-specific code. In the other words, kernel mode means that the software is run on the target hardware.
S60 ecosystem.
1. Licensees.
2. Product Creation Community (PCC)
• Boutiques – experts in designing complete S60 phones and managing entire S60 phone projects
• Competence Centers – top-tier software companies with deep S60 end-to-end understanding and extensive S60 project support
• Wireless Technology Providers – experts on the hardware platforms or hardware components upon which S60 phones are built
• Contractors – skilled software companies offering focused expertise in specific technology areas
3. 3rd party developers.
S60 architecture

S60 architecture consists of ...
1. Cellular modem controlled by modem software.
2. Domestic Operating System (DOS).
3. Application processor engine controlled by Symbian OS.
4. S60 software.

Nokia’s Mobile Software (MSW) is the organization behind the S60 platform.

Monday, August 13, 2007

Coding for Mobile on Mobile

If you are thinking to do this Hmmmm. you need some rest. ;-)
OR
Do what i do use http://www.j2medit.com/

Saturday, August 11, 2007

How to use TLex to Parse tokens from String.

  _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();
}

Friday, August 10, 2007

"C++/C Development with Eclipse" Then and Now

In the Past i have tried to use Eclipse for my day to day development, But at that time it too me around 6 hours before i could install all the req. tools and started my developmentBut that is also not a smooth road.

But Now {2 day} i found a good Eclipse CDT bundle for Windows with that i start and running in 30 mins. I suggest you take a look in to it.

http://wascana.sourceforge.net/
LiMo [Linux Mobile] Platform architecture
How to hide Status Pane

CEikonEnv* iEnv = CEikonEnv::Static();
CEikStatusPane* statusPane=Env->AppUiFactory()->StatusPane();
statusPane->MakeVisible(EFalse);
Include files:
#include <eikspane.h>
#include <eikenv.h>

Link against: eikcore.lib

Tuesday, August 07, 2007

Sending Application in Background using RSS

Add the "Launch" field in application info resource in your Project .RSS file
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 ?
One use case may be the running wallpaper where a server with GUI runs in BackGround.

Sunday, August 05, 2007

Java Verified Signing Flow.
How to get the Resource File from Installation
_LIT(KIconFile,"!:\\Data\\MyApp\\MyApp.mbm");
TFileName myCompleteFileName(KIconFile());
CompleteWithAppPath(myCompleteFileName);
Symbian Symbianed Flow For Symbian V9

Capability Mobile Diagarm For Symbian v9
The "capabilities" model was introduced in Symbian OS v9.x (S60 3rd Edition onwards). There are 20 capabilities, which are divided into four groups:


Symbian V9 Security Description.

A capability is an access token that corresponds to an access permission of sensitive system resources.

Basic capabilities

LocalServices
Grants access to "short-link" connections such as Bluetooth and infrared. These connections are not billable transactions. An example of this kind of action is device-to-device file transfer.

Location
Grants access to the location of the device, such as network cell ID.

NetworkServices
Grants access to remote service and might involve cost for the user. Typical use cases are dialing a normal GSM voice call or sending a text message.

ReadUserData
Grants read-only access to confidential user data. Typical use cases are reading contacts, messages, and calendar events.

WriteUserData
Grants write access to user data. Typical use cases are adding or deleting contacts, messages, or calendar events.

UserEnvironment
Grants access to live confidential information about the user and his/her immediate environment. An example of a typical protected resource in a mobile device is a camera.

Extended capabilities

PowerMgmt
Grants access to kill any process running in the system or completely turn off the device.

ProtServ
Grants the right to a server to register with the protected name. Protected names start with a “!”. The kernel will prevent servers without ProtServ capability from using such a name and therefore will prevent protected servers from being impersonated.

ReadDeviceData
Grants read-only access to sensitive system data such as device settings.

WriteDeviceData
Grants write access to sensitive system data such as device lock settings, system time, and time zone.

SurroundingsDD
Grants access to logical device drivers that provide input information about the surroundings of the mobile phone, for example global positioning system (GPS) device drivers.

SwEvent
Grants access to simulate key presses and capture such events from any application. Typical example is a screen-shot application.

TrustedUI
Grants access to create a trusted UI session and display dialogs in a secure UI environment. Typical example is password dialog.

Platform-approved capabilities

AllFiles
Grants read-only access to all data caged directories and write access to /private –directory. NOTE! AllFiles will not be granted for a filemanager type of application.

CommDD
Grants access to communication device drivers such as WiFi, USB, and serial device drivers.

DiskAdmin
Grants access to disk administration functions such as formatting a drive or mounting/unmounting drive partitions.

MultimediaDD
Grants access to critical multimedia device drivers such as camera and sound.

NetworkControl
Grants access to modify or access network protocol controls such as dropping all connections from the mobile phone.

Manufacturer-approved capabilities

DRM (digital rights management)
Grants access to DRM-protected content in plain form.

TCB
Grants write access to /sys and /resource directories in the mobile phone.
Using FlashLite with Symbian C++

Code for S60 V3:


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();
}

Code for S60 FP1:


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();
}

Get Phone Screen Size
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);
Find out all the Message server entries.


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();
...
}
A color picker in Symbian S60 v3

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();
}

Saturday, August 04, 2007

How to Hide Application from User Menu
In your ApplicationName_reg.rss file you will find a structure RESOURCE APP_REGISTRATION_INFO, you need to add the following line, to the resource.
BYTE hidden = KAppIsHidden;
This application will be a hidden application, and it will not be shown in Applications list.
Mobile DRM

Several articles I read recently on Mobile DRM:

Roberto Nunes’s Forum Nokia Blog:
DRM and some more TLA (tree letters abbreviations)
DRMs - Part 2
DRMs - Part 3 OMA DRM
DRMs - Part 4 - Conclusions

medialoper.com:
Microsoft Zune’s Big Innovation: Viral DRM
ipodnn.com:
MS defends Zune temporary DRM

Friday, August 03, 2007

How to detect if an application is launched by user or the startup list

It is sometimes useful to be able to detect whether an application is started at boot time by the Startup List API (present only in S60 3rd Edition) or by the user, and passing Symbian Signed - which is generally required to have an application which requires auto boot feature - makes this almost mandatory. So How we can archive it let us try

First, we will modify the application registration file and add some opaque_data field in the APP_REGISTRATION_INFO resource. The content and value of these data does not really matter, you just need to specify something: :

#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.

To do this, we will override the ProcessCommandParametersL() function in your AppUI:



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 );
}

Thursday, August 02, 2007

How to launch an application with its UID

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);
}

stats counter