Saturday, November 26, 2022

Big Data

 Big data refers to data sets that are too large or complex to be dealt with by traditional data-processing application software. Data with many fields offer greater statistical power, while data with higher complexity may lead to a higher false discovery rate.













































Year


Thursday, August 18, 2022

Talking with Servers (Web services)

 4.1 Introduction to web services

A web service is any piece of software that makes itself available over the internet and uses a standardized XML messaging system. XML is used to encode all communications to a web service. For example, a client invokes a web service by sending an XML message, then waits for a corresponding XML response. As all communication is in XML, web services are not tied to any one operating system or programming language—Java can talk with Perl; Windows applications can talk with Unix applications.


Web services are self-contained, modular, distributed, dynamic applications that can be described, published, located, or invoked over the network to create products, processes, and supply chains. These applications can be local, distributed, or web-based. Web services are built on top of open standards such as TCP/IP, HTTP, Java, HTML, and XML.


Web services are XML-based information exchange systems that use the Internet for direct application-to-application interaction. These systems can include programs, objects, messages, or documents.


A web service is a collection of open protocols and standards used for exchanging data between applications or systems. Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer. This interoperability (e.g., between Java and Python, or Windows and Linux applications) is due to the use of open standards.


To summarize, a complete web service is, therefore, any service that –


Is available over the Internet or private (intranet) networks

Uses a standardized XML messaging system

Is not tied to any one operating system or programming language

Is self-describing via a common XML grammar

Is discoverable via a simple find mechanism



4.2 Restfull Web Service

REST stands for REpresentational State Transfer. REST is web standards based architecture and uses HTTP Protocol. It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard methods. REST was first introduced by Roy Fielding in 2000.

In REST architecture, a REST Server simply provides access to resources and REST client accesses and modifies the resources. Here each resource is identified by URIs/ global IDs. REST uses various representations to represent a resource like text, JSON, XML. JSON is the most popular one.

HTTP methods

Following four HTTP methods are commonly used in REST based architecture.

GET − Provides a read only access to a resource.

POST − Used to create a new resource.

DELETE − Used to remove a resource.

PUT − Used to update a existing resource or create a new resource.

A web service is a collection of open protocols and standards used for exchanging data between applications or systems. Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer. 

This interoperability (e.g., between Java and Python, or Windows and Linux applications) is due to the use of open standards.

Web services based on REST Architecture are known as RESTful web services. These webservices uses HTTP methods to implement the concept of REST architecture. A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods.

Creating RESTFull Webservice

Sr.No. URI HTTP Method POST body Result

1 /UserService/users        GET          empty     Show list of all the users.

2 /UserService/addUser    POST       JSON String  Add details of new user.

3 /UserService/getUser/:id     GET          empty     Show details of a user.




4.3 Soap Web Service

SOAP is an XML-based protocol for accessing web services over HTTP. It has some specification which could be used across all applications.

SOAP is known as the Simple Object Access Protocol, but in later times was just shortened to SOAP v1.2. SOAP is a protocol or in other words is a definition of how web services talk to each other or talk to client applications that invoke them.

SOAP was developed as an intermediate language so that applications built on various programming languages could talk easily to each other and avoid the extreme development effort.

In today's world, there is huge number of applications which are built on different programming languages. For example, there could be a web application designed in Java, another in .Net and another in PHP.

Exchanging data between applications is crucial in today's networked world. But data exchange between these heterogeneous applications would be complex. So will be the complexity of the code to accomplish this data exchange.

One of the methods used to combat this complexity is to use XML (Extensible Markup Language) as the intermediate language for exchanging data between applications.

Every programming language can understand the XML markup language. Hence, XML was used as the underlying medium for data exchange.

But there are no standard specifications on use of XML across all programming languages for data exchange. That is where SOAP comes in.

SOAP was designed to work with XML over HTTP and have some sort of specification which could be used across all applications. 

4.4 JSON parsing

JSON stands for JavaScript Object Notation. It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file and extract necessary information from it.

Android provides four different classes to manipulate JSON data. These classes are JSONArray,JSONObject,JSONStringer and JSONTokenizer.

The first step is to identify the fields in the JSON data in which you are interested in.

Advantage of JSON over XML

1) JSON is faster and easier than xml for AJAX applications.

2) Unlike XML, it is shorter and quicker to read and write.

3) It uses array.

json object

