Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 1 1 Mobile Systems M Alma Mater Studiorum – University of Bologna CdS Laurea Magistrale (MSc) in Computer Science Engineering Mobile Systems M course (8 ECTS) II Term – Academic Year 2017/2018 04 – Development and Runtime Platforms: Overview, J2ME, iOS, and Android Paolo Bellavista [email protected]http://lia.disi.unibo.it/Courses/sm1718-info/ http://lia.disi.unibo.it/Staff/PaoloBellavista/
92
Embed
04 Development and Runtime Platforms: Overview, J2ME, iOS ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 1 1
Mobile Systems M
Alma Mater Studiorum – University of Bologna
CdS Laurea Magistrale (MSc) in
Computer Science Engineering
Mobile Systems M course (8 ECTS) II Term – Academic Year 2017/2018
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 9
Android in a Single Slide
Launched by Google in 2007 as an Apache free-software platform, based on Linux
Applications were developed in Java and compiled into Dalvik Executable format (DEX – custom bytecode, e.g., more concise than usual .class)
Quite large subset of J2SE facilities + rich library of support features (Android SDK) available for the community of developers Touch screen management, local sensors (accelerometers,
gyroscopes, GPS, …), 3D graphics, advanced support for location-based services, …
Also here possible? fragmentation issues due to different OS versions and to usage of different extensions of the support stack (given the potential openness of the adopted approach…)
Development/Runtime Platforms – Mobile Systems M 10
A Comparison with a Toy Application
(Gavalas et al, IEEE Software, 2011)
Development/Runtime Platforms – Mobile Systems M 11
A First Comparison
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 12
A First Comparison
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 13
A First Comparison
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 14
A First Comparison
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 15
A First Comparison
Development/Runtime Platforms – Mobile Systems M 16
By delving into finer technical details:
Java 2 Micro Edition
In general terms, different editions of Java “distributions”
Central role of
the KVM +
CLDC +
MIDP stack
Development/Runtime Platforms – Mobile Systems M 17
JSR 248:
Mobile Service Architecture (MSA)
17
Actually, more complex
and articulated
situation
Important
fragmentation
issues
MSA, in two
versions:
full (17/14) or
subset (8/9)
Development/Runtime Platforms – Mobile Systems M 18
J2ME: Configurations and Profiles
A configuration defines a minimal platform for a
horizontal group of devices
Similar requirements on memory and computing power
It defines Java language and virtual machine characteristics
that have to be available on the targeted group of devices
“A Configuration is a specification that defines a minimum Java Platform
functionality for a family of devices. It defines the minimum number of Java
libraries, VM capabilities, Security specification, and a Generic Connection
Framework”
Profile as a set of additional APIs that extend a
configuration with capabilities that are useful for a specific
group of devices “A Profile is a collection of Java APIs that supplement a Configuration to
provide capabilities for a specific device group or market type”
Development/Runtime Platforms – Mobile Systems M 19
J2ME: Defined Configurations
Connected Device Configuration (CDC)
Typically for devices with higher resources if compared with low-end phone devices (no more valid nowadays)
For example, set-top boxes, initially some kinds of PDAs, …
Connected, Limited Device Configuration (CLDC)
For devices with very limited onboard resources
Virtual machine for CLDC: Sun’s Kilo Virtual Machine (KVM) Small memory footprint (60K)
Overall minimum memory = 160K
16/32-bit processors
Processor speed = at least in the range 8-32MHz
Typical hardware of CLDC configuration
For CLDC the only STRONG requirement is available memory size: At least non-volatile 128K for KVM and CLDC libraries
At least volatile 32K for KVM runtime
Development/Runtime Platforms – Mobile Systems M 20
J2ME Profiles
Any profile defines requirements for a family of devices
associated with a specific vertical market
It extends (with a upper overlay layer) a configuration. Always on
top of one defined configuration
It defines a standardized Java platform for a device family/class
in order to achieve interoperability (effort towards the reduction of
fragmentation issues)
It includes class libraries with finer granularity if compared with the
ones in a configuration
Available profiles:
Mobile Information Device Profile (MIDP)
on top of CLDC. It includes additional features for GUIs, multimedia
and gaming support, end-to-end security, extended support to
network connectivity for mobile phones and entry-level PDAs
Development/Runtime Platforms – Mobile Systems M 21
Defined J2ME Profiles (continued…)
…
Foundation Profile on top of CDC. Set of basic Java APIs for resource-limited
devices; crucial and central factor is lack of standard GUI support
Personal Profile
on top of CDC. Together with Foundation Profile, Personal Profile implements the support for development of high-end PDA applications. Personal Profile includes complete set of AWT APIs, support for applets and Xlets
Personal Basis Profile
on top of CDC. It provides developers with an environment for the support of applications with network connectivity and an elementary degree of grahics support for content presentation
Development/Runtime Platforms – Mobile Systems M 22
MIDP: Hardware Requirements
Memory (in addition to the one requested by CLDC)
128K non-volatile for MIDP components
8K non-volatile for persistent application data
32K volatile for KVM
Display
Screen with at least 96x54 pixels
Display depth (or color depth or bit per pixel) at least equal to 1-bit
Form factor of pixels (aspect ratio) = 1:1
Input peripherals (one or multiple)
One-handed keypad
Two-handed keypad
Touch screen
Networking
Two-way
Wireless
Management of intermittent connectivity
Limited bandwidth
Development/Runtime Platforms – Mobile Systems M 23
MIDP Architecture
Mobile Information Device (MID)
CLDC
MIDP
Native OS + System Software
MIDP
Applications
OEM-Specific
Applications
OEM-Specific
Classes
Device-Native
Applications
Original Equipment Manufacturer (OEM)
Development/Runtime Platforms – Mobile Systems M 24
Development/Runtime Platforms – Mobile Systems M 25
MIDP Application Model
MIDP applications are called “MIDlets” MIDlet model is, under many perspectives,
similar to the applet model in J2SE: component-container model and lifecycle management
Also security support for applications that share resources/data (via MIDlet Suite)
MIDlet lifecycle is described as state transitions, indicated as: Start – resource acquisition and execution start Pause – resource release and entrance in the
“wait” state Destroy – resource release, thread destruction,
and ending of all activities
Java Application Manager (JAM) for MIDlet lifecycle management
Pause
Active
Destroyed
sta
rtA
pp
d
es
tro
yA
pp
pau
se
Ap
p
des
tro
yA
pp
Development/Runtime Platforms – Mobile Systems M 26
Typical J2ME Support Stack
Mobile Information
Device Profile
KVM
CLDC = KVM + J2ME Core
API in this
example DSP chip (e.g., ARM)
J2ME core APIs
Your
MIDlet Yellow pages, train timetable and ticketing, games, …
UI, HTTP networking, ...
Thread support,
no floating point…
32-bit RISC, 256K ROM, 256K Flash, 64K RAM
KVM + CLDC + MIDP: applications are developed and run on top
of this standardized stack, independently from OS and hw
details
Development/Runtime Platforms – Mobile Systems M 27
CLDC/MIDP: some Detail about the Primary Packages
Package javax.microedition.io
javax.microedition.lcdui (user interface for lcd displays)
javax.microedition.midlet
javax.microedition.rms (persistent storage)
Widget support for user GUIs Form, TextField, TextBox, DateField, List, Image, Gauge, Alert,
Canvas, Graphics, Display
Two different types of APIs (lower and higher abstraction layers) for GUI management
High level for widget, scrolling, ...
Low level for graphics fine-grained GUI control
Classes for event management – Command and CommandListener
Most relevant: is obvious for all, isn’t it ?, which is the underlying threading model?
Development/Runtime Platforms – Mobile Systems M 28
Usual “Hello World”
as a MIDlet
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HiMIDlet extends MIDlet {
private TextBox textbox;
public HiMIDlet() {
textbox = new TextBox ("", "Hello World!", 20, 0);
}
public void startApp() {
Display.getDisplay(this).setCurrent(textbox);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
}
Development/Runtime Platforms – Mobile Systems M 29
MIDlet:
Simple GUI Management import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloWorld extends MIDlet implements
CommandListener { private Form mainscreen; private Form detailsscreen; private Display myDisplay; private Command exitCommand; private Command resetCommand; private Command detailsCommand; public HelloWorld(){ myDisplay = Display.getDisplay(this); mainscreen = new Form("Hello World"); detailsCommand = new Command("Details",Command.SCREEN, 1); resetCommand = new Command("Reset",Command.SCREEN,1); exitCommand = new Command("Exit", Command.EXIT, 1); }
Development/Runtime Platforms – Mobile Systems M 30
StringItem strItem = new StringItem("Hello", " World"); mainscreen.addCommand(detailsCommand);
Development/Runtime Platforms – Mobile Systems M 39
J2ME: Types of
Supported Web Connections
HTTP/HTTPS Simple to use
XML over HTTP/HTTPS Recently most widespread usage thanks to availability of several
lightweight parsers
Model: it creates object-based representation of a doc n memory, e.g., DOM
Push: it parses a whole document, by distributing then events to the registered listeners, e.g., SAX
Pull: it parses the document a part after the other (fragment), by returning a single element or tag
In addition, very often, exploitation of features defined in additional JSRs: among the others, JSR82 (Bluetooth), JSR179 (Location), JSR135 (Mobile Media), JSR180 (SIP), and JSR172 (Web Services)
Development/Runtime Platforms – Mobile Systems M 40
(optional) Exercise on J2ME: How to Design a MIDlet Application
Identifying the target devices
Identifying the profiles that are supported by those devices
Developing the application For instance, if as a MIDlet because CLDC/MIDP is supported,
application suitable for cellphones and small pagers
The development environment should be integrated with CLDC/MIDP: MIDP reference implementation http://www.oracle.com/technetwork/java/index-jsp-138820.html
Possibility of execution (for validation and testing purposes) over MIDP emulators For example, usage of J2ME Wireless Toolkit and ktoolbar to
create a project and to design, implement, configure, and validate a MIDlet
Probably you will appreciate more working with Eclipse ME http://eclipseme.org/
Development/Runtime Platforms – Mobile Systems M 44
A Superficial Overview of
the Security Model
JME CANNOT support the regular and complete
security model of J2SE The implementation of the only J2SE protection domains is
larger than the whole CLDC implementation (footprint)
Therefore, how to implement a security solution for JME?
Main guideline – to split the problem into two parts:
VM-level security (low-level)
Obtained via the 2-phase verifier for class files that is
included in CLDC
Application-level security
Sandbox model
Development/Runtime Platforms – Mobile Systems M 45
Security:
Class File Verifier in 2 Phases
Off-device verification Tool for pre-verification adds a “stack map” attribute to any method
in the Java class file in order to facilitate in-device verification
Pre-verification process (computationally heavyweight) is run on
server/desktop side before that the class file is downloaded on
mobile device
“stack map” then helps to make more efficient the in-device
verification
Faster
Less code in VM and minor memory consumption
In-device verification Environment verification (e.g., memory requirements at runtime)
Bytecode check
Type check
“Proper” termination, i.e., adequate and robust (e.g., no instructions
for unconditional jump)
Development/Runtime Platforms – Mobile Systems M 46
Stack map attribute grows the size of classfile of around 5%
Security:
Class File Verifier in 2 Phases
Development/Runtime Platforms – Mobile Systems M 47
Application-level Security:
Sandbox Model
Applications (MIDlets, but not only them) have to execute in a
close environment from where they can access only the
APIs defined by configuration, profile, and licensed classes
that are supported by the used device Do you remember the sandbox execution model for applets?
More specifically, MIDlet sandbox model specifies: Class files have to pass an adequate verification step (to
guarantee they are valid)
Only the APIs defined by CLDC, profile, and licensed extension
classes have to be available
Application download occurs at so-called native layer (native
code level), mandatorily via the Java Application Manager (JAM)
Forbidden to override the standard class loading mechanism
Forbidden the access to the set of native functions that the VM can
instead use
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 48
Android: Architecture
Classical hierarchical architecture, structured into layers (growing complexity from bottom to top)
Layers:
Linux kernel
Libraries (native Linux)
+ Android runtime
(Dalvik VM + core
libraries)
Application
Framework
Applications
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 49
Android: Architecture
Kernel Layer Based on traditional Linux v3.x
kernel and evolutions It introduces Hardware
Abstraction Layer (HAL)
Libraries in native language (C/C++)
Android Runtime Execution environment for
applications, written in Java Based on Dalvik VM
Application Framework It provides applications with
advanced services, encapsulated in Java objects,
Application Core Apps: provided by the
«initial» onboard system Developers’ written apps…
Development/Runtime Platforms – Mobile Systems M
Android:
Elements about Version Evolution
Ice Cream Sandwich 4.0.1 (October 2011) Linux kernel 3.0.1; customizable launcher; "Contacts" app fully integrated with main social network applications; Android Beam (data exchange via NFC); Wi-Fi Direct, etc. etc.
Development/Runtime Platforms – Mobile Systems M
Android:
Elements about Version Evolution
Jelly Bean 4.1.1 (July 2012) Linux kernel 3.1.10; new features for picture/video sharing via NFC; advanced voice recognition; official end of the support of Adobe Flash, etc. etc.
Kit Kat 4.4 (October 2013) Support for 3 new types of sensors (geomagnetic rotation vector, step detector and counter), added step counter feature; decreased battery consumption during audio playing; Android RunTime (ART) and new compiler, experimental in this version, that can be activated in Developers Options (not on all devices); optimized working on devices with limited RAM, …
Development/Runtime Platforms – Mobile Systems M
Android:
Elements about Version Evolution
Lollipop 5.0-5.1.1 (November 2014) Introduction of Google Fit for physical activity; new Linux 3.10.x. kernel; removal of Dalvik runtime, that is officially replaced by ART; native 64 bit support; Bluetooth 4.1; improvement of graphical performance thanks to OpenGL ES 3.1 support; improvement of camera support thanks to dedicated APIs; added multi-user features on smartphones; …
Marshmallow 6.0 (October 2015) Doze mode, with CPU speed reduction when display is switched off; native support to fingerprint readers; Direct Share for sharing among apps; request of post-install/run-time permissions; USB Type-C support; support to External storage to make it uniform to Internal Storage; MIDI support for music instruments; experimental multi-window feature
Development/Runtime Platforms – Mobile Systems M
Android:
Elements about Version Evolution
Nougat «N» 7.1.2 (August 2016) Ability to display multiple apps on-screen at once in a split-screen view; support for inline replies to notifications; OpenJDK-based Java environment; support for the Vulkan graphics rendering API; "seamless" system updates on supported devices; …
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 54
Kernel Linux 3.x
Hardware Abstraction Layer (HAL)
Memory management
Process management
Network stack
Standard Linux power management
…
54
Kernel extensions Ashmem: shared memory manager;
reference counting and automatic deallocation by the kernel
IPC binder: low overhead thanks to the usage of Ashmem (rigid access discipline via memory block descriptors)
Advanced power management: exploitation of different energy management policies via WakeLocks
Android:
OS Kernel Layer
It is NOT a real complete Linux OS kernel. It lacks: Native window manager system
Complete support to GNU C library
Complete support to standard Linux utilities
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 55
Power Management
and WakeLocks
Manifest example of cross-layering
Android apps (with permission to access Power Manager) can achieve control of energy consumption by enforcing the desired policy:
Always active CPU, also with switched-off display
Prioritary CPU with display that is at least backlit
…
Via WakeLocks: access locks to the features of Power Manager (different types of WakeLock). For instance:
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 57
Activity A single action that one user can accomplish via a window (it corresponds usually to a single screen) It is the fundamental Android component
E.g., home activity
Intent Maximum reusability of activity Request to perform an operation (e.g., choice of a phone number) Received by a component that has a compatibile Intent Filter
Service Running in background (no interaction with user, differently from activity) Usable by 1+ components No dedicated process/thread in background
Broadcast Receiver Responds to compatible Intents by executing the associated operations Typically, notify actions (calls, sms transmissions, …) Lifecycle is limited to the response Differently from activities and services, multiple receivers can be activated by a single intent
Android:
Application Framework
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 58
Package and Activity Manager Manage the lifecycle of Activities and apps, included in Android Packages (APK).
Each APK includes a descriptor (manifest), executable dex, and the associated «static» resources (xml, png, …), according to a predefined file structure
Window Manager and View System Offer advanced graphics features that can be used directly in apps. View System is
based on the View class, and consists of GUI components that interact with user and with event managers (no Java Swing, no AWT)
Applications
Resource Manager and Content
Provider Resource manager for any resource (all files except
for code) and shared access to local data (SQLite RDBMS and persistence through files)
Telephony, Notification, and Location Manager
Allow to access functionality for telephony, notification, and positioning
Android: Application Framework
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 59
Core Applications
Real and regular apps (same execution model as for apps developed by
third parties and downloaded by users), pre-installed at default over an Android device
Home application (and associated activity): manager app frm which it is possible to launch execution of other apps. Which threading model?
Message management
Client app for email
Contact book
Map management
Web browser: WebKit browser engine
(open-source); used also in Safari and
Google Chrome
Only browser engine (HTML parser +
renderer + JavaScript engine)
Applications
Android: Core Applications
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 60
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 61
Conversation Concept:
Android Task One App may include several activities:
Independent and disjoint
Associated the one with the other
Activities are different from forms
They should be simple
They should be usable and reusable
→ there is the need to structure activities to
compose a more complex conversation
with user (as for Web pages)
A task models a conversation
It includes an activity stack, also of
different apps: on top the only active
activity in the task
Activity start pushes it on top of the
stack; its closing discards the activity
from the stack
It may be in foreground or in
background
MyFirstProject
it.mypackage
process
MyActivity MyActivity
App Dialer
Dialer process
Contacts Contacts
Dialer Dialer
… …
MyActivity
Contacts
TASK
root activity root activity
top of the
stack
top of the
stack
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 62
Intent and Intent Filter
Activation of a component is triggered by an Intent (usually to pass from an activity to the following one)
explicit: component to activate is known at compile time; it needs the Class descriptor of the component
implicit: component to activate is NOT known at compile time; it needs that the following data are specified
action and category: they describe respectively action and type of the component to activate for execution
url: it specifies data to be processed by the activated component
mime type: it specifies the data type used Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(“http://www.unibo.it”));
Component is selected based on applicable Intent Filters (description of which intents an activity can handle) that are declared in the manifest, according to an algorithm of Intent Resolution
Cannot work directly on external User Interface objects (throw the Exception CalledFromWrongThreadException: “Only the original thread that created a view hierarchy can touch its views”)
Cannot be stopped by executing destroy() nor stop(). Use instead interrupt() or join() (by case)
As usual, two main ways of having a Thread that executes application code: Providing a new class that extends Thread and
overriding its run() method
Providing a new Thread instance with a Runnable object during its creation.
In both cases, start() method must be explicitly called to actually execute the new Thread
68
Development/Runtime Platforms – Mobile Systems M
Android Handler
Associated with a single thread and that thread's message queue
Bound to the thread/message queue of the thread that has created it
It delivers messages and runnables to that message queue
It executes them as they come out of the message queue
Two main types of usage for a Handler:
To schedule messages and runnables to be executed as some point in the future
To add an action into a queue performed on a different thread
69
Development/Runtime Platforms – Mobile Systems M
Handler Example
70
Development/Runtime Platforms – Mobile Systems M
Android AsyncTask
Created on the UI thread and can be executed only once
Run on a background thread and result is published on the UI thread
The three parameters of an AsyncTask are: Params, the type of the parameters sent to the async task upon
execution
Progress, the type of the progress units published during the background computation
Result, the type of the result of the background computation
Go through 4 steps: onPreExecute(): invoked on the UI thread immediately after the
async task is started
doInBackground(Param ...): invoked on the background thread immediately after onPreExecute() finishes executing
onProgressUpdate(Progress...): invoked on the UI thread after a call to publishProgress(Progress...)
onPostExecute(Result): invoked on the UI thread after background computation finishes
71
Development/Runtime Platforms – Mobile Systems M
AsyncTask Example
72
Development/Runtime Platforms – Mobile Systems M
Violate the single thread model: the Android UI toolkit is not
thread-safe and must always be manipulated on the UI thread
In this piece of code, ImageView is manipulated on a worker
thread, which can cause really weird problems. Tracking down
and fixing such bugs can be difficult and time-consuming
To Summarize: Pay Attention…
73
Development/Runtime Platforms – Mobile Systems M
Classes and methods also tend to make the code more complicated and more difficult to read
It becomes even worse when implementing complex operations that require frequent UI updates
To Summarize: Pay Attention…
74
Development/Runtime Platforms – Mobile Systems M
To Summarize: Pay Attention…
75
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 76
Example: Developing a Launcher
for Replacing the usual Home
A custom home can be created by:
1. Defining a new Activity
2. Declaring the launcher’s action MAIN in
the Intent Filter
3. Searching installed apps via Package
Manager
4. Selecting the only apps that have an Intent
Filter related to launch
5. Creating a selection View (Button) for each
suitable app
6. Defining the click event: Intent notification
7. Association of the event to the View
As already mentioned, home allows starting any app, serving as a launcher
Android as an open platform – “All Apps are created equal” → it is possible to
customize the system with our own home
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 77
// Step 1: definition of a new activity
public class CategoryTestActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout activitiesList;
activitiesList = (LinearLayout)
findViewById(R.id.activitiesList);
// Steps 3 and 4: app search and selection based on IntentFilter
Intent intent = new Intent();
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
PackageManager pkgManager = getPackageManager();
List<ResolveInfo> activities =
pkgManager.queryIntentActivities(intent, 0);
…
Example: Developing a Launcher
for Replacing the usual Home
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 78
…
for (ResolveInfo resolveInfo : activities) {
final ResolveInfo ri = resolveInfo;
Button button = new Button(this); //Step 5: one button per app
At default any Android app runs in a dedicated Dalvik VM
and within its own separated process. Which UID/GID?
Process and group identifiers are selected from an interval that is
defined system-level: FIRST_APPLICATION_UID, LAST_APPLICATION_UID
Process-level permissions are assigned and controlled
depending on user ID & group ID assigned to
processes. Typically what do you expect?
Finer-grained permissions are assigned (and revocable) even for a
single operation via manifest file
Development/Runtime Platforms – Mobile Systems M Development/Runtime Platforms – Mobile Systems M 81
Exercise on Android
To design and develop a simple context-dependent Android app (for example, able to play different audio/video files
depending on current user location), by employing the APIs of the Media Framework library (native) and the APIs of the Location Manager (Java-based, application framework level)
Suggestion to use, but free personal choice :
Android Studio and SDK tools https://developer.android.com/studio/index.html
It could be the initial starting seed for a possible project activity…
As additional examples of Android usage and project activities, please see also http://lia.disi.unibo.it/Courses/sm1415-info/esercizi.html
Development/Runtime Platforms – Mobile Systems M 87
Alternative Possibilities for
iOS Development
Primary option: exploitation of Xcode and Objective C,
exactly same way as in traditional MacOSX
Alternatively:
Web applications that employ AJAX/Javascript technologies; possibility to access via Safari
Usage of Java
J2ME and AlcheMo for iPhone
Xmlvm
Java installation over “unlocked” and “jailbroken” iPhone
By the way, do you know what the terms “unlocking” and “jailbreaking” mean?
Development/Runtime Platforms – Mobile Systems M 88
Unlocking & Jailbreaking
To be precise, unlocking and jailbreaking identify two different procedures
Unlocking is the process through which a device is made compatible with telco networks for which it was not specifically licensed (overcoming the locking with a given dedicated telco operator)
Jailbreaking is the process through which a developer exits her own “jail” in UNIX-like OS and/or breaks the imposed system of Digital Right Management (DRM). It is a specific form of growth of execution privilege
In iOS, it allows a user to execute arbitrary code and apps, by bypassing the regular mechanism of distribution of Apple code (based on iTunes App Store and iTunes Application)
To enjoy yourself with experimentation, tools such as:
Development/Runtime Platforms – Mobile Systems M 90
Also proposals that succeeded in terms of standardization.
For example:
Canvas element as third-party JavaScript extension that allows dynamic rendering of bitmap images
Introduced by Apple for usage within Webkit component of MacOSX (forming the basis of Safari browser), then adopted by Mozilla and Firefox
Standardized by WHATWG (see last slide) for the new specification proposals towards HTML5
Canvas is a “drawable” area defined in the HTML code, with attributes for height and size. JavaScript code can use a wide set of drawing functions, by allowing to use dynamically generated graphics (drawings, animations, image compositions/elaborations, …)
In competition with Macromedia Flash/FlashLite. For instance, see these two examples:
Development/Runtime Platforms – Mobile Systems M 92
J2ME over iOS:
alcheMo We already stated that NO official support to Java
Anyway it is possible to run Java applicatons over iPhone after
jailbreaking and various installations...
Tools for source conversion:
For instance, alcheMo is able to automatically convert JME apps for iPhone, by using a wide set of JME CLDC1.1 and MIDP2.0 features (including touch screen support) – anyway with NO BIG success in the developers community
It supports several additional JSRs, including JSR-256 (Mobile Sensor API), JSR-135 MMAPI, JSR-179 LBS, JSR-75 File Connection &
Personal Info Management, JSR-120 Wireless Messaging
It supports additional APIs for multi-touch and native iPhone look&feel
Process of rapid automatic translation, with almost no specific skills and past experience of development over iPhone