










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Android Project Report for BSCS Students
Typology: Study notes
1 / 18
This page cannot be seen from the preview
Don't miss anything!











Android working framework is a standout amongst the most generally utilized portable Operating System nowadays. Android versatile working framework depends on the Linux part and is created by Google. Android working framework is principally intended for cell phones and tablets. Since Android is an open source it has turned into the quickest developing versatile working framework. Because of its open source it has turned out to be most loved for some purchasers and consumers. Also, programming engineers can
without much of a stretch change and add upgraded include in it to meet the most recent prerequisites of the versatile innovation. Android clients download more than 1.5 billion applications and amusements from Google Play every month. Because of Its Powerful improvement structure clients also, programming engineers can make their own applications for extensive variety of gadgets. A portion of the key highlights of Android working framework are: Application Frame work, Dalvik virtual machine, Integrated browser, Optimized Graphics, SQLite, Media Support, GSM Technology, Bluetooth, Edge, 3G, Wi-Fi, Camera and GPS echo help the developers for better software development Android provides Android Software development kit (SDK).
Unlike other mobile operating systems, Android is written in Java and is run on virtual machines. Android features the Dalvik Runtime Machine and Android Runtime in newer versions which executes its own bytecode. Dalvik is a core component and all Android user applications and the application framework are written in Java and executed in Dalvik.
The android is a powerful operating system and it supports large number of applications in Smartphones. These applications are more comfortable and advanced for the users. The hardware that supports android software is based on ARM architecture platform. The android is an open source operating system means that it’s free and any one can use it. The android has got millions of apps available that can help you managing your life one or other way and it is available low cost in market at that reason android is very popular.
Android became the world’s leading smartphone platform at the end of 2010. For the first quarter of 2012, Android had a 59% smartphone market share worldwide. At the half of 2012, there were 400 million devices activated and 1 million activations per day. Analysts point to the advantage to Android of being a multi-channel, multi-carrier OS.
The platform was created by Android Inc. which was bought by Google and released as the Android Open Source Project (AOSP) in 2007. According to Google: “ The goal of the Android Open Source Project is to create a successful real-world product that improves the mobile experience for end users.” Currently, the Android Open Source Project (AOSP) is governing the Android maintenance and development cycle
One of most interesting feature of the Android is that it has the ability to update itself. Android has been upgraded often since the original release of Astro. List of Android version names are: Cupcake, Donut, Éclair, Froyo, Gingerbread, Honeycomb, Ice-cream Sandwich, Jellybean etc. Latest Android version is Pie 9.
Android consists of a kernel based on the Linux kernel, with middleware, libraries and APIs written in C and application software running on an application framework which includes Java-compatible libraries based on Apache Harmony. Android uses the Dalvik virtual machine with just-in-time compilation to run Dalvik dex-code (Dalvik Executable), which is usually translated from Java bytecode.
The main hardware platform for Android is the ARM architecture. There is support for x86 from the Android x86 project and Google TV uses a special x86 version of Android.
Android software stack is subdivided into five parts: Applications, Application Framework, Libraries, Android Runtime, and the Linux Kernel.
It is the most upper layer in android architecture. All the applications like camera, Google maps, browser, SMS, calendars, contacts are native applications. These applications work with end user with the help of application framework to operate.
The shell is the user space of the operating system. It acts as the intermediary between the user and the operating system. The Android shell is divided into the following parts
Android applications which are developing, this layer contain needed classes and services. Developers can reuse and extend the components already present in API. In this layer, there are managers which enable the application for accessing data. These are as follows
Activity manager: It manages the lifecycle of applications. It enables proper management of all the activities. All the activities are controlled by activity manager.
Resource manager: It provides access to non-code resources such as graphics etc. Notification manager: It enables all applications to display custom alerts in status bar.
Location manager: It fires alerts when user enters or leaves a specified geographical location. Package manager: It is used to retrieve the data about installed packages on device.
Window manager : It is used to create views and layouts.
Telephony manager: It is used to handle settings of network connection and all information about services on device.
In this section, all the android applications are executed. Android has its own virtual machine i.e. DVM (Dalvik Virtual Machine), which is used to execute the android application. With this DVK, users can execute multiple applications at the same time.
Android has its own libraries, which is written in C/C++. These libraries cannot be accessed directly. With the help of application framework, we can access these libraries. There are many libraries like web libraries to access web browsers, libraries for android and video formats etc.
Usually only background and empty processes are killed by the system and so the user experience stays unaffected. Android only kills apps when the memory usage goes too high but usually Android does not kill apps
Processes can contain multiple threads such as in Linux based systems. Most Android applications implement thread to separate the UI from input handling and I/O operations or long running calculations.
Android applications are made up of processes and their included threads. Tasks are a series of activities of possibly multiple applications. A task is basically a history of a user’s actions. E.g. When a user reads their mail and opens a link which uses the browser application. In this case, the task is made up of two applications (mail and browser) and many activities. The importance of the task concept is that it allows users to navigate backwards like popping elements of a stack.
The structure of an Android applications is based on four different components which are Activity, Service, Broadcast Receiver and Content Provider. An application doesn’t necessarily have all these components, but it should at least have an Activity in order to present a graphical user interface.
Services and broadcast receivers allow applications to perform jobs in the background. Services usually run for a long time, but broadcast receivers can be triggered by events and run for a short time.
An activity is a single screen of an application. It contains visual elements that allow user interaction. An application contains many activities. The state of an android applications processes is determined by the state of the application’s components, such as its activities. As the application components alter their states the underlying type of the process is changed. All activities are subclasses from android-app. Activity and their life cycle is controlled by the On… () functions.
As an application starts, the following functions are called sequentially OnCreate(), OnStart() and OnResume(). OnCreate() is called only one in the lifetime of a process but OnStart() and OnResume() are called more often. If an activity loses focus then the OnPause() function is called. If the activity is no longer visible then the OnStop() function is called. Before deleting the activity OnDestroy() function is called which end the activity lifetime The following describes the functions in detail:
Besides flash memory file systems, Android devices typically support the following media-based file systems:
VFS also supports pseudo file systems, which are not media based. The Linux kernel supports several pseudo file systems which are:
Due to the extensive use of shared memory, determining how much memory your app is using requires care.
When users switch between apps, Android keeps apps that are not foreground—that is, not visible to the user or running a foreground service like music playback— in a least-recently used (LRU) cache. For example, when a user first launches an app, a process is created for it; but when the user leaves the app, that process does not quit. The system keeps the process cached. If the user later returns to the app, the system reuses the process, thereby making the app switching faster.
If your app has a cached process and it retains memory that it currently does not need, then your app— even while the user is not using it— affects the system's overall performance. As the system runs low on memory, it kills processes in the LRU cache beginning with the process least recently used. The system also accounts for processes that hold onto the most memory and can terminate them to free up RAM.
The key concept present in any operating system which allows the system to support multitasking, multiprocessing, etc. is Task Scheduling. Task Scheduling is the core which refers to the way the different processes can share the common CPU. Scheduler and dispatcher are the softwares which help to carry out this assignment. Android operating system uses O (1) scheduling algorithm as it is based on Linux Kernel 2.6. Therefore, the scheduler is names as Completely Fair Scheduler as the processes can schedule within a constant amount of time, regardless of how many processes are running on the operating system.
Schedulers in Android:
An I/O scheduler, in simple terms, is a system process that controls the way the cpu processes and accepts data. It also controls the way memory is accessed and manipulated.
For android here are some I/O schedulers:
-Anticipatory Prioritizes read operations over write. It anticipates synchronous read operations.
-BFQ : Instead of time slices allocation by CFQ, BFQ assigns budgets. Disk is granted to an active process until it’s budget (number of sectors) expires. BFQ assigns high budgets to non-read tasks. Budget assigned to a process varies over time as a function of it’s behavior. It is a very accurate scheduler.
-CFQ : Completely Fair Queuing scheduler maintains a scalable per-process I/O queue and attempts to distribute the available I/O bandwidth equally among all I/O requests. Each per-process queue contains synchronous requests from processes. Time slice allocated for each queue depends on the priority of the ‘parent’ process. Gives all round performance.
-Deadline : Goal is to minimize I/O latency or starvation of a request. The same is achieved by round robin policy to be fair among multiple I/O requests. Five queues are aggressively used to reorder incoming requests. It is a real time scheduler.
-Noop : Inserts all the incoming I/O requests to a First In First Out queue and implements request merging.
-SIO : Simple I/O scheduler aims to keep minimum overhead to achieve low latency to serve I/O requests. No priority queues concepts, but only basic merging. Sio is a mix between noop & deadline. No reordering or sorting of requests occurs.
-V(R) : Unlike other schedulers, synchronous and asynchronous requests are not treated separately, instead a deadline is imposed for fairness. The next request to be served is based on it’s distance from last request. Highly unstable and unreliable.
Android has security features built into the operating system that significantly reduce the frequency and impact of application security issues. The system is designed so you can typically build user’s apps with default system and file permissions and avoid difficult decisions about security. Some of the core security features that help you build secure apps include:
The Android Application Sandbox, which isolates user’s app data and code execution from other apps.
An application framework with robust implementations of common security functionality such as cryptography, permissions, and secure IPC. Technologies like ASLR, NX, ProPolice, safe_iop, 14 OpenBSD dlmalloc, OpenBSD calloc, and Linux mmap_min_addr to mitigate risks associated with common memory management errors.
An encrypted file system that can be enabled to protect data on lost or stolen devices.
User-granted permissions to restrict access to system features and user data.
Application-defined permissions to control application data on a per-app basis.
Nevertheless, it is important that you be familiar with the Android security best practices in this document. Following these practices as general coding habits will reduce the likelihood of inadvertently introducing security issues that adversely affect your users.
Storing Data
The most common security concern for an application on Android is whether the data that you save on the device is accessible to other apps. There are three fundamental ways to save data on the device: Using internal storage by default, files that you create on internal storage are accessible only to user’s app. This protection is implemented by Android and is enough for most applications.
Networking on Android is not significantly different from other Linux environments. The key consideration is making sure that appropriate protocols are used for sensitive data, such as HttpsURLConnection for secure web traffic. We prefer use of HTTPS over HTTP anywhere that HTTPS is supported on the server, because mobile devices frequently connect on networks that are not secured, such as public Wi-Fi hotspots. Authenticated, encrypted socket-level communication can be easily implemented using the SSLSocket class. Given the frequency with which Android devices connect to unsecured wireless networks using Wi-Fi, the use of secure networking is strongly encouraged for all applications that communicate over the network. We have seen some applications use localhost network ports for handling sensitive IPC. We discourage this approach since these interfaces are accessible by other applications on the device. Instead, on should use an Android IPC mechanism where authentication is possible such as with a Service. (Even worse than using loopback is to bind to INADDR_ANY since then user’s application may receive requests from anywhere.) Also, one common issue that warrants repeating is to make sure that you do not trust data downloaded from HTTP or other insecure protocols. This includes validation of input in WebView and any responses to intents issued against HTTP.
Android is a much more diverse operating system than iOS and Windows Phone Mobile. Android has grown rapidly over the past 4 years becoming the most used smartphone operating system in the world. It's because Android doesn't release 1 phone from 1 company with 1 new OS every year, but countless phones from numerous companies, adding their own twist, throughout the year, developing gradually day- by-day. Android's ability to customize is unparalleled compared to Apple's and Microsoft's software allowing the user to change and customize nearly every aspect of Android which most iPhone and Windows 7 users wouldn't dream possible. We cannot say that Android is better or worse than one OS but is unique and incomparable to other mobile operating systems.
REFERENCES