PROG 38448 Mobile Java Application Development PROG 38448 Mobile Java Application Development BlackBerry App Lifecycle Java ME API.

Slides:



Advertisements
Similar presentations
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
Advertisements

CE881: Mobile and Social Application Programming Simon M. Lucas Layouts.
Course Introduction & Overview
Writing Your First MIDlet Running JAVA on a Cell Phone Jon A. Batcheller January 27, 2004.
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
UNDERSTANDING JAVA APIS FOR MOBILE DEVICES v0.01.
PACKAGES. PACKAGES IN JAVA A package is a collection of related classes and interfaces in Java Packages help in logical grouping of classes and interfaces.
Quality Assurance and Testing of J2ME Programs for Mobiles Phones.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
© 2009 Research In Motion Limited Advanced Java Application Development for the BlackBerry Smartphone Trainer name Date.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
Developing Software for Wireless Devices
Chapter 14 Applets. 2 Knowledge Goals Understand the differing roles of applications and applets Understand how a browser operates Understand the role.
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
PDA Programming Using J2ME Presenter :涂俊凱 Date : 2003/4/8.
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
V0.01 © 2009 Research In Motion Limited Understanding Java APIs for Mobile Devices Trainer name Date.
Cosc 4755 Phone programming: GUI Concepts & Threads.
Cosc 4730 Phone Programming in Java An Introduction.
Multithreading in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
© 2009 Research In Motion Limited User interface design for mobile devices.
Java 2 Platform, Micro Edition (J2ME) By Xiaorong Wang.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
Intro to Android Programming George Nychis Srinivasan Seshan.
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
CS5103 Software Engineering Lecture 08 Android Development II.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 6 Today’s Windows Windows Vista and Windows 7 McGraw-Hill.
220 FINAL TEST REVIEW SESSION Omar Abdelwahab. INHERITANCE AND POLYMORPHISM Suppose you have a class FunClass with public methods show, tell, and smile.
Michael Brockway Advanced Applications Development in Java J2ME -- Introduction l Introduction / Overview l Java 2 Micro Edition n CLDC n MIDP l Examples.
1 Event Driven Programming wirh Graphical User Interfaces (GUIs) A Crash Course © Rick Mercer.
J2ME Presented by May Sayed & Menna Hawash. Outline Introduction “Java Technology” Introduction “What is J2ME?” J2ME Architecture J2ME Core Concepts 
PROG Mobile Java Application Development PROG Mobile Java Application Development BlackBerry API for UI Applications.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
1Basics of J2ME. 2 Objectives –Understand the different java API’s and how the mobile edition API’s fit in –Understand what a mobile configuration and.
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 13 lcdui and OXO Rob Pooley
Week 3, Day 1: Processes & Threads Processes Threads SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
BlackBerry Event Handling. Overview Introduction Typical Application Model Event Listeners Responding to UI Events Touch Screen Events Touch Screen Gestures.
Java Threads. What is a Thread? A thread can be loosely defined as a separate stream of execution that takes place simultaneously with and independently.
Considerations, Practices, and Guidelines for Mobile Devices (BlackBerry)
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Cosc 4730 Android Fragments. Fragments You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own.
1 GUI programming Graphical user interface-based programming Chapter G1 (pages )
CIS Intro to JAVA Lecture Notes Set 8 9-June-05.
PROG Mobile Java Application Development PROG Mobile Java Application Development Data Storage, Continued.
Creating a GUI Class An example of class design using inheritance and interfaces.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 6 Today’s Windows Windows Vista and Windows 7 McGraw-Hill.
1 Introduction to J2ME Outline MIDP Building J2ME Apps- Tool J2ME Wireless Toolkit Demo MIDlet Programming -- MIDlet Transition States -- Midlet Skeleton.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Java Threads 1 1 Threading and Concurrent Programming in Java Threads and Swing D.W. Denbo.
CHAPTER 6 Threads, Handlers, and Programmatic Movement.
Android Fragments. Slide 2 Lecture Overview Getting resources and configuration information Conceptualizing the Back Stack Introduction to fragments.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
Lecture 15 Basic GUI programming
CSC 205 Programming II Lecture 5 AWT - I.
Activities and Intents
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Lesson 1: Buttons and Events – 12/18
Abstract Window ToolKit (AWT)
Introduction to Computing Using Java
Android Topics UI Thread and Limited processing resources
Constructors, GUI’s(Using Swing) and ActionListner
Java Programming COMP-417 Applet
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Presentation transcript:

PROG Mobile Java Application Development PROG Mobile Java Application Development BlackBerry App Lifecycle Java ME API

