• Ei tuloksia

4. Concept of Applications

N/A
N/A
Info
Lataa
Protected

Academic year: 2022

Jaa "4. Concept of Applications"

Copied!
42
0
0

Kokoteksti

(1)

4. Concept of Applications

What constitutes an application?

• Design process

• Example

• Packaging applications

• Symbian OS application development

• Summary

(2)

So What Is an Application?

• In an abstract sense:

– A piece of software that something specific and useful?

– Set of programs?

– Someting that gives device more capabilities?

– Runs on top of underlying specific hardware and infrastructure software?

• Technically:

– Bootstrap?

– Simple main() ?

– A class implementing certain predefined methods that override platform’s methods?

– A collection of classes that form a complex configuration?

– A combination of executables and other files (e.g. graphics, auxiliary data files, etc)?

• Something else, what?

(3)

Application and Software Stack

Application Facilities - Applications

- UI and application specific libraries Middleware

- Communications stacks

- Abstract access to lower-level facilities Low-level Software

- Kernel

- Device drivers

App code

App code

App code

App code

(4)

Or only simply….?

Application Facilities - Applications

- UI and application specific libraries Middleware

- Communications stacks

- Abstract access to lower-level facilities Low-level Software

- Kernel

- Device drivers

App code

(5)

Concern: Depth of Integration

• Independent applications that share nothing are simple to implement

• Applications share data

– Common format; should one app’s extensions be understandable by another app?

• Applications share (library) code

– Common facilities can be reused relatively safely

• Applications are intertwined

– E.g. a MMS can be sent from different applications

– Common infrastructure interface; sometimes menu items that should be generated on-the-fly, ...

– Sometimes features can be difficult to associate with some particular application (themes, ringing tones, ...)

• Complexity increases in both design and testing

(6)

Concern: Application priority

• Application priority determines how important a certain application is

– Implemented with threads and thread priorities

– Thread priority determines how responsive a thread is when it is running

• However, starting a thread can be slow

– If rapid actions are needed, one must have the thread already running

• Keeping the most important applications (or related infrastructure) constantly running?

– Especially if some resources are required, they can also be reserved in advance

• Saving data when an application is shut down? Or saving data more often so that applications can be shut down at any phase of the execution? Automatic shutdown of low-priority

applications?

• Further testing challenges as more and more combinations enabled!

(7)

Concern: Usability

Importance demonstrated by e.g. CACM theme issue (5 articles)

– 3 dedicated to usability, user experience, design involving users, etc.

– 2 with wider focus

Consistency of user experience and differences to workstation usage patterns

– Short duration – Focused actions

– No long-lasting sessions

– Complexity in interaction design

Can be considered a design driver, at least indirectly

– Adequate performance

– Practical to perform common tasks, whereas rarely needed properties can be harder to perform

– Also related to application priorities and depth of integration

May be predefined for an independent application developer

(8)

Content and goals

• What constitutes an application?

Design process

• Example

• Packaging applications

• Symbian OS application development

• Summary

(9)

Workflow

Scoping

Performance management UI design

Memory layout and data structures Communication and I/O

(10)

Scoping

• Fundamental purpose of the application

– What it does

– What it does not

• For a mobile version of a workstation application, a subset of features to be selected

• Relative priority to be given to features; the priority will then guide the development iteratively

– Priority should therefore be based on the importance of the feature to the user

– Easiness of activities performed seldom can be compromized

• Scoping can be helped with paper protos, mock-ups, or

running prototypes

(11)

Importance of Performance

• General responsiveness metrics needed (how fast an application starts, shuts down, opens file, etc)

– Forces to consider sequences of events that occur when the user performs an action

• Test all assumptions with a real device; do not trust the emulator

– Start with key features, then advance to less critical ones

• Assume that more will be expected in the future

– Use e.g. an old hardware platform for less capable executions

• Focus on real bottlenecks, not on the ones that one can most easily find or fix

– It is the overall performance that counts

– Rule of thumb: Start with data structures, their layout in memory, algorithms, UI design

(12)

User Interface Design

• Study key use cases and features that characterize the application

– Scoping as already discussed

– Innovations that can be device or application specific

– End-user productivity gained with the designed interface (ease-of- use)

– End-user responsiveness (the feel of being in control)

• The device keeps the user informed and does not halt at random times

• Fooling the user

• Problems

– Tendency to repeat actions if seemingly nothing happens – Device specific design of UI

– Small screen, clumsy keyboard

• ”One size fits all” vs. application-specific features and devices

(13)

Data Model and Memory Concerns

• Data representation bears great significance to memory consumption

– Disk or memory?

– Static vs. dynamic?

– Stack vs. heap?

• Implementation techniques can also have an effect to this

– Dynamically linked libraries and the necessary loading facilities – Virtual machine and its implementation

– Inheritance and virtual function table – Applied design patterns

– Methodology used in the development – …

(14)

Communication and I/O

• Local (e.g. files) and remote resources (e.g. services offered by a server in a network) to be considered

– Local access is usually relatively fast

