27
Introduction to Symbian C++ Programming Huang, Chi-Chia 2009.02.05 1 Context-Aware Group, Intelligent Agents Lab, NTU Based on Symbian OS Basics Workbook 3.1

Introduction to Symbian C++ Programming

  • Upload
    jariah

  • View
    41

  • Download
    3

Embed Size (px)

DESCRIPTION

Introduction to Symbian C++ Programming. Huang, Chi-Chia 2009.02.05. Based on Symbian OS Basics Workbook 3.1. Outline. Setting up development environment Basic concept of Symbian C++ Porting to Cell phone. Development Environment. Java runtime environment Carbide C++ - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to  Symbian C++ Programming

Introduction to Symbian C++ Programming

Huang, Chi-Chia2009.02.05

1Context-Aware Group, Intelligent Agents Lab, NTU

Based on Symbian OS Basics Workbook 3.1

Page 2: Introduction to  Symbian C++ Programming

Outline

• Setting up development environment• Basic concept of Symbian C++• Porting to Cell phone

Context-Aware Group, Intelligent Agents Lab 2

Page 3: Introduction to  Symbian C++ Programming

Development Environment

• Java runtime environment• Carbide C++

– Download from Forum.Nokia.com– Account needed

• ActivePerl– Active Perl 5.6.1 build 631

• SDK– S60 3rd Edition, Feature Pack 1– Download from Forum.Nokia.com– Account needed

Context-Aware Group, Intelligent Agents Lab 3

Page 4: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 4

Page 5: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 5

Page 6: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 6

Page 7: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 7

Page 8: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 8

Page 9: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 9

Page 10: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 10

Page 11: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 11

Page 12: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 12

Page 13: Introduction to  Symbian C++ Programming

Carbide C++

Context-Aware Group, Intelligent Agents Lab 13

Page 14: Introduction to  Symbian C++ Programming

Emulator

Context-Aware Group, Intelligent Agents Lab 14

Page 15: Introduction to  Symbian C++ Programming

Basic Concept of Symbian C++

• Stack and Heap• Leaves• Two Phase construction• Active Object

Context-Aware Group, Intelligent Agents Lab 15

Page 16: Introduction to  Symbian C++ Programming

Stack and Heap

• Stack– Object are delete automatically– Default size is 8kb

• Heap– Object must deleted by programmer using delete

• Example

Context-Aware Group, Intelligent Agents Lab 16

Page 17: Introduction to  Symbian C++ Programming

Leaves

• Leaves are used instead of C++ exception• When there is a resource failure, the code “leave”• The new operator has been overload to leave if

insufficient memory is available– Use new (ELeave)

• Functions that can leave should end in “L”

Context-Aware Group, Intelligent Agents Lab 17

Page 18: Introduction to  Symbian C++ Programming

Two Phase Construction

• C++ constructor must never leave as the destructor will not be called

Context-Aware Group, Intelligent Agents Lab 18

Page 19: Introduction to  Symbian C++ Programming

Active Object

• Events are scheduled by the active scheduler• Events are handled by active object• Each application has an active scheduler• The active scheduler runs in a loop in the application’s

main loop• Active objects have a:

– TRequestStatus bas class member, iStatus, that is passed inro asynchronous functions

– RunL() Function that is called when the action completes– DoCancel() function that is called when the action is cancelled

Context-Aware Group, Intelligent Agents Lab 19

Page 20: Introduction to  Symbian C++ Programming

Context-Aware Group, Intelligent Agents Lab 20

Page 21: Introduction to  Symbian C++ Programming

Active Object

Context-Aware Group, Intelligent Agents Lab 21

Page 22: Introduction to  Symbian C++ Programming

Porting to Cell Phone

Context-Aware Group, Intelligent Agents Lab 22

Page 23: Introduction to  Symbian C++ Programming

Porting to Cell Phone

Context-Aware Group, Intelligent Agents Lab 23

Page 24: Introduction to  Symbian C++ Programming

Porting to Cell Phone

Context-Aware Group, Intelligent Agents Lab 24

Page 25: Introduction to  Symbian C++ Programming

Porting to Cell Phone

Context-Aware Group, Intelligent Agents Lab 25

Page 26: Introduction to  Symbian C++ Programming

Porting to Cell Phone

Context-Aware Group, Intelligent Agents Lab 26

Page 27: Introduction to  Symbian C++ Programming

Porting to Cell Phone

• Symbian Signed

Context-Aware Group, Intelligent Agents Lab 27