symbainresources.com
Tutorials Projects Links Contact

Tutorials: Java Platform, Micro Edition (Java ME)

< Back to the tutorials overview page...

Find the slides and the exercises of the Java™ Platform, Micro Edition (formerly known as J2ME)-course at the department of Mobile Computing at the University of Applied Sciences in Hagenberg. This course requires basic Java knowledge — it does not explain the Java programming language itself, but only the aspects that have been introduced for Java ME.

Complete Download: Download the complete section (27 MB)


Java Platform, Micro Editon — Overview

Java Platform, Micro Edition - OverviewIn the first module of the Java ME course, you will get a quick overview of the concepts behind Java ME. This includes information on the architecture of Java ME applications and how they differ from Java SE. In order to give you an impression on what is involved in developing for mobile phones using Java ME, the slides also contain basic information on distributing your applications. After this generic introduction, the concept of commands is introduced. In the challenge you will develop, debug and deploy your very first "Hello World" MIDlet.

Contents:

  • Java Platform, Micro Edition
  • Profiles, Configurations — MIDP, CLDC, CDC
  • MIDlet Suites, Manifest, .jad and .jar
  • Signing, Obfuscation, Over-the-Air distribution
  • IDEs, Emulators
  • JTWI, MSA, MIDP 3.0, JavaFX
  • Commands

Level: Basic
Version: v3.0b, April 2009
Based on: Java ME, MIDP 2.0 - also covers future development (MIDP 3.0, MSA, JavaFX Mobile)

Download:
Materials: Java ME Overview
Challenge: Hello World - Instructions


High Level UI

Java Platform, Micro Edition - High Level UIJava ME comes with an easy to use user interface framework. This module will show you how the available controls look like and how they can be put together to create your own applications. The challenge is about developing a small rock, paper and scissors game and lets you try the concepts of this and the commands introduced in the previous lesson in a small game.

Contents:

  • Form, Alert, List, TextBox, Ticker
  • Items:
    • ChoiceGroup
    • TextField
    • Gauge
    • DateField
    • ImageItem
    • Spacer
    • CustomItem
  • LWUIT, eSWT, JavaFX Mobile

Level: Basic
Version: v3.0, April 2009
Based on: Java ME, MIDP 2.0

Download:
Materials: High Level UI
Challenge: Rock, Paper, Scissors - Instructions
Challenge: Rock, Paper, Scissors - Solution


Low Level Graphics

Java Platform, Micro Edition - Low Level GraphicsCurrently, Java ME is mainly used for games. Especially there it is very important to know how to handle the low level graphics facilities that are available in Java ME. This includes directly drawing to the screen as well as handling key input yourself. Most major applications also implement their own user interface themselves instead of using the high level UI provided by Java ME. The first challenge of this module is a simply key code analyzer so that you can familiarize yourself with the concepts of the Canvas and event processing. The second challenge is more sophisticated and requires you to write a small paint application.

Contents:

  • Canvas
  • Key Events
  • Game Actions
  • Geometry and Text
  • Images
  • PNG Optimization

Level: Basic
Version: v3.0b, April 2009
Based on: Java ME, MIDP 2.0

Download:
Materials: Low Level Graphics
Challenges: Instructions
Challenge: Key Analyzer - Solution
Challenge: PaintApp - Solution


Timer, Tasks and Threads

Java Platform, Micro Edition - Timer, Tasks and ThreadsMost mobile applications will have to use asynchronous processing — for running the game loop or for connecting your MIDlet to the Internet. This module is a repetition of the basic thread concepts that you will need for your mobile applications. It also contains details of how to use the Timer to generate regular call-backs. In the first challenge, you will write a small alarm clock based on the high level user interface. The second challenge is about drawing a ball that bounces around on the screen using the low level graphics API.

Contents:

  • Timer
  • Scheduling
  • Threads
  • Runnable vs. Thread

Level: Basic
Version: v3.0, April 2009
Based on: Java ME, MIDP 2.0

Download:
Materials: Timer, Tasks and Threads
Challenges: Instructions
Challenge: Alarm Clock - Solution
Challenge: Bouncing Ball - Solution


Game API