A JSON object contains key/value pairs like map. The keys are strings and the values are the JSON types. Keys and values are separated by comma. The { (curly brace) represents the json object.

{  

    "employee": {  

        "name":       "sachin",   

        "salary":      56000,   

        "married":    true  

    }  

}  

json array

The [ (square bracket) represents the json array.

["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]  

Let's take another example of json array.

{ "Employee" :  

    [  

     {"id":"101","name":"Sonoo Jaiswal","salary":"50000"},  

     {"id":"102","name":"Vimal Jaiswal","salary":"60000"}  

    ]   

}  

4.5 XML parsing

XML stands for Extensible Mark-up Language.XML is a very popular format and commonly used for sharing data on the internet. This chapter explains how to parse the XML file and extract necessary information from it.

Android provides three types of XML parsers which are DOM,SAX and XMLPullParser. Among all of them android recommend XMLPullParser because it is efficient and easy to use. So we are going to use XMLPullParser for parsing XML.


The first step is to identify the fields in the XML data in which you are interested in. For example. In the XML given below we interested in getting temperature only.


<?xml version="1.0"?>

<current>

   

   <city id="2643743" name="London">

      <coord lon="-0.12574" lat="51.50853"/>

      <country>GB</country>

      <sun rise="2013-10-08T06:13:56" set="2013-10-08T17:21:45"/>

   </city>

   

   <temperature value="289.54" min="289.15" max="290.15" unit="kelvin"/>

   <humidity value="77" unit="%"/>

   <pressure value="1025" unit="hPa"/>

</current>


XML - Elements

1Prolog

An XML file starts with a prolog. The first line that contains the information about a file is prolog


2Events

An XML file has many events. Event could be like this. Document starts , Document ends, Tag start , Tag end and Text e.t.c


3Text

Apart from tags and events, and xml file also contains simple text. Such as GB is a text in the country tag.

4.Attributes

Attributes are the additional properties of a tag such as value e.t.c.  


Database Issues

 3.1 Hoarding Techniques:

A database is a collection of systematically stored records or information. Databases store data in a particular logical manner. A mobile device is not always connected to the server or network; neither does the device retrieve data from a server or a network for each computation. Rather, the device caches some specific data, which may be required for future computations, during the interval in which the device is connected to the server or network. Caching entails saving a copy of select data or a part of a database from a connected system with a large database. The cached data is hoarded in the mobile device database. Hoarding of the cached data in the database ensures that even when the device is not connected to the network, the data required from the database is available for computing.

Database hoarding may be done at the application tier itself. The following figure shows a simple architecture in which a mobile device API directly retrieves the data from a database. It also shows another simple architecture in which a mobile device API directly retrieves the data from a database through a program, for ex: IBM DB2 Everyplace (DB2e).

      

Both the two architectures belong to the class of one-tier database architecture because the databases are specific to a mobile device, not meant to be distributed to multiple devices, not synchronized with the new updates, are stored at the device itself. Some examples are downloaded ringtones, music etc.IBM DB2 Everyplace (DB2e)is a relational database engine which has been designed to reside at the device. It supports J2ME and most mobile device operating systems. DB2e synchronizes with DB2 databases at the synchronization, application, or enterprise server.

The database architecture shown below is for two-tier or multi-tier databases. Here, the databases reside at the remote servers and the copies of these databases are cached at the client tiers. This is known as client-server computing architecture.

A cache is a list or database of items or records stored at the device. Databases are hoarded at the application or enterprise tier, where the database server uses business logic and connectivity for retrieving the data and then transmitting it to the device. The server provides and updates local copies of the database at each mobile device connected to it. The computing API at the mobile device (first tier) uses the cached local copy. At first tier (tier 1), the API uses the cached data records using the computing architecture as explained above. From tier 2 or tier 3, the server retrieves and transmits the data records to tier 1 using business logic and synchronizes the local copies at the device. These local copies function as device caches.

The advantage of hoarding is that there is no access latency (delay in retrieving the queried record from the server over wireless mobile networks). The client device API has instantaneous data access to hoarded or cached data. After a device caches the data distributed by the server, the data is hoarded at the device. The disadvantage of hoarding is that the consistency of the cached data with the database at the server needs to be maintained.

           

 3.2 Caching invalidation mechanisms

A cached record at the client device may be invalidated. This may be due to expiry or modification of the record at the database server. Cache invalidation is a process by which a cached data item or record becomes invalid and thus unusable because of modification, expiry, or invalidation at another computing system or server. Cache invalidation mechanisms are used to synchronize the data at other processors whenever the cache-data is written (modified) by a processor in a multiprocessor system, cache invalidation mechanisms are also active in the case of mobile devices having distributed copies from the server.

A cache consists of several records. Each record is called a cache-line, copies of which can be stored at other devices or servers. The cache at the mobile devices or server databases at any given time can be assigned one of four possible tags indicating its state-modified (after rewriting), exclusive, shared, and invalidated (after expiry or when new data becomes available) at any given instance. These four states are indicated by the letters M, E, S, and I, respectively (MESI). The states indicated by the various tags are as follows:


The E tag indicates the exclusive state which means that the data record is for internal use and cannot be used by any other device or server.

The S tag indicates the shared state which indicates that the data record can be used by others.

The M tag indicates the modified state which means that the device cache

The I tag indicates the invalidated state which means that the server database no longer has a copy of the record which was shared and used for computations earlier.


The following figure shows the four possible states of a data record i at any instant in the server database and its copy at the cache of the mobile device j.


       

Another important factor for cache maintenance in a mobile environment is cache consistency (also called cache coherence).This requires a mechanism to ensure that a database record is identical at the server as well as at the device caches and that only the valid cache records are used for computations.



3.3 Client server computing with adaptation

Client-server computing is a distributed computing architecture, in which there are two types of nodes, i.e., the clients and the servers. A server is defined as a computing system, which responds to requests from one or more clients. A client is defined as a computing system, which requests the server for a resource or for executing a task.


The client can either access the data records at the server or it can cache these records at the client device. The data can be accessed either on client request or through broadcasts or distribution from the server. The client and the server can be on the same computing system or on different computing systems. Client-server computing can have N-tier architecture (N= 1, 2 ...). When the client and the server are on the same computing system then the number of tiers, N = 1. When the client and the server are on different computing systems on the network, then N = 2. A command interchange protocol (e.g., HTTP) is used for obtaining the client requests at the server or the server responses at the client.


The following subsections describe client-server computing in 2, 3, or N-tier architectures. Each tier connects to the other with a connecting, synchronizing, data, or command interchange protocol.

      


Two-tier Client-Server Architecture: The following figure shows the application server at the second tier. The data records are retrieved using business logic and a synchronization server in the application server synchronizes with the local copies at the mobile devices. Synchronization means that when copies of records at the server-end are modified, the copies cached at the client devices should also be accordingly modified. The APIs are designed independent of hardware and software platforms as far as possible as different devices may have different platforms.


3.4 context-aware computing  

The context of a mobile device represents the circumstances, situations, applications, or physical environment under which the device is being used. For example, let us assume that a mobile phone is operating in a busy, congested area.

 If the device is aware of the surrounding noises, then during the conversation, it can raise the speaker volume by itself and when the user leaves that area, the device can again reduce the volume. Also, if there is intermittent loss of connectivity during the conversation, the device can introduce background noises by itself so that the user does not feel discomfort due to intermittent periods of silence.

 This is one example in which the computing system is aware of the surrounding physical context in which the conversation is taking place.

A context-aware computing system is one which has user, device, and application interfaces such that, using these, the system remains aware of the past and present surrounding situations, circumstances, or actions such as the present mobile network, surrounding devices or systems, changes in the state of the connecting network, physical parameters such as present time of the day, presently remaining memory and battery power, presently available nearest connectivity, past sequence of actions of the device user, past sequence of application or applications, and previously cached data records, and takes these into account during computations.

Context-aware computing leads to application-aware computing. This is so because the APIs are part of the context (implicit or explicit contexts). For example, if context is a contact, the phone-talk application will adapt itself to use of the telephone number from the ‘contact’ and to the use of GSM or CDMA communication.

 Use of context in computing helps in reducing possibility of errors. It helps in reducing the ambiguity in the action(s). It helps in deciding the expected system response on computations. For example, if name is input in personal biodata context, then the address, experience, and achievements, which correspond to that name, are also required for computations.

 This is because all four are related and needed in biodata context. When name is input in telephone directory context, then the address and phone number, which correspond to that name, are also required for computations.

 This is because all three are related in context to telephone directory. The name in two different contexts (personal biodata and telephone directory) during computations needs computations to perform different actions.


3.5 Transaction Model

A transaction is the execution of interrelated instructions in a sequence for a specific operation on a database. Database transaction models must maintain data integrity and must enforce a set of rules called ACID rules

These rules are as follows:

1. Atomicity: All operations of a transaction must be complete. In case, a transaction cannot be completed; it must be undone (rolled back). Operations in a transaction are assumed to be one indivisible unit (atomic unit).


2. Consistency: A transaction must be such that it preserves the integrity constraints and follows the declared consistency rules for a given database. Consistency means the data is not in a contradictory state after the transaction.


3. Isolation: If two transactions are carried out simultaneously, there should not be any interference between the two. Further, any intermediate results in a transaction should be invisible to any other transaction.


4. Durability: After a transaction is completed, it must persist and cannot be aborted or discarded. For example, in a transaction entailing transfer of a balance from account A to account B, once the transfer is completed and finished there should be no roll back.


3.5 Query Processing

Query processing means making a correct as well as efficient execution strategy by query decomposition and query-optimization. A relational-algebraic equation defines a set of operations needed during query processing. Either of the two equivalent relational-algebraic equations given below can be used.

     

This means first select a column Contacts.cTelNumin a row in Contacts in which Contacts.cTelNumcolumn equals a column DialledNumbers.dTelNumby crosschecking and matching the records of a column in Contacts with all the rows of DialledNumbers. Then in the second step select the row in which Contacts. firstChar = “R” and the selected cTelNumexists. Then in the third step project cNameand CTelNum.

     

This means that in first series of step, crosscheck all rows of Contacts and DialledNumbersand select, after AND operation, the rows in which Contacts.firstchar =“R” and Contacts.cTelNum = DialledNumbers.dTelNum. Then in the next step project cNameand cTelNumform the selected records.


3.5 Data Recovery

Data is non-recoverable in case of media failure, intentional attack on the database and transactions logging data, or physical media destruction. However, data recovery is possible in other cases. Figure below shows recovery management architecture. It uses a recovery manager, which ensures atomicity and durability. Atomicity ensures that an uncommitted but started transaction aborts on failure and aborted transactions are logged in log file.


     


Durability ensures that a committed transaction is not affected by failure and is recovered. Stable state databases at the start and at the end of transactions reside in secondary storage. Transaction commands are sent to the recovery manager, which sends fetch commands to the database manager.

 The database manager processes the queries during the transaction and uses a database buffer. The recovery manager also sends the flush commands to transfer the committed transactions and database buffer data to the secondary storage. 

The recovery manager detects the results of operations. It recovers lost operations from the secondary storage. Recovery is by detecting the data lost during the transaction.


Designing the user interface

 Android Intent is the message that is passed between components such as activities, content providers, broadcast receivers, services etc.

It is generally used with startActivity() method to invoke activity, broadcast receivers etc.

The dictionary meaning of intent is intention or purpose. So, it can be described as the intention to do action.

The LabeledIntent is the subclass of android.content.Intent class.

Android intents are mainly used to:

o Start the service

o Launch an activity

o Display a web page

o Display a list of contacts

o Broadcast a message

o Dial a phone call etc.

Types of Android Intents

1) Implicit Intent

Implicit Intent doesn't specify the component. In such case, intent provides information of available components provided by the system that is to be invoked.

For example, you may write the following code to view the webpage.

Intent intent=new Intent(Intent.ACTION_VIEW);  

                intent.setData(Uri.parse("http://www.javatpoint.com"));  

                startActivity(intent);  

2) Explicit Intent

Explicit Intent specifies the component. In such case, intent provides the external class to be invoked.

Intent i = new Intent(getApplicationContext(), ActivityTwo.class);  

startActivity(i);  


Activity Lifecycle

An activity represents a single screen with a user interface just like window or frame of Java.Android activity is the subclass of ContextThemeWrapper class.

If you have worked with C, C++ or Java programming language then you must have seen that your program starts from main() function. Very similar way, Android system initiates its program with in an Activity starting with a call on onCreate() callback method. There is a sequence of callback methods that start up an activity and a sequence of callback methods that tear down an activity as shown in the below Activity life cycle diagram: (image courtesy : android.com )

                

The Activity class defines the following call backs i.e. events. 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.

Sr.No Callback & Description

1 onCreate()

This is the first callback and called when the activity is first created.

2 onStart()

This callback is called when the activity becomes visible to the user.

3 onResume()

This is called when the user starts interacting with the application.

4 onPause()

The paused activity does not receive user input and cannot execute any code and called when the current activity is being paused and the previous activity is being resumed.

5 onStop()

This callback is called when the activity is no longer visible.

6 onDestroy()

This callback is called before the activity is destroyed by the system.

7 onRestart()

This callback is called when the activity restarts after stopping it.





Activity manifest

The AndroidManifest.xml file contains information of your package, including components of the application such as activities, services, broadcast receivers, content providers etc.

It performs some other tasks also:

o It is responsible to protect the application to access any protected parts by providing the permissions.

o It also declares the android api that the application is going to use.

o It lists the instrumentation classes. The instrumentation classes provide profiling and other information’s. This information’s are removed just before the application is published etc.

This is the required xml file for all the android application and located inside the root directory.

Elements of the AndroidManifest.xml file

The elements used in the above xml file are described below.

<manifest>

manifest is the root element of the AndroidManifest.xml file. It has package attribute that describes the package name of the activity class.

<application>

application is the subelement of the manifest. It includes the namespace declaration. This element contains several subelements that declares the application component such as activity etc.

The commonly used attributes are of this element are icon, label, theme etc.

android:icon represents the icon for all the android application components.

android:label works as the default label for all the application components.

android:theme represents a common theme for all the android activities.

<activity>

activity is the subelement of application and represents an activity that must be defined in the AndroidManifest.xml file. It has many attributes such as label, name, theme, launchMode etc.

android:label represents a label i.e. displayed on the screen.

android:name represents a name for the activity class. It is required attribute.

<intent-filter>

intent-filter is the sub-element of activity that describes the type of intent to which activity, service or broadcast receiver can respond to.

<action>

It adds an action for the intent-filter. The intent-filter must have at least one action element.

<category>

It adds a category name to an intent-filter.

2.2 Views in Android

       


Introduction to Mobile Computing and Android

Introduction to Mobile Computing:-

Mobile Computing is a technology that allows transmission of data, voice and video via a computer or any other wireless enabled device without having to be connected to a fixed physical link. The main concept involves −

Mobile communication

Mobile hardware

Mobile software

Mobile communication

The mobile communication refers to the infrastructure put in place to ensure that seamless and reliable communication goes on. These would include devices such as protocols, services, bandwidth, and portals necessary to facilitate and support the stated services. The data format is also defined at this stage. This ensures that there is no collision with other existing systems which offer the same service.

Since the media is unguided/unbounded, the overlaying infrastructure is basically radio wave-oriented. That is, the signals are carried over the air to intended devices that are capable of receiving and sending similar kinds of signals.

Mobile Hardware

Mobile hardware includes mobile devices or device components that receive or access the service of mobility. They would range from portable laptops, smart phones, tablet Pc's, Personal Digital Assistants.

These devices will have a receptor medium that is capable of sending and receiving signals. These devices are configured to operate in full- duplex, whereby they are capable of sending and receiving signals at the same time. They don't have to wait until one device has finished communicating for the other device to initiate communications.

Mobile software

Mobile software is the actual program that runs on the mobile hardware. It deals with the characteristics and requirements of mobile applications. This is the engine of the mobile device. In other terms, it is the operating system of the appliance. It's the essential component that operates the mobile device.

Since portability is the main factor, this type of computing ensures that users are not tied or pinned to a single physical location, but are able to operate from anywhere. It incorporates all aspects of wireless communications.


Applications of Mobile Computing

1. For Estate Agents: Estate agents can work either at home or out in the field. With mobile computers they can be more productive. They can obtain current real estate information by accessing multiple listing services, which they can do from home, office or car when out with clients. They can provide clients with immediate feedback regarding specific homes or neighborhoods, and with faster loan approvals, since applications can be submitted on the spot. Therefore, mobile computers allow them to devote more time to clients

2. Emergency Services: Ability to receive information on the move is vital where the emergency services are involved. Information regarding the address, type and other details of an incident can be dispatched quickly, via a Cellular Digital Packet Data (CDPD) system using mobile computers, to one or several appropriate mobile units, which are in the vicinity of the incident. 

3. In courts: Defense counsels can take mobile computers in court. When the opposing counsel references a case which they are not familiar, they can use the computer to get direct, real-time access to on-line legal database services, where they can gather information on the case and related precedents. Therefore mobile computers allow immediate access to a wealth of information, making people better informed and prepared.

 4. In companies: Managers can use mobile computers in, say, critical presentations to major customers. They can access the latest market share information. At a small recess, they can revise the presentation to take advantage of this information. They can communicate with the office about possible new offers and call meetings for discussing responds to the new proposals. Therefore, mobile computers can leverage competitive advantages.

 5. Credit Card Verification: At Point of Sale (POS) terminals in shops and supermarkets, when customers use credit cards for transactions, the intercommunication is required between the bank central computer and the POS terminal, in order to effect verification of the card usage, can take place quickly and securely over cellular channels using a mobile computer unit. This can speed up the transaction process and relieve congestion at the POS terminals

Limitations of Mobile Computing:-

1. Insufficient Bandwidth: Mobile Internet access is generally slower than direct cable connections, using technologies such as GPRS and EDGE, and more recently 3G networks. These networks are usually available within range of commercial cell phone towers. Higher speed wireless LANs are inexpensive but have very limited range.

 2. Security Standards: When working mobile, one is dependent on public networks, requiring careful use of Virtual Private Network (VPN). Security is a major concern while concerning the mobile computing standards on the fleet. One can easily attack the VPN through a huge number of networks interconnected through the line. 

3. Power consumption: When a power outlet or portable generator is not available, mobile computers must rely entirely on battery power. Combined with the compact size of many mobile devices, this often means unusually expensive batteries must be used to obtain the necessary battery life.In such a way that it saves the power or increases the battery life.  

4. Transmission interferences: Weather, terrain, and the range from the nearest signal point can all interfere with signal reception. Reception in tunnels, some buildings, and rural areas is often poor.

 5. Potential health hazards: People who use mobile devices while driving are often distracted from driving are thus assumed more likely to be involved in traffic accidents. Cell phones may interfere with sensitive medical devices. There are allegations that cell phone signals may cause health problems.

 6. Human interface with device: Screens and keyboards tend to be small, which may make them hard to use. Alternate input methods such as speech or handwriting recognition require training.


Architecture of Mobile Computing:-

             

3-tier architecture is an application program that is organized into three major parts, comprising of:

The data access layer tier at the bottom,

The application tier (business logic) in the middle and

The client tier (presentation) at the top.

Each tier is distributed to a different place or places in a network. These tiers do not necessarily correspond to physical locations on various computers on a network, but rather to logical layers of the application.

1. Presentation Layer (UI):

This layer presents data to the user and optionally permits data manipulation and data entry, also this layer requests the data form Business layer.

This layer accomplished through use of Dynamic HTML and client-side data sources and data cursors.

2. Business Logic Layer:

The business logic acts as the server for client requests from workstations. It acts according Business rules fetch or insert data through the Data Layer.

In turn, it determines what data is needed (and where it is located) and acts as a client in relation to a third tier of programming that might be located on a local or mainframe computer.

Because these middle-tier components are not tied to a specific client, they can be used by all applications and can be moved to different locations, as response time and other rules require.

3. Data Access Layer:

The third tier of the 3-tier system is made up of the DBMS that provides all the data for the above two layers.

This is the actual DBMS access layer.

Avoiding dependencies on the storage mechanisms allows for updates or changes without the application tier clients being affected by or even aware of the change.


Characteristics of Mobile Communication:-

Mobile computing has changed the complete landscape of our day-to-day life. Following are the major advantages of Mobile Computing −

Location Flexibility:-

This has enabled users to work from anywhere as long as there is a connection established. A user can work without being in a fixed position. Their mobility ensures that they are able to carry out numerous tasks at the same time and perform their stated jobs.

Saves Time:-

The time consumed or wasted while travelling from different locations or to the office and back, has been slashed. One can now access all the important documents and files over a secure channel or portal and work as if they were on their computer. It has enhanced telecommuting in many companies. It has also reduced unnecessary incurred expenses.

Enhanced Productivity:-

Users can work efficiently and effectively from whichever location they find comfortable. This in turn enhances their productivity level.

Ease of Research:-

Research has been made easier, since users earlier were required to go to the field and search for facts and feed them back into the system. It has also made it easier for field officers and researchers to collect and feed data from wherever they are without making unnecessary trips to and from the office to the field.

Entertainment:-

Video and audio recordings can now be streamed on-the-go using mobile computing. It's easy to access a wide variety of movies, educational and informative material. With the improvement and availability of high speed data connections at considerable cost, one is able to get all the entertainment they want as they browse the internet for streamed data. One is able to watch news, movies, and documentaries among other entertainment offers over the internet. This was not possible before mobile computing dawned on the computing world.

Streamlining of Business Processes:-

Business processes are now easily available through secured connections. Looking into security issues, adequate measures have been put in place to ensure authentication and authorization of the user accessing the services. Some business functions can be run over secure links and sharing of information between business partners can also take place.

Meetings, seminars and other informative services can be conducted using video and voice conferencing. Travel time and expenditure is also considerably reduced.




Cellular Network:-

A cellular network is a radio network distributed over land through cells where each cell includes a fixed location transceiver known as base station. These cells together provide radio coverage over larger geographical areas. User equipment (UE), such as mobile phones, is therefore able to communicate even if the equipments   moving through cells during transmission. 

Cellular networks give subscribers advanced features over alternative solutions, including increased capacity, small battery power usage, a larger geographical coverage area and reduced interference from other signals. Popular cellular technologies include the Global System for Mobile Communication, general packet radio service, 3GSM and code division multiple access.

             

Location management:-

Location management enables the networks to track the locations of mobile nodes. Location management has two major sub-tasks: (i) location registration, and (ii) call delivery or paging. 

In location registration procedure, the mobile node periodically sends specific signals to inform the network of its current location so that the location database is kept updated. The call delivery procedure is invoked after the completion of the location registration. Based on the information that has been registered in the network during the location registration, the call delivery procedure queries the network about the exact location of the mobile device so that a call may be delivered successfully. 

The design of a location management scheme must address the following issues: (i) minimization of signaling overhead and latency in the service delivery, (ii) meeting the guaranteed quality of service (QoS) of applications, and (iii) in a fully overlapping area where several wireless networks co-exist, an efficient and robust algorithm must be designed so as to select the network through which a mobile device should perform registration, deciding on where and how frequently the location information should be stored, and how to determine the exact location of a mobile device within a specific time frame.




Handoffs noise and its effects on mobile

Handoff management is the process by which a mobile node keeps its connection active when it moves from one access point to another. There are three stages in a handoff process. 

First, the initiation of handoff is triggered by either the mobile device, or a network agent, or the changing network conditions. 

The second stage is for a new connection generation, where the network must find new resources for the handoff connection and perform any additional routing operations.

 Finally, data-flow control needs to maintain the delivery of the data from the old connection path to the new connection path according to the agreed-upon QoS guarantees. Depending on the movement of the mobile device, it may undergo various types of handoff. 

In a broad sense, handoffs may be of two types: 

(i) intra-system handoff (horizontal handoff) 

 (ii) Inter-system handoff (vertical handoff). 


Reasons:-

when the phone is moving away from the area covered by one cell and entering the area covered by another cell the call is transferred to the second cell in order to avoid call termination when the phone gets outside the range of the first cell;

when the capacity for connecting new calls of a given cell is used up and an existing or new call from a phone, which is located in an area overlapped by another cell, is transferred to that cell in order to free-up some capacity in the first cell for other users, who can only be connected to that cell;

in non-CDMA networks when the channel used by the phone becomes interfered by another phone using the same channel in a different cell, the call is transferred to a different channel in the same cell or to a different channel in another cell in order to avoid the interference.












1.3 Understanding GSM and CDMA

 The cellular mobile service is being used everywhere in the world today. GSM and CDMA are two dominant technologies in the world of mobile communication. These two technologies differ the way in which the calls and data transfer takes place over a network and mobile.

What is GSM?

GSM stands for Global System for Mobile Communication. It is a digital mobile telephony system used for trans-receiving of the data and voice signals and is a second generation standard for mobile networks.

The GSM standard operates on three different carrier frequencies 900MHz, 1800MHz and 1900MHz. 900MHz band is used for original GSM system and the 1800MHz band is added to support the increasing number of customers. The 1900 MHz frequency band is used mainly in the United States.

A GSM phone is a digital cellular technology used for transmitting mobile voice and data services. GSM makes use of narrowband Time Division Multiple Access (TDMA) technique for transmitting signals.

                             

Time Division Multiple Access (TDMA)

The GSM standard has led to the evolution of the wireless services like GPRS (General Packet Radio Service) UMTS (Universal Mobile Radio System) and EDGE (Enhanced Data Rates for GSM Evolution). Its users were the first to take the advantage of Short Message System (SMS).

A GSM system makes use of cells to provide wireless communication to the subscribers. The GSM mobiles are identified by using Subscriber Identity Module (SIM). This is a removable smart card which contains the information of the subscriber. This SIM card allows the customer to switch from one mobile to another.

Advantages of GSM

GSM provides improved spectrum efficiency

Low-cost mobile set and base stations

High-quality speech

International roaming

Compatibility with Integrated Services Digital Network (ISDN)

What is CDMA?

CDMA stands for Code Division Multiple Access. It is used in cellular communication similar to GSM and is a second generation and third generation standard for mobile networks. It is the most secure mode of communication because of its spread spectrum property.

CDMA is a form of multiplexing where a number of signals occupy a single transmission channel and optimizing the use of available bandwidth. This technology is used in ultra high frequency (UHF) cellular systems having a band ranging from 800MHz to 1.9GHz.

                    

Code Division Multiple Access (CDMA)

CDMA uses to analog to digital conversion in combination with spread spectrum technology. First, the audio signal is digitized to binary elements.

The frequency of the transmitted signal is then made to change according to the code. Thus, it can be intercepted only by a receiver whose frequency is programmed with the same code.

The original CDMA standard called CDMA One offers a transmission speed of up to 14.4 kbps in its single channel form and up to 115kbps in an eight-channel form. CDMA2000 and wideband CDMA deliver the data many times faster.

Advantages

Efficient utilization of fixed frequency spectrum.

Flexible allocation of resources

Multipath fading may be substantially reduced due to large signal bandwidth.

No limit on a number of users.

Impossible to decipher the code sent and better signal quality.

Soft hand-off minimizes signal breakup as the handset passes from one cell to another.

CDMA is compatible with other cellular technologies, thus allowing a national wide roaming.

Differences between GSM and CDMA

1. The GSM is based on wedge spectrum called a carrier. The CDMA is based on spread spectrum technology.

2. This carrier is divided into time slots, and each user is assigned a different time slot. Thus, until the ongoing call is finished, no other user can access the same slot. CDMA technology allows each user to transmit over the entire frequency spectrum all the time.

3. Less security compared to CDMA technology. More security is provided in CDMA technology.

4. Signals can be detected as the GSM signals are concentrated in the narrow bandwidth. The signals cannot be detected easily in CDMA.

5. The GSM network operates in the frequency spectrum of 850MHz and 1900MHz. The CDMA network operates in the frequency spectrum of 850MHz and 1900MHz.

6. GSM is used over 80% of the world’s mobile network. CDMA is exclusively used in the United States, Canada and Japan.

7. GSM uses EDGE data transfer technology. CDMA has faster data transfer as EVDO ready data transfer technology is used.


1.4 Overview of Android

     Android is an open source and Linux-based Operating System for mobile devices such as smartphones and tablet computers. Android was developed by the Open Handset Alliance, led by Google, and other companies.

Android offers a unified approach to application development for mobile devices which means developers need only develop for Android, and their applications should be able to run on different devices powered by Android.

The first beta version of the Android Software Development Kit (SDK) was released by Google in 2007 where as the first commercial version, Android 1.0, was released in September 2008.

On June 27, 2012, at the Google I/O conference, Google announced the next Android version, 4.1 Jelly Bean. Jelly Bean is an incremental update, with the primary aim of improving the user interface, both in terms of functionality and performance.

The source code for Android is available under free and open source software licenses. Google publishes most of the code under the Apache License version 2.0 and the rest, Linux kernel changes, under the GNU General Public License version 2.

Why Android?

             

Features of Android

Android is a powerful operating system competing with Apple 4GS and supports great features. Few of them are listed below −

Sr.No. Feature & Description

1 Beautiful UI

Android OS basic screen provides a beautiful and intuitive user interface.

2 Connectivity

GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC and WiMAX.

3 Storage

SQLite, a lightweight relational database, is used for data storage purposes.

4 Media 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 Messaging

SMS and MMS

6 Web browser

Based on the open-source WebKit layout engine, coupled with Chrome's V8 JavaScript engine supporting HTML5 and CSS3.

7 Multi-touch

Android has native support for multi-touch which was initially made available in handsets such as the HTC Hero.

8 Multi-tasking

User can jump from one task to another and same time various application can run simultaneously.

9 Resizable widgets

Widgets are resizable, so users can expand them to show more content or shrink them to save space.

10 Multi-Language

Supports single direction and bi-directional text.

11 GCM

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 Wi-Fi Direct

A technology that lets apps discover and pair directly, over a high-bandwidth peer-to-peer connection.

13 Android Beam

A popular NFC-based technology that lets users instantly share, just by touching two NFC-enabled phones together.

Categories of Android applications

There are many android applications in the market. The top categories are −

                     

History 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 Sandwitch, Jelly Bean, KitKat, Lollipop and Marshmallow. Let's understand the android history in a sequence.

         


1.8.1 Android architecture


Android architecture is a software stack of components to support a mobile device needs. Android software stack contains a Linux Kernel, collection of c/c++ libraries which is exposed through an application framework services, runtime and application.

 

Following are main components of android architecture those are

1. Applications

2. Android Framework

3. Android Runtime

4. Platform Libraries

5. Linux Kernel

In these components Linux Kernel is the main component in android to provide its operating system functions to mobile and Dalvik Virutal Machine (DVM) which is responsible for running a mobile application.

 

Following is the pictorial representation of android architecture with different components.

 

        

Applications

The top layer of android architecture is Applications. The native and third party applications like contacts, email, music, gallery, clock, games, etc. whatever we will built those will be installed on this layer only.

 

The application layer runs within the Android run time using the classes and services made available from the application framework. 

Application Framework

The Application Framework provides the classes used to create an Android applications. It also provides a generic abstraction for hardware access and manages the user interface and application resources. It basically provides the services through which we can create the particular class and make that class helpful for the Applications creation.

 

The application framework includes services like telephony service, location services, notification manager, NFC service, view system, etc. which we can use for application development as per our requirements.

Android Runtime

Android Runtime environment is an important part of Android rather than an internal part and it contains a components like core libraries and the Dalvik virtual machine. The Android run time is the engine that powers our applications along with the libraries and it forms the basis for the application framework.

 

Dalvik Virtual Machine (DVM) is a register-based virtual machine like Java Virtual Machine (JVM). It is specially designed and optimized for android to ensure that a device can run multiple instances efficiently. It relies on the Linux kernel for threading and low-level memory management.

 

The core libraries in android runtime will enable us to implement an android applications using standard JAVA programming language.

Platform Libraries

The Platform Libraries includes various C/C++ core libraries and Java based libraries such as SSL, libc, Graphics, SQLite, Webkit, Media, Surface Manger, OpenGL etc. to provide a support for android development.

 

Following are the summary details of some core android libraries available for android development. 

Media library for playing and recording an audio and video formats

The Surface manager library to provide a display management

SGL and OpenGL Graphics libraries for 2D and 3D graphics

SQLite is for database support and FreeType for font support

Web-Kit for web browser support and SSL for Internet security.

Linux Kernel

Linux Kernel is a bottom layer and heart of the android architecture. It manage all the drivers such as display drivers, camera drivers, Bluetooth drivers, audio drivers, memory drivers, etc. which are mainly required for the android device during the runtime.

 

The Linux Kernel will provides an abstraction layer between the device hardware and the remainder of the stack. It is responsible for memory management, power management, device management, resource access, etc.


1.8.2 Android 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 −

android.app − Provides access to the application model and is the cornerstone of all Android applications.

android.content − Facilitates content access, publishing and messaging between applications and application components.

android.database − Used to access data published by content providers and includes SQLite database management classes.

android.opengl − A Java interface to the OpenGL ES 3D graphics rendering API.

android.os − Provides applications with access to standard operating system services including messages, system services and inter-process communication.

android.text − Used to render and manipulate text on a device display.

android.view − The fundamental building blocks of application user interfaces.

android.widget − A rich collection of pre-built user interface components such as buttons, labels, list views, layout managers, radio buttons etc.

android.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