{"id":75491,"date":"2023-11-05T16:04:30","date_gmt":"2023-11-05T16:04:30","guid":{"rendered":"https:\/\/essays.homeworkacetutors.com\/an-android-application-development\/"},"modified":"2023-11-05T16:04:30","modified_gmt":"2023-11-05T16:04:30","slug":"an-android-application-development","status":"publish","type":"post","link":"https:\/\/www.colapapers.com\/us\/an-android-application-development\/","title":{"rendered":"An Android Application Development"},"content":{"rendered":"<div class=\"content position-relative mb-4\">\n<p>This paper talks briefly about developing applications on the android mobile platform using the Java Programming language. The overview includes introduction to the android platform features, architecture, APIs, application framework and the android SDK. A Hello World application walks you through the development process to understand the concepts of the android software stack and the tools involved.<\/p>\n<p>In late 2007, a group of industry leaders came together around the Android Platform to form the Open Handset Alliance (http:\/\/www.openhandsetalliance.com). Some of the alliance\u2019s prominent members include:\u00a0<\/p>\n<p>\u00e2\u20ac\u00a2 Sprint Nextel \u00e2\u20ac\u00a2 T-Mobile\u00a0<\/p>\n<p>\u00e2\u20ac\u00a2 Motorola \u00e2\u20ac\u00a2 Samsung\u00a0<\/p>\n<p>\u00e2\u20ac\u00a2 Sony Ericsson \u00e2\u20ac\u00a2 Toshiba\u00a0<\/p>\n<p>\u00e2\u20ac\u00a2 Vodafone\u00a0<\/p>\n<p>\u00e2\u20ac\u00a2 Google\u00a0<\/p>\n<p>\u00e2\u20ac\u00a2 Intel\u00a0<\/p>\n<p>\u00e2\u20ac\u00a2 Texas Instruments.\u00a0<\/p>\n<p>Android was designed to serve the needs of mobile operators, handset manufacturers, and application developers [3].<\/p>\n<h2>Android is:<\/h2>\n<p>A software stack for mobile devices that includes an operating system (Linux Kernel version 2.6), middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language [1].<\/p>\n<p>The Figure1: \u201cAndroid Architecture diagram\u201d gives a good overview of what constitutes the android platform. Android includes a set of C\/C++ libraries (indicated green in Figure1) used by various components of the Android system. These capabilities are exposed to developers through the Android application framework.<\/p>\n<h2>Android Platform Features:<\/h2>\n<p>The following is an explanation of the building blocks of the platform as indicated in Figure1.<\/p>\n<p>Application framework: Developers have full access to the same framework APIs used by the core applications (refer Figure1) written in Java. An application can publish its capabilities and any other application may then make use of those capabilities. Underlying all applications is a set of services and systems, including:<\/p>\n<p>A rich and extensible set of Views that can be used to build an application, including<\/p>\n<p>lists, grids, text boxes, buttons, and even an embeddable web browser<\/p>\n<p>Content Providers that enable applications to access data from other applications (such as<\/p>\n<p>Contacts), or to share their own data<\/p>\n<p>A Resource Manager, providing access to non-code resources such as localized strings,<\/p>\n<p>graphics, and layout files<\/p>\n<p>A Notification Manager that enables all applications to display custom alerts in the status<\/p>\n<p>bar<\/p>\n<p>An Activity Manager that manages the lifecycle of applications and provides a common<\/p>\n<p>navigation backstack<\/p>\n<p>Dalvik virtual machine optimized for mobile devices, executes files in the Dalvik<\/p>\n<p>Executable (.dex) format. The \u2018dx\u2019 tool included in the SDK converts .class files into .dex<\/p>\n<p>files.<\/p>\n<p>Integrated browser based on the open source WebKit engine<\/p>\n<p>Optimized graphics powered by a custom 2D graphics library; 3D graphics based on<\/p>\n<p>the OpenGL ES 1.0 specification (hardware acceleration optional)<\/p>\n<p>SQLite for structured data storage<\/p>\n<p>Media support for common audio, video, and still image formats (MPEG4, H.264,<\/p>\n<p>MP3, AAC, AMR, JPG, PNG, GIF)<\/p>\n<p>GSM Telephony (hardware dependent)<\/p>\n<p>Bluetooth, EDGE, 3G, and WiFi (hardware dependent)<\/p>\n<p>Camera, GPS, compass, and accelerometer (hardware dependent)<\/p>\n<p>Rich development environment including a device emulator, tools for debugging,<\/p>\n<p>memory and performance profiling, and a plugin for the Eclipse IDE<\/p>\n<h2>Application Fundamentals:<\/h2>\n<p>Android applications are written in the Java programming language. The compiled Java code along with any data and resource files required by the application is bundled by the aapt tool into an Android package, an archive file marked by an .apk suffix. This file is the vehicle for distributing the application and installing it on mobile devices; it\u2019s the file users download to their devices. All the code in a single .apk file is considered to be one application. By default, every application runs in its own Linux process, with a unique linux user id. Each process has its own virtual machine (VM).<\/p>\n<h2>Application Components:<\/h2>\n<p>Android applications consist of loosely coupled components, bound using a project manifest that describes each component and how they interact. There are six components that provide the building blocks for your applications:<\/p>\n<h2>1) Activities:<\/h2>\n<p>Your application\u2019s presentation layer. Every screen in your application will be an<\/p>\n<p>extension of the Activity class. Activities use Views to form graphical user interfaces that<\/p>\n<p>displays information and respond to user actions. In terms of desktop development, an<\/p>\n<p>Activity is equivalent to a Form.<\/p>\n<h2>2) Services:<\/h2>\n<p>Services are the invisible workers of your application. Service components run invisibly,<\/p>\n<p>updating your data sources and visible Activities and triggering Notifi cations. They\u2019re used<\/p>\n<p>to perform regular processing that needs to continue even when your application\u2019s Activities<\/p>\n<p>aren\u2019t active or visible.<\/p>\n<h2>3) Content Providers:<\/h2>\n<p>Are a shareable data store. Content Providers are used to manage and share application<\/p>\n<p>databases. Content Providers are the preferred way of sharing data across application<\/p>\n<p>boundaries. This means that you can confi gure your own Content Providers to permit access<\/p>\n<p>from other applications and use Content Providers exposed by others to access their stored<\/p>\n<p>data. Android devices include several native Content Providers that expose useful databases<\/p>\n<p>like contact information.<\/p>\n<h2>4) Intents:<\/h2>\n<p>They are simple message-passing framework. Using Intents, you can broadcast messages<\/p>\n<p>system-wide or to a target Activity or Service, stating your intention to have an action<\/p>\n<p>performed. The system will then determine the target(s) that will perform any actions as<\/p>\n<p>appropriate.<\/p>\n<h2>5) Broadcast Receivers:<\/h2>\n<p>By creating and registering a Broadcast Receiver, your application can listen for broadcast<\/p>\n<p>Intents that match specific filter criteria. Broadcast Receivers will automatically start your<\/p>\n<p>application to respond to an incoming Intent, making them ideal for event-driven<\/p>\n<p>applications.<\/p>\n<h2>6) Notifications:<\/h2>\n<p>They are user notification framework. Notifi cations let you signal users without stealing<\/p>\n<p>focus or interrupting their current Activities. They are the preferred technique for getting<\/p>\n<p>a user\u2019s attention from within a Service or Broadcast Receiver. For example, when a device<\/p>\n<p>receives a text message or an incoming call, it alerts you by fl ashing lights, making sounds,<\/p>\n<p>displaying icons, or showing dialog messages. You can trigger these same events from your<\/p>\n<p>own applications using Notifications. By decoupling the dependencies between application<\/p>\n<p>components, you can share and interchange individual pieces, such as Content Providers or<\/p>\n<p>Services, with other applications \u2013 both your own and those of third parties.<\/p>\n<h2>The manifest file:<\/h2>\n<p>The AndroidManifest.xml file is where your global settings are made. If you are an<\/p>\n<p>ASP.NET developer, you can think of AndroidManifest.xml as Web.config and<\/p>\n<p>Global.asax rolled into one. (If you are not an ASP.NET developer, this means that<\/p>\n<p>AndroidManifest.xml is a place for storing settings.) AndroidManifest.xml will include<\/p>\n<p>such settings as application permissions, Activities, and intent filters. [4]<\/p>\n<p>Please refer to Code 1: Manifest file<\/p>\n<h2>Building Hello World Application:<\/h2>\n<p>We will write the first android application, Hello World, using the eclipse IDE.<\/p>\n<p>Make sure that you have a suitable version of Eclipse(3.5 or 3.6 recommended) installed on<\/p>\n<p>your computer. Download the windows .zip file for the SDK starter package. Unpack the<\/p>\n<p>SDK files into a directory named android-sdk-<machine-platform> in a safe location on<\/machine-platform><\/p>\n<p>your computer.<\/p>\n<h2>Next, install the Eclipse(3.5 or 3.6) ADT plug-in for Android as follows:<\/h2>\n<p>Start Eclipse, then select Help &gt; Install New Software\u2026.<\/p>\n<p>Click Add, in the top-right corner.<\/p>\n<p>In the Add Repository dialog that appears, enter \u201cADT Plugin\u201d for the Name and the<\/p>\n<p>following URL for the Location: https:\/\/dl-ssl.google.com\/android\/eclipse\/<\/p>\n<p>In Available Software dialog, select checkbox next to Developer Tools, click Next<\/p>\n<p>In the next window, you\u2019ll see a list of the tools to be downloaded. Click Next.<\/p>\n<p>Read and accept the license agreements, then click Finish.<\/p>\n<p>When the installation completes, restart Eclipse.<\/p>\n<h2>Then, configure ADT by doing following steps:<\/h2>\n<p>Select Window &gt; Preferences\u2026 to open the Preferences panel<\/p>\n<p>Select Android from the left panel.<\/p>\n<p>For the SDK Location in the main panel, click Browse\u2026 and locate your downloaded<\/p>\n<p>SDK directory.<\/p>\n<p>Click Apply, then OK.<\/p>\n<h2>Now, to install a platform in Eclipse:<\/h2>\n<p>In the Android SDK and AVD Manager, choose Available Packages in the left panel.<\/p>\n<p>Click the repository site checkbox to display the components available for installation.<\/p>\n<p>Select at least one platform to install, and click Install Selected. If you aren\u2019t sure which<\/p>\n<p>platform to install, use the latest version.<\/p>\n<h2>Go on, and create an AVD:<\/h2>\n<p>In Eclipse, choose Window &gt; Android SDK and AVD Manager.<\/p>\n<p>Select Virtual Devices in the left panel.<\/p>\n<p>Click New. (The Create New AVD dialog appears.)<\/p>\n<p>Type the name of the AVD, such as \u201cmy_avd\u201d.<\/p>\n<p>Choose a target. The target is the platform (that is, the version of the Android SDK, such<\/p>\n<p>as 2.1) you want to run on the emulator.<\/p>\n<p>You can ignore the rest of the fields for now.<\/p>\n<p>Click Create AVD.<\/p>\n<h2>Create a New Android Project:<\/h2>\n<p>After you\u2019ve created an AVD, the next step is to start a new Android project in Eclipse.<\/p>\n<p>Please refer to Figure 1&amp;2: New Android Project and also follow the steps below.<\/p>\n<p>Fill in the project details with the following values:<\/p>\n<p>Project name: HelloAndroid<\/p>\n<p>Application name: Hello, Android<\/p>\n<p>Package name: com.example.helloandroid (or your own private namespace)<\/p>\n<p>Create Activity: HelloAndroid<\/p>\n<p>Click Finish.<\/p>\n<p>Here is a description of each field:<\/p>\n<p>Project Name: The name of the directory that will contain the project files.<\/p>\n<p>Application Name: This is the human-readable title for your application \u2013 the name that<\/p>\n<p>will appear on the Android device.<\/p>\n<p>Package Name: This is the package namespace (following the same rules as for packages<\/p>\n<p>in the Java programming language) that you want all your source code to reside under. This<\/p>\n<p>also sets the package name under which the stub Activity will be generated.<\/p>\n<p>Your package name must be unique across all packages installed on the Android system; for this reason, it\u2019s important to use a standard domain-style package for your applications. The example above uses the \u201ccom.example\u201d namespace, which is a namespace reserved for example documentation \u2013 when you develop your own applications, you should use a namespace that\u2019s appropriate to your organization or entity.<\/p>\n<h2>Create Activity<\/h2>\n<p>This is the name for the class stub that will be generated by the plugin. This will be a subclass of Android\u2019s Activity class. An Activity is simply a class that can run and do work. It can create a UI if it chooses, but it doesn\u2019t need to. As the checkbox suggests, this is optional, but an Activity is almost always used as the basis for an application.<\/p>\n<p>Min SDK Version: This value specifies the minimum API Level required by your application. For more information, see Android API Levels.<\/p>\n<p>Other fields: The checkbox for \u201cUse default location\u201d allows you to change the location on disk where the project\u2019s files will be generated and stored. \u201cBuild Target\u201d is the platform target that your application will be compiled against (this should be selected automatically, based on your Min SDK Version). Notice that the \u201cBuild Target\u201d you\u2019ve selected uses the Android 1.1 platform. This means that your application will be compiled against the Android 1.1 platform library. If you recall, the AVD created above runs on the Android 1.5 platform. These don\u2019t have to match; Android applications are forward-compatible, so an application built against the 1.1 platform library will run normally on the 1.5 platform. The reverse is not true.<\/p>\n<p>Your Android project is now ready. It should be visible in the Package Explorer on the left. Open the HelloAndroid.java file, located inside HelloAndroid &gt; src &gt; com.example.helloandroid). Please refer to Code2: HelloAndroid. Notice that the class is based on the Activity class. An Activity is a single application entity that is used to perform actions. An application may have many separate activities, but the user interacts with them one at a time. The onCreate() method will be called by the Android system when your Activity starts \u2013 it is where you should perform all initialization and UI setup. An activity is not required to have a user interface, but usually will. Now let\u2019s modify some code!<\/p>\n<h2>Construct the UI<\/h2>\n<p>Please refer to Code 3: Construct UI<\/p>\n<p>An Android user interface is composed of hierarchies of objects called Views. A View is a drawable object used as an element in your UI layout, such as a button, image, or (in this case) a text label. Each of these objects is a subclass of the View class and the subclass that handles text is TextView. In this change, you create a TextView with the class constructor, which accepts an Android Context instance as its parameter. A Context is a handle to the system; it provides services like resolving resources, obtaining access to databases and preferences, and so on. The Activity class inherits from Context, and because your HelloAndroid class is a subclass of Activity, it is also a Context. So, you can pass this as your Context reference to the TextView.<\/p>\n<p>Next, you define the text content with setText(). Finally, you pass the TextView to setContentView() in order to display it as the content for the Activity UI. If your Activity doesn\u2019t call this method, then no UI is present and the system will display a blank screen.<\/p>\n<p>There it is \u2013 \u201cHello, World\u201d in Android! The next step, of course, is to see it running.<\/p>\n<h2>Run the Application:<\/h2>\n<p>The Eclipse plugin makes it easy to run your applications:<\/p>\n<p>Select Run &gt; Run.<\/p>\n<p>Select \u201cAndroid Application\u201d.<\/p>\n<p>The Eclipse plugin automatically creates a new run configuration for your project and then launches the Android Emulator. Depending on your environment, the Android emulator might take several minutes to boot fully, so please be patient. When the emulator is booted, the Eclipse plugin installs your application and launches the default Activity. You should now see something like this: Please refer to Figure 4: Hello Android. The \u201cHello, Android\u201d you see in the grey bar is actually the application title. The Eclipse plugin creates this automatically (the string is defined in the res\/values\/strings.xml file and referenced by your AndroidManifest.xml file). The text below the title is the actual text that you have created in the TextView object.<\/p>\n<h2>Conclusion:<\/h2>\n<p>That concludes the basic \u201cHello World\u201d tutorial. Refer to http:\/\/developer.android.com\/index.html for more information. To do that, android offers a number of APIs for developing your applications. The following list of core APIs that provide an insight into what\u2019s available; all Android devices will offer support for at least these Java APIs[2]:<\/p>\n<p>android.util: The core utility package contains low-level classes like specialized containers,<\/p>\n<p>string formatters, and XML parsing utilities.<\/p>\n<p>com.google.android.maps: A high-level API that provides access to native map controls<\/p>\n<p>that you can use within your application. Includes the MapView control as well as the<\/p>\n<p>overlay and MapController classes used to annotate and control your embedded maps.<\/p>\n<p>android.text: The text processing tools for displaying and parsing text.<\/p>\n<p>android.database: low-level classes required for working with databases.<\/p>\n<h2>Figures:<\/h2>\n<h2>Figure 1: Android Architecture Diagram<\/h2>\n<h2>Figure2: New Android Project<\/h2>\n<h2>Figure3: New Android Project<\/h2>\n<h2>Figure 4: Hello Android<\/h2>\n<h2>Code 1: Manifest File<\/h2>\n<\/p>\n<p><manifest .=\"\"><\/manifest><\/p>\n<p><application .=\"\"><\/application><\/p>\n<p><activity <=\"\" android_name=\"com.example.project.FreneticActivity\" p=\"\"><\/p>\n<p>android:icon=\u201d@drawable\/small_pic.png\u201d<\/p>\n<p>android:label=\u201d@string\/freneticLabel\u201d<\/p>\n<h2>. . . &gt;<\/h2>\n<\/p>\n<p><\/activity><\/p>\n<h2>. . .<\/h2>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This paper talks briefly about developing applications on the android mobile platform using the Java Programming language. The overview includes introduction to the android platform features, architecture, APIs, application framework and the android SDK. A Hello World application walks you through the development process to understand the concepts of the android software stack and the [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5797],"tags":[9790,9869,9870,9889,3953,9940,9799,9939],"class_list":["post-75491","post","type-post","status-publish","format-standard","hentry","category-computer-science","tag-assignment-help-for-masters-students","tag-au","tag-complete-the-assignment-in-a-page-paper","tag-in-1050-word-essay","tag-need-help-writing-a-masters-thesis","tag-online-class-course-exam-help","tag-research-essay-pro","tag-write-my-essay-homework-due-in-hours"],"_links":{"self":[{"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/posts\/75491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/comments?post=75491"}],"version-history":[{"count":0,"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/posts\/75491\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/media?parent=75491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/categories?post=75491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.colapapers.com\/us\/wp-json\/wp\/v2\/tags?post=75491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}