Professional Documents
Culture Documents
Report Final - ACCL
Report Final - ACCL
The project describes that the ACCL is a component library that could be used by an application developer to create, evaluate and implement various charts and charting features in the Android platform. This document is intended for the application developers and the testers of Android system. The Overall Description section, of this document gives an overview of the functionality of the system. It describes the informal requirements and is used to establish a context for the technical requirements and specification. Android Charting Component Library(ACCL) supports Real time results, Real time graphs, Supports 3D charts, Supports all charting features unlike kiChart, Supports other charts also in addition to kiChart.
1.2
Motivation
People always like to see things graphically instead of the fact that are jotted down on the paper because its always easier to use and of course understand in a much lesser time.
Thus, charting was introduced to help people observe data in a statistical manner, which is always preferred.
To achieve this goal of viewing data statistically different types of charts were developed. A chart is a graphical representation of data, in which "the data is represented by symbols, such as bars in a bar chart, lines in a line chart, or slices in a pie chart. A chart can represent tabular numeric data, functions or some kinds of qualitative structures.
Different types of charts which even our project is going to incorporate are defined further.
The component library for charting in the Androids native SDK, will allow the programmers to develop and enhance the applications needing statistical analysis without worrying to first write the code for the all the charts and then proceed. As there is currently no component library for charting present in the native SDK.
1|Page
The developers may also use this library to check their systems memory usage or use it in any network monitoring tool which requires statistical analysis.
Thus, this library will provide as a base for the application developers and would help them concentrate on the main application without caring about the lower level details.
1.3
Scope
This component library will be a collection of various charting components for application developers like Android application developers and various testers working on Android. This system will be designed to maximize the clients productivity by allowing them to view their vital information in a graphical form, which would otherwise be a very complex job. By maximizing the clients work efficiency and production the library will meet the clients needs while remaining easy to understand and use. More specifically, this component library is designed to allow the users to view different types of charts according to their requirements and convenience like pie charts, stack charts, histograms, bar charts etc. The project will help the company in greatly in establishing themselves in the Android market. The project help other developers also working with the Androids native SDK. The project would remove the load of the lower level work and help them concentrate on the main application. Thus, it would make the Android OS ultimately more efficient and convenient to work on.
1.4
which our project has come to its completion. Abstract includes a brief and simple description about overall project. Section one explains introductory part which contains overview about how many summarizers are there and which out of them we are using for our project and why.
2|Page
Section second implies product perspective in which we highlight the initial requirements that are required in the beginning for developing this project, like software interface, hardware interface requirement analysis, feasibility study, and all the technical terms with their explanation are mentioned in this section. Next section explains about the various modules along with their working. Fourth section includes description of various database tables to be used for storing information like basic word table and stop word table. It is then followed by description of information in diagrammatic manner like using Context diagrams, DFDs, and flowcharts of all the project modules. The last section of this report includes a working example from the developed tool along with screenshots and coding used for the project.
1.5
Purpose
The main purpose of ACCL is to develop a component library that could be used by an application developer to create, evaluate and implement various charts and charting features in the Android platform. Developing a component library for charting in the native Android SDK. The library will have all the charting features which must be present in the respective charts like pie chart, line chart, bar chart, area chart etc. The library will enhance the performance of the charts and remove the lag that appears in loading and further processing them. The library will act as an tool in reducing the load of developing any further charting based application for the company, like network monitoring tool etc. The component library for charting in the Androids native SDK, will allow the programmers to develop and enhance the applications needing statistical analysis without worrying to first write the code for the all the charts and then proceed. As there is currently no component library for charting present in the native SDK. The developers may also use this library to check their systems memory usage or use it in any network monitoring tool which requires statistical analysis. Thus, this library will provide as a base for the application developers and would help them concentrate on the main application without caring about the lower level details
3|Page
2.0 2.1
Android is an operating system for mobile devices such as smart phones and tablet computers. It is developed by the Open Handset Alliance led by Google. Google purchased the initial developer of the software, Android Inc., in 2005. The unveiling of the Android distribution on November 5, 2007 was announced with the founding of the Open Handset Alliance, a consortium of 84 hardware, software, and telecommunication companies devoted to
advancing open standards for mobile devices. Google released most of the Android code under the Apache License, a free software license. The Android Open Source Project (AOSP) is tasked with the maintenance and further development of Android. Android consists of a kernel based on the Linux kernel, with middleware, libraries and
APIs written in C and application software running on an application framework which includes Java-compatible libraries based on Apache Harmony. Android uses the Dalvik virtual machine with just-in-time compilation to run compiled Java code. Android has a large
community of developers writing applications ("apps") that extend the functionality of the devices. Developers write primarily in a customized version of Java. There are currently more than 520,000 apps available for Android. Apps can be downloaded from third-party sites or through online stores such as Android Market, the app store run by Google. Android was listed as the best-selling smartphone platform worldwide in Q4 2010 by Canalys with over 190 million Android devices in use by October 2011.
4|Page
2.2
History
2.2.1 Foundation
Android, Inc. was founded in Palo Alto, California, United States in October, 2003 byAndy Rubin (co-founder of Danger), Rich Miner (co-founder of Wildfire Communications, Inc.), Nick Sears (once VP at T-Mobile), and Chris White (headed design and interface development at WebTV) to develop, in Rubin's words "...smarter mobile devices that are more aware of its owner's location and preferences". Despite the obvious past accomplishments of the founders and early employees, Android Inc. operated secretly, revealing only that it was working on software for mobile phones. That same year, Rubin ran out of cash. Steve Perlman brought him $10,000 in cash in an envelope and refused a stake in the company.
an Evalueserve study
reporting
that
had
filed
2.3
Enter search advertising giant Google. Now a household name, Google has shown an interest in spreading its brand and suite of tools to the wireless marketplace. The companys business model has been amazingly successful on the Internet, and technically speaking, wireless isnt that different. The companys initial forays into mobile were beset with all the problems you would expect. The freedoms Internet users enjoyed were not shared by mobile phone subscribers. Internet users can choose from the wide variety of computer brands, operating systems, Internet service providers, and Web browser applications. Nearly all Google services are free and ad driven. Many applications in the Google Labs suite would directly compete with the applications available on mobile phones. The applications range from simple calendars and calculators to navigation with Google Map sand the latest tailored news from News Alertsnot to mention corporate acquisitions like Blogger and YouTube. When this approach didnt yield the intended results, Google decided to a different approachto revamp the entire system upon which wireless application development was based, hoping to provide a more open environment for users and developers: the Internet model. The Internet model allowes users to choose between freeware, shareware, and paid software. This enables free market competition among services. Forming of the Open Handset Alliance With its user-centric, democratic design philosophies, Google has led a movement to turn the existing closely guarded wireless market into one where phone users can move between carriers easily and have unfettered access to applications and services. With its vast resources, Google has taken a broad approach, examining the wireless infrastructure from the FCC wireless spectrum policies to the handset manufacturers requirements, application developer needs, and mobile operator desires. Next, Google joined with other like-minded members in the wireless community and posed the following question: What would it take to build a better mobile phone? The Open Handset Alliance (OHA) (Figure 1.5) was formed in November 2007 to answer that very question. The OHA is a business alliance comprised of many of the largest and most successful mobile
6|Page
companies on the planet. Its members include chip makers, handset manufacturers, software developers, and service providers. The entire mobile supply chain is well represented. The Open Handset Alliance 17
Working together, OHA members began developing a nonproprietary open standard platform that would aim to alleviate the aforementioned problems hindering the mobile community. They called it the Android project. Googles involvement in the Android project has been extensive. The company hosts the open source project and provides online documentation, tools, forums, and the 03_0321627091_ch01.qxd 7/22/09 3:06 PM Page 17Software Development Kit (SDK). Google has also hosted a number of events at conferences and the Android Developer Challenge, a contest to encourage developers to write killer Android applicationsfor $10 million dollars in prizes. Manufacturers: Designing the Android Handsets More than half the members of the OHA are handset manufacturers, such as Samsung, Motorola, HTC, and LG, and semiconductor companies, such as Intel, Texas Instruments,NVIDIA, and Qualcomm. These companies are helping design the first generation of Android handsets The first shipping Android handsetthe T-Mobile G1was developed by handset manufacturer HTC with service provided by T-Mobile. It was released in October 2008. Many other Android handsets are slated for 2009 and early 2010. Content Providers: Developing Android Applications When users have Android handsets, they need those killer apps, right? Google has led the pack, developing Android applications, many of which, like the email client and Web browser, are core features of the platform. OHA members, such as
7|Page
eBay, are also working on Android application integration with their online auctions. The first Android Developer Challenge received 1,788 submissionsall newly developed Android games, productivity helpers, and a slew of Location-Based Services (LBS). We also saw humanitarian, social networking, and mash-up apps. Many of these applications have debuted with users through the Android MarketGoogles software distribution mechanism for Android.
2.4
After you have the phones, you have to get them out to the users. Mobile operators from Asia, North America, Europe, and Latin America have joined the OHA, ensuring a market for the Android movement. With almost half a billion subscribers, telephony giant China Mobile is a founding member of the alliance. Other operators have signed on as well.
2.5
Android is hailed as the first complete, open, and free mobile platform. n Complete: The designers took a comprehensive approach when they developed the Android platform. They began with a secure operating system and built a robust software framework on top that allows for rich application development opportunities. n Open: The Android platform is provided through open source licensing. Developers have unprecedented access to the handset features when developing applications. n Free: Android applications are free to develop. There are no licensing or royalty fees to develop on the platform. No required membership fees. No required testing fees. No required signing or certification fees. Android applications can be distributed and commercialized in a variety of ways.
8|Page
9|Page
2.6
Licensing
With the exception of brief update periods, Android has been available under a free and open source software license from October 21, 2008 until March 2011. Google published the entire source code (including network and telephony stacks) under an Apache License. Google also keeps the reviewed issues list publicly open for anyone to see and comment. Even though the software is open source, device manufacturers cannot use Google's Android trademark unless Google certifies that the device complies with their Compatibility Definition Document (CDD). Devices must also meet this definition to be eligible to license Google's closed-source applications, including the Android Market. In September 2010, Skyhook Wireless filed a lawsuit against Google in which they alleged that Google had used the compatibility document to block Skyhook's mobile positioning service (XPS) from Motorola's Android mobile devices. In December 2010 a judge denied Skyhook's motion for preliminary injunction, saying that Google had not closed off the possibility of accepting a revised version of Skyhook's XPS service, and that Motorola had terminated their contract with Skyhook because Skyhook wanted to disable Google's location data collection functions on Motorola's devices, which would have violated Motorola's obligations to Google and its carriers. In early 2011, Google chose to withhold the Android source code to the tablet-only Honeycomb release, creating a controversy over Google's commitment to open source with Android. The reason, according to Andy Rubin in an official Android blog post, was because Honeycomb was rushed for production of the Motorola Xoom, and they did not want third parties creating a "really bad user experience" by attempting to put onto smartphones a version of Android intended for tablets. Google later confirmed that the Honeycomb source code would not be released until after it was merged with the Gingerbread release in Ice Cream Sandwich. One of the criticisms often levied against Android is that it is not as open as Google claims. A mid-2009 Google strategy briefing included phrases such as "Do not develop in the open. Instead, make source code available after innovation is complete". The document also suggests that time-to-market exclusivity be given to partners who abide by Google's specifications. In an
10 | P a g e
internal email, dated Aug. 6, 2010, Dan Morrill, a manager in the Android group, noted in passing that it was obvious to the phone makers that "we are using compatibility as a club to make them do things we want." In a July 2011 research into open source projects, Android was found to be the most "closed" platform scoring significantly lower in an "openness" index. The other projects examined were Qt, Symbian, MeeGo, Mozilla, WebKit, Linux and Eclipse.
11 | P a g e
3.0
Android
Android is an operating system for mobile devices such as smart phones and tablet computers .Developed by the Open Handset Alliance led by Google. Android Open Source Project is tasked with the maintenance and further development of android.
3.1
About Android
Android consists of a kernel based on the Linux kernel. The next level up contains the Android native libraries. They are all written in C/C++ internally, but youll be calling them through Java interfaces. In this layer you can find the Surface Manager, 2D and 3D graphics, Media codec, the SQL database (SQLite), and a native web browser engine (WebKit).Android uses the Dalvik virtual machine. Dalvik Virtual Machine. Dalvik runs dex files, which are converted at compile time from standard class and jar files. Android has seen a number of updates since its original release. Its recent releases are 2.0 Eclair , 2.1 clair, 2.2 Froyo , 2.3 Gingerbread, 3.0 , 3.1 ,3.2 Honeycomb.
3.2
Android Emulator
The Android SDK includes a mobile device emulator a virtual mobile device that runs on your computer. The emulator lets you develop and test Android applications without using a physical device. The emulator supports a variety of options that you can specify when launching the emulator, to control its appearance or behavior. Google provides an Android emulator with their SDK, which is designed to let developers test their apps on Android before running them on handsets. We can use this to test drive Android on our computer, heres how to do it.
12 | P a g e
Then, download the Android SDK from Google (link below), and make sure to select the correct version for your computer. Once its downloaded, unzip the files as normal.
13 | P a g e
In Windows, run the SDK Setup.exe program to get started running Android on your PC.
14 | P a g e
15 | P a g e
If you see an SSL error message, click the Settings tab on the left in the SDK and AVD Manager window that opened in the background. Here, uncheck the Force https box, click Ok, and then reopen the setup.
Now, the Package Installer will open. You can choose what you want to install, and then clickInstall to begin installing the Android emulator on your computer.
16 | P a g e
By default, all of the SDK platforms, samples, and APIs will be selected for install. This can take quite a while to download, as several versions of Android are currently available. If you only want to play around with Android, choose the version you want. Youll want the SDK Platform Android your version. Then click the Reject bullet on all the other entries, and click Install. We wanted to try out the latest Android 2.2 as well as the older 1.5, so we downloaded both of them.
17 | P a g e
Once youve started installing, youll see a window showing the download and installation progress. This may take a few minutes, depending on your Internet speed.
Youll have some little Androids in your taskbar, but unfortunately they dont show the download progress.
18 | P a g e
Enter a name for your virtualized Android, and select the version of Android you want to use from the drop-down menu. This will only show the version you installed previously, so you may only see one version listed depending on your selection.
19 | P a g e
Enter a size under the SD Card entry; this is a virtual SD card thats actually an IMG file that Android will use to store your settings and files in. Then, select a screen size from the skin options. The default is a standard, Nexus One-type display, while the others are different sizes including even a BlackBerry-style device.
20 | P a g e
The program may appear to freeze while it is creating the AVD, so just wait until you see the confirmation window.
21 | P a g e
Youre now ready to run Android on your PC! Select your new virtual Android, and click Starton the right.
You can choose to scale the display if youve chosen a larger screen size than your monitor will fit, and then select Launch.
Android will now begin to load in your emulator. Several command prompt windows may open, and then youll see the emulator itself. Notice that the default, large screen size will display a keypad and virtual buttons on the right side of the emulated device.
22 | P a g e
Android may take several minutes to load, especially on your first run. After a while, the boot screen will switch to an Android boot animation. Finally, youll be presented with your new Android home screen! Use your mouse as you would normally, though remember that you dont need to double-click to open apps.
23 | P a g e
We did experience a few crashes in our tests, and the emulator felt somewhat sluggish, but in all, its fun to try out a new mobile OS without spending money on a new phone.
24 | P a g e
3.3
Android Platform
Android is an operating system and a software platform upon which applications are developed. A core set of applications for everyday tasks, such as Web browsing and email, are included on Android handsets. As a product of the Open Handset Alliances vision for a robust and open source development environment for wireless, Android is an emerging mobile development platform. The platform was designed for the sole purpose of encouraging a free and open market that all mobile applications phone users might want to have and software developers might want to develop.
3.4
The Android platform is designed to be more fault-tolerant than many of its predecessors.The handset runs a Linux operating system, upon which Android applications are executed in a secure fashion. Each Android application runs in its own virtual machine. Android applications are managed code; therefore, they are much less likely to cause the phone to crash, leading to fewer instances of device corruption (also called bricking the phone, or rendering it useless).
25 | P a g e
26 | P a g e
27 | P a g e
Some of the core functions the kernel handles include 1) Enforcement of application permissions and security 2) Low-level memory management 3) Process management and threading 4) The network stack 5) Display, keypad input, camera, WiFi, Flash memory, audio, and binder (IPC) driver access.
3.5
When an application is installed, the operating system creates a new user profile associated with the application. Each application runs as a different user, with its own private files on the file system, a user ID, and a secure operating environment. The application executes in its own process with its own instance of the Dalvik VM and under its own user ID on the operating system.
sensors. Applications also require permission to access shared data containing private and personal information such as user preferences, users location, and contact information. Applications might also enforce their own permissions by declaring them for other applications to use. The application can declare any number of different permission types, such as read-only or read-write permissions, for finer control over the application.
3.5.4
Android applications are written in Java For now, the Java language is the developers only choice on the Android platform. There has been some speculation that other programming languages, such as C++, might be added in future versions of Android.
29 | P a g e
30 | P a g e
31 | P a g e
4.0
People always like to see things graphically instead of the fact that are jotted down on the paper because its always easier to use and of course understand in a much lesser time. Thus, charting was introduced to help people observe data in a statistical manner, which is always preferred. To achieve this goal of viewing data statistically different types of charts were developed. A chart is a graphical representation of data, in which "the data is represented by symbols, such as bars in a bar chart, lines in a line chart, or slices in a pie chart. A chart can represent tabular numeric data, functions or some kinds of qualitative structures. Different types of charts which even our project is going to incorporate are defined further.
4.1
Bar chart
A bar chart or bar graph is a chart with rectangular bars with lengths proportional to the values that they represent. The bars can be plotted vertically or horizontally. Bar charts are used for plotting discrete (or 'discontinuous') data which has discrete values. Some examples of discontinuous data include 'shoe size' or 'eye color', for which you would use a bar chart. In contrast, some examples of continuous data would be 'height' or 'weight'. A bar chart is very useful if you are trying to record certain information whether it is continuous or not continuous data. Bar charts also look a lot like a histogram. They are often mistaken for each other.
32 | P a g e
Bar Chart
4.2
Histogram
In statistics, a histogram is a graphical representation showing a visual impression of the distribution of data. It is an estimate of the probability distribution of a continuous variable and was first introduced by Karl Pearson. A histogram consists of tabular frequencies, shown as adjacent rectangles, erected over discrete intervals (bins), with an area equal to the frequency of the observations in the interval. The height of a rectangle is also equal to the frequency density of the interval, i.e., the frequency divided by the width of the interval. The total area of the histogram is equal to the number of data. A histogram may also be normalized displaying relative frequencies. It then shows the proportion of cases that fall into each of several categories, with the total area equaling 1. The categories are usually specified as consecutive, non-overlapping intervals of a variable. The categories (intervals) must be adjacent, and often are chosen to be of the same size. Histograms are used to plot density of data, and often for density estimation: estimating the probability density function of the underlying variable. The total area of a histogram used for probability density is always normalized to 1. If the length of the intervals on the x-axis is all 1, then a histogram is identical to a relative frequency plot.
33 | P a g e
Histograms
4.3
Pie Chart
A pie chart (or a circle graph) is a circular chart divided into sectors, illustrating proportion. In a pie chart, the arc length of each sector (and consequently its central angle and area), is proportional to the quantity it represents. When angles are measured with 1 turn as unit then a number of percent is identified with the same number of centiturns. Together, the sectors create a full disk. It is named for its resemblance to apie which has been sliced. The earliest known pie chart is generally credited to William Playfair's Statistical Breviary of 1801. The pie chart is perhaps the most ubiquitous statistical chart in the business world and the mass media. However, it has been criticized,[4]and some recommend avoiding it, pointing out in particular that it is difficult to compare different sections of a given pie chart, or to compare data across different pie charts. Pie charts can be an effective way of displaying information in some cases, in particular if the intent is to compare the size of a slice with the whole pie, rather than comparing the slices among them. Pie charts work particularly well when the slices represent 25
34 | P a g e
to 50% of the data, but in general, other plots such as the bar chart or the dot plot, or nongraphical methods such as tables, may be more adapted for representing certain information. It also shows the frequency within certain groups of information.
t Pie Char
35 | P a g e
4.4
Line Chart
A line chart or line graph is a type of graph, which displays information as a series of data points connected by straight line segments. It is a basic type of chart common in many fields. It is an extension of a scatter graph, and is created by connecting a series of points that represent individual measurements with line segments. A line chart is often used to visualize a trend in data over intervals of time a time series thus the line is often drawn chronologically.
Line chart
5.0 5.1
The Android SDK includes a variety of tools that help you develop mobile applications for the Android platform. The tools are classified into two groups: SDK tools and platform tools. SDK tools are platform independent and are required no matter which Android platform you are developing on. Platform tools are customized to support the features of the latest Android platform.
36 | P a g e
5.2
SDK Tools
The SDK tools are installed with the SDK starter package and are periodically updated. The SDK tools are required if you are developing Android applications. The most important SDK tools include the Android SDK Manager (android sdk), the AVD Manager (android avd) the emulator (emulator), and the Dalvik Debug Monitor Server (ddms). A short summary of some frequently-used SDK tools is provided below:
5.2.1 ANDROID
Android is an important development tool that lets us:
Create, delete, and view Android Virtual Devices (AVDs). See Managing AVDs from the Command Line.
Create and update Android projects. See Managing Projects from the Command Line. Update your Android SDK with new platforms, add-ons, and documentation. See Adding SDK Packages. If we are using Eclipse, the android tool's features are integrated into ADT, so you should not need to use this tool directly.
37 | P a g e
How DDMS Interacts with a Debugger On Android, every application runs in its own process, each of which runs in its own virtual machine (VM). Each VM exposes a unique port that a debugger can attach to. When DDMS starts, it connects to adb. When a device is connected, a VM monitoring service is created between adb and DDMS, which notifies DDMS when a VM on the device is started or terminated. Once a VM is running, DDMS retrieves the the VM's process ID (pid), via adb, and opens a connection to the VM's debugger, through the adb daemon (adbd) on the device. DDMS can now talk to the VM using a custom wire protocol. DDMS assigns a debugging port to each VM on the device. Typically, DDMS assigns port 8600 for the first debuggable VM, the next on 8601, and so on. When a debugger connects to one of these ports, all traffic is forwarded to the debugger from the associated VM. You can only attach a single debugger to a single port, but DDMS can handle multiple, attached debuggers.
38 | P a g e
5.3
The Eclipse Platform is designed for building integrated development environments (IDEs) that can be used to create applications as diverse as web sites, embedded Java TM programs, C++ programs, and Enterprise JavaBeans TM. This paper is a general technical introduction to the Eclipse Platform. Part I presents a technical overview of its architecture. Part II is a case study of how the Eclipse Platform was used to build a full-featured Java development environment.
39 | P a g e
The navigator view shows the files in the user's workspace; the text editor (top right) shows the content of a file; the tasks view (bottom right) shows a list of to-dos; the outline view (bottom left) shows a content outline of the file being edited (not available for plain text files). Although the Eclipse Platform has a lot of built-in functionality, most of that functionality is very generic. It takes additional tools to extend the Platform to work with new content types, to do new things with existing content types, and to focus the generic functionality on something specific. The Eclipse Platform is built on a mechanism for discovering, integrating, and running modules called plug-ins. A tool provider writes a tool as a separate plug-in that operates on files in the workspace and surfaces its tool-specific UI in the workbench. When the Platform is launched, the user is presented with an integrated development environment (IDE) composed of the set of
40 | P a g e
available plug-ins.
The quality of the user experience depends significantly on how well the
tools integrate with the Platform and how well the various tools work with each other. The Eclipse Platform (or simply "the Platform" when there is no risk of confusion) is designed and built to meet the following requirements: Support the construction of a variety of tools for application development. Support an unrestricted set of tool providers, including independent software vendors (ISVs). Support tools to manipulate arbitrary content types (e.g., HTML, Java, C, JSP, EJB, XML, and GIF). Facilitate seamless integration of tools within and across different content types and tool providers. Support both GUI and non-GUI-based application development environments. Run on a wide range of operating systems, including Windows and Linux TM Capitalize on the popularity of the Java programming language for writing tools. The Eclipse Platform's principal role is to provide tool providers with mechanisms to use, and rules to follow, that lead to seamlessly-integrated tools. These mechanisms are exposed via welldefined API interfaces, classes, and methods. The Platform also provides useful building blocks and frameworks that facilitate developing new tools.
41 | P a g e
42 | P a g e
5.4
43 | P a g e
Launching the Android SDK Manager The Android SDK Manager is the tool that you use to install and upgrade SDK packages in your development environment. You can launch the Android SDK Manager in one of the following ways. Launching from Eclipse/ADT If you are developing in Eclipse and have already installed the ADT Plugin, follow these steps to access the Android SDK Manager tool: Open Eclipse Select Window > Android SDK Manager.
5.4.2
The Android Software Development Kit (SDK) allows developers to create applications for the Android platform. The Android SDK includes sample projects with source code, development tools, an emulator, and required libraries to build Android applications which are written using the Java programming language. Much of the info in this guide comes from the documentation on the Android Developers site. Follow this quick guide to successfully install Android SDK on your computer. If you are new to it, it is a bit complicated to install compared to your usual program. However if you are good in following instructions, its as easy as A-B-C. The process involves four general steps: Meeting System Requirements Fetching the Android SDK Package Installing the Android Development Tools (ADT) Plug-in for Eclipse
44 | P a g e
Windows XP or Vista Mac OS X 10.4.8 or later (x86 only) Linux (tested on Linux Ubuntu Dapper Drake)
Eclipse 3.5 (Galileo) or greater. Note: Eclipse 3.4 (Ganymede) is no longer supported with the latest version of ADT.
Eclipse JDT plug-in (included in most Eclipse IDE packages) If you need to install or update Eclipse, you can download it here. Several types of Eclipse packages are available for each platform. For developing Android applications, we recommend that you install one of these packages:
o o o
Eclipse IDE for Java Developers Eclipse Classic (versions 3.5.1 and higher) Eclipse IDE for Java EE Developers
45 | P a g e
JDK 5 or JDK 6 (JRE alone is not sufficient) Apache Ant 1.8 or later Note: Not compatible with GNU Compiler for Java (gcj)
If Java Development Kit (JDK) is already installed on your development computer, make sure that it meets the version requirements listed above. In particular, note that some Linux distributions may include JDK 1.4 or GNU Compiler for Java, both of which are not supported for Android development.
46 | P a g e
From within Eclipse, select Window > Android SDK and AVD Manager. On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory.
On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK. Then type android on the terminal window and press Enter.
To download components, use the graphical UI of the Android SDK and AVD Manager to browse the SDK repository and select new or updated components (see Figure ). The Android SDK and AVD Manager installs the selected components in your SDK environment.
47 | P a g e
For SDK Install in Windows we have used the following steps: 1. Download the latest version of Android SDK for Windows 2. Unzip the package to the root of C:\. (NOTE: This will output a folder called androidsdk-windows) 3. Open up the android-sdk-windows folder and launch the SDK Manager. 4. When you launch the SDK Manager for the first time it will ask for which packages to install. The only package we are concerned with at this time is Android SDK Platform tools, revision 6. You can reject all the others if you are not interested in them. 5. Once that is finished, you will need to install the USB drivers included with the Android SDK. 1. Click on Available Packages on the left. 2. Expand Third party Add-ons.
48 | P a g e
3. Expand Google Inc. add-ons. 4. Check Google USB Driver package, revision 4. 5. Click Installed Selected. 6. Once thats finished installing, you can close the SDK Manager. 7. Go to the Control Panel, and select the System Properties (Windows XP) or System (Windows Vista/7). 8. Select the Advanced settings. (On Windows XP: Click on the Advanced tab. On Windows Vista/7: Click on Advanced system settings on the left.) 9. Click on Environment Variables. 10. Under the System variable section, you will look for Path. Double-click on it. 11. In the Variable values section, add at the very end the location of the tools & package tools folder, with a semicolon separating these two paths from the rest. (e.g. %SystemRoot%;C:\android-sdk-windows\platform-tools;C:\android-sdk-windows\tools) 12. On your Android device, ensure that USB Debugging is enabled (Settings Applications Development). 13. Plug the device into the computer via USB cable. The computer will attempt to install the drivers automatically. 14. On success, open a command prompt on the computer, and type in the following command to sure everything is setup properly: adb devices 15. If it lists any devices, everything is fine and you are finished. If not, the drivers may not be installed correctly, please continue. 16. Open the Device Manager as follows: 1. Right-click on My Computer (Windows XP) or Computer (Windows Vista/7). 2. Click on Manage. 3. Click on Device Manager on the left. 17. You will probably see Unknown Device with ADB listed under it with a yellow exclamation mark. 18. Right-click on ADB. 19. Click on Update Driver Software. 20. Click on Browse my computer for driver software. 21. Click on Let me pick from a list of device drivers on my computer.
49 | P a g e
22. Click on Have Disk. 23. Click on Browse. 24. Navigate to C:\android-sdk-windows\extras\google\usb_driver and select android_winusb.inf. 25. Click on Android ADB Interface. (NOTE: You will get an Update Driver Warning, click on Yes.) 26. Once finished installing the driver, open a command prompt on the computer, and type in the following command to sure everything is setup properly: adb devices 27. If it lists any devices, everything is fine and you are finished. If not, try restarting Windows. If you still cant see your device, you may have further issues and will have to do further research on your own.
50 | P a g e
5.5
Android Emulator
The Android SDK includes a mobile device emulator a virtual mobile device that runs on your computer. The emulator lets you develop and test Android applications without using a physical device. The emulator supports a variety of options that you can specify when launching the emulator, to control its appearance or behavior. Google provides an Android emulator with their SDK, which is designed to let developers test their apps on Android before running them on handsets. We can use this to test drive Android on our computer, heres how to do it.
51 | P a g e
6.0 6.1
The purpose of the class diagram is to model the static view of an application. The class diagrams are the only diagrams which can be directly mapped with object oriented languages and thus widely used at the time of construction. The UML diagrams like activity diagram, sequence diagram can only give the sequence flow of the application but class diagram is a bit different. So it is the most popular UML diagram in the coder community. So the purpose of the class diagram can be summarized as:
Analysis and design of the static view of an application. Describe responsibilities of a system. Base for component and deployment diagrams. Forward and reverse engineering.
52 | P a g e
6.2
The purpose of use case diagram is to capture the dynamic aspect of a system. But this definition is too generic to describe the purpose. Because other four diagrams (activity, sequence, collaboration and State chart) are also having the same purpose. So we will look into some specific purpose which will distinguish it from other four diagrams. Use case diagrams are used to gather the requirements of a system including internal and external influences. These requirements are mostly design requirements. So when a system is analyzed to gather its functionalities use cases are prepared and actors are identified. Now when the initial task is complete use case diagrams are modelled to present the outside view. So in brief, the purposes of use case diagrams can be as follows:
53 | P a g e
Used to gather requirements of a system. Used to get an outside view of a system. Identify external and internal factors influencing the system. Show the interacting among the requirements are actors.
6.3
SEQUENCE DIAGRAM:
UML sequence diagrams are used to show how objects interact in a given situation. An important characteristic of a sequence diagram is that time passes from top to bottom: the interaction starts near the top of the diagram and ends at the bottom (i.e. Lower equals later). A popular use for them is to document the dynamics in an object-oriented system. For each key collaboration, diagrams are created that show how objects interact in various representative scenarios for that collaboration.
54 | P a g e
7.0 7.1
Since ACCL is a component library it does not possess any user interface. As it is imported for development of Android charting applications, those applications can have their user interface according to the requirement of the users intended to use the charts.
55 | P a g e
7.2
Hardware Interface:
The hardware interface could be any android-oriented device like mobile systems using Android platform could be an interface to the application using this component library. The interface could be extended to android tablets as well.
7.3
Software Interface:
The application developers use the ACCL in order to develop the applications intended for the user. the user implements it in his device using Android software. The gap between the ACCL and the application is bridged by importing ACCL in the development phase of the application.
56 | P a g e
7.4
57 | P a g e
7.5
Other Requirements:
But the recommended test process involves testing in every phase of the lifecycle. During the requirements phase the emphases is on validation to determine that the requirements meet the needs of organization. During the design and program phases the emphasis is on verification to ensure that the design and program accomplish the defined requirements. During the test and installation phases, the emphasis is on inception to determine that the implemented system meets
58 | P a g e
the system specification.During the maintenance phases, the system will be restarted to determine that the changes work and the unchanged portion continues to work.
8.0
Execution of Application
The project is named as ANDROID CHARTING COMPONENT LIBRARY, which basically will be used to display charts and all the various features of a chart. The main purpose of ACCL is to develop a component library that could be used by an application developer to create, evaluate and implement various charts and charting features in the native Android platform. DESCRIPTION OF CLASSES: The main class is named as AcclDemoActivity which has been used in order to invoke the different classes and the methods in those class. The next step is our base to the project. It has been named as base class . This class includes the method to draw the axes of the display as well as the display of text along the axes. The basic chart called the line chart is the next step to it. So the class line has been included to display the line chart. Similarly other classes have been included like bar chart , area chart , column chart and of course the pie chart. The detailed execution of this application will be such that , the component library that is built need to be imported in the application. The library has been named as ACCL . Hence one can import the package using import accl.*; Once it is imported , the user can invoke the different classes and display any chart of his choice by simply invoking that method.
59 | P a g e
For eg. If the user wants to display a pie chart then the following steps need to be followed: 1. Import the package named as ACCL. 2. Invoke the class named as piechart. 3. Invoke the parameterized constructor in that class. 4. Pass the parameters that the user wants to be displayed along the axes. 5. These parameters will be accepted by the library in an array format which corresponds to the x and y axis respectively. The different possibilities of data types along the axes has been taken care of . As we know the possible types can be integer , string and double. Therefore the possible combinations of data types has been given below: Integer-string Integer-integer Integer-double String-string String-integer String-double Double-double Double-integer Double-string.
6. The required chart will then be displayed accordingly. Similarly these steps can be used to display the other charts in the package as well. With the inclusion of all possible combinations of data types , the feature and appropriateness of the library has been enhanced. The relevant enclosures have also been added.
60 | P a g e
9.0
Classes Used:
Some of the classes used throughout the completion of our project is numerous so it is not possible to explain them all here in the report so we are illustrating few classes which have been used .
Canvas:
public class Canvas extends Object java.lang.Object android.graphics.Canvas
Class Overview The Canvas class holds the "draw" calls. To draw something, you need 4 basic components: A Bitmap to hold the pixels, a Canvas to host the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect, Path, text, Bitmap), and a paint (to describe the colors and styles for the drawing). Public Constructors Canvas() Construct an empty raster canvas. Canvas(Bitmap bitmap) Construct a canvas with the specified bitmap to draw into.
61 | P a g e
RectF:
public class RectF extends Object implements Parcelable java.lang.Object
android.graphics.RectF
Class Overview RectF holds four float coordinates for a rectangle. The rectangle is represented by the coordinates of its 4 edges (left, top, right bottom). These fields can be accessed directly. Use width() and height() to retrieve the rectangle's width and height. Note: most methods do not check to see that the coordinates are sorted correctly (i.e. left <= right and top <= bottom). Public Constructors RectF() Create a new empty RectF. RectF(float left, float top, float right, float bottom) Create a new rectangle with the specified coordinates. RectF(RectF r) Create a new rectangle, initialized with the values in the specified rectangle (which is left unmodified). RectF(Rect r)
62 | P a g e
Methods Used:
Some of the methods used throughout the completion of our project is numerous so it is not possible to explain them all here in the report so we are illustrating few classes which have been used . public void drawARGB (int a, int r, int g, int b) Fill the entire canvas' bitmap (restricted to the current clip) with the specified ARGB color, using srcover porterduff mode. Parameters a r g b alpha component (0..255) of the color to draw onto the canvas red component (0..255) of the color to draw onto the canvas green component (0..255) of the color to draw onto the canvas blue component (0..255) of the color to draw onto the canvas
public void drawArc (RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint) Draw the specified arc, which will be scaled to fit inside the specified oval. If the start angle is negative or >= 360, the start angle is treated as start angle modulo 360. If the sweep angle is >= 360, then the oval is drawn completely. Note that this differs slightly from SkPath::arcTo, which treats the sweep angle modulo 360. If the sweep angle is negative, the sweep angle is treated as sweep angle modulo 360 The arc is drawn clockwise. An angle of 0 degrees correspond to the geometric angle of 0 degrees (3 o'clock on a watch.)
63 | P a g e
Parameters oval The bounds of oval used to define the shape and size of the arc Starting angle (in degrees) where the arc begins
startAngle
sweepAngle Sweep angle (in degrees) measured clockwise useCenter If true, include the center of the oval in the arc, and close it if it is being stroked.
This will draw a wedge paint The paint used to draw the arc
public void drawCircle (float cx, float cy, float radius, Paint paint) Draw the specified circle using the specified paint. If radius is <= 0, then nothing will be drawn. The circle will be filled or framed based on the Style in the paint. Parameters cx cy The x-coordinate of the center of the cirle to be drawn The y-coordinate of the center of the cirle to be drawn
radius The radius of the cirle to be drawn paint The paint used to draw the circle
public void drawColor (int color) Fill the entire canvas' bitmap (restricted to the current clip) with the specified color, using srcover porterduff mode.
64 | P a g e
public void drawLine (float startX, float startY, float stopX, float stopY, Paint paint) Draw a line segment with the specified start and stop x,y coordinates, using the specified paint. NOTE: since a line is always "framed", the Style is ignored in the paint. Parameters startX The x-coordinate of the start point of the line startY The y-coordinate of the start point of the line paint The paint used to draw the line
public void drawOval (RectF oval, Paint paint) Draw the specified oval using the specified paint. The oval will be filled or framed based on the Style in the paint. Parameters oval The rectangle bounds of the oval to be drawn
public void drawPaint (Paint paint) Fill the entire canvas' bitmap (restricted to the current clip) with the specified paint. This is equivalent (but faster) to drawing an infinitely large rectangle with the specified paint. Parameters
65 | P a g e
public void drawPath (Path path, Paint paint) Draw the specified path using the specified paint. The path will be filled or framed based on the Style in the paint. Parameters path The path to be drawn
public void drawPicture (Picture picture) Save the canvas state, draw the picture, and restore the canvas state. This differs from picture.draw(canvas), which does not perform any save/restore. Parameters picture The picture to be drawn
public void drawPoint (float x, float y, Paint paint) Helper for drawPoints() for drawing a single point.
66 | P a g e
GRID VIEW: We need to create a base of the project that is axes x, y and grid lines for the reference of the values given by the user.
67 | P a g e
LINE CHART: As per the values given by the user we get the desired Line Chart.
68 | P a g e
BAR CHART: As per the values given by the user we get the desired Bar Chart.
69 | P a g e
PIE CHART: As per the values given by the user we get the desired Pie Chart.
70 | P a g e
User Input 1: Array 1[X]: {1.0, 5.0, 10.0, 18.0} Array 2[Y]: {11.0, 15.0, 110.0, and 11.0}
Output:
71 | P a g e
User Input 2: Array1[X] : {Jan, Feb., Mar, Apr } Array2[Y] : {10.0,15.0, 110.0, 118.0 }
Output:
72 | P a g e
Bar Chart
User Input 1: Array1 [X]: {Jan, Feb., Mar} Array2[Y] : {15.0, 110.0, 11.0}
Output:
73 | P a g e
User Input 2: Array1[X] : {2007, 2008, 2009} Array2[Y]: {2000, 3000, 1000}
Output:
74 | P a g e
Column Chart:
Output:
75 | P a g e
Output:
76 | P a g e
Pie Chart
User Input 1: Array1 []:{USA, UK, INDIA, JAPAN, NEPAL } Array2 []:{ 35, 30, 15, 15, 5 }
Output:
77 | P a g e
Output:
78 | P a g e
79 | P a g e
13.0 References
80 | P a g e