Tetris Development For Android
Tetris Development For Android
INTRODUCTION
1.2Existing System:
Tetris is available in many forms and available on various devices like desktop computers, hand held devices like PDA etc. as of today.
Otherwise further justification or alterations in proposed system that have to be made if it is having a change of being approved .This is an ongoing effort that improves in accuracy of each phase of the system lifecycle. For my project I am not expecting any feasibility costs spent on this on this project because here I am using open source environments.
1.4.3Operational feasibility:
People are inherently resistant to change and mobiles have been known to facilitate change. In my project a technical people require to configure the software and technical background is necessary to work on the sensors.
2. SCOPE OF PROJECT
The scope of this project is to develop an Android based gaming application for Tetris. The game (or one of its many variants) is available for nearly every video game console and computer operating system, as well as on devices such as graphing calculators, mobile phones, portable media players, PDAs and even as an Easter egg on non-media products like oscilloscopes. It has even been played on the sides of various buildings, with the record holder for the world's largest fully functional game of Tetris being an effort by Dutch students in 1995 that lit up all 15 floors of the Electrical Engineering department at Delft University of Technology. This project is aimed to develop the Tetris game on Mobile phone.
3. PRODUCT PERSPECTIVE
This research is on the latest open source mobile development platform called, Android and to implement a game based technologies for different requirements.
Having only hardware is not sufficient, to access an application Software is must. Assumption is made in such a way that the mobile is charged with enough battery. The battery should be in a working mode. The one who using the mobile must have a minimum knowledge of how to play Tetris game.
Integrated browser based on the open source Web Kit engine. Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional). SQLite for structured data storage. GPS Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plug-in for the Eclipse IDE. The system is expected to run on low memory devices also. The system should not consume lot of bandwidth so that the other applications will block for the internet. The system should provide secured access to the web server.
6.
PROJECT ANALYSIS
6.1 Overview:
Tetris is one of the few games that achieve ultimate popularity. It is remarkably simple, yet remarkably difficult. It's been ported to every computer and game console known to man, and has sold millions of cartridges, tapes, and disks across the land. Besides that, it also led to one of the most interesting legal battles in the history of video games, leading to the famed Tengen version of Tetris and to the downfall of a few companies. It's a pretty cool story, so let's get down to business. Hold on for a second while I set the time machine to cruise control Tetris has been involved in many legal battles. In June 1985, Alexey Pajitnov created Tetris on an Elektronika 60 while working for the Soviet Academy of Sciences at their Computer Center in Moscow with Dmitry Pavlovsky, and Vadim Gerasimov ported it to the IBM PC. Gerasimov reports that Pajitnov chose the name "Tetris" as "a combination of 'tetramino' and 'tennis'.
From there, the PC game exploded into popularity, and began spreading all around Moscow. This version is available on Gerasimov's web site. Meanwhile, before any legal rights were settled, the Spectrum HoloByte IBM PC version of Tetris was released in the United States in 1986. The game's popularity was tremendous, and many players were instantly hookedit was a software blockbuster, with reviews such as in Computer Gaming World calling the game "deceptively simple and insidiously addictive". The details of the licensing issues were uncertain by this point, but in 1987 Andromeda managed to obtain copyright licensing for the IBM PC version and any other home computer system. By 1988, the Soviet government began to market the rights to Tetris through an organization called Elektronorgtechnica, or "Elorg" for short. Pajitnov had granted his rights to the Soviet Government, via the Computer Center he worked at for ten years. By this time Elorg had still seen no money from Andromeda, and yet Andromeda was licensing and sub-licensing rights that they themselves did not even have. By 1989, half a dozen different companies claimed rights to create and distribute the Tetris software for home computers, game consoles, and handheld systems. Elorg, meanwhile, held that none of the companies were legally entitled to produce an arcade version, and signed those rights over to Atari Games, while it signed non-Japanese console and handheld rights over to Nintendo.
10
Pajitnov himself has made very little money from the deal, even though Nintendo profited greatly from the game. In 1996, The Tetris Company LLC (TTC) was formed in an effort to derive revenue from TetrisTTC is now the exclusive licensee of Tetris Holding, LLC, which owns copyright registrations for Tetris products in the United States and trademark registrations for Tetris in most every country in the world. Tetris Holding through TTC has licensed its intellectual property to a number of companies. The U.S. Court of International Trade and the U.S. Customs have at times issued seizure orders to preclude knock-off Tetris games from being imported into the U.S., despite bulletins circulated by the U.S. Copyright Office stating that copyright does not apply to the rules of a game. Due to the popularity of Tetris, there have also been many knock-off and lookalike games on the Internet, many with names confusingly similar to "Tetris". In order to stop this infringement, TTC and Tetris Holding have vigorously policed and enforced their rights and have sent cease-and-desist letters to websites that infringe the Tetris mark.
11
When first playing Tetris, brain function and activity increases, along with greater cerebral energy consumption, measured by glucose metabolic rate. As Tetris players become more proficient, their brains show a reduced consumption of glucose, indicating more efficient brain activity for this task. The game can also cause a repetitive stress symptom in that the brain will involuntarily picture Tetris combinations even when the player is not playing the game (the Tetris effect), although this can occur with any computer game showcasing repeated images or scenarios. In January 2009, an Oxford University research group headed by Dr Emily Holmes reported in PLoS ONE that for healthy volunteers, playing Tetris soon after viewing traumatic material in the laboratory reduced the number of flashbacks to those scenes in the following week. They believe that the computer game may disrupt the memories that are retained of the sights and sounds witnessed at the time, and which are later reexperienced through involuntary, distressing flashbacks of that moment. The group hope to develop this approach further as a potential intervention to reduce the flashbacks experienced in PTSD, but emphasized that these are only preliminary results.
12
7. PROJECT DESIGN
What is UML?
The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems, as well as for business modeling and other non-software systems. The UML represents a collection of best engineering practices that have proven successful in the modeling of large and complex systems. The UML is a very important part of developing objects oriented software and the software development process. The UML uses mostly graphical notations to express the design of software projects. Using the UML helps project teams communicate, explore potential designs, and validate the architectural design of the software.
Goals of UML:
The primary goals in the design of the UML were:
13
Provide users with a ready-to-use, expressive visual modeling language so they can develop and exchange meaningful models. Provide extensibility and specialization mechanisms to extend the core concepts. Be independent of particular programming languages and development processes. Provide a formal basis for understanding the modeling language. Encourage the growth of the OO tools market. Support higher-level development concepts such as collaborations, frameworks, patterns and components. Integrate best practices.
UML Diagrams:
UML diagram is designed to let developers and customers view a software system from a different perspective and in varying degrees of abstraction. UML diagrams commonly created in visual modeling tools include.
14
An actor is represents a user or another system that will interact with the system you are modeling. A use case is an external view of the system that represents some action the user might perform in order to complete a task.
15
16
Class diagrams are used in nearly all Object Oriented software designs. Use them to describe the Classes of the system and their relationships to each other.
17
to an object of class 2. Messages pass between the different objects until the object of class 1 receives the final message.
18
19
Activity diagrams describe the workflow behavior of a system. Activity diagrams are similar to state diagrams because activities are the state of doing something. The diagrams describe the state of activities by showing the sequence of activities performed. Activity diagrams can show activities that are conditional or parallel.
20
21
8. CODE IMPLEMENTATION
8.1 Android:
The Android platform is a software stack for mobile devices including an operating system, middleware and key applications. Developers can create applications for the platform using the Android SDK. Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use, which runs on top of a Linux kernel. An embarrassing bug found on the G1 Phone has been fixed by Google. After starting up the phone if a user then typed reboot, the phone would reboot. The bug was found accidentally by a user who happened to type Reboot into his phone. Google moved quickly to fix the problem, users in the US are already reporting having received the update and according to the BBC, users in the UK will have the update by 12th November. The G1 has had surprisingly few bugs for a phone that is based on a completely new platform and is the first phone to use it.
Android Architecture:
The following diagram shows the major components of the Android operating system. Each section is described in more detail below.
22
Applications:
Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language.
Application Framework:
Developers have full access to the same framework APIs used by the core applications. The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework). This same mechanism allows components to be replaced by the user. Underlying all applications is a set of services and systems, including: A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser
23
Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data A Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files A Notification Manager that enables all applications to display custom alerts in the status bar An Activity Manager that manages the life cycle of applications and provides a common navigation back stack
Libraries:
Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. Some of the core libraries are listed below: System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices Media Libraries - based on Packet Videos Open CORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view SGL - the underlying 2D graphics engine 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer FreeType - bitmap and vector font rendering SQLite - a powerful and lightweight relational database engine available to all applications
24
Android Runtime:
Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language. Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included "dx" tool. The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.
LINUX KERNEL:
Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.
25
So far this framework has typically been used to develop Ides (Integrated Development Environments), such as the highly-regarded Java IDE called Java Development Toolkit (JDT) and compiler that come as part of Eclipse (and which are also used to develop Eclipse itself). However, it can be used for other types of client application as well, see the popular Bit Torrent client for example.
The main properties of the Java, which made Java so popular, are as follows: Simple
26
standard form, the JVM is an interpreter for Byte code. This may come has a bit of surprise.
Java Platform:
One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any supported hardware/operating-system platform. One should be able to write a program once, compile it once, and run it anywhere. This is achieved by compiling the Java language code, not to machine code but to Java bytecode instructions analogous to machine code but intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. End-users commonly
27
use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets. Standardized libraries provide a generic way to access host specific features such as graphics, threading and networking. In some JVM versions, bytecode can be compiled to native code, either before or during program execution, resulting in faster execution. A major benefit of using bytecode is porting. However, the overhead of interpretation means that interpreted programs almost always run more slowly than programs compiled to native executables would, and Java suffered a reputation for poor performance. This gap has been narrowed by a number of optimisation techniques introduced in the more recent JVM implementations. One such technique, known as just-in-time (JIT) compilation, translates Java bytecode into native code the first time that code is executed, then caches it. This result in a program that starts and executes faster than pure interpreted code can, at the cost of introducing occasional compilation overhead during execution. More sophisticated VMs also use dynamic recompilation, in which the VM analyzes the behavior of the running program and selectively recompiles and optimizes parts of the program. Dynamic recompilation can achieve optimizations superior to static compilation because the dynamic compiler can base optimizations on knowledge about the runtime environment and the set of loaded classes, and can identify hot spots - parts of the program, often inner loops, that take up the most execution time. JIT compilation and dynamic recompilation allow Java programs to approach the speed of native code without losing portability.
28
Windows XP or Vista. Requirements also include Java Development Kit, Apache Ant, and Python 2.2 or later. The officially supported integrated development environment (IDE) is Eclipse (3.2 or later) using the Android Development Tools (ADT) Plug-in, though developers may use any text editor to edit Java and XML files then use command line tools to create, build and debug Android applications. A preview release of the Android software development kit (SDK) was released on 12 November 2007. On 15 July 2008, the Android Developer Challenge Team accidentally sent an email to all entrants in the Android Developer Challenge announcing that a new release of the SDK was available in a "private" download area. The email was intended for winners of the first round of the Android Developer Challenge. The revelation that Google was supplying new SDK releases to some developers and not others (and keeping this arrangement private) have led to widely reported frustration within the Android developer community. On 18 August 2008 the Android 0.9 SDK beta was released. This release provides an updated and extended API, improved development tools and an updated design for the home screen. Detailed instructions for upgrading are available to those already working with an earlier release. On 23 September 2008 the Android 1.0 SDK (Release 1) was released.[75] According to the release notes, it included "mainly bug fixes, although some smaller features were added". It also included several API changes from the 0.9 version. On March 9, 2009, Google released version 1.1 for the android dev phone. While there are a few aesthetic updates, a few crucial updates include support for "search by voice, priced apps, alarm clock fixes, sending gmail freeze fix, fixes mail notifications and refreshing intervals, and now the maps show business reviews". Another important update is that Dev phones can now access paid apps and developers can now see them on the Google marketplace.
29
9. TESTING
What is testing?
A process of executing a program with the explicit intention of finding errors, that is making the program fail. Testing is the process of detecting errors. Testing performs a very critical role for quality assurance and for ensuring the reliability of software. The results of testing are used later on during maintenance also.
Psychology of Testing
The aim of testing is often to demonstrate that a program works by showing that it has no errors. The basic purpose of testing phase is to detect the errors that may be present in the program. Hence one should not start testing it the intent of showing that a program works but the intent should be to show that a program does not work. Testing is the process of executing a program with the intent of finding errors.
Testing Objectives
The main objective of testing is to uncover a host of errors, systematically and with minimum effort and time. Stating formally, we can say, Testing is a process of executing a program with the intent of finding an error. A successful test is one that uncovers an as yet discovered error. A good test case is one that has a high probability of finding error, if it exists. The tests are inadequate to detect possibly present errors. The software more or les confirms to the quality and reliable standards.
Software Testing:
30
It is the process of testing the functionality and correctness of a software by running it. A good test case is the one that has a high probability of finding an as yet undiscovered error. A successful test is one that uncovers an as yet undiscovered error. Software testing is usually performed for one of the two reasons. Defect detection. Reliability estimation.
31
32
Levels of Testing:
In order to uncover the errors present in different phases we have the concept of levels of testing. The basic levels of testing are Client needs Requirements Design Code Acceptance Testing System Testing Integration Testing Unit Testing
Unit Testing:
It concentrates on each unit of the software as implemented in source code and is a white box oriented. Using the component level design description as a guide, important control paths are tested to uncover errors with in the boundary of the module. In the unit testing, the steps can be conducted in parallel for multiple components. In my project I tested all the modules individually related to main function codes and attacks also.
Integration Testing:
Here focus is on design and construction of the software architecture. Integration Testing is a systematic technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. The objective
33
is to take unit tested components and build a program structure that has been dictated by design. The goal here is to see if modules can be integrated properly, the emphasis being on testing interfaces between modules. This testing activity can be considered as testing the design and hence the emphasis on testing module interactions. In this project the main system is formed by integrating all the modules. When integrating all the modules I have checked whether the integration effects working of any of the services by giving different combinations of inputs with which the two services run perfectly before integration.
Validation Testing:
In this, requirements established as part of software requirement analysis are validated against the software that has been constructed i.e., validation succeeds when software functions in a manner that can reasonably expected by the customer.
System Testing:
System testing of software or hardware is testing conducted on a complete, integrated system to evaluate the system's compliance with its specified requirements. System testing falls within the scope of black box testing, and as such, should require no knowledge of the inner design of the code or logic. Here the entire software system is tested. The reference document for this process is the requirements document, and the goal is to see if software meets its requirements.
34
scripts, particularly when written. Written test cases are usually collected into test suites.
35
36
37
38
39
40
41
42
43
44
45
Currently the application only supports the Tetrominoes to drop from top to bottom, the application can also be extended to move Tetrominoes from bottom to top, the project can also be extended to have different levels, based on the level we can make Tetrominoes to drop at increasing speeds.
46
12. CONCLUSION
Finally we concluded that the QTetris is a game application developed on a new mobile platform Android, and for the users who loves playing games, it also helps users to get relaxed from heavy work.
47
13. BIBLIOGRAPHY
14. APPENDIX
48
.apk extension
The extension for an Android package file, which typically contains all of the files related to a single Android application. The file itself is a compressed collection of an AndroidManifest.xml file, application code (.dex files), resource files, and other files. A project is compiled into a single .apk file.
.dex extension
Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically translating compiled applications written in the Java programming language.
Action
A description of something that an Intent sender wants done. An action is a string value assigned to Intent. Action strings can be defined by Android or by a third-party developer. For example, android.intent.action.VIEW for a Web URL, or com.example.rumbler.SHAKE_PHONE for a custom application to vibrate the phone.
Activity
A single screen in an application, with supporting Java code, derived from the Activity class.
Adb
Android Debug Bridge, a command-line debugging application shipped with the SDK. It provides tools to browse the device, copy tools on the device, and forward ports for debugging. See Using adb for more information.
49
Application
A collection of one or more activities, services, listeners, and intent receivers. An application has a single manifest, and is compiled into a single .apk file on the device.
Content Provider
A class built on ContentProvider that handles content query strings of a specific format to return data in a specific format. See Reading and writing data to a content provider for information on using content providers.
Content URI
A type of URI. See the URI entry.
Dalvik
The name of Android's virtual machine. The Dalvik VM is an interpreter-only virtual machine that executes files in the Dalvik Executable (.dex) format, a format that is optimized for efficient storage and memory-mappable execution. The virtual machine is register-based, and it can run classes compiled by a Java language compiler that have been transformed into its native format using the included "dx" tool. The VM runs on top of Posix-compliant operating systems, which it relies on for underlying functionality (such as threading and low level memory management). The Dalvik core class library is intended to provide a familiar development base for those used to programming with Java Standard Edition, but it is geared specifically to the needs of a small mobile device.
DDMS
Dalvik Debug Monitor Service, a GUI debugging application shipped with the SDK. It provides screen capture, log dump, and process examination capabilities. See Using the Dalvik Debug Monitor Server to learn more about this program.
50
Drawable
A compiled visual resource that can be used as a background, title, or other part of the screen. It is compiled into an android.graphics.drawable subclass.
Intent
A class (Intent) that contains several fields describing what a caller would like to do. The caller sends this intent to Android's intent resolver, which looks through the intent filters of all applications to find the activity most suited to handle this intent. Intent fields include the desired action, a category, a data string, the MIME type of the data, a handling class, and other restrictions.
Intent Filter
Activities and intent receivers include one or more filters in their manifest to describe what kinds of intents or messages they can handle or want to receive. An intent filter lists a set of requirements, such as data type, action requested, and URI format, that the Intent or message must fulfill. For activities, Android searches for the activity with the most closely matching valid match between the Intent and the activity filter. For messages, Android will forward a message to all receivers with matching intent filters.
Intent Receiver
An application class that listens for messages broadcast by calling Context.sendBroadcast (). For example code, see Listening for and broadcasting global messages.
Layout resource
An XML file that describes the layout of an Activity screen.
Manifest
51
An XML file associated with each Application that describes the various activies, intent filters, services, and other items that it exposes. See AndroidManifest.xml File Details.
. URIs
Android uses URI strings both for requesting data (e.g., a list of contacts) and for requesting actions (e.g., opening a Web page in a browser). Both are valid URI strings, but have different values. All requests for data must start with the string "content://". Action strings are valid URIs that can be handled appropriately by applications on the device; for example, a URI starting with "http://" will be handled by the browser.
52