The Content Provider. Android application may consist of

The part presents main concepts for application development.
There are four types of application components: Activity, Service, Broadcast
Receivers, and Content Provider. Android application may consist of one or
several of these components types. Activity presents user interfaces that users
will interact with. For example, in text messaging application, one activity
presents the user interface to let users write message to others. All
activities are written through extending Activity base class. Service does not
have user interface and run in background, for example, play background music.
Service extends Service base class. The component Broadcast Receivers receives
and reacts to broadcast announcements. For example, when low battery is low,
the information is needed to inform users. All the receivers extend
BroadcastReceiver base class. The final one, Content Provider stores data and
provide data. The content provider extends ContentProvider base class but
applications do not call directly to the methods in ContentProvider, instead
they call methods in the object ContentResolver, which call ContentProvider.
Android provides the following four mechanisms for storing and retrieving data:
Preferences, Files, Databases, and Network. The Android API contains support
for creating and using SQLite databases. Each database is private to the
application that creates it. The SQLiteDatabase object represents a database
and has methods for interacting with it — making queries and managing the data.
To create the database, call SQLiteDatabase.create() and also subclass
SQLiteOpenHelper. All databases, SQLite and others are stored on the device in
rectangles are possible operations in the process of transitions between
different states. There is a code example in APPENDIX B. The entire lifetime of
one activity starts at the onCreate() and finishes on onDestroy(), where
release all the remaining resources. If one activity is between onResume() and
onPause(), it is foreground and interact with users, at the most top of all the
activities. When one activity is between onStart() and onStop(), it is visible
but may not be in the foreground and interact with users. During the time, the
activity can maintain resources. /data/data/package_name/databases. Except that
the Content provider is activated by a request from ContentResolver, other
three components are activated by asynchronous messages called intents. There
is code example of triggering intent in APPENDIX B. Android must know that
application components exist before it can start the application components.
So, the components written in applications should be registered in the manifest
file, which is bundled into Android package, and is XML structured, and named
AndroidManifest.xml for all applications. Next, I want to say some about the
lifecycle of components; it is important to understand lifecycle before
developing applications.



Location sensing technologies

Best services for writing your paper according to Trustpilot

Premium Partner
From $18.00 per page
4,8 / 5
Writers Experience
Recommended Service
From $13.90 per page
4,6 / 5
Writers Experience
From $20.00 per page
4,5 / 5
Writers Experience
* All Partners were chosen among 50+ writing services by our Customer Satisfaction Team

(Global Positioning System) is the most widely known location-sensing
technology today. A GPS receiver estimates position by measuring satellite
signal’s time difference of arrival. The US Department of Defense maintains the
expensive satellite infrastructure in earth orbit. It is said in Patterson
2003 that there are several reasons why GPS is not a universally applicable
location sensing mechanism. Firstly, it does not work indoor, particularly in
steel-framed building. Secondly, GPS use an absolute coordinate system, whereas
some applications (for example, guidance systems for robotic equipment) require
coordinate relative to specific objects. Finally, the specific component needed
for GPS impose weight, cost and energy consumption requirements that are
problematic for mobile hardware. In addition, GPS’s performance degrades in
high-rise urban areas, and receivers have a relatively long start-up time. As a
consequence, other location sensing technologies is developed. Wi-Fi
Localization is one of them. It uses algorithms to compute localization based
on data from Wi-Fi access points. In Hazas 2004, there is the Figure 2-8
showing comparison of several location sensing technologies including GPS and
Wi-Fi and mobile phones. We can see from the figure that usually GPS has higher
accuracy than Wi-Fi and mobile phones. Actu