Tuesday, September 29, 2009

Java ME and my exp

I have been associated with Android for last six months. Wanted to know why original Samurai who brought Java to mobile platform lost the game. Here is my understanding of Java ME as developer platform.

Java ME, first released in 1998, was design to run in constrained processing, memory and screen size (or even without it) for the purpose of running it on setup box, mobile phone etc.

Developing application on this platform requires many changes approach from traditional server/desktop app development. Few of them would be:

Java ME Stack: 


Java ME has two main components for application development.
Profile:
There are two type of profile:

Configuration: 
  • CDC - Connected Device Configuration
  • CDLC - Connected Device Limited Configuration
CDC is super-set
Virtual Machine:


Application runs in Java Virtual Machine especially customized for Mobile usage. There are two main VMs for Java ME.
  • KVM: Kilobyte VM by Sun
  • CVM: Compact VM
The classic virtual machine for 32-bit architectures and large amounts of memory but KVM for 16-bit or 32-bit architectures with limited amounts of memory.

Platform Design: 
Java ME is drived from Java SE but a scaled down version. Wherever possible, Java ME must reuse Java SE classes and packages.When a Java SE class is incorporated into Java ME, new methods and fields may not be added to it.












Design View Point 
  • Move most computation from client to server 
  • Only UI rendering on client app 
  • Consider data cache/buffering for network updates due to low bandwidth 
  • Separate thread for UI rendering/interface 
  • Separate logic for control presentation - MVC
Coding View Point 
  • Use scalar objects 
  • Minimize GC kick start 
  • Obj = null;
  • Reuse Obj and Obj pool 
  • Use local variable mostly 
  • Avoid String concatenation - Immutation is poisonous
  • Use thread but avoid synchronization 
Midlet Suite: 
  • JAR - Java Archive
  • JAD - Java Application Descriptor

App Development Steps 
  1. Install Java ME Tool kit
  2. Code you application 
  3. Compile using Java Me TK 
  4. Pre-verify - On device/Pre-device 
  5. Package 
  6. Deploy 
  7. Execute

References: 

0 comments:

Post a Comment