FIT2081 Notes - Michelle Yu-Ying Wong
Thanks Monash and the FIT2081 team for providing me with resources to compile these notes.
• Software
... [Show More] development kit – bundle of software components and libraries, used to develop and deploy an
application in a given mobile platform. (android uses java software development kit to compile java classes then
uses android software development kit to run software).
• Application programming interface – prewritten java class libraries which can be used in user applications to
perform common and complicated functions (for example accessing UI, hardware). They are used in applications
by instantiating instances of the class and invoking public methods on these projects.
• Integrated development environments – software environment which support app development, by supplying
tools such as language sensitive code editors, interface designed, debuggers and device monitors.
Application types
• Different application types require different developer skills, platforms, each with their own strength and
weaknesses.
• Applications should have presence across all major platforms.
Native applications
• Application developed and deployed using technologies with software development tools and language used by
and recommended by the platform vendor.
• Communicates with the platform to access device data.
• Distributed using application marketplaces.
• Android -> Java (C++) with android SDK à JDK (runs on windows, mac and linux)
• Apple à objective C/Cocoa or swift (stack runs only on macs)
• Advantages
o Works offline
o Speed , runs in its own process (not a page of a web browser’s process, runs independently from the
browser’s process). Critical for applications where performance optimisation is critical like games that
require fluid complex graphics.
o More secure because it doesn’t require web transactions
o Can take full advantage of device features and hardware capabilities (camera, GPS, accelerometer,
compass, contacts , gestures and notification system) because it has direct access to the API the OS uses,
without API bridges.
o User experience is consistent with the OS.
• Disadvantage
o Not cross-platform (requires specialised teams for different mobile platform languages to develop,
update, maintain and test application code). More work, overhead and costs.
o Must explicitly specify layouts for different android devices with different sizes and orientations, which
can result in more pleasing UI than automatic responsive designs in HTML5.
o Clients must update their own software to be compliant with updates– which can be a hassle for the user.
It can also lead to fragmentation, and lead hassles for the developers. different versions might need to be
kept on different servers.
o Content and design is restricted and must be approved by app stores. Subscription costs must go to
market vendor. Re-approval can lead to delays.
Mobile Web Applications
• Built with website development technologies (HTML5, CSS, JS)
• Uses browser engines to render user interfaces, interpret code , acquire assets and resources (images, audio)
• Uses JS à native API bridges to interact with device hardware.
• Navigated to using URL/Bookmarks
• Features available: GPS, tap-to-call feature, camera API
• Features unavailable: notifications, background operation, accelerometer, orientation info, complex gestures.
• Dynamic developments to bridge differences between web applications and native apps.
o Improved JS execution speed
o Improved HTML5/CSS4 look and feel (can include meta-elements in the web page header to render the
page with browser décor and icons, swiping)
o HTLM caching makes offline operations possible
o Push notifications can be possible for mobile apps.
o Chrome remote debugging tools allow debugging client side of JS code on device.
• Advantages
o Updates are instantaneous and can be updated without client input (less fragmentation)
o Stack is defined by standard bodies rather than platform vendors, so code can be shared between
platforms with minimal adjustments. Allows developers to focus on business logic rather than adapting
to different platforms. Developers don’t need sophisticated skills so can develop with learning curve.
o Responsive designs due to HTML5.
o Most discoverable (can be found using search engines)
o No installation is required (doesn’t waste space on applicant’s device)
• Disadvantages
o Privacy issues – information must be sent from user device to servers, even if it is encrypted, can’t
always be trusted.
o Data storage is restricted to local file storage.
o Reduced offline functionalities, caching is usually just to fall back with grace is not guaranteed to be
operational.
o No access to native API , so entirely dependent on the quality, completeness and cross-browser
consistency of JS à native API bridges.
o Differences in rendering engines (Google uses Blink which diverges from WebKit sufficiently).
o Requires keyboard to load to type URL, rather than just tapping an icon .
o The amount of time users browse the web on mobile device is declining, app usage increases.
o Look and feel is still different from OS user experience.
Hybrid apps
• Native apps written in a language or development environment other than recommended languages, renders web
content and processes JS code in a native app embedded broswer, which does not have visible address bars or
other controls. It comes in two types:
o Thin native shell containing a web app, contains a JS à Native API bridge and also a component
interacts with the platform’s web rendering engine to maintain a UI. (Cordova, Trigger.io, Sencha).
o Cross compiler which converts code into a Native app executable in any platform (Xamarin). Through
the platforms underlying API. While it is possible to build hybrid web apps without third party support,
they provide advanced features like a complete IDE, and updated JS à native API bridges.
• Xamarin – build android and iOS apps with .NET and C#.
• Again, accesses device features through an abstraction layer known as a compliant API binding bridge or plugins
between the native and Webview components. Usually these extensions have more access than mobile web
browsers alone (can detect, swipe, gestures)
• Must be installed from the marketplace.
• Can bundle websources (depending on complexity of size) so app services don’t have to wait for web servers.
• Advantages
o Develop once deploy anywhere architecture – allows a single code base to be deployed on any platform.
Scaling and maintenance is not an issue, requires less specialised developers.
o Easy way to deploy an existing web application into app stores and leverage the channel for content, app
discovery and monetization. While you still have to share purchase prices, only have to update content
once as long as there is no changes in the native code, which would require a fresh submission of the
application.
• Disadvantages
o Access to native API might not always be available, requires additional development to make a plugin to
support it. Therefore, there might be some delayed access to new features.
o The application can only run as well as the WebView instance, so performance is tied to the quality of
the platform’s browser. JavaScript is single threaded, but you can offload tasks to native threads for
parallel execution.
o Look and feel – platform UI might be difficult to mimic using HTML, CSS and Javascript.
o Functionality with hardware depends on framework used. So quality, completeness and broswer
consistency depends on the JS to native API bridges.
o Webkit might not be equally maintained for all mobile platforms.
Summary
• Also should consider design, because it is as important as implementation (requirements are different for a desktop
and a mobile application).
• The apps built in this course are native apps. It has a free IDE and emulator, and has the highest device count.
Android
• A software stack which includes a lightweight, modified version of a Linux kernel, opensource middleware,
software and priority software (hardware drivers).
• Usually these priority software are from google and licensed to manufacturers of android devices (because it takes
time and resources to develop an alternative suit of software).
• Optimised for mobile devices (smartphones, tablets, laptops, smart TV) – responsive to hardware features such as
touch input and optimised to operate with the limitations the devices.
• The android SDK code (android open source project) is licensed by Apache for modification, redistribution
without the need to push modifications to the community. It encourages community driven projects to add and
experiment new features to advanced users. It is very business friendly but causes fragmentation.
• It is the flagship software of the open handset alliance , a consortium of device manufacturers, software, chipset
and telecommunications companies, who are obliged or forbidden to build their own version of the OS. Aim to
develop open standards, create mobile device with common OS software that facilitate app development and
distribution. Google is responsible for code, API, Linux, development tools.
• The android ecosystem is a set of interdependent evolving component that enable the creation and distribution of
android apps which includes alliance, hardware manufacturers, ID, distribution channels, developers and app
developers. OEM and google manufacture google flagship devices which run on unaltered open source code.
Android OS Architecture
• Consists of layers of software, middleware (libraries and API), service and hardware.
• Coordinate with each other, lower levels perform services for higher levels.
• User applications – top level programs which include propriety applications for basic functionalities (SMS, calendar,
internet browsing) and applications which extend the functionality. Distributed in an archive file .apk through
marketplaces or are pre-installed in the device.
• Applications run on framework libraries (java compatible) which act as wrappers for underlying C/C++ libraries or
with C/C++ libraries through the native development kit.
o Uses java software development kit to compile java classes then android software development kit to run
software.
o These libraries include those which interact with VM, apache libraries for networking, string handling,
networking and android libraries specific for android development (UI building and database)
§ JDK android class library uses a subet of Apache Harmony Java (not Oracle’s java standard
edition). Still obey java conventions. They have common Java API classes and method signatures
aside from UI AIs ( Swing AWT)
§ Difference from java, the cycle of code is not built by classes, but an activity.
§ The C+/C++ android uses is bionic, which is different from the standard C library code, it has a
smaller runtime footprint and is optimised for low-frequency CPUs.
o Framework libraries manage android applications and allow for high level of reusability and
interchangeability.
o Activity manager – controls application life cycles and back stack.
o Content providers – enables apps to access other apps.
o Resource manage – provide access to non-coded embedded resources.
o Notification manage – enable customer alerts in status bar
o View system – a set of views used to create application UI (lists, grids, text boxes)
o Package manger – allows other applications to find information about another application
• These libraries do no run directly on a process on Linux but in individual instances of the android run time virtual
machine, within its own Linux kernel process, running applications consisting of components. It uses android run time
or dalvik to translate byte code into native instructions executed in a Linux runtime environment.
o The compilation happens either in time (Dalvik) or using AOT (ART upon installation, dex -> elf using
dex2oat utility.
o ART exploits the low level functions on linux so it is more efficient than a standard java virtual machine in
terms of memory usage, allows multiple instances to run efficiently within resource constraints of a mobile
device.
o After AOT compilation, the system profiles the application and compiles frequently execute segments of byte
code into machine, JIT to improve execution speed, memory allocation and garbage collection. This
eliminates a lot of execution overhead, but requires more time to install applications and uses more memory.
o This allows applications to be sandboxed
§ Each app is a different user, assigned their own linux ID.
§ Although this can be shared between apps to share data.
§ They can only access components and files required to do its work, using user ID.
§ Each application cannot interfere with OS to access resources from other applications unless
permission is granted by the user.
§ Application is not tied to specific hardware and improves security.
• Hardware abstraction layer – defines a standard interface for hardware vendors to implement
o Exposes device hardware capabilities to higher Java API framework
o Each library implements an interface for a specific hardware component.
• Linux kernel
o OS: a collection of software that manages computer hardware resources and provides common services for
computer programs (memory, process and power management, network stacks, device drivers, WiFi and
audio).
o Provides a multi-tasking execution environment allowing multiple processes to execute concurrently.
o Usually work with hardware in ARM RISC architecture licensed to and manufactured by several chip
manufacturers under license by ARM holdings but can support intel.
o Actual kernel used (4.4, 4.9 and 4.14) varies for the device
o Android system is quite different from Linux and include additional features like wakelocks.
o Power management, process management and memory management at lowest level [Show Less]