Complete or partial implementation of optional packages (JSR)
https:// phoneme.dev.java.net /
JavaME Components
J2ME architecture is divided in to four different level
KVM (Kilobyte Virtual Machine or custom implementation)
Configurations (CDC, CLDC)
Profiles (MIDP 1.0/2.0/2.1/3.0)
Optional packages (JSR-XX)
JavaME How it works?
JavaME KVM
Kilobyte Virtual Machine (KVM):
compact, portable Java virtual machine specifically designed from the ground up for small, resource-constrained devices.
The high-level design goal for the KVM was to create the smallest possible “complete” Java virtual machine that would maintain all the central aspects of the Java programming language, but would run in a resource-constrained device with only a few hundred kilobytes total memory budget.
More specifically, the KVM was designed to be:
small, with a static memory footprint of the virtual machine core in the
range of 40 kilobytes to 80 kilobytes (depending on compilation options and
the target platform,)
clean, well-commented, and highly portable,
modular and customizable,
as “complete” and “fast” as possible without sacrificing the other design goals.
JavaME KVM
Native Sun’s implementations of KVM for Windows, Solaris, Linux
KVM has been successfully ported to more than 30 devices
There are another implementations of KVM (Sony Ericsson – JP 5-8, Nokia J9)
A configuration is a complete Java runtime environment, consisting of:
Java virtual machine (VM) to execute Java bytecode
Native code to interface to the underlying system
Set of core Java runtime classes (core classes, Input/Output,)
basically used to classify myriad devices into a fixed configuration
defines the Java language and virtual machine features and minimum class libraries that a device manufacturer or a content provider can expect to be available on all devices of the same category
To use a configuration, a device must meet certain minimum requirements.
SDKs & IDEs + CodeWarrior + Sun Studio One + JDE for Balckberry + Borland JBuilder MobileSet 2.0 + + IntelliJ IDEA + + + + + + + NetBeans + + + + + + + Eclipse Android SDK Siemens SDK Motorola SDK Nokia SDK RIM Blackberry SDK SE SDK Sun SDK
IDE IDEA is really powerful and agile IDE for software development. IntelliJ IDEA provides integrated support for productive development of Java ME DoJa/MIDP/CLDC application development. Intelligent coding assistance, which recognizes wide variety of mobile SDKs (WTK, DoJa and more), with smart code completion and on-the-fly code analysis with syntax and error highlighting, plus instant quick-fixes and refactorings, unit testing and other developer-assisting features traditionally available for Java code, beefed up with run configurations with support for variety of mobile device emulators are tied together to help efficiently develop Java ME applications. Java ME module type allows to quickly set-up your application, with required mobile JDK, application resources, packaging options, build settings, etc. in a convenient manner. Also IDEA provides a couple of plug- in’s for JavaME support.
A free, open-source Integrated Development
Environment for software developers. It contains
all the tools that are need to create professional
desktop, enterprise, web, and mobile applications
with the Java language. NetBeans IDE have early
access to the most of Sun Java features. Highly
recommended by Sun.
Features of NetBeans IDE:
Ability to interact with different emulators (JTWI support)
MSA support
Visual mobile designer - GUI visual editor
Wizards for component creation;
SVG (Scalable Vector Graphics) components are embedded
Since version 6.7 NetBeans supports LWUIT library for UI building
These J2ME wireless toolkits have been tested to
work with EclipseME. (Others may work if they
meet the UEI specification.):
Sun Wireless Toolkits
Motorola SDK for J2ME
Nokia Developer Suite 2.2 for J2ME
Siemens SMTK for Series 60
Sony Ericsson J2ME SDK
Sprint PCS Wireless Toolkit for Java 2.0.13
MJT plug-in for development support (project creation, midlet creation, test creation)
IntelliJ IDEA Net Beans Eclipse
SDKs
Major vendors of mobile devices provide their own SDK in order to create
performance application with device(platform) specific features and nice
look&feel.
Vendor’s SDK usually includes following components:
APIs:
Bleutooth API (JSR-82)
Location API (JSR-179)
File Connection API(JSR-75)
Scalable 2D Vector Graphics API (JSR-226)
Mobile 3D Graphics API (JSR-184)
Java Binding for the OpenGL ES API (JSR 239)
XML API for Java ME (JSR 280)
Specific Game API (Mascot, Capsule 3D Graphics)
Platform-specific libraries
Unit testing library (JMUnit, J2MEUnit)
Device emulator (for one or series of devices)
Profiler
Emulators
Emulators Virtual specification-related device 2 1 J2ME Wireless Toolkit 1.0.4 many (all version of SE Java Platform supported, all popular models supported) 1 1 Sony Ericsson J2ME SDK Separate emulator for each series 1 1 Blackberry Java Development Environment 3.6 3410, 6310, 9200, 9210, 7210, 7650 1 1 Nokia General emulator 1 1 Motorola SDK v3.1.1 for J2ME iXXX Series (emulators in according with models) 1 1 Motorola iXXX Emulator Phones CLDC MIDP Emulator
Testing
Automated tools:
TestQuest
m-Test
IBM Rational RealTime (using JUnit implementation)
Unit Testing :
JMEUnit
JMUnit (most popular)
MOMEUnit
Hammockmocks
MockME
Frameworks & Libs
JMUnit
JMEUnit
SonyEricsson Mobile Unit 1.0
MoMe Unit
Hammockmocks
MockMe
OpenBaseMovil -db
Perst Lite for J2ME
OpenBaseMovil -core
FallME
Polish framework
SpringME
Apime
LWIUT
KUIX
Polish
Fire-j2me
Lwvcl
Synclast UI API
kUI
Thinlet GUI Toolkit
Pax JavaME GUI library
TWUIK
Testing frameworks Database and storage frameworks Application Model frameworks UI
ProGuard
ProGuard is a free Java class file shrinker,
optimizer, obfuscator, and preverifier.
ProGuard:
Creating more compact code, for smaller code archives, faster transfer across networks, faster loading, and smaller memory footprints.
Making programs and libraries harder to reverse-engineer.
Listing dead code, so it can be removed from the source code.
ProGuard usage
Eclipse MTJ plug-in supports ProGuard integration
ProGuard can be integrated in project by means of Ant
Project may be obfuscated by ProGuard independently
java -jar proguard.jar options ...
Antenna
Antenna provides a set of Ant tasks suitable for developing
wireless Java applications targeted at the MIDP.
Antenna helps to:
c ompile
preverify
package
obfuscate
r un
Preprocess
The main feature of Antenna is to preprocess sources in order to
create vendor-dependent build from vendor- independent codebase.
Antenna - How it works?
J2ME-Polish
J2ME Polish is a suite of tools and technologies aimed at mobile
developers and companies within the mobile space.
Main features of J2ME Polish include:
Lush : A UI toolkit that is highly flexible and that can be designed outside of the application's source code.
Janus : A toolset for porting mobile application to different handsets and different technology platforms.
Touch : Technology for accessing server side content and communicating with remote parties.
Trunk : A persistence solution that allows you to load and save complex data with a single line of code.
Marjory : Our community maintained device database.
Polish can do what? J2ME Polish can be adjusted to support several platforms that support more than the normal MIDP profile.
Polish – How it works? Annotations in simple JavaME code
Polish – How it works? CSS styles for UI components in separate CSS file
Special Ant task Ant task Target device MIDlet class name
Annotations + CSS + Ant Task = ?
JavaME issues
Poor native UI component palette
RMS storage API is inconvenient
Design issues (e.g. you can’t inherit your class from Layer)
JavaME pit faults
Porting – app works on Nokia, but will not work on SE
Graphics – different screen’s size, different colors, different VGA
Emulator – Looks fine on emulator, fails on device
Midlet size – sometimes 128K is boundary size
Bundled resources size
Hard to test without real device
Android Agenda
What is Android?
Android features
Dalvik VM
Android market
Android architecture
Important APIs
Android Development tools
Android applications
Inside of Android project
Security model
Android application building blocks
Testing
Simple application
Android issues
What is Android?
Android is a software stack for mobile devices that includes:
operating system (Linux kernel)
Middleware (Google-developed Java libraries)
key applications (Media player, web browser)
The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
Android features
Handset layouts - VGA, 2D graphics library, 3D graphics library based on OpenGL ES 1.0
SQLite as storage engine
Connectivity - GSM/EDGE, CDMA, EV-DO, UMTS, Bluetooth, and Wi-Fi
Messaging – SMS/MMS/threaded text messaging
Web browser - WebKit application framewor
Dalvik virtual machine
Media support - MPEG-4, H.264, MP3, AAC, MIDI, OGG, AMR, JPEG, PNG, GIF
Hardware support – cameras, touchscreens, GPS, accelerometers, and accelerated 3D graphics
Multi-touch – native support
Android market – Similar ot IPhone App Store
Dalvik virtual machine
Register based
Dex file format
Private byte code format
No JIT
Private VM per application / process.
GC understands memory sharing semantics
Non-standard Java virtual machine.
Not Java SE or Java ME
No Swing/AWT windowing toolkits
Android’s programs are written in Java, using Java-oriented IDEs. It just
doesn’t compile the java code into java bytecode but instead Dalvik bytecode
(.dex)
Every application has its own instance of the Dalvik virtual machine
Android Market
Google’s application store, where users can search, download, buy and install software
27.10.2008 opened for developers to upload free software ($25 one time application fee)
Q1 2009 developers can distribute paid apps
Users can provide feedback to the developer and even rate the application
For developers: register, upload, and publish. The Android Market interface will provide developers with dashboard view of their account that will eventually include analytic data about how their apps are doing.
Android architecture
Android development tools
Eclipse Android development tools (ADT plug-in) . Provides convenient way to create and run Android projects.
Other IDEs
Android SDK
IDE for Android development
The best is Eclipse
IntelliJ IDEA Android plug-in
NetBeans Android plug-in from Project Kenai
Android SDK contains
Android emulator
command line tools
aapt - Android asset packaging tool
adb - Android debug bridge
aidl - Android IDL compiler
emulator - Android emulator
ddms – Dalvik debug monitor
documentation
example applications
Emulator limitations
No support for placing or receiving actual phone calls
No support for camera/video capture (input)
No support for audio input
No support for determining connected state
No support for determining battery charge level
No support for Bluetooth
Android applications
An application is composed of one or more activities
Every application is wrapped in a APK file.
Application runs in separate Linux processes.
Applications share code and data via Linux Copy on Write semantics.
Applications forks of a preinitialized Zygote process
Shared memory is used for communication.
Security Model
Each application runs as a separate Linux user.
Security is enforced by OS and MMU, not VM.
Applications asks for specific permissions during installation:
android.permission.VIBRATE
android.permission.CALL
android.permission.DELETE_PACKAGES ...
Inside of Android project Default properties of application Main application configuration file Source code folder Generated files, shouldn’t be changed manually Raw bytes data Bundled resources of application (icons, images)
Application building blocks
AndroidManifest.xml
Activities
Views
Layouts
Intents & IntentReceivers
Services
Notifications (Broadcast recievers)
ContentProviders
Manifest file describes
components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of
names the classes that implement each of the components and publishes their capabilities (for example, which Intent messages they can handle)
which permissions the application must have in order to access protected parts of the API and interact with other applications
the permissions that others are required to have in order to interact with the application's components
the minimum level of the Android API that the application requires
the libraries that the application must be linked against
Activity
an activity is usually a single screen in our application
however, activities can also be faceless
one activity is designated as the entry point for your application
activity from one application can be used by another application, in other words activities are reusable
Specify the position of child views (controls) on the screen
Common Layout Objects:
FrameLayout : all child views are pinned to the top left corner of the screen
LinearLayout : each child view is added in a straight line (vertically or horizontally)
TableLayout : add views using a grid of rows and columns
RelativeLayout : add views relative to the position of other views or to its parent.
AbsoluteLayout : for each view you add, you specify the exact screen coordinate to display on the screen
More info: http:// code.google.com/android/devel/ui/layout.html
Intents
Specify what intentions you have in terms of a specific action being performed
Launch Activities
Transition between the activities of your application
Explicitly ( using new Intent(current_application_context, new_activity_to_start); ):
Intent newIntent = new Intent(this, OtherActivity.class);
startActivity(newIntent); //OtherActivity will become visible
Implicitly ( using new Intent(action_to_perform,data_to_perform_action_on); ):
Intent newIntent = new Intent(Intent.ACTION_DIAL,
Uri.parse(“tel:12345”));
startActivity(newIntent);
Services
Services run in the background
Primarily used for:
Updating Content Providers
Firing Intents
Triggering Notifications
Any operation that does not necessitate user interaction (i.e. networking, MP3 playback)
For intensive and/or blocking operations, the service should be run in its own thread
Creating and Controlling Services
Create a Service:
Extend the Service class; override specific methods (such as onCreate , onStart , onBind , etc).
Start and stop a Service:
Use the startService method from inside your current Activity class
Use the stopService method from inside your current Activity class
Testing
Android SDK includes JUnit
autoandroid (formerly known as Positron) – the mix of JUnit and Selenuim for Android
Simple Android application Source code Layout xml file
Android issues
Android uses a Linux kernel, but, according to Google, it is not a Linux operating system. This specific nature makes it difficult to reuse existing Linux applications or libraries.
Android does not use Java SE and ME. Android only reuses the Java language syntax, but does not provide the full-class libraries and APIs bundled with Java SE or ME.
Android does not officially allow apps to be installed on, nor run from, an SD card.
Applications written in C and other languages can be compiled to ARM native code and run, but this development path is not officially supported by Google
Android pit faults
Few real devices are available
C yano MOD vs. Android
Google Libs for Google services
RIM Blackberry Agenda
What is Blackberry?
BES
Blackberry development
Capabilities
Architecture
SDK
IDE
Simulator
App World
Frameworks
What is Blackberry?
BlackBerry is a line of wireless handheld
devices, which supports:
push e-mail
mobile telephone
text messaging
internet faxing
web browsing
multi-touch
Developed by the company Research In Motion
BES BlackBerry handhelds are integrated into an organization's e-mail system through a software package called "BlackBerry Enterprise Server" (BES).
BES – How it works?
Blackberry development
Blackberry capabilities
The BlackBerry smartphone is a pure Java device with all built-in applications and APIs written in Java
BlackBerry supports:
MIDP Standard APIs (MIDP v2.0 supported) for cross platform development
CLDC Standard APIs (CLDC v1.1 supported) for connectivity
BlackBerry specific Java APIs
Java APIs for the BlackBerry solution enables you to develop rich custom client applications that provide:
Customizable user interface
Local data storage on the device
Event listening and system interfaces
Secure wireless transport via HTTP
Advanced Java API capabilities include:
Integration with BlackBerry Email, PIM and Phone applications
Almost always-on background threads to listen for push data
Communication with Bluetooth®-enabled peripherals
Location-based services and multimedia
2D Graphics , SVG support (Plazmic Media Engine)
Full phone data access
Blackberry - Java
BlackBerry devices are designed from the ground-up to run Java applications
Native BlackBerry applications are written in Java
All BlackBerry devices run the BlackBerry Java Virtual Machine (JVM) with full support for Java ME standard
BlackBerry devices are software-upgradeable
New versions of BlackBerry O/S and JVM can be loaded onto existing devices to provide new features and APIs
BlackBerry exposes thousands of Java APIs
Extensive Java ME JSR support
Including Java Technology for the Wireless Industry (JTWI), Wireless Messaging, Mobile Media, Bluetooth, Location and Web Services
BlackBerry APIs that offer tighter integration with BlackBerry Smartphones
Blackberry Architecture
SDK
Java Development Environment v 4.5
Additional component packs (4.6/4.7)
Bundled Simulator in SDK
IDE
Blackberry JDE (within SDK)
Eclipse (JDE plug-in for Eclipse)
BlackBerry Java Development Environment (JDE)
BlackBerry JDE used to build, test and
optimize Java ME applications for BlackBerry
It is free
Supports Java ME as well as many BlackBerry APIs
Includes a robust set of wireless debugging, profiling and optimization tools
Secure code-signing infrastructure
JDE Component Pack enables choice of Java-based IDE
Access to additional APIs for features, such as advanced cryptography, synchronization, and messaging, is restricted
RIM Controlled APIs are split into 3 categories:
Runtime APIs
BlackBerry Application APIs
BlackBerry Cryptography APIs
Signing of applications is not required to run applications using the BlackBerry Smartphone Simulator.
Sign services
Sign service administrations fee is $20
Blackberry App World
The BlackBerry App World™ storefront gives BlackBerry device users a single location to discover, purchase, download, manage, and rate items such as applications for BlackBerry devices
0 comments
Post a comment