Mobile Java


Published on

Mobile java based platforms overview

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Разве они J2* ? Слишком много слов! Используй меньше.
  • 1. Очень много текста !!!
  • Нужно рассказать о других машинах. Рассказать о PhoneME Мало о KVM. Больше информации.
  • Пояснить для каких устройств каждая конфигурация.
  • 1. Возможно объединить с предыдущим.
  • Про профили явно информации недостаточно.
  • ??? Надо?
  • ???
  • Mobile Java

    1. 1. Mobile Java
    2. 2. The Big Agenda <ul><li>JavaME </li></ul><ul><li>Google Android </li></ul><ul><li>RIM Blackberry </li></ul>
    3. 3. JavaME Agenda <ul><li>Java & JavaME </li></ul><ul><li>JavaME Details </li></ul><ul><ul><li>JVMs overview, KVM, </li></ul></ul><ul><ul><li>CLDC & MIDP </li></ul></ul><ul><li>JavaME Development </li></ul><ul><ul><li>SDKs & IDEs </li></ul></ul><ul><ul><li>Emulators </li></ul></ul><ul><ul><li>Testing </li></ul></ul><ul><li>JavaME Frameworks and Libs </li></ul><ul><ul><li>Proguard </li></ul></ul><ul><ul><li>Antenna </li></ul></ul><ul><ul><li>J2ME Polish </li></ul></ul><ul><li>JavaME issues and pit faults </li></ul>
    4. 4. Java <ul><li>Java editions </li></ul><ul><ul><li>JavaSE </li></ul></ul><ul><ul><li>JavaEE </li></ul></ul><ul><ul><li>JavaME </li></ul></ul><ul><li>Different target devices and systems </li></ul>
    5. 5. Java overview
    6. 6. Java ME <ul><li>Java Platform, Micro Edition , or Java ME , </li></ul><ul><li>is a Java platform designed for mobile </li></ul><ul><li>devices and embedded systems. </li></ul><ul><li>Target devices: </li></ul><ul><li>industrial controls </li></ul><ul><li>mobile phones </li></ul><ul><li>set-top boxes </li></ul>
    7. 7. PhoneME <ul><li>December 22th, 2008, JAVA ME source is </li></ul><ul><li>licensed as GPLv2. </li></ul><ul><li>Implementation of CLDC and MIDP. </li></ul><ul><li>Complete or partial implementation of optional packages (JSR) </li></ul><ul><li>https:// / </li></ul>
    8. 8. JavaME Components <ul><li>J2ME architecture is divided in to four different level </li></ul><ul><ul><li>KVM (Kilobyte Virtual Machine or custom implementation) </li></ul></ul><ul><ul><li>Configurations (CDC, CLDC) </li></ul></ul><ul><ul><li>Profiles (MIDP 1.0/2.0/2.1/3.0) </li></ul></ul><ul><ul><li>Optional packages (JSR-XX) </li></ul></ul>
    9. 9. JavaME How it works?
    10. 10. JavaME KVM <ul><li>Kilobyte Virtual Machine (KVM): </li></ul><ul><li>compact, portable Java virtual machine specifically designed from the ground up for small, resource-constrained devices. </li></ul><ul><li>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. </li></ul><ul><li>More specifically, the KVM was designed to be: </li></ul><ul><li>small, with a static memory footprint of the virtual machine core in the </li></ul><ul><li>range of 40 kilobytes to 80 kilobytes (depending on compilation options and </li></ul><ul><li>the target platform,) </li></ul><ul><li>clean, well-commented, and highly portable, </li></ul><ul><li>modular and customizable, </li></ul><ul><li>as “complete” and “fast” as possible without sacrificing the other design goals. </li></ul>
    11. 11. JavaME KVM <ul><li>Native Sun’s implementations of KVM for Windows, Solaris, Linux </li></ul><ul><li>KVM has been successfully ported to more than 30 devices </li></ul><ul><li>There are another implementations of KVM (Sony Ericsson – JP 5-8, Nokia J9) </li></ul><ul><li>http :// / products / cldc / wp / KVMwp.pdf </li></ul>
    12. 12. JavaME KVM keywords <ul><li>KVM: </li></ul><ul><ul><li>As the name implies, it is used for small program </li></ul></ul><ul><ul><li>A subset of JVM </li></ul></ul><ul><ul><li>A pool for running java code on the device </li></ul></ul>
    13. 13. JavaME Configurations <ul><li>A configuration is a complete Java runtime environment, consisting of: </li></ul><ul><ul><li>Java virtual machine (VM) to execute Java bytecode </li></ul></ul><ul><ul><li>Native code to interface to the underlying system </li></ul></ul><ul><ul><li>Set of core Java runtime classes (core classes, Input/Output,) </li></ul></ul><ul><ul><li>basically used to classify myriad devices into a fixed configuration </li></ul></ul><ul><ul><li>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 </li></ul></ul><ul><li>To use a configuration, a device must meet certain minimum requirements. </li></ul>
    14. 14. JavaME Configurations <ul><li>There are two different configurations </li></ul><ul><ul><li>Connected Device Configuration (CDC, set-top boxes, video-phones) </li></ul></ul><ul><ul><li>Connected Limited Device Configuration (CLDC, cell phones, smartphones) </li></ul></ul>CDC CLDC JavaSE
    15. 15. JavaME CDC & CLDC <ul><li>CDC Devices </li></ul><ul><ul><li>2 MB or more total available memory </li></ul></ul><ul><ul><li>Memory dedicated to J2ME environment </li></ul></ul><ul><ul><li>More than 2MB ROM/Flash </li></ul></ul><ul><ul><li>More than 512 KB RAM </li></ul></ul><ul><ul><li>Network connectivity </li></ul></ul><ul><li>Full Java 2 Virtual Machine specification </li></ul><ul><li>CLDC Devices: </li></ul><ul><ul><li>160KB to 512KB total memory available for Java technology </li></ul></ul><ul><ul><li>Limited power (battery), connectivity (often intermittent), UI (small screen) </li></ul></ul><ul><li>Features missing in the CLDC VM: </li></ul><ul><ul><li>Floating point types </li></ul></ul><ul><ul><li>Object finalization </li></ul></ul><ul><ul><li>JNI or reflection </li></ul></ul><ul><ul><li>Thread groups or daemon threads </li></ul></ul><ul><ul><li>User Class loaders </li></ul></ul><ul><li>Change in classfile verification  preverification </li></ul>
    16. 16. JavaME Configuration keywords <ul><li>Configuration </li></ul><ul><ul><li>defines a basic, lowest-common-denominator J2ME runtime environment </li></ul></ul><ul><ul><li>includes the virtual machine and a set of core classes derived primarily from J2SE </li></ul></ul><ul><ul><li>basically used to classify myriad devices into a fixed configuration </li></ul></ul>
    17. 17. JavaME Profile <ul><li>The profile is layered on top of (and thus extends) a configuration. </li></ul><ul><li>Defines a standard Java platform for a vertical market device family, to ensure interoperability </li></ul><ul><li>Profiles typically include class libraries that are far more domain-specific than the class libraries provided in a configuration. </li></ul>
    18. 18. JavaME Profiles <ul><li>There are many functionality supported by MIDP </li></ul><ul><ul><li>Graphical user interface </li></ul></ul><ul><ul><li>Media </li></ul></ul><ul><ul><li>Networking (high-level) </li></ul></ul><ul><ul><li>Security </li></ul></ul>
    19. 19. JavaME Profile defines <ul><li>Application life-cycle management (application installation, launching, deletion) </li></ul><ul><li>User interface </li></ul><ul><li>Event handling </li></ul><ul><li>High-level application model (the interaction between the user and the application) </li></ul>
    20. 20. JavaME MIDlets <ul><li>MIDP application are known as MIDlet </li></ul><ul><li>MIDlets are executed by device-specific Application Secutirty Manager (ASM) </li></ul><ul><li>ASM defines security restrictions for each MIDlet </li></ul><ul><li>ASM can interrupt MIDlet </li></ul><ul><li>MIDlets move from state to state in the lifecycle </li></ul>
    21. 21. JavaME Simple Midlet <ul><li>import javax.microedition.lcdui.Display; </li></ul><ul><li>import javax.microedition.lcdui.TextBox; </li></ul><ul><li>import javax.microedition.midlet.MIDlet; </li></ul><ul><li>import javax.microedition.midlet.MIDletStateChangeException; </li></ul><ul><li>public class HelloWorldMidlet extends MIDlet { </li></ul><ul><li>private TextBox textBox; </li></ul><ul><li>public HelloWorldMidlet() { </li></ul><ul><li>textBox = new TextBox(&quot;&quot;, &quot;Hellw, World!&quot;, 20, 0); </li></ul><ul><li>} </li></ul><ul><li>protected void destroyApp( boolean arg0) throws MIDletStateChangeException { </li></ul><ul><li>notifyDestroyed(); </li></ul><ul><li>} </li></ul><ul><li>protected void pauseApp() { </li></ul><ul><li>notifyPaused(); </li></ul><ul><li>} </li></ul><ul><li>protected void startApp() throws MIDletStateChangeException { </li></ul><ul><li>Display. getDisplay ( this ).setCurrent(textBox); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
    22. 22. 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  
    23. 23. 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. <ul><li>A free, open-source Integrated Development </li></ul><ul><li>Environment for software developers. It contains </li></ul><ul><li>all the tools that are need to create professional </li></ul><ul><li>desktop, enterprise, web, and mobile applications </li></ul><ul><li>with the Java language. NetBeans IDE have early </li></ul><ul><li>access to the most of Sun Java features. Highly </li></ul><ul><li>recommended by Sun. </li></ul><ul><li>Features of NetBeans IDE: </li></ul><ul><li>Ability to interact with different emulators (JTWI support) </li></ul><ul><li>MSA support </li></ul><ul><li>Visual mobile designer - GUI visual editor </li></ul><ul><li>Wizards for component creation; </li></ul><ul><li>SVG (Scalable Vector Graphics) components are embedded </li></ul><ul><li>Creation of custom SVG components </li></ul><ul><li>Game builder support </li></ul><ul><li>Multiple device configurations for project </li></ul><ul><li>Access to web services </li></ul><ul><li>Ant-based agile automated build system </li></ul><ul><li>Midlet signing, JMUnit support, certificate management, Proguard obfuscator integration </li></ul><ul><li>Since version 6.7 NetBeans supports LWUIT library for UI building </li></ul><ul><li>These J2ME wireless toolkits have been tested to </li></ul><ul><li>work with EclipseME. (Others may work if they </li></ul><ul><li>meet the UEI specification.): </li></ul><ul><li>Sun Wireless Toolkits </li></ul><ul><li>Motorola SDK for J2ME </li></ul><ul><li>Nokia Developer Suite 2.2 for J2ME </li></ul><ul><li>Siemens SMTK for Series 60 </li></ul><ul><li>Sony Ericsson J2ME SDK </li></ul><ul><li>Sprint PCS Wireless Toolkit for Java 2.0.13 </li></ul><ul><li>MJT plug-in for development support (project creation, midlet creation, test creation) </li></ul>IntelliJ IDEA Net Beans Eclipse
    24. 24. SDKs <ul><li>Major vendors of mobile devices provide their own SDK in order to create </li></ul><ul><li>performance application with device(platform) specific features and nice </li></ul><ul><li>look&feel. </li></ul><ul><li>Vendor’s SDK usually includes following components: </li></ul><ul><li>APIs: </li></ul><ul><ul><li>Bleutooth API (JSR-82) </li></ul></ul><ul><ul><li>Location API (JSR-179) </li></ul></ul><ul><ul><li>File Connection API(JSR-75) </li></ul></ul><ul><ul><li>Scalable 2D Vector Graphics API (JSR-226) </li></ul></ul><ul><ul><li>Mobile 3D Graphics API (JSR-184) </li></ul></ul><ul><ul><li>Java Binding for the OpenGL ES API (JSR 239) </li></ul></ul><ul><ul><li>XML API for Java ME (JSR 280) </li></ul></ul><ul><ul><li>Specific Game API (Mascot, Capsule 3D Graphics) </li></ul></ul><ul><ul><li>Platform-specific libraries </li></ul></ul><ul><li>Unit testing library (JMUnit, J2MEUnit) </li></ul><ul><li>Device emulator (for one or series of devices) </li></ul><ul><li>Profiler </li></ul>
    25. 25. Emulators
    26. 26. 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
    27. 27. Testing <ul><li>Automated tools: </li></ul><ul><ul><li>TestQuest </li></ul></ul><ul><ul><li>m-Test </li></ul></ul><ul><ul><li>IBM Rational RealTime (using JUnit implementation) </li></ul></ul><ul><li>Unit Testing : </li></ul><ul><ul><li>JMEUnit </li></ul></ul><ul><ul><li>JMUnit (most popular) </li></ul></ul><ul><ul><li>MOMEUnit </li></ul></ul><ul><ul><li>Hammockmocks </li></ul></ul><ul><ul><li>MockME </li></ul></ul>
    28. 28. Frameworks & Libs <ul><li>JMUnit </li></ul><ul><li>JMEUnit </li></ul><ul><li>SonyEricsson Mobile Unit 1.0 </li></ul><ul><li>MoMe Unit </li></ul><ul><li>Hammockmocks </li></ul><ul><li>MockMe </li></ul><ul><li>OpenBaseMovil -db </li></ul><ul><li>Perst Lite for J2ME </li></ul><ul><li>OpenBaseMovil -core </li></ul><ul><li>FallME </li></ul><ul><li>Polish framework </li></ul><ul><li>SpringME </li></ul><ul><li>Apime </li></ul><ul><li>LWIUT </li></ul><ul><li>KUIX </li></ul><ul><li>Polish </li></ul><ul><li>Fire-j2me </li></ul><ul><li>Lwvcl </li></ul><ul><li>Synclast UI API </li></ul><ul><li>kUI </li></ul><ul><li>Thinlet GUI Toolkit </li></ul><ul><li>Pax JavaME GUI library </li></ul><ul><li>TWUIK </li></ul>Testing frameworks Database and storage frameworks Application Model frameworks UI
    29. 29. ProGuard <ul><li>ProGuard is a free Java class file shrinker, </li></ul><ul><li>optimizer, obfuscator, and preverifier. </li></ul><ul><li>ProGuard: </li></ul><ul><li>Creating more compact code, for smaller code archives, faster transfer across networks, faster loading, and smaller memory footprints. </li></ul><ul><li>Making programs and libraries harder to reverse-engineer. </li></ul><ul><li>Listing dead code, so it can be removed from the source code. </li></ul>
    30. 30. ProGuard usage <ul><li>Eclipse MTJ plug-in supports ProGuard integration </li></ul><ul><li>ProGuard can be integrated in project by means of Ant </li></ul><ul><li> <taskdef resource=&quot;proguard/ant/; classpath=&quot;/usr/local/java/proguard/lib/proguard.jar&quot; /> </li></ul><ul><li>Project may be obfuscated by ProGuard independently </li></ul><ul><ul><ul><li>java -jar proguard.jar  options  ... </li></ul></ul></ul>
    31. 31. Antenna <ul><li>Antenna provides a set of  Ant  tasks suitable for developing </li></ul><ul><li>wireless Java applications targeted at the MIDP. </li></ul><ul><li>Antenna helps to: </li></ul><ul><li>c ompile </li></ul><ul><li>preverify </li></ul><ul><li>package </li></ul><ul><li>obfuscate </li></ul><ul><li>r un </li></ul><ul><li>Preprocess </li></ul><ul><li>The main feature of Antenna is to preprocess sources in order to </li></ul><ul><li>create vendor-dependent build from vendor- independent codebase. </li></ul>
    32. 32. Antenna - How it works?
    33. 33. J2ME-Polish <ul><li>J2ME Polish is a suite of tools and technologies aimed at mobile </li></ul><ul><li>developers and companies within the mobile space. </li></ul><ul><li>Main features of J2ME Polish include: </li></ul><ul><li>Lush :  A UI toolkit that is highly flexible and that can be designed outside of the application's source code. </li></ul><ul><li>Janus :  A toolset for porting mobile application to different handsets and different technology platforms. </li></ul><ul><li>Touch :  Technology for accessing server side content and communicating with remote parties. </li></ul><ul><li>Trunk :  A persistence solution that allows you to load and save complex data with a single line of code. </li></ul><ul><li>Marjory :  Our community maintained device database. </li></ul>
    34. 34. Polish can do what? J2ME Polish can be adjusted to support several platforms that support more than the normal MIDP profile.
    35. 35. Polish – How it works? Annotations in simple JavaME code
    36. 36. Polish – How it works? CSS styles for UI components in separate CSS file
    37. 37. Special Ant task Ant task Target device MIDlet class name
    38. 38. Annotations + CSS + Ant Task = ?
    39. 39. JavaME issues <ul><li>Poor native UI component palette </li></ul><ul><li>RMS storage API is inconvenient </li></ul><ul><li>Design issues (e.g. you can’t inherit your class from Layer) </li></ul>
    40. 40. JavaME pit faults <ul><li>Porting – app works on Nokia, but will not work on SE </li></ul><ul><li>Graphics – different screen’s size, different colors, different VGA </li></ul><ul><li>Emulator – Looks fine on emulator, fails on device </li></ul><ul><li>Midlet size – sometimes 128K is boundary size </li></ul><ul><li>Bundled resources size </li></ul><ul><li>Hard to test without real device </li></ul>
    41. 41. Android Agenda <ul><li>What is Android? </li></ul><ul><li>Android features </li></ul><ul><ul><li>Dalvik VM </li></ul></ul><ul><ul><li>Android market </li></ul></ul><ul><li>Android architecture </li></ul><ul><ul><li>Important APIs </li></ul></ul><ul><li>Android Development tools </li></ul><ul><li>Android applications </li></ul><ul><ul><li>Inside of Android project </li></ul></ul><ul><ul><li>Security model </li></ul></ul><ul><ul><li>Android application building blocks </li></ul></ul><ul><li>Testing </li></ul><ul><li>Simple application </li></ul><ul><li>Android issues </li></ul>
    42. 42. What is Android? <ul><li>Android is a software stack for mobile devices that includes: </li></ul><ul><li>operating system (Linux kernel) </li></ul><ul><li>Middleware (Google-developed Java libraries) </li></ul><ul><li>key applications (Media player, web browser) </li></ul><ul><li>The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language. </li></ul>
    43. 43. Android features <ul><li>Handset layouts - VGA, 2D graphics library, 3D graphics library based on OpenGL ES 1.0 </li></ul><ul><li>SQLite as storage engine </li></ul><ul><li>Connectivity - GSM/EDGE, CDMA, EV-DO, UMTS, Bluetooth, and Wi-Fi </li></ul><ul><li>Messaging – SMS/MMS/threaded text messaging </li></ul><ul><li>Web browser - WebKit application framewor </li></ul><ul><li>Dalvik virtual machine </li></ul><ul><li>Media support - MPEG-4, H.264, MP3, AAC, MIDI, OGG, AMR, JPEG, PNG, GIF </li></ul><ul><li>Hardware support – cameras, touchscreens, GPS, accelerometers, and accelerated 3D graphics </li></ul><ul><li>Multi-touch – native support </li></ul><ul><li>Android market – Similar ot IPhone App Store </li></ul>
    44. 44. Dalvik virtual machine <ul><li>Register based </li></ul><ul><li>Dex file format </li></ul><ul><li>Private byte code format </li></ul><ul><li>No JIT </li></ul><ul><li>Private VM per application / process. </li></ul><ul><li>GC understands memory sharing semantics </li></ul><ul><li>Non-standard Java virtual machine. </li></ul><ul><li>Not Java SE or Java ME </li></ul><ul><li>No Swing/AWT windowing toolkits </li></ul><ul><li>Android’s programs are written in Java, using Java-oriented IDEs. It just </li></ul><ul><li>doesn’t compile the java code into java bytecode but instead Dalvik bytecode </li></ul><ul><li>(.dex) </li></ul><ul><li>Every application has its own instance of the Dalvik virtual machine </li></ul>
    45. 45. Android Market <ul><li>Google’s application store, where users can search, download, buy and install software </li></ul><ul><li>27.10.2008 opened for developers to upload free software ($25 one time application fee) </li></ul><ul><li>Q1 2009 developers can distribute paid apps </li></ul><ul><li>Users can provide feedback to the developer and even rate the application </li></ul><ul><li>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. </li></ul>
    46. 46. Android architecture
    47. 47. Android development tools <ul><li>Eclipse Android development tools (ADT plug-in) . Provides convenient way to create and run Android projects. </li></ul><ul><li>Other IDEs </li></ul><ul><li>Android SDK </li></ul>
    48. 48. IDE for Android development <ul><li>The best is Eclipse </li></ul><ul><li>IntelliJ IDEA Android plug-in </li></ul><ul><li>NetBeans Android plug-in from Project Kenai </li></ul>
    49. 49. Android SDK contains <ul><li>Android emulator </li></ul><ul><li>command line tools </li></ul><ul><ul><li>aapt - Android asset packaging tool </li></ul></ul><ul><ul><li>adb - Android debug bridge </li></ul></ul><ul><ul><li>aidl - Android IDL compiler </li></ul></ul><ul><ul><li>emulator - Android emulator </li></ul></ul><ul><ul><li>ddms – Dalvik debug monitor </li></ul></ul><ul><li>documentation </li></ul><ul><li>example applications </li></ul>
    50. 50. Emulator limitations <ul><li>No support for placing or receiving actual phone calls </li></ul><ul><li>No support for camera/video capture (input) </li></ul><ul><li>No support for audio input </li></ul><ul><li>No support for determining connected state </li></ul><ul><li>No support for determining battery charge level </li></ul><ul><li>No support for Bluetooth </li></ul>
    51. 51. Android applications <ul><li>An application is composed of one or more activities </li></ul><ul><li>Every application is wrapped in a APK file. </li></ul><ul><li>Application runs in separate Linux processes. </li></ul><ul><li>Applications share code and data via Linux Copy on Write semantics. </li></ul><ul><ul><li>Applications forks of a preinitialized Zygote process </li></ul></ul><ul><li>Shared memory is used for communication. </li></ul>
    52. 52. Security Model <ul><li>Each application runs as a separate Linux user. </li></ul><ul><li>Security is enforced by OS and MMU, not VM. </li></ul><ul><li>Applications asks for specific permissions during installation: </li></ul><ul><ul><li>android.permission.VIBRATE </li></ul></ul><ul><ul><li>android.permission.CALL </li></ul></ul><ul><ul><li>android.permission.DELETE_PACKAGES ... </li></ul></ul>
    53. 53. 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)
    54. 54. Application building blocks <ul><li>AndroidManifest.xml </li></ul><ul><li>Activities </li></ul><ul><li>Views </li></ul><ul><li>Layouts </li></ul><ul><li>Intents & IntentReceivers </li></ul><ul><li>Services </li></ul><ul><li>Notifications (Broadcast recievers) </li></ul><ul><li>ContentProviders </li></ul>
    55. 55. Manifest file describes <ul><li>components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of </li></ul><ul><li>names the classes that implement each of the components and publishes their capabilities (for example, which Intent messages they can handle) </li></ul><ul><li>which permissions the application must have in order to access protected parts of the API and interact with other applications </li></ul><ul><li>the permissions that others are required to have in order to interact with the application's components </li></ul><ul><li>the minimum level of the Android API that the application requires </li></ul><ul><li>the libraries that the application must be linked against </li></ul>
    56. 56. Activity <ul><li>an activity is usually a single screen in our application </li></ul><ul><li>however, activities can also be faceless </li></ul><ul><li>one activity is designated as the entry point for your application </li></ul><ul><li>activity from one application can be used by another application, in other words activities are reusable </li></ul><ul><li>Have a state and can persist </li></ul><ul><li>Can be foreground and background </li></ul>
    57. 57. Views <ul><li>The basic UI component </li></ul><ul><li>Responsible for drawing and event handling </li></ul><ul><li>Define your View through: </li></ul><ul><ul><ul><li>Layout Resources (i.e. defined in main.xml file): </li></ul></ul></ul><ul><ul><ul><ul><li><ListView </li></ul></ul></ul></ul><ul><ul><ul><ul><li> android:id=&quot;@+id/myListView&quot; </li></ul></ul></ul></ul><ul><ul><ul><ul><li> android:layout_width=&quot;fill_parent&quot; </li></ul></ul></ul></ul><ul><ul><ul><ul><li> android:layout_height=&quot;wrap_content&quot; </li></ul></ul></ul></ul><ul><ul><ul><ul><li>/> </li></ul></ul></ul></ul><ul><ul><ul><li>From your Activity class code: </li></ul></ul></ul><ul><ul><ul><ul><li>setContentView(R.layout.main); </li></ul></ul></ul></ul><ul><ul><ul><ul><li>ListView myListView = (ListView)findViewById(; </li></ul></ul></ul></ul><ul><ul><ul><li>Inside your code: </li></ul></ul></ul><ul><ul><ul><ul><li>ListView myListView = new ListView(this); </li></ul></ul></ul></ul><ul><ul><ul><ul><li>setContentView(myTextView); </li></ul></ul></ul></ul>
    58. 58. Layouts <ul><li>Layouts </li></ul><ul><ul><li>Specify the position of child views (controls) on the screen </li></ul></ul><ul><ul><li>Common Layout Objects: </li></ul></ul><ul><ul><ul><li>FrameLayout : all child views are pinned to the top left corner of the screen </li></ul></ul></ul><ul><ul><ul><li>LinearLayout : each child view is added in a straight line (vertically or horizontally) </li></ul></ul></ul><ul><ul><ul><li>TableLayout : add views using a grid of rows and columns </li></ul></ul></ul><ul><ul><ul><li>RelativeLayout : add views relative to the position of other views or to its parent. </li></ul></ul></ul><ul><ul><ul><li>AbsoluteLayout : for each view you add, you specify the exact screen coordinate to display on the screen </li></ul></ul></ul><ul><ul><li>More info: http:// </li></ul></ul>
    59. 59. Intents <ul><ul><li>Specify what intentions you have in terms of a specific action being performed </li></ul></ul><ul><ul><li>Launch Activities </li></ul></ul><ul><ul><ul><li>Transition between the activities of your application </li></ul></ul></ul><ul><ul><ul><li>Explicitly ( using new Intent(current_application_context, new_activity_to_start); ): </li></ul></ul></ul><ul><ul><ul><ul><li>Intent newIntent = new Intent(this, OtherActivity.class); </li></ul></ul></ul></ul><ul><ul><ul><ul><li>startActivity(newIntent); //OtherActivity will become visible </li></ul></ul></ul></ul><ul><ul><ul><li>Implicitly ( using new Intent(action_to_perform,data_to_perform_action_on); ): </li></ul></ul></ul><ul><ul><ul><ul><li>Intent newIntent = new Intent(Intent.ACTION_DIAL, </li></ul></ul></ul></ul><ul><ul><ul><ul><li> Uri.parse(“tel:12345”)); </li></ul></ul></ul></ul><ul><ul><ul><ul><li>startActivity(newIntent); </li></ul></ul></ul></ul>
    60. 60. Services <ul><li>Services run in the background </li></ul><ul><li>Primarily used for: </li></ul><ul><ul><li>Updating Content Providers </li></ul></ul><ul><ul><li>Firing Intents </li></ul></ul><ul><ul><li>Triggering Notifications </li></ul></ul><ul><ul><li>Any operation that does not necessitate user interaction (i.e. networking, MP3 playback) </li></ul></ul><ul><li>For intensive and/or blocking operations, the service should be run in its own thread </li></ul><ul><li>Creating and Controlling Services </li></ul><ul><ul><li>Create a Service: </li></ul></ul><ul><ul><ul><li>Extend the Service class; override specific methods (such as onCreate , onStart , onBind , etc). </li></ul></ul></ul><ul><ul><li>Start and stop a Service: </li></ul></ul><ul><ul><ul><li>Use the startService method from inside your current Activity class </li></ul></ul></ul><ul><ul><ul><li>Use the stopService method from inside your current Activity class </li></ul></ul></ul>
    61. 61. Testing <ul><li>Android SDK includes JUnit </li></ul><ul><li>autoandroid (formerly known as Positron) – the mix of JUnit and Selenuim for Android </li></ul>
    62. 62. Simple Android application Source code Layout xml file
    63. 63. Android issues <ul><li>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. </li></ul><ul><li>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. </li></ul><ul><li>Android does not officially allow apps to be installed on, nor run from, an SD card. </li></ul><ul><li>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 </li></ul>
    64. 64. Android pit faults <ul><li>Few real devices are available </li></ul><ul><li>C yano MOD vs. Android </li></ul><ul><li>Google Libs for Google services </li></ul>
    65. 65. RIM Blackberry Agenda <ul><li>What is Blackberry? </li></ul><ul><li>BES </li></ul><ul><li>Blackberry development </li></ul><ul><li>Capabilities </li></ul><ul><ul><li>Architecture </li></ul></ul><ul><ul><li>SDK </li></ul></ul><ul><ul><li>IDE </li></ul></ul><ul><ul><li>Simulator </li></ul></ul><ul><li>App World </li></ul><ul><li>Frameworks </li></ul>
    66. 66. What is Blackberry? <ul><li>BlackBerry  is a line of wireless handheld </li></ul><ul><li>devices, which supports:  </li></ul><ul><li>push e-mail </li></ul><ul><li>mobile telephone </li></ul><ul><li>text messaging </li></ul><ul><li>internet faxing </li></ul><ul><li>web browsing   </li></ul><ul><li>multi-touch  </li></ul><ul><li>Developed by the company Research In Motion </li></ul>
    67. 67. BES BlackBerry handhelds are integrated into an organization's e-mail system through a software package called &quot;BlackBerry Enterprise Server&quot; (BES).
    68. 68. BES – How it works?
    69. 69. Blackberry development
    70. 70. Blackberry capabilities <ul><li>The BlackBerry smartphone is a pure Java device with all built-in applications and APIs written in Java </li></ul><ul><li>BlackBerry supports: </li></ul><ul><li>MIDP Standard APIs (MIDP v2.0 supported) for cross platform development </li></ul><ul><li>CLDC Standard APIs (CLDC v1.1 supported) for connectivity </li></ul><ul><li>BlackBerry specific Java APIs </li></ul><ul><li>Java APIs for the BlackBerry solution enables you to develop rich custom client applications that provide: </li></ul><ul><li>Customizable user interface </li></ul><ul><li>Local data storage on the device </li></ul><ul><li>Event listening and system interfaces </li></ul><ul><li>Secure wireless transport via HTTP </li></ul><ul><li>Advanced Java API capabilities include: </li></ul><ul><li>Integration with BlackBerry Email, PIM and Phone applications </li></ul><ul><li>Almost always-on background threads to listen for push data </li></ul><ul><li>Communication with Bluetooth®-enabled peripherals </li></ul><ul><li>Location-based services and multimedia </li></ul><ul><li>2D Graphics , SVG support (Plazmic Media Engine) </li></ul><ul><li>Full phone data access </li></ul>
    71. 71. Blackberry - Java <ul><li>BlackBerry devices are designed from the ground-up to run Java applications </li></ul><ul><ul><li>Native BlackBerry applications are written in Java </li></ul></ul><ul><ul><li>All BlackBerry devices run the BlackBerry Java Virtual Machine (JVM) with full support for Java ME standard </li></ul></ul><ul><ul><li>BlackBerry devices are software-upgradeable </li></ul></ul><ul><ul><ul><li>New versions of BlackBerry O/S and JVM can be loaded onto existing devices to provide new features and APIs </li></ul></ul></ul><ul><li>BlackBerry exposes thousands of Java APIs </li></ul><ul><ul><li>Extensive Java ME JSR support </li></ul></ul><ul><ul><ul><li>Including Java Technology for the Wireless Industry (JTWI), Wireless Messaging, Mobile Media, Bluetooth, Location and Web Services </li></ul></ul></ul><ul><ul><li>BlackBerry APIs that offer tighter integration with BlackBerry Smartphones </li></ul></ul>
    72. 72. Blackberry Architecture
    73. 73. SDK <ul><li>Java Development Environment v 4.5 </li></ul><ul><li>Additional component packs (4.6/4.7) </li></ul><ul><li>Bundled Simulator in SDK </li></ul>
    74. 74. IDE <ul><li>Blackberry JDE (within SDK) </li></ul><ul><li>Eclipse (JDE plug-in for Eclipse) </li></ul>
    75. 75. BlackBerry Java Development Environment (JDE) <ul><ul><li>BlackBerry JDE used to build, test and </li></ul></ul><ul><ul><li>optimize Java ME applications for BlackBerry </li></ul></ul><ul><ul><li>It is free </li></ul></ul><ul><ul><li>Supports Java ME as well as many BlackBerry APIs </li></ul></ul><ul><ul><li>Includes a robust set of wireless debugging, profiling and optimization tools </li></ul></ul><ul><ul><li>Secure code-signing infrastructure </li></ul></ul><ul><ul><li>JDE Component Pack enables choice of Java-based IDE </li></ul></ul>
    76. 76. Blackberry Simulator <ul><li>A lot of simulators </li></ul><ul><li>Free </li></ul><ul><li>http :// / eng / developers / resources / simulators.jsp </li></ul>
    77. 77. Application Signing <ul><li>Access to additional APIs for features, such as advanced cryptography, synchronization, and messaging, is restricted </li></ul><ul><li>RIM Controlled APIs are split into 3 categories: </li></ul><ul><ul><li>Runtime APIs </li></ul></ul><ul><ul><li>BlackBerry Application APIs </li></ul></ul><ul><ul><li>BlackBerry Cryptography APIs </li></ul></ul><ul><li>Signing of applications is not required to run applications using the BlackBerry Smartphone Simulator. </li></ul><ul><li>Sign services </li></ul><ul><li>Sign service administrations fee is $20 </li></ul>
    78. 78. Blackberry App World <ul><li>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 </li></ul><ul><li>Similar to Apple App Store and Google Market </li></ul>
    79. 79. Frameworks <ul><li>J2ME-Polish (Blackberry Storm only for now) </li></ul><ul><li>OpenBaseMovil (going to support) </li></ul>