programming with android calculator example
Download
Skip this Video
Download Presentation
Programming with Android: Calculator Example

Loading in 2 Seconds...

play fullscreen
1 / 18

Programming with Android: Calculator Example - PowerPoint PPT Presentation


  • 162 Views
  • Uploaded on

Programming with Android: Calculator Example. Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna. Calculator: Outline. Today: How to build a Calculator? Define the layout of the application

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Programming with Android: Calculator Example' - godfrey


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
programming with android calculator example
Programming with Android: Calculator Example

Luca Bedogni Marco Di Felice

Dipartimento di Informatica: Scienza e Ingegneria

Università di Bologna

calculator outline
Calculator: Outline

Today:

How to build a Calculator?

Define the layout of the application

Create an application that uses this layout

Add some sort of intelligence to the application

Test it

2

calculator layout
Calculator: layout

Define the buttons, labels, cells and so on

Place them on the screen

Pay attention: Android powered phones are very different in terms of resolutions

Try not to stick with absolute values/positioning (we will see this later)

calculator layout definition2
Calculator: layout definition

Operator

First Operand

calculator layout definition3
Calculator: layout definition

Operator

Second Operand

First Operand

calculator layout definition4
Calculator: layout definition

Operator

Second Operand

First Operand

Result

calculator layout definition5
Calculator: layout definition

Operator

Second Operand

First Operand

Result

Operators

calculator layout definition6
Calculator: layout definition

Operator

Second Operand

First Operand

Result

Operators

calculator logic definition
Calculator: logic definition

Whenever a user selects a operand cell, a keyboard will pop up

Pressing an operator button will switch the focus from one operand to another (except for =)

We want to deal with float numbers

calculator events
Calculator: events

We want to be warned when a user touches something on the screen

Every time this happens, we will react with a set of actions

The MVC pattern is relaxed that way (pros and cons)

We do not want the result to be focusable

calculator layout building
Calculator: layout building

We will use a set of layouts

Layouts are grouped together following a hierarchy

Why not absolute positioning?

calculator layout building1
Calculator: layout building

We will use a set of layouts

Layouts are grouped together following a hierarchy

Why not absolute positioning?

Android has a wide range of devices

Wide range of resolution

Wide range of capabilities

calculator layout building2
Calculator: layout building

We will use a set of layouts

Layouts are grouped together following a hierarchy

Why not absolute positioning?

Android has a wide range of devices

Wide range of resolution

Wide range of capabilities

Need to build dynamic applications that

performs different depending on the device

they're running in.

calculator recap
Calculator: Recap

Define a Layout

Pay Attention to devices heterogeneity

Features

Keyboard should pop up when needed

Should not pop up on the result

Switch from one cell to another when pressing operand

React to Events

calculator start
Calculator: start

Let's start developing the calculator

ad