Java Platform, Micro Edition - Game APIThe game API is one of the most interesting and unique concepts of Java ME. It consists of very useful classes that help you with typical tasks that are required in almost ever game — for example sprite handling, tiled backgrounds or collision detection. This module will explain those concepts and how to create an own game loop. The challenge is the largest project yet and involves writing your own game called "Schlabo". The player moves his avatar at the bottom of the screen and has to shoot the enemy that moves randomly at the top.

Contents:

  • Performance
  • Game API
  • Game loop
  • GameCanvas
  • Bitmaps
  • Sprite
  • Layer and TiledLayer
  • LayerManager

Level: Basic
Version: v3.0a, April 2009
Based on: Java ME, MIDP 2.0

Download:
Materials: Game API
Challenge: Game - Strategy
Challenge: Game - Project resources
Challenge: Game - Solution


Record Stores, Distribution and Localization

Java Platform, Micro Edition - Record Stores, Distribution and LocalizationAlmost every application needs to store data — e.g. for saving user preferences, highscores or login data. This module explains the concepts behind the record stores, the only way to save data that is included in the MIDP specification and therefore supported on all phones. Data access can be handled conveniently using the DataInputStream and DataOutputStream-classes.This module also covers how to distribute your applications using different project configurations in NetBeans; a process which can involve pre-processing, selective resource inclusion as well as obfuscation. As mobile phones are available on a global market, localization is also a very important aspect. The challenge involves extending the game from the last course so that the game can save the highscore and can be deployed on phones with different screen sizes using specialized graphics.

Contents:

  • Record Stores
    • Input/OutputStreams
  • Distribution
    • Deployment
    • Pre-Processing
    • Obfuscation
    • OTA-Deployment
  • Localization

Level: Basic
Version: v3.0a, April 2009
Based on: Java ME, MIDP 2.0

Download:
Materials: Record Stores, Distribution and Localization
Challenge: Game II - Instructions
Materials: Game II - Project resources
Materials: Game II - Start project (solution of "Game API"-Module


Generic Connection Framework, HTTP and Sockets

Java Platform, Micro Edition - Generic Connection Framework, HTTP and SocketsThe speciality of mobile phones is that they are *mobile* and offer access to the internet from anywhere. In this section, you will learn how to use the Generic Connection Framework in Java ME to connect to web servers or other clients using HTTP or sockets directly. The challenge involves creating a client for a multiplayer game similar to "Asteroids", the game server is provided in the downloadable materials.

Contents:

  • Generic Connection Framework
  • Asynchronous connections
  • Hypertext Transfer Protocol
  • HTTP Get / HTTP Post
  • Sockets

Level: Intermediate
Version: v3.0, April 2009
Based on: Java ME, MIDP 2.0

Download:
Materials: Generic Connection Framework, HTTP and Sockets
Challenges: Show PNG and Masteroids Client - Instructions
Challenge 1: Show PNG - Start project
Challenge 1: Show PNG - Solution
Challenge 2: Masteroids - Protocol
Challenge 2: Masteroids - Server
Challenge 2: Masteroids - Java ME Client - Start project
Challenge 2: Masteroids - Java ME Client - Solution


Mobile 3D Graphics

Java Platform, Micro Edition - Mobile 3D GraphicsNearly all of today's PC and console games use 3D graphics. With mobile phones getting more and more powerful and some devices even boasting a hardware 3D acceleration, development using three-dimensional graphics is an important topic for mobile computing. This module covers the JSR 184 (Mobile 3D Graphics) and explores the possibilities offered by its retained mode (high level) API for defining a scene graph and modifying objects in the world. A detailed example walks you through the basics of the free, open source 3D package Blender. Using this powerful software, you can create a sample 3D scene that you can display on your mobile phone with just a few lines of code. The challenge is about extending a sample 3D game framework, featuring an exciting car racing game!

Contents:

  • Mobile 3D - Overview
  • JSR 184 (m3g)
  • Scene graph
  • Your first m3g file with Blender
  • Display, load and modify the 3D scene
  • Objects and materials
  • Challenge: 3D car racing game

Level: Intermediate
Version: v3.0a, April 2009
Based on: Java ME, MIDP 2.0

Download:
Materials: Mobile 3D Graphics
Challenge: Monkey3D - Start project
Challenge: Monkey3D - Solution
Challenge: CarRace - Instructions
Challenge: CarRace - Start project
Challenge: CarRace - Solution


< Back to the tutorials overview page...