Design Introducing The Android Sdk Computer Science Essay

Published:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

The Android SDK Software Development Kit is the Googles mobile app development software to create applications for the Android platform. The SDK comes with the standard toolkit of a debugger, code libraries, a hardware emulator and few sample projects and tutorials. Android SDK can run on multiple platform and favours JAVA and Objective C programming language. The code can be compiled or made ready to run on both ARM and x86 processors which means the app will run on variety of Android Devices available in the wild. However, in order to create an Android app, it was necessary to have some specific software installed in the computer which was:

JAVA (Although normally it is pre-installed on computers already)

The Eclipse IDE (Integral Development Environment)- a software suit which the application will be created in.

Android SDK comes with built-in SDK components, latest version of Eclipse IDE with built-in ADT (Android Developer Tools) to restructure Android app development.

Installing requirements and Setting up components

Before installing any of the software's above, it was essential to make sure that the computer meets the minimum requirements for Android development such as Windows 7 (32 or 64 bit) is required, or if using Windows XP (32 bit). In this project, all the requirements were met using Windows 7.

Similarly with JAVA, JDE component (JAVA Development Environment) was required (note: there are lots of components of JAVA for different purposes, however, to write JAVA programs, JAVA (JDE) is required).

After downloading JAVA, one must download Android SDK bundle which involves Eclipse and ADT plugins. Although Android SDK involves ADT components, one has to open the Eclipse and download the ADT plugin from inside of the Eclipse application. This ADT plugin is required because it gives Eclipse increased functionality which will be needed for the Application development for Android.

Finally, after installing ADT for Eclipse, we will need to add Android Versions and Packages. This is done using the Android SDK Manager that can access from inside Eclipse under the Windows Menu. We also need to decide Android versions that we want to develop for. The Android Developer website helps the beginner to see the recommended and minimum installation items. After installing at least one Android Version, we can come back to the Android SDK Manager to install additional versions at any later time.

In conclusion, each components work together, and all make essential parts of our development process.

http://developer.android.com/sdk/installing.html#

Setting up 'Project Harrow

Now that the development environment is set-up, the process for Android Application can be started. To start a project, developer needs to launch the Eclipse Development Environment. Once Eclipse loads, under the File Menu, Choose New, then select Android Application Project. This opens up a New Android Project Wizard as shown on the next page.

Figure Choosing 'Android Application Project" from the File Menu

Once we click on the New Android Project dialogue, a pop-up-window will appear. This window needs to know following things. This is shown is figure 43.

Name of the Android Application in the Application Name field. In our case, this will be 'Smoke Free Harrow'.

The name of the new project (Not Displayed on the Device). However, once 'Application Name' is entered, the Project name and the Package name fields are entered automatically updated to reflect the Application Name such as 'SmokeFreeHarrow'. Note that the project name does not use any special characters or spaces. It will usually take the form of:

com.your_company_website.your_project_name.

If client approves the final application and wants to publish the application on Google Play Store, the name of the Package Name needs to be absolutely unique that will never be used for different project by anyone. Hence, 'com.example_smokefreeharrow' name is used, because there's a better likelihood that no one else has used that name.

Figure Android Project Wizard

The Target SDK and Minimum required SDK fields can be kept at the default settings. The Target SDK is the highest version of Android that developer would want to use in their programming. The Minimum Required SDK is the minimum version that developer wants their application to run on. When the New Android Application Wizard opens, developer can notice the blue, red and yellow icons that they can hover over to get more information about a specific item. If there is red icon with an 'X' will tell the developer that there is an error in that field. The yellow icon gives warning of a particular field and lastly the blue icon with the 'I' will give more information about that item. This is illustrated from the following Figure 45:

Figure Example of warnings in creating a New Android Project

After the developer clicks next, they will come across the few settings on the next page as shown in Figure in 46. The check boxes that are needed are checked by default. The workspace is a folder on the computer that contains a set of project files. The folder must have been created during Eclipse installation process. If not, developer can create a new folder to their preferred location of the computer to use as Workspace.

Figure Configuring the Project

The location is greyed since developer has already made the folder. However, a new location can be selected if 'create project in Workspace' is unchecked!

Clicking next will bring up the Activity Screen, where developer will need to choose what kind of activity they would like to create. An Activity in an Android application can be thought of as a discrete screen inside of the application that can display whatever the developer creates. The developer needs to choose a 'Blank Activity' to create a blank activity with an action bar and optional navigational components such as tabs or horizontal swipe.

Figure Creating Activity

On clicking next from this screen (as shown in Figure 47), next screen brings up the properties if developer like to give name for Activity Name, Layout Name and Title. For Navigation type, develop has to choose none and click finish to create their New Android Project (as shown in Figure 48).

Figure New Project under the Package Explorer

Android Project

Development

Moving forward from figure 48, developer will need to open up the New Project that created, by clicking arrow to the left of the project's name in the Package Explorer window. After the opening the project folder, one can see the automated files and folders inside the project (as shown in Figure 49):

Figure Automated file under the Package folder

After opening up a New Android Project, first thing first, developer will need to be aware of the main files in the project. The first one is "AndroidManifest.xml" file which has been highlighted in Figure 50. This file contains all the basic application information and hence why it is the main file for the app.

Figure Understanding the Android Manifest XML file

Figure 50 shows the window that open after double clicking on "AndroidManifest.xml", this tab shows the main properties for the application for example version name, version code, properties such as Google maps or camera. At the bottom of the manifest window, there are different other tabs such as Application, Permission, Instrumentation, AndroidManifest.xml. This is shown below:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.projectharrow"

android:versionCode="1"

android:versionName="1.0">

<uses-sdk android:minSdkVersion="8"/>

