Case Study About Android and IOS Final Project Report
Case Study About Android and IOS Final Project Report
On
Submitted By
&
We are highly indebted to ‘Dr. Jasraj Meena’ for their guidance and
constant supervision as well as for providing necessary information
regarding the project and also for their support in completing the project.
We would like to express our gratitude towards our parents and members of
DTU for their co-operation and encouragement which help us in the
completion of this project.
5.1History
6.1Architecture of iOS
1.6.1Core OS Layer
2.6.1 Core Services Layer
3.6.1Address book framework
4.6.1Cloud Kit framework
5.6.1Core data Framework
6.6.1Core Foundation framework
7.6.1Core Location framework
8.6.1Core Motion Framework
9.6.1Foundation Framework
10.6.1Healthkit framework
11.6.1Homekit framework
12.6.1Social framework
13.6.1StoreKit framework
8.1User Interface
1.8.1 UIKit
2.8.1Core Graphics
9.1Games
1.9.1 GameKit
2.9.1 SpriteKit
3.9.1 OpenGL ES
10.1Data
1.10.1Core Data
2.10.1 Foundation
1.2What is Android?
2.2Why Android?
3.2Features of Android
1.3.2Beautiful UI
2.3.2Connectivity
3.3.2Storage
4.3.2Media support
5.3.2Messaging
6.3.2Web browser
7.3.2Multi-touch
8.3.2Multi-tasking
9.3.2Resizable widgets
10.3.2Multi-Language
11.3.2GCM
12.3.2Wi-Fi Direct
13.3.2Android Beam
4.2Android Applications
6.2History of Android
7.2Android – Architecture
8.2Linux kernel
9.2Libraries
10.2Android Libraries
1.10.2android.app
2.10.2android.content
3.10.2android.database
4.10.2android.opengl
5.10.2android.os
6.10.2android.text
7.10.2android.view
8.10.2android.widget
9.10.2android.webkit
11.2Android Runtime
12.2Android – Services
13.2Started
14.2Bound
15.2Android - Content Providers
16.2Android – Fragments
17.2Overview of memory management
18.2Garbage collection
19.2Share memory
20.2References
1.1What is mobile operating system?
Every computer or mobile device has an operating system (OS) installed on
it. Windows, OS X (now macOS), Unix, Linux, Android, and iOS are all
operating systems.
The mobile operating system manages the hardware and makes it possible
for smartphones, tablets, and wearables to run apps and other programs in a
user-friendly way. A mobile OS also manages mobile multimedia functions,
mobile and internet connectivity, touch screen controls, Bluetooth
connectivity, GPS navigation, cameras, speech recognition, and more. Most
operating systems are not interchangeable. For example, if you have a
Samsung phone, which runs the Android OS, you cannot use it to run Apple
iOS, which is the operating system used to run iPhones, iPads, and iPod
Touches.
4.2.1 iPhone OS / iOS: The iOS was developed by the Apple Inc. for the
use on its device. The iOS operating system is the most popular operating
system today. It is a very secure operating system. The iOS operating
system is not available for any other mobiles.
7.2.1 Harmony OS: The harmony operating system is the latest mobile
operating system that was developed by Huawei for the use of its devices. It
is designed primarily for IoT devices.
8.2.1 Palm OS: The palm operating system is a mobile operating system
that was developed by Palm Ltd for use on personal digital assistants
(PADs). It was introduced in 1996. Palm OS is also known as the Garnet
OS.
As we are focusing on iOS and android so let’s now discuss this two
operating system and details:
3.1What is iOS?
IOS stands for iphone operating system. It is a proprietary mobile operating
system of apple for its handheld. It supports Objective-C, C, C++, Swift
programming language. It is based on the Macintosh OS X. iPhone, iPod,
iPad and apple TV all comes with IOS.
• Multitasking
• Social Media
• iCloud
• In-App purchase
• Game Center
• Notification Center
• Accelerometer
• Gyroscope
• Powerful APIs
• GPS
• High end processor
• Accessibility
• Bluetooth
• Orientations
• Camera integration
• Location services
• Maps
• Email, contacts, web pages and messages etc.
5.1History
iPhone was first release in June, 2007 and on September 5, 2007, Apple
released the iPod Touch which had most of the non-phone abilities of the
iPhone. In June 2010 apple rebranded iPhone OS as iOS. iPad first
generation was released in April 2010 and iPad Mini was released in
November 2012.
To develop iOS application use following steps:
• Register as a developer.
6.1Architecture of iOS
Architecture of IOS is a layered architecture. At the uppermost level iOS
works as an intermediary between the underlying hardware and the apps you
make. Apps do not communicate to the underlying hardware directly.
Apps talk with the hardware through a collection of well-defined system
interfaces. These interfaces make it simple to write apps that work
constantly on devices having various hardware abilities.
Lower layers gives the basic services which all application relies on and
higher level layer gives sophisticated graphics and interface related services.
Apple provides most of its system interfaces in special packages called
frameworks. A framework is a directory that holds a dynamic shared library
that is. a files, related resources like as header files, images, and helper apps
required to support that library. Every layer has a set of Framework which
the developer uses to construct the applications.
1.6.1Core OS Layer
The Core OS layer holds the low level features that most other technologies
are built upon.
64-Bit support from IOS7 supports the 64-bit app development and enables
the application to run faster.
2.6.1 Core Services Layer Some of the Important Frameworks available in
the core services layers are detailed:
Its classes allow you create a touch based user interface. Because all iOS
apps are based on UIKit, you can’t ship an app without this framework. It
gives the infrastructure for drawing to the screen, handling events and
creating common user interface elements. UIKit also arranges a complex
app by organizing the content that’s showed on the screen.
2.8.1Core Graphics
Its interfaces are part of the Quartz Core framework. To create higher level
animations and visual effects use Core Animation. UIKit provides
animations that are built on top of the Core Animation technology.
If you require advanced animations further than the capabilities of UIKit,
use Core Animation directly. You can create a hierarchy of layer objects
that you manipulate, rotate, scale, transform. Core Animation’s familiar
view-like abstraction lets you can create dynamic user interfaces without
having to use low-level graphics APIs such as OpenGL ES.
9.1Games
1.9.1 GameKit
2.9.1 SpriteKit
This framework provides graphics support for animating arbitrary textured
images or sprites. In addition to being a graphics engine, it also contains
physics support to bring objects to life. It is a good option for games and
other apps that need complex animation chains.
3.9.1 OpenGL ES
10.1Data
1.10.1Core Data
It manages an app’s data model. Use it to create model objects which are
known as managed objects. You manage relationships between those
objects and make changes to the data through the framework. It takes
benefit of the built in SQLite technology to save and manage data
competently.
2.10.1 Foundation
1.2What is Android?
2.2Why Android?
3.2Features of Android
Android is a powerful operating system competing with Apple 4GS and
supports great features. Few of them are listed below
1.3.2Beautiful UI
Android OS basic screen provides a beautiful and intuitive user interface.
2.3.2Connectivity
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC
and WiMAX.
3.3.2Storage
SQLite, a lightweight relational database, is used for data storage purposes.
4.3.2Media support
H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-AAC, AAC 5.1,
MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP.
5.3.2Messaging
SMS and MMS
6.3.2Web browser
Based on the open-source WebKit layout engine, coupled with Chrome's V8
JavaScript engine supporting HTML5 and CSS3.
7.3.2Multi-touch
Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero.
8.3.2Multi-tasking
User can jump from one task to another and same time various application
can run simultaneously.
9.3.2Resizable widgets
Widgets are resizable, so users can expand them to show more content or
shrink them to save space.
10.3.2Multi-Language
Supports single direction and bi-directional text.
11.3.2GCM
Google Cloud Messaging (GCM) is a service that lets developers send short
message data to their users on Android devices, without needing a
proprietary sync solution.
12.3.2Wi-Fi Direct
A technology that lets apps discover and pair directly, over a high-bandwidth
peer-to-peer connection.
13.3.2Android Beam
A popular NFC-based technology that lets users instantly share, just by
touching two NFC-enabled phones together.
4.2Android Applications
Android applications are usually developed in the Java language using the
Android Software Development Kit.
Once developed, Android applications can be packaged easily and sold out
either through a store such as Google Play, SlideME, Opera Mobile
Store, Mobango, F-droid and the Amazon Appstore.
Android powers hundreds of millions of mobile devices in more than 190
countries around the world. It's the largest installed base of any mobile
platform and growing fast. Every day more than 1 million new Android
devices are activated worldwide.
This project has been written with an aim to teach you how to develop and
package Android application. We will start from environment setup for
Android application programming and then drill down to look into various
aspects of Android applications.
6.2History of Android
The code names of android ranges from A to N currently, such as Aestro,
Blender, Cupcake, Donut, Eclair, Froyo, Gingerbread, Honeycomb, Ice
Cream Sandwich, Jelly Bean, KitKat, Lollipop and Marshmallow. Let's
understand the android history in a sequence.
7.2Android - Architecture
Android operating system is a stack of software components which is
roughly divided into five sections and four main layers as shown below in
the architecture diagram.
8.2Linux kernel
At the bottom of the layers is Linux - Linux 3.6 with approximately 115
patches. This provides a level of abstraction between the device hardware
and it contains all the essential hardware drivers like camera, keypad, display
etc. Also, the kernel handles all the things that Linux is really good at such
as networking and a vast array of device drivers, which take the pain out of
interfacing to peripheral hardware.
9.2Libraries
On top of Linux kernel there is a set of libraries including open-source Web
browser engine WebKit, well known library libc, SQLite database which is
a useful repository for storage and sharing of application data, libraries to
play and record audio and video, SSL libraries responsible for Internet
security etc.
10.2Android Libraries
This category encompasses those Java-based libraries that are specific to
Android development. Examples of libraries in this category include the
application framework libraries in addition to those that facilitate user
interface building, graphics drawing and database access. A summary of
some key core Android libraries available to the Android developer is as
follows −
• 1.10.2android.app
Provides access to the application model and is the cornerstone of all
Android applications.
• 2.10.2android.content
Facilitates content access, publishing and messaging between
applications and application components.
• 3.10.2android.database
Used to access data published by content providers and includes
SQLite database management classes.
• 4.10.2android.opengl
A Java interface to the OpenGL ES 3D graphics rendering API.
• 5.10.2android.os
Provides applications with access to standard operating system
services including messages, system services and inter-process
communication.
• 6.10.2android.text
Used to render and manipulate text on a device display.
• 7.10.2android.view
The fundamental building blocks of application user interfaces.
• 8.10.2android.widget
A rich collection of pre-built user interface components such as
buttons, labels, list views, layout managers, radio buttons etc.
• 9.10.2android.webkit
A set of classes intended to allow web-browsing capabilities to be
built into applications.
Having covered the Java-based core libraries in the Android runtime, it is
now time to turn our attention to the C/C++ based libraries contained in this
layer of the Android software stack.
11.2Android Runtime
This is the third section of the architecture and available on the second layer
from the bottom. This section provides a key component called Dalvik
Virtual Machine which is a kind of Java Virtual Machine specially designed
and optimized for Android.
The Dalvik VM makes use of Linux core features like memory management
and multi-threading, which is intrinsic in the Java language. The Dalvik VM
enables every Android application to run in its own process, with its own
instance of the Dalvik virtual machine.
The Android runtime also provides a set of core libraries which enable
Android application developers to write Android applications using standard
Java programming language.
12.2Android - Services
A service is a component that runs in the background to perform long-
running operations without needing to interact with the user and it works
even if application is destroyed. A service can essentially take two states
13.2Started
A service is started when an application component, such as an activity, starts
it by calling startService(). Once started, a service can run in the background
indefinitely, even if the component that started it is destroyed.
14.2Bound
A service is bound when an application component binds to it by calling
bindService(). A bound service offers a client server interface that allows
components to interact with the service send requests, get result, and even
do so across processes with interprocess communication (IPC).
A service has life cycle callback methods that you can implement to monitor
changes in the service's state and you can perform work at the appropriate
stage. The following diagram on the left shows the life cycle when the
service is created with startService() and the diagram on the right shows the
life cycle when the service is created with bindService(): (image courtesy :
android.com )
To create an service, you create a Java class that extends the Service base
class or one of its existing subclasses. The Service base class defines various
callback methods and the most important are given below. You don't need to
implement all the callbacks methods. However, it's important that you
understand each one and implement those that ensure your app behaves the
way users expect.
Content providers let you centralize content in one place and have many
different applications access it as needed. A content provider behaves very
much like a database where you can query it, edit its content, as well as add
or delete content using insert(), update(), delete(), and query() methods. In
most cases this data is stored in an SQlite database.
A content provider is implemented as a subclass of ContentProvider class
and must implement a standard set of APIs that enable other applications to
perform transactions.
public class My Application extends ContentProvider {
}
16.2Android – Fragments
You create fragments by extending Fragment class and You can insert a
fragment into your activity layout by declaring the fragment in the activity's
layout file, as a <fragment> element.
Prior to fragment introduction, we had a limitation because we can show only
a single activity on the screen at one given point in time. So we were not able
to divide device screen and control different parts separately. But with the
introduction of fragment we got more flexibility and removed the limitation
of having a single activity on the screen at a time. Now we can have a single
activity but each activity can comprise of multiple fragments which will have
their own layout, events and complete life cycle.
Following is a typical example of how two UI modules defined by fragments
can be combined into one activity for a tablet design, but separated for a
handset design.
The application can embed two fragments in Activity A, when running on a
tablet-sized device. However, on a handset-sized screen, there's not enough
room for both fragments, so Activity A includes only the fragment for the
list of articles, and when the user selects an article, it starts Activity B,
which includes the second fragment to read the article.
18.2Garbage collection
A managed memory environment, like the ART or Dalvik virtual machine,
keeps track of each memory allocation. Once it determines that a piece of
memory is no longer being used by the program, it frees it back to the heap,
without any intervention from the programmer. The mechanism for
reclaiming unused memory within a managed memory environment is
known as garbage collection. Garbage collection has two goals: find data
objects in a program that cannot be accessed in the future; and reclaim the
resources used by those objects.
Each heap generation has its own dedicated upper limit on the amount of
memory that objects there can occupy. Any time a generation starts to fill
up, the system executes a garbage collection event in an attempt to free up
memory. The duration of the garbage collection depends on which
generation of objects it's collecting and how many active objects are in each
generation.
Even though garbage collection can be quite fast, it can still affect your
app's performance. You don’t generally control when a garbage collection
event occurs from within your code. The system has a running set of criteria
for determining when to perform garbage collection. When the criteria are
satisfied, the system stops executing the process and begins garbage
collection. If garbage collection occurs in the middle of an intensive
processing loop like an animation or during music playback, it can increase
processing time. This increase can potentially push code execution in your
app past the recommended 16ms threshold for efficient and smooth frame
rendering.
Additionally, your code flow may perform kinds of work that force garbage
collection events to occur more often or make them last longer-than-normal.
For example, if you allocate multiple objects in the innermost part of a for-
loop during each frame of an alpha blending animation, you might pollute
your memory heap with a lot of objects. In that circumstance, the garbage
collector executes multiple garbage collection events and can degrade the
performance of your app.
19.2Share memory
In order to fit everything, it needs in RAM, Android tries to share RAM
pages across processes. It can do so in the following ways:
• Each app process is forked from an existing process called Zygote. The
Zygote process starts when the system boots and loads common framework
code and resources (such as activity themes). To start a new app process, the
system forks the Zygote process then loads and runs the app's code in the
new process. This approach allows most of the RAM pages allocated for
framework code and resources to be shared across all app processes.
• Most static data is mmapped into a process. This technique allows data to be
shared between processes, and also allows it to be paged out when needed.
Example static data include: Dalvik code (by placing it in a pre-
linked. odex file for direct mmapping), app resources (by designing the
resource table to be a structure that can be mmapped and by aligning the zip
entries of the APK), and traditional project elements like native code
in .so files.
• In many places, Android shares the same dynamic RAM across processes
using explicitly allocated shared memory regions (either with ashmem or
gralloc). For example, window surfaces use shared memory between the app
and screen compositor, and cursor buffers use shared memory between the
content provider and client.
20.2References
What is an Operating System? (https://www.howtogeek.com/361572/what-
is-an-operating-system/)
How are iOS and Android similar? How are they different?
(https://www.tutorialspoint.com/how-are-ios-and-android)