Professional Documents
Culture Documents
in partial fulfillment of the requirements for the award of the Degree of Bachelor of Technology in INFORMATION TECHNOLOGY By VINAY KUMAR SINGH ATUL YADAV ATUL GARG ASHISH KALRA (8IT-3) under the guidance of Ms. Promila Bahadur Department of Information Technology Amity School of Engineering and Technology AMITY UNIVERSITY UTTAR PRADESH NOIDA (U.P.)
APRIL 2012
DECLARATION
We Vinay Singh, Atul Yadav, Ashish Kalra and Atul Garg student of B. Tech (I.T.) hereby declare the project titled ANDROID APPLICATION (NOTICE BOARD) which is submitted by us to Department of Information Technology, Amity School of Engineering and Technology, Amity University, Uttar Pradesh, Noida, in partial fulfillment of requirements for the award of degree of Bachelor in Technology in Information Technology, has not been previously formed the basis for the award of any degree, diploma or other similar title or recognition.
Noida Date: 29-03-2012 Vinay Singh A2305308215 Atul Yadav A2305308199 Ashish Kalra A2305308192 Atul Garg A2305308189
CERTIFICATE
On the basis of declaration submitted by Vinay Singh, Atul Yadav, Ashish Kalra and Atul Garg student of B. Tech (I.T.). We hereby certify that the project titled ANDROID APPLICATION (NOTICE BOARD), which is submitted to Department of Information Technology, Amity School of Engineering and Technology, Amity University, Noida, Uttar Pradesh, in partial fulfillment of the requirement for the award of degree of Bachelor of Technology in Information Technology, is an original contribution with an existing knowledge and faithful record of work carried out by them under my guidance and supervision. To the best of our knowledge this work has not been submitted in part or full for any degree or diploma in this University or elsewhere.
Noida Date: 29-03-2012 Ms. Promila Bahadur Department of Information Technology Amity School of Engineering and Technology Amity University, Uttar Pradesh
ACKNOWLEDGEMENT
We would like to sincerely thank my faculty guide, Ms. Promila Bahadur for taking all possible pains to go through my project to make necessary changes as and when needed. They both were always there whenever I felt need of their guidance and support. Our deepest and sincere thanks to my guide at , Prof.(Dr.) Balwinder Shukla for giving me such a great opportunity to do research at such a prestigious university and exposure to this incredible project. We would also like to thank my institution and all other faculty members without whom this project might have been a distant realty.
Vinay Singh A2305308215 Atul Yadav A2305308199 Ashish Kalra A2305308192 Atul Garg A2305308189
Abstract
Android Internet Applications allow mobile users to connect to the World Wide Web or to access the web pages from their mobile device. These days everyone seems to be connected with the world using wireless devices and amazingly mobile phone is the most commonly used wireless device. Android SDK provides immense opportunities and flexibility for programmers to develop higher-end internet applications for Android based devices. Android Internet Applications (or Android Web Applications) can include a wide varietysuch as applications that help to connect to the internet for playing online games such as chess etc., applications that connect to the internet to find information for unknown calls, applications that help to import internet explorer, firefox and chrome bookmarks to the android browser and so on (the list is endless). Android Mobile Development has extensive experience & expertise in developing mobile applications from simple to complex. We have invested heavily in our infrastructure and developing in-house team of mobile application developers. And above all a commitment to deliver economical & professional services to our clients irrespective of their size and location. All this makes us a perfect choice for our clients to outsource mobile applications development including Android Internet Applications development to us.
CONTENTS TABLE
S.No.
Contents Introduction
Page No. 8 8 9 9 9 11 11 11 11 12 12 12 12 12 13 15 15 15 15 17 17 17 18 18 18 19 20 20 20 20 21 26 26 26 27 27 7 27
1.0 1.1 2.0 2.1 2.2 3.0 3,1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 5.0 5.1 5.2 5.3 5.4 5.5 5.6 6.0 6.1 6.2 6.3 6.4 7.0 7.1 7.2 7.3 7.4 7.5
Android Operating System Literature Review Android Operating System Security and Permission Android Components Activity Views and Viewgroups Intents Services Content Provider Broadcast Receiver (Home screen) Widgets Other Compound Controls Android Development Tools7 What are Android Development Tools? Dalvik Virtual Machines How to develop Android Application? Android Application Architecture Android Manifest.xml R.java and Resources Assets Reference to Resources in xml files Activities and Layouts Activities and Lifecycle Installation Pre Requisites for using a 64-bit Linux Eclipse and Automatic Android SDK Manually install Android SDK Install a Specific Android Version Android Virtual Device Emulator What is Android Emulator? Goole vs Android AVD Emulator Shortcuts Performance Hardware Button
CHAPTER 1 INTRODUCTION
1.1 Android Operation System Android is an operating system based on Linux with a Java programming interface. The Android Software Development Kit (Android SDK) provides all necessary tools to develop Android applications. This includes a compiler, debugger and a device emulator, as well as its own virtual machine to run Android programs. Android is currently primary developed by Google. Android allows background processing, provides a rich user interface library, supports 2-D and 3-D graphics using the OpenGL libraries, access to the file system and provides an embedded SQLite database.
Android applications consists out of different components and can re-use components of other applications if these applications declare their components as available. This leads to the concept of a task in Android, an application can re-use other Android components to archive a task. For example you can write an Application which integrates the map component and a camera component to archive a certain task.
Android applications consists out of different components and can re-use components of other applications if these applications declare their components as available. This leads to the concept of a task in Android, an application can re-use other Android components to archive a task. For example you can write an Application which integrates the a map component and a camera component to archive a certain task.
Android also contains a permission system. Android predefines permissions for certain tasks but every application can also define its own permissions. An application must declare in its configuration file (AndroidManifest.xml) that it requires certain permissions. Depending on the details of the defined permission, the Android system will during installation automatically grant the permission, reject it or ask the user if he grants these permissions to the application.
10
If for example the application declares that is requires Internet access then the user need to confirm this during installation. This is called "user driven security". The user decides to grant permission or to deny it. If the user does not want to give all permissions required by the application, this application cannot be installed. The check of the permission is only performed during installation; permissions cannot be denied or granted after the installation. Typically not all users check the permissions in detail but some users do and if there is something strange with them, they will write bad reviews on the corresponding Android markets.
3.1. Activity
Activity
represents the presentation layer of an Android application. A simplified (and can be displayed as dialogs or transparent. An Android application can have
several Activities.
are user interface widgets, e.g. buttons or text fields. The base class for all Views is often have attributes which can be used to change their appearance
android.view.View. Views
and behavior.
11
A ViewGroup is responsible for arranging other Views e.g. they are layout manager. The base class for a layout manager is android.view.ViewGroups. ViewGroup also extends View.
ViewGroups
can be nestled to create complex layouts. You should not nestle ViewGroups too
3.3. Intents
Intents
are asynchronous messages which allow the application to request functionality from
other components of the Android system, e.g. from Services or Activities. An application can call a component directly (explicit intent) or ask the Android system to evaluate registered components for a certain Intents (implicit intents). For example the application could implement sharing of data via an Intent and all components which allow sharing of data would be available for the user to select. Applications register themselves to an intent via an Intent Filter. Intents allow to combine loosely coupled components to perform certain tasks.
3.4. Services
Services
perform background tasks without providing an UI. They can notify the user via the
3.5. ContentProvider
ContentProvider
can share data with other applications. Android contains an SQLite database which is frequently used in conjunction with a ContentProvider to persists the data of the
ContentProvider.
3.6. BroadcastReceiver
BroadcastReceiver
will get notified by the Android system if the specified situation happens. For example a
12
BroadcastReceiver
could get called once the system completed its boot process or if a phone
call is received.
are interactive components which are primary used on the Android homescreen.
They typically display some kind of data and allow the user to perform actions via them. For example a Widget could display a short summary of new emails and if the user select a email it could start the email application with the selected email.
3.8. Other
Android provide much more components but the list above describes the most important ones. Other Android components are "Live Folders" and "Live Wallpapers". Live Folders display data on the homescreen without launching the corresponding application. 3.9 Compound Controls If you don't want to create a completely customized component, but instead are looking to put together a reusable component that consists of a group of existing controls, then creating a Compound Component (or Compound Control) might fit the bill. In a nutshell, this brings together a number of more atomic controls (or views) into a logical group of items that can be treated as a single thing. For example, a Combo Box can be thought of as a combination of a single line EditText field and an adjacent button with an attached PopupList. If you press the button and select something from the list, it populates the EditText field, but the user can also type something directly into the EditText if they prefer. In Android, there are actually two other Views readily available to do this: Spinner and AutoCompleteTextView, but regardless, the concept of a Combo Box makes an easy-tounderstand example. To create a compound component:
13
1. The usual starting point is a Layout of some kind, so create a class that extends a Layout. Perhaps in the case of a Combo box we might use a LinearLayout with horizontal orientation. Remember that other layouts can be nested inside, so the compound component can be arbitrarily complex and structured. Note that just like with an Activity, you can use either the declarative (XML-based) approach to creating the contained components, or you can nest them programmatically from your code. 2. In the constructor for the new class, take whatever parameters the superclass expects, and pass them through to the superclass constructor first. Then you can set up the other views to use within your new component; this is where you would create the EditText field and the PopupList. Note that you also might introduce your own attributes and parameters into the XML that can be pulled out and used by your constructor. 3. You can also create listeners for events that your contained views might generate, for example, a listener method for the List Item Click Listener to update the contents of the EditText if a list selection is made. 4. You might also create your own properties with accessors and modifiers, for example, allow the EditText value to be set initially in the component and query for its contents when needed. 5. In the case of extending a Layout, you don't need to override the onDraw() and onMeasure() methods since the layout will have default behavior that will likely work just fine. However, you can still override them if you need to. 6. You might override other on... methods, like onKeyDown(), to perhaps choose certain default values from the popup list of a combo box when a certain key is pressed. To summarize, the use of a Layout as the basis for a Custom Control has a number of advantages, including:
You can specify the layout using the declarative XML files just like with an activity screen, or you can create views programmatically and nest them into the layout from your code.
14
The onDraw() and onMeasure() methods (plus most of the other on... methods) will likely have suitable behavior so you don't have to override them. In the end, you can very quickly construct arbitrarily complex compound views and re-use them as if they were a single component.
15
16
17
If you create a new resource, the corresponding reference is automatically created in R.java. These references are static int values and define ID's for the resources. The Android system provides methods to access the corresponding resource via these ID's. For example to access a String with the reference id R.string.yourString use the method
getString(R.string.yourString)); .
R.java is automatically created by the Eclipse development environment, manual changes are not necessary.
5.3. Assets
While the directory res is contains structured values which are known to the Android platform the directory assets can be used to store any kind of data. In Java you can access this data via the AssetsManager and the getAssets() method .
or if you have defined a "hello" string as resource you can access it via
18
XML based layouts are defined via a resource file in the folder /res/layout . This file specifies the ViewGroups, Views, their relationship and their attributes for a specific layout. If a UI element needs to be accessed via Java code you have to give the UI element an unique id via the android:id attribute. To assign a new id to an UI element use @+id/yourvalue. By conversion this will create and assign a new id yourvalue to the corresponding UI element. In your Java code you can later access these UI elements via the method
findViewById(R.id.yourvalue).
Defining layouts via XML is usually the preferred way as this separates the programming logic from the layout definition. It also allows the definition of different layouts for different devices. You can also mix both approaches.
- always called if the Activity ends, can be used to release resource or save - called if the Activity is re-started, can be used to initialize fields
data
onResume()
The activity will also be restarted if a so called "configuration change" happens. A configuration change for example happens if the user changes the orientation of the device (vertical or horizontal). The activity is in this case restarted to enable the Android platform to load different resources for these configuration, e.g. layouts for vertical or horizontal mode. In the emulator you can simulate the change of the orientation via CNTR+F11. You can avoid a restart of your application for certain configuration changes via the configChanges attribute on your activity definition in your AndroidManifest.xml. The
19
following activity will not be restarted in case of orientation changes or position of the physical keyboard (hidden / visible).
5.7. Context
The class android.content.Context provides the connections to the Android system. It is the interface to global information about the application environment. Context also provides access to Android Services, e.g. theLocation Service. As Activities and Services extend the class Context you can directly access the context via this.
CHAPTER 6 INSTALLATION
20
After the new Android development components are installed you will be prompted to install the Android SDK. You can use the following wizard or go to the next section to learn how to do it manually.
21
22
The dialog allows you to install new packages and also allows you to delete them. Select "Available packages" and open the "Third Party Add-ons". Select the Google API 14 (Android 4.0) version of the SDK and press "Install".
23
Press the "Install" button and confirm the license for all packages. After the installation completes, restart Eclipse.
24
25
26
27
7.4. Performance
Try to use a smaller resolution for your emulator as for example HVGA. The emulator gets slower the more pixels its needs to render as it is using software rendering. Also if you have sufficient memory on your computer, add at least 1 GB of memory to your emulator. This is the value "Device ram size" during the creation of the AVD. Also set the flag "Enabled" for Snapshots. This will save the state of the emulator and let it start much faster.
28
29
CHAPTER 8
SCREENSHOTS
30
31
32
33
CHAPTER 9 CONCLUSION
Android is a truly open, free development platform based on Linux and open source. Handset makers can use and customize the platform without paying a royalty. A component-based architecture inspired by Internet mash-ups. Parts of one application can be used in another in ways not originally envisioned by the developer. can even replace built-in components with own improved versions. This will unleash a new round of creativity in the mobile space.
Android is open to all: industry, developers and users Participating in many of the successful open source projects Aims to be as easy to build for as the web. Google Android is stepping into the next level of Mobile Internet
34
Android has been criticized for not being all open-source software despite what was announced by Google. Parts of the SDK are proprietary and closed source, and some believe this is so that Google can control the platform. Software installed by end-users must be written in Java, and will not have access to lower level device APIs. This provides end-users with less control over their phone's functionality than other free and open source phone platforms, such as OpenMoko. With all upcoming applications and mobile services Google Android is stepping into the next level of Mobile Internet. Android participates in many of the successful open source projects. That is, architect the solution for participation and the developers will not only come but will play well together. The future scope for this application is that we can change the static setting of database to dynamic so that it can be modified to a enhanced application. Administrator will be provided with the option of editing the courses and fields within them respectively.
35
CHAPTER 11 REFERENCES 1. http://www.android.com - Android Official Webpage 2. http://code.google.com/android/ - Official Android Google Code Webpage 3. http://www.openhandsetalliance.com/ - Open Handset Alliance Webpage 4. http://www.androidwiki.com Android Wiki 5. http://googleblog.blogspot.com/ Official Google Blog 6. http://en.wikipedia.org/wiki/Android_(mo...Wikipedia Information 7. http://en.wikipedia.org/wiki/SQLite 8. http://en.wikipedia.org/wiki/WebKit 9. http://en.wikipedia.org/wiki/Eclipse_(software) 10. http://www.itworld.com/google-android-dr-080213
36