This section shows the name of the package, some version of information and some application information.

<application android:name="projectharrow_appDelegate"

android:icon="@drawable/icon"

android:label="@string/app_name"

android:debuggable="true"

android:theme="@android:style/Theme.NoTitleBar">

<!-- activity root is the default, beginning activity -->

<activity

One can see the activity name and the location of the label with a formatted activity nameandroid:name="BT_activity_root"

android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"

android:excludeFromRecents="false"

android:noHistory="true">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

Application section shows main icon location and location for the name of the app. below that, there is an activity tag that contains the information for the Activity that was created using Android Application Wizard. At the end there is intent filter tag. In that intent filter tag are two lines of code that specify this activity to the main activity and that tell this activity to start when the app is launched. If we had additional activities we would have to add those to the manifest file such as following:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.projectharrow"

android:versionCode="1"

android:versionName="1.0">

<uses-sdk android:minSdkVersion="8"/>

Required device permissions

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.GET_ACCOUNTS" />

<uses-permission android:name="android.permission.READ_CONTACTS" />

<uses-permission android:name="android.permission.WRITE_CONTACTS" />

Google Cloud Messaging permissions

<permission android:name="com.projectharrow.permission.C2D_MESSAGE"android:protectionLevel="signature" />

<uses-permission android:name="com.projectharrow.permission.C2D_MESSAGE" />

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-permission android:name="android.permission.VIBRATE" />

Recommended Device Features

<uses-feature android:name="android.hardware.camera" android:required="false" />

<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

<uses-feature android:name="android.hardware.location" android:required="false" />

<uses-feature android:name="android.hardware.location.gps" android:required="false" />

<uses-feature android:name="android.hardware.telephony" android:required="false" />

<application android:name="projectharrow_appDelegate"

android:icon="@drawable/icon"

android:label="@string/app_name"

android:debuggable="true"

android:theme="@android:style/Theme.NoTitleBar">

Activity root is the default, beginning activity

<activity android:name="BT_activity_root"

android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"

android:excludeFromRecents="false"

android:noHistory="true">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

Google Cloud Messaging permissions

<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver"

android:permission="com.google.android.c2dm.permission.SEND" >

<intent-filter>

<action android:name="com.google.android.c2dm.intent.RECEIVE" />

<action android:name="com.google.android.c2dm.intent.REGISTRATION" />

<category android:name="com.projectharrow" />

</intent-filter>

</receiver>

<service android:name=".GCMIntentService" />

Activities for general layout (tabbed or non-tabbed layout)

<activity android:name=".BT_activity_base" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_activity_root_tabs" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

Remaining activities are for individual plugin types:

<activity android:name=".BT_screen_customHTML" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_pptDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_map" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_menuListSimple" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_htmlDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_excelDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_splash" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_pdfDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_customURL" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_menuButtons" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_settingsLogIn" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".WB_screen_menuImage" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".CR_Random_Splash" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_blank" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

<activity android:name=".BT_screen_wordDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity>

This line is for Google maps which is for the element for the venue search

<uses-library android:name="com.google.android.maps"/>

</application>

</manifest>

Second important file within 'Android Project' is the Activity File which is located inside src folder inside the project folder. This file consists of JAVA pages (.jar or .JAVA). This is where the application is constructed. Following few pages will be the important coding snippets explained to make up the application.

https://sites.google.com/site/chicagoandroid/110/main-java

Implementation

In Android Operating System, if a user does something on the screen or if a new screen loads up, that's going to be an Android Activity. Hence, each time user loads a screen, they will loading new Android activity. New Beginners always wondered that "how do Android know that we want this activity to display when the android application launch?"

In the AndroidManifest.xml file, there are group of things in-between <activity and </activity> tags, that is the number of activities for example, launching home screen, menu buttons etc. As such following is the important activity which tells us about the main activity. This code will instruct Android that this activity is the main activity and this will be displayed when the app launches. Please notes <activity denotes that activity has begins and </activity denotes that activity ends.

<activity android:name="BT_activity_root"

android:label="@string/app_name"android:configChanges="keyboardHidden|orientation"

android:excludeFromRecents="false"

android:noHistory="true">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

In this application, users has inputted a command for push notifications to prompt user for "allow" push notifications if they have NOT previously said "no thanks".

if(BT_fileManager.doesCachedFileExist("rejectedpush.txt")){

BT_debugger.showIt(activityName + ":Device owner has rejected Push Notifications");

}else{

confirmRegisterForPush();

}

Writing Services

Essay Writing
Service

Find out how the very best essay writing service can help you accomplish more and achieve higher marks today.

Assignment Writing Service

From complicated assignments to tricky tasks, our experts can tackle virtually any question thrown at them.

Dissertation Writing Service

A dissertation (also known as a thesis or research project) is probably the most important piece of work for any student! From full dissertations to individual chapters, we’re on hand to support you.

Coursework Writing Service

Our expert qualified writers can help you get your coursework right first time, every time.

Dissertation Proposal Service

The first step to completing a dissertation is to create a proposal that talks about what you wish to do. Our experts can design suitable methodologies - perfect to help you get started with a dissertation.

Report Writing
Service

Reports for any audience. Perfectly structured, professionally written, and tailored to suit your exact requirements.

Essay Skeleton Answer Service

If you’re just looking for some help to get started on an essay, our outline service provides you with a perfect essay plan.

Marking & Proofreading Service

Not sure if your work is hitting the mark? Struggling to get feedback from your lecturer? Our premium marking service was created just for you - get the feedback you deserve now.

Exam Revision
Service

Exams can be one of the most stressful experiences you’ll ever have! Revision is key, and we’re here to help. With custom created revision notes and exam answers, you’ll never feel underprepared again.