10/9/2015Wendi Jollymore, ACES2 BlackBerry App Life Cycle 1. Application Starts Three ways to start an app: User clicks app icon App starts automatically on startup or reboot App is started by another app Starting point in your application class is main() method

10/9/2015Wendi Jollymore, ACES3 BlackBerry App Life Cycle 2. Application Object Is Created Triggered in the main() method You instantiate your application class that extends UiApplication Application classes with a Ui must extend UiApplication class Can only have one UiApplication instance for any application Otherwise RuntimeException is thrown.

10/9/2015Wendi Jollymore, ACES4 BlackBerry App Life Cycle 3. Event thread is started main() is the main thread or process that’s running Do anything you need to do here before you pass control to BB O/S enterEventDispatcher() method call Takes control of the main thread Draws the main screen and listens for events Won’t return, so if you need something else done in main(), do it first

10/9/2015Wendi Jollymore, ACES5 BlackBerry App Life Cycle 4. Events are processed User events triggered by input from trackball, touch screen, keyboard, etc Other events 5. Application Exits When the last screen is removed from the stack. Avoid System.exit() !! Close all screens until the last screen is closed. Proper clean up of all application state

10/9/2015Wendi Jollymore, ACES6 What is the API? Application Program Interface The collection and definition of building blocks available in a language Descriptions of classes and their public methods Where to read the API docs? api/index.html Go to any JDE folder and select BlackBerry JDE API Reference

10/9/2015Wendi Jollymore, ACES7 Java ME API Java ME – Micro Edition For developing mobile apps Runs on custom JVM for BlackBerry BlackBerry Java Virtual Machine MIDP 2.0 Standard– Mobile Information Device Profile MIDP.html Part of Java ME API used for various mobile devices (not just for RIM) Contains APIs for persistent storage, user interface, networking

10/9/2015Wendi Jollymore, ACES8 Java ME API CLDC – Connected Limited Device Configuration LDC.html A specification for a stripped down virtual machine For devices with very limited memory Contains minimalist versions of java.lang, java.util, java.io Contains java.microedition.io for network connections

10/9/2015Wendi Jollymore, ACES9 Java ME API Other API Extensions specific to BlackBerry devices User Interface Persistent Data Storage Networking Event Listeners Application Integration Additional utilities for encryption, compression, location-based services, etc.

10/9/2015Wendi Jollymore, ACES10 Using API to Create App Simplest: Start with two classes An application class The main application where it all starts Extends UiApplication class Three main tasks to perform: Create an instance of the app Create main screen and push onto display stack Start the event dispatch thread

10/9/2015Wendi Jollymore, ACES11 Using API to Create App Simplest: Start with two classes (continued) A screen class A visible display Extends MainScreen class Could have components, images, user input, etc Components = Fields net.rim.device.api.ui.Field Layout = Managers net.rim.device.api.ui.Manager

10/9/2015Wendi Jollymore, ACES12 UiApplication Class net.rim.device.api.ui.UiApplication Child of Application class A non-gui program would extend this Base class for all UI applications Contains a screen stack Only top screen is ever visible pushScreen(screen) adds a screen to the stack Lays out and prints the screen object A screen can only be pushed onto the stack once, or exception occurs

10/9/2015Wendi Jollymore, ACES13 UiApplication Class public class MyApp extends UiApplication { public MyApp() { MyScreen scr = new MyScreen(); pushScreen(scr); } //... }

10/9/2015Wendi Jollymore, ACES14 UiApplication Class Event dispatcher thread enterEventDispatcher() called on your application class Takes control of main thread Handles all drawing and event- handling Never returns; ends when application ends Call this in the application’s main() method

10/9/2015Wendi Jollymore, ACES15 UiApplication Class public class MyApp extends UiApplication { public MyApp() { MyScreen scr = new MyScreen(); pushScreen(scr); } public static void main(String[] args) { MyApp app = new MyApp(); app.enterEventDispatcher(); } }

10/9/2015Wendi Jollymore, ACES16 MainScreen Class net.rim.device.api.ui.container. MainScreen Child of Screen/FullScreen class Has a VerticalFieldManager, title area, default menu, etc In the MainScreen constructor is where you’d create and lay out your main UI

10/9/2015Wendi Jollymore, ACES17 MainScreen Class public class MyScreen extends MainScreen { public MyScreen() { LabelField label = new LabelField(“Hello!"); add(label); LabelField title = new LabelField("Java ME"); this.setTitle(title); } }

10/9/2015Wendi Jollymore, ACES18 Hierarchy It’s interesting to note the inheritance hierarchy of these classes: Object Field ScrollView Manager Screen

10/9/2015Wendi Jollymore, ACES19 Exercises and Homework Exercise: Do the exercise in the Lesson 2 notes For next class: Read Chapter 4 of Beginning BlackBerry