– Remote access commonly introduces a longish round-trip time

• Level of abstraction in communication significant

– binary streams -> text streams -> XML forward only readers and writers -> XML document object model

– Also affects development time

• Costs of a connection

– Download a lot of data when WLAN is available, use local proxy when only GPRS can be used

(15)

Content and goals

• What constitutes an application?

• Design process

Example

• Packaging applications

• Symbian OS application development

• Summary

(16)

Workflow

Scoping

Performance management UI design

Memory layout and data structures Communication and I/O

(17)

Scoping

(18)

Scoping .... Cont’d

• Calendar entries

• Reminders

• Contacts

• Day-week-month view

• Import/export (synchronization)

• Lunar phase

• Connectivity/group features

• Time zones

• Repeated events

• Overlapping treatment

• Public holidays

• Automatic meeting coordination

• ”Date” operations

(19)

Performance

• Implementation of a mock-up

• First build for a real device

– Also tested with the device

(20)

UI Design

(21)

Data Structure?

(22)

I/O and Communication

• Server Synchronization?

• On the fly update with e.g. SMS? Or only pull when the user has suitable

connectivity access?

(23)

Content and goals

• What constitutes an application?

• Implementing applications

• Example

Packaging applications

• Symbian OS application development

• Summary

(24)

Packaging Applications

Mobile device

Emulator

Development workstation

Emulator runnable

Emulator compilation

Device runnable

Cross-

compilation

Device installable

Device runnable Source

code

Packing

Download

+ Auxiliaries

(25)

Problem: How to deliver?

• Users of mobile devices may not have a computer readily available

– Delivery of applications should therefore not be based on loading an application from web to a host computer and then download it to the device

• Over-the-air delivery of applications

– Long loading times

– People may not realize the trustworthiness of the download site – What happens if the phone is flashed?

• Memory cards

– What if the device type changes?

• Issues related to digital rights management

– Can the application be copied?

– How about auxiliaries?

(26)

Technical Implementation

• Platform-specific installation packages

– Java: JAR; Midlet suite – Symbian: SIS

– Windows: CAB – Linux: DEB

• Installation managers implemented in devices can control installation at installation-time

– Certificates for controlling who is responsible for implementation – Signing programs common (e.g. Symbian Signed)

– User can usually override

• Platform specific security schemes to prevent unauthorized access to device’s resources at run-time

– Sandbox security (Java)

– Capability based security (Symbian)

(27)

Content and goals

• What constitutes an application?

• Implementing applications

• Example

• Packaging applications

Symbian OS application development

• Summary

(28)

Process

Create project definition file

Create makefile/

workspace

Code

Build for emulator

Build for device Run ok?

Debug

Run ok?

Done yes

yes no

no

(29)

Application Structure

CApaDocumentCApaApplication CCoeEnv CCoeControl CCoeAppUi

AppArch UI Control Framework

CExAppView CExAppUI CExDocumentCExApplication

Application

CEikonEnv CEikAppUI CEikDocumentCEikApplication

Eikon/Uikon

(30)

Device (type) Specific Features

• Many, if not all, platforms define a wrapper layer that inherits CEik* and from which CMy* must be inherited

– Series 60 -> CAkn*

– Qkon -> CQkn*

• Can lead to confusing problems as forgetting the

wrapping layer can result in compilable applications that fail in execution

– Example: An application crashes when opening a menu

• Challenge: How to implement systems that are portable

between devices offering similar yet different facilities

(31)

Sample Application

(32)

Auxiliary Files and Definitions

• Project Definition File

• Application Definition File

• Resource File

– Version information

– Default file name for saving application data – Menu structure of the application

– Constant strings to ease localization

• UI and Panic related constants

– *.HRH

– *.PAN

(33)

DLL Entry Point

// DLL entry point, return that everything is ok GLDEF_C TInt E32Dll(TDllReason /*aReason*/) {

return KErrNone;

}

EXPORT_C CApaApplication* NewApplication() {

return (new CQAApplication);

}

(34)

… or an EXE

(depending on Symbian version)

LOCAL_C CApaApplication* NewApplication() {

return new CQAApplication;

}

GLDEF_C TInt E32Main() {

return EikStart::RunApplication(NewApplication);

}

(35)

CQAApplication

class CQAApplication : public CAknApplication {

public: // from CApaApplication TUid AppDllUid() const;

protected: // from CEikApplication

CApaDocument* CreateDocumentL();

};

CApaDocument* CQAApplication::CreateDocumentL() {

// Create QA document, and return a pointer to it

CApaDocument* document = CQADocument::NewL(*this);

return document;

}

TUid CQAApplication::AppDllUid() const {

return KUidQAApp; // Return the UID }

(36)

CQADocument

class CQADocument : public CAknDocument { public:

static CQADocument* NewL(CEikApplication& aApp);

static CQADocument* NewLC(CEikApplication& aApp);

~CQADocument();

CEikAppUi* CreateAppUiL();

CQAEng* Model();

private:

void ConstructL();

CQADocument(CEikApplication& aApp);

CQAEng * iModel;

};

CEikAppUi* CQADocument::CreateAppUiL(){

CEikAppUi* appUi = new (ELeave) CQAAppUi;

return appUi;

}

(37)

CQAAppUi

class CQAAppUi : public CAknAppUi { public:

void ConstructL();

CQAAppUi();

~CQAAppUi();

void HandleCommandL(TInt aCommand); // from CEikAppUi private:

CQAAppView* iAppView;

CQAEng* iModel;

};

void CQAAppUi::HandleCommandL(TInt aCommand) { switch(aCommand) {

case EQAAsk: iModel->Reset(); iAppView->DrawNow(); break;

case EQAAnswer: iModel->Select(); iAppView->DrawNow(); break;

case EAknSoftkeyExit:

case EQAQuit: Exit(); break;

default: User::Panic (_L("QandA"), EQABasicUi); break;

} }

(38)

CQAAppView

class CQAAppView : public CCoeControl { public:

static CQAAppView* NewL(const TRect& aRect);

static CQAAppView* NewLC(const TRect& aRect);

~CQAAppView();

void SetModel(CQAEng * aModel);

void Draw(const TRect& aRect) const; // from CCoeControl private:

void ConstructL(const TRect& aRect);

CQAAppView();

CQAEng * iModel;

};

(39)

CQAEng

class CQAEng : public CBase { public:

static CQAEng* NewL(); // Two-phase constructor.

~CQAEng(); // Destructor.

TPtrC Question(); // Reference to current question.

TPtrC Answer(); // Reference to current answer.

void Select(); // Allows one to answer to a question.

TBool Used(); // Identifies whether the answer is visible.

void Reset(); // Defines new question and and answer.

protected:

void ConstructL(); // Constructors.

CQAEng();

private:

// All questions and answers implemented as arrays.

CDesCArrayFlat * iQuestions, * iAnswers;

// Current question and answer are indices to the arrays.

TInt iQuestion, iAnswer;

TBool iUsed; // Identifies if the answer has been selected.

};

(40)

Generating an Installation Package

; qanda-simple.pkg

;

;Language; standard language definitions

&EN

; standard SIS file header; application name and id.

#{"qanda-simple"},(0x01005b97),1,0,0

;Supports Series 60 v 0.9

(0x101F6F88), 0, 0, 0, {"Series60ProductID"}

; Files to copy; Application and compiled resource file.

"..\..\..\epoc32\release\armi\urel\qanda-simple.APP"

-"C:\system\apps\qanda-simple\qanda-simple.app"

"..\..\..\epoc32\release\armi\urel\qanda-simple.rsc"

-"C:\system\apps\qanda-simple\qanda-simple.rsc"

(41)

Content and goals

• What constitutes an application?

• Implementing applications

• Example

• Packaging applications

• Symbian OS application development

Summary

(42)

Summary

• Application concept is fundamentally about

connecting new (application specific) features to the existing device infrastructure

• Application priority is affected by

– the importance of keeping the application in execution

– the priority of threads used for implementing the application

• Five principal topics form the guideline for application design

– Scoping

– Performance

– Proper UI design

– Internal data representation – Communication model

• Symbian solution: Collection of matching classes

Viittaukset

LIITTYVÄT TIEDOSTOT

Myös sekä metsätähde- että ruokohelpipohjaisen F-T-dieselin tuotanto ja hyödyntä- minen on ilmastolle edullisempaa kuin fossiilisen dieselin hyödyntäminen.. Pitkän aikavä-

Jos valaisimet sijoitetaan hihnan yläpuolelle, ne eivät yleensä valaise kuljettimen alustaa riittävästi, jolloin esimerkiksi karisteen poisto hankaloituu.. Hihnan

Vuonna 1996 oli ONTIKAan kirjautunut Jyväskylässä sekä Jyväskylän maalaiskunnassa yhteensä 40 rakennuspaloa, joihin oli osallistunut 151 palo- ja pelastustoimen operatii-

DVB:n etuja on myös, että datapalveluja voidaan katsoa TV- vastaanottimella teksti-TV:n tavoin muun katselun lomassa, jopa TV-ohjelmiin synk- ronoituina.. Jos siirrettävät

Solmuvalvonta voidaan tehdä siten, että jokin solmuista (esim. verkonhallintaisäntä) voidaan määrätä kiertoky- selijäksi tai solmut voivat kysellä läsnäoloa solmuilta, jotka

Helppokäyttöisyys on laitteen ominai- suus. Mikään todellinen ominaisuus ei synny tuotteeseen itsestään, vaan se pitää suunnitella ja testata. Käytännön projektityössä

Tornin värähtelyt ovat kasvaneet jäätyneessä tilanteessa sekä ominaistaajuudella että 1P- taajuudella erittäin voimakkaiksi 1P muutos aiheutunee roottorin massaepätasapainosta,

Since both the beams have the same stiffness values, the deflection of HSS beam at room temperature is twice as that of mild steel beam (Figure 11).. With the rise of steel