Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 54

HIGHER AND LOWER CARD GAMING

A Mini project report submitted in partial fulfillment of the requirements


for the award of the degree of

BACHELOR OF TECHNOLOGY
In

COMPUTER SCIENCE & ENGINEERING


By

B.PRIYANKA (17S45A0503)
N.M.JOSHMITHA (17S45A0504 )
M.HARISH (17S45A0502)

Under the Guidance of


Mr. D.ANJI REDDY
Associate Professor

Department of Computer Science & Engineering


VAAGESWARI COLLEGE OF ENGINEERING
(Affiliated to JNTU Hyderabad &Approved by AICTE)
Ramakrishna colony, Karimnagar-505481
2017-2020
DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING

VAAGESWARI COLLEGE OF ENGINEERING


(Affiliated to JNTU Hyderabad & Approved by AICTE)

Ramakrishna colony, Karimnagar-505 527

CERTIFICATE
This is certify to that the Mini project report entitled “HIGHER AND LOWER
CARD GAMING”, submitted by following students, in partial fulfillment of the
requirements for the award of the Degree of Bachelor of Technology in CSE, is a bonafied
record of the work performed by

B.PRIYANKA (17S45A0503)
N.M.JOSHMITHA (17S45A0504 )
M.HARISH (17S45A0502)

The work embodied in this mini project report has not been submitted to any other
institution for the award of any degree.

INTERNAL GUIDE HEAD OF DEPT

PRINCIPAL EXTERNAL EXAMINER


ACKNOWLEDGEMENT

The satisfaction that accomplishes the successful completion of any


task would be incomplete without the mention of the people who make it
possible and whose constant guidance and encouragement crown all efforts
with success.

We express our sincere thanks to Head of Department Mr. D.ANJI


REDDY, giving us moral support and his attention and valuable guidance to
us throughout this course.

We sincerely extends our thanks to Dr.CH.SRINIVAS, Principal of


Vaageswari College of Engineering, Karimnagar.

We would like to thank all the staff and all my friends for their good
wishes, their helping hand constructive criticism, which led the successful
completion of this mini project report.

We immensely indebted to my parents, brother and sister for their


love and unshakable belief in our and understanding and ever decreasing
grudges for not spending time more often. We will now, since the excuse is
in the process of Vanishing by being printed on this every pages.
Finally, We thank all those who directly and indirectly helped us in
this regard we apologize for not listing everyone here.
ABSTRACT
This app is developed for the android game users for their interest on gaming with 3G
features of android. This game belongs to the category of deck of cards. When the player
click on start button randomly generated card is displayed with lower and higher options.
When user clicks on lower, if the next generated number is lower than the current number,
score of 5 will be added to the initial score of zero and will proceed similarly for higher but
the next generated number should be higher than the current number. If user assumption is
wrong, than will be given with save option , to save the score in the database. Also user can
view the top 5 scores of the game of the same device app.

In android mobile we don't have such a game to test the assumptions of the users
based on the card gaming, specifying higher or lower numbering, maintaining and viewing
the scores of already played game scorers. In our proposed system we are going to develop an
android app, which helps users to play the game of card with assumptions on higher and
lower numbering on it. If the user clicks on higher the number generated should be greater
than the current number and vice versa. Also user can view the top 5 game scores.
CONTENTS PAGE NO
CHAPTER 1
INTRODUCTION 1
1.1 Purpose 1

1.2 Scope 1

1.3 Project review 1

CHAPTER 2
SYSTEM ANALYSIS 2

2.1 Existing System 2

2.2 Proposed System 2

2.3 Operating Environment 2

2.4 Design and Important constraints 2

2.4.1 User Interface 3

2.4.2 User Documentation 3

2.4.3 User Classes & Characteristics 3

2.5 Document Conventions 3

2.5.1 Module Description 3

CHAPTER 3
SYSTEM DESIGN 5

3.1 Software Design 5

3.2 Input/Output Designs 5

3.3UML DIAGRAMS 6

3.3 UML Concepts 6

3.4 Building Block of the UML 6


3.5 Things in the UML 7

3.6 Relationships in the UML 8

3.7 Sequence Diagrams 9

3.8 Use case Diagram 11

3.9 Activity Diagram 12

3.10 Class diagram 14

3.11 Objet Diagram 16


3.12 Deployment Diagram
21
CHAPTER 4

IMPLEMENTATION 22

Overview of Software Development Tools 22

TECHNOLOGY 23

4.1 Java and its features 23

4.2 Java overview 23

4.3 Android 24

4.4 Features 24

4.4.1 Android Application 24

4.4.2 Libraries 25

4.4.3 Android Runtime 25

4.5 Developing in eclipse with ADT 26

4.5.1 Creating an Android project 27

4.5.2 Running your application 29


4.5.3 Creating an AVD 29
4.5.4 Creating a run configuration 31

4.6 Designing 32
4.6.1 Designing for performance 32

4.6.2 Introduction 32

4.6.3 Avoid creating objects 33

4.6.4 Use native methods 33

4.6.5 Declare constants final 36

4.6.6 Do converse the device battery 39

CHAPTER 5
TESTING 40

5.1 Software Testing 40


5.2 Testing Phases 40

5.2.1 Testing activities 40

5.3 Test Case Design 42

5.3.1 White-box testing 43

5.3.2 Black-box testing 43

CHAPTER 6
OUTPUT SCREENS 44

CHAPTER 7
CONCLUSION 48

BIBILOGRAPHY 49
LIST OF FIGURES

IG.NO DESCRIPTION PAGE


NO
3.1 An actor in a use case diagram 11

3.2 Use cases in a use case diagram 12

3.3 Use case diagram 13

3.4 Class diagram 15

3.5 Object diagram 17

3.6 Sequence diagram 18

3.7 Activity diagram 19


3.8 Deployment diagram 21
CHAPTER 1

INTRODUCTION

1.1 Purpose
This app is developed for the android game users for their interest on gaming with 3G
features of android. This game belongs to the category of deck of cards. When the player click
on start button randomly generated card is displayed with lower and higher options. When
user clicks on lower, if the next generated number is lower than the current number, score of 5
will be added to the initial score of zero and will proceed similarly for higher but the next
generated number should be higher than the current number. If user assumption is wrong, than
will be given with save option , to save the score in the database. Also user can view the top 5
scores of the game of the same device app.

1.2 Scope
One of the fastest growing industries now a days is mobile industry. There are many
competitors in this area who are doing research and development on new platforms & user
experience. One such technology is Android from Google which is supported for Google
phones. These phones are described as next Generation mobiles [As described by Google].
This application Higher lower card game can be used by any Android mobile user.

1.3 Project Overview


Android is a software stack for mobile devices that includes an operating system,
middleware and key applications. The Android SDK provides the tools and APIs necessary to
begin developing applications on the Android platform using the Java programming language.
The Android SDK includes a comprehensive set of development tools. Requirements include
Java Development Kit, 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.

CHAPTER 2
SYSTEM ANALYSIS
Problem Definition

2.1 Existing System:

In android mobile we don't have such a game to test the assumptions of the users based
on the card gaming, specifying higher or lower numbering, maintaining and viewing the
scores of already played game scorers.

2.2 Proposed System:

In the proposed system we are going to develop an android app, which helps users to
play the game of card with assumptions on higher and lower numbering on it. If the user clicks
on higher the number generated should be greater than the current number and vice versa.
Also user can view the top 5 game scores.

2.3 Operating Environment:


Software Requirements are Windows as Operating System, Linux operating system.
Java 2 standard edition, Eclipse with AdtPlugin,android-sdk2.3. For the base SDK package, at
least 600MB of available disk space. For each platform downloaded into the SDK, an
additional 100MB is needed.

Hardware Requirements are Ram is 1GB Ram and above ,Hard Disk is 50GB and aboveAnd
Processor is Dual core and above.

2.4 Design and Implementation Constraints


All modules are coded thoroughly based on requirements from software organization.
The software is designed in such a way that the user can easily interact with the screen.
Software is designed in such a way that it can be extended to the real time business.

2.4.1 User Interfaces:

This application include GUI standards or product family style guides that are to be
followed, screen layout constraints, buttons and functions that will appear on every screen,
display standards, and so on.

2.4.2 User Documentation


In our user manual we are going to keep the information regarding our product, which
can be understandable by a new person who is going to use it. If a new person is using it,
online help will be provided in that. We are going to explain each and every step clearly about
our product so that any user can easily understand it.

2.4.3 User Classes and Characteristics


End user of the application is the mobile phone user. This game belongs to the
category of deck of cards. When the player click on start button randomly generated card is
displayed with lower and higher options. When user clicks on lower, if the next generated
number is lower than the current number, score of 5 will be added to the initial score of zero
and will proceed similarly for higher but the next generated number should be higher than the
current number. If user assumption is wrong, than will be given with save option.

2.5 Document Conventions


To prepare this SRS we had used the lettering style of Times New Roman and Font
size for sub headings is 14 with bold. The matter which is mentioned in this SRS is 12 with a
lettering style Times New Roman. Then headings are of lettering style Times New Roman
with Font size 12.

2.5.1 Module Description


The following are the modules in the system.

1. Starting Game :

This particular module helps user to start the game , which shows the current
random number on the card with initial score as zero.

2. Choosing Higher or Lower Card:


This module helps user to select any one option higher or lower based on his/her
assumptions

3. Changing Number:

This module generates the random number on the user click on higher or lower.

4. High Score Checker:

This module displays user with the top 5 game scorers by referring the database.
Technologies used:

Language : Java ,android SDK 2.3

IDE : Eclipse

Operating System : Windows Xp and above

Hardware Requirements:
Ram : 1GB Ram and above
Hard Disk : 50GB and above
Processor : Dual core and above
CHAPTER - 3
SYSTEM DESIGN
System design is transition from a user oriented document to programmers or data base personnel.
The design is a solution, how to approach to the creation of a new system. This is composed of several
steps. It provides the understanding and procedural details necessary for implementing the system
recommended in the feasibility study. Designing goes through logical and physical stages of development,
logical design reviews the present physical system, prepare input and output specification, details of
implementation plan and prepare a logical design walkthrough.

3.1 SOFTWARE DESIGN

In designing the software following principles are followed:

1. Modularity and partitioning: software is designed such that, each system should consists of
hierarchy of modules and serve to partition into separate function.

2. Coupling: modules should have little dependence on other modules of a system.

3. Cohesion: modules should carry out in a single processing function.

4. Shared use: avoid duplication by allowing a single module is called by other that need the function it
provides

3.2 INPUT/OUTPUT DESIGNS

Input design:
Considering the requirements, procedures to collect the necessary input data in most efficiently
designed. The input design has been done keeping in view that, the interaction of the user with the system
being the most effective and simplified way.

Also the measures are taken for the following

■ Controlling the amount of input


■ Avoid unauthorized access to the Universal Dossier
■ Eliminating extra steps
■ Keeping the process simple
■ At this stage the input forms and screens are designed.

Output design:
All the screens of the system are designed with a view to provide the user with easy operations in
simpler and efficient way, minimum key strokes possible. Instructions and important information is
emphasized on the screen. Almost every screen is provided with no error and important messages and
option selection facilitates. Emphasis is given for speedy processing and speedy transaction between the
screens. Each screen assigned to make it as much user friendly as possible by using interactive procedures.
So to say user can operate the system without much help from the operating manual.

3.3 UML DIAGRAMS

3.3 UML Concepts

The Unified Modelling Language (UML) is a standard language for writing software blue prints.

The UML is a language for

• Visualizing
• Specifying
• Constructing
• Documenting the artefacts of a software intensive system.
The UML is a language which provides vocabulary and the rules for combining words in that vocabulary
for the purpose of communication. A modelling language is a language whose vocabulary and the rules
focus on the conceptual and physical representation of a system. Modelling yields an understanding of a
system.

3.4 Building Blocks of the UML:

The vocabulary of the UML encompasses three kinds of building blocks:

• Things
• Relationships
• Diagrams
Things are the abstractions that are first-class citizens in a model; relationships tie these things together;
diagrams group interesting collections of things.

3.5 Things in the UML:

There are four kinds of things in the UML:

• Structural things
• Behavioral things
• Grouping things
• Annotational things
Structural things are the nouns of UML models. The structural things used in the project design are:

First, a use case is a description of set of sequence of actions that a system performs that yields an
observable result of value to particular actor.

Fig: Use Cases

Second, a node is a physical element that exists at runtime and represents a computational resource,
generally having at least some memory and often processing capability.

Fig: Nodes

Behavioural things are the dynamic parts of UML models. The behavioural thing used is:

Interaction:

An interaction is a behaviour that comprises a set of messages exchanged among a set of objects
within a particular context to accomplish a specific purpose. An interaction involves a number of other
elements, including messages, action sequences (the behaviour invoked by a message, and links (the
connection between objects).

display

3.6 Relationships in the UML:

There are four kinds of relationships in the UML:

• Dependency
• Association
• Generalization
• Realization
A dependency is a semantic relationship between two things in which a change to one thing may affect
the semantics of the other thing (the dependent thing).

---------------->

Fig: Dependencies

An association is a structural relationship that describes a set links, a link being a connection
among objects. Aggregation is a special kind of association, representing a structural relationship between
a whole and its parts.

Fig: Association

A generalization is a specialization/ generalization relationship in which objects of


the specialized element (the child) are substitutable for objects of the generalized element.

------------------------------

Fig: Generalization

A realization is a semantic relationship between classifiers, where in one classifier specifies a


contract that another classifier guarantees to carry out.

Fig: Realization
3.7 Sequence Diagrams:
UML sequence diagrams are used to represent the flow of messages, events and actions between
the objects or components of a system. Time is represented in the vertical direction showing the sequence
of interactions of the header elements, which are displayed horizontally at the top of the diagram.

Sequence Diagrams are used primarily to design, document and validate the architecture,
interfaces and logic of the system by describing the sequence of actions that need to be performed to
complete a task or scenario. UML sequence diagrams are useful design tools because they provide a
dynamic view of the system behaviour which can be difficult to extract from static diagrams or
specifications.
Actor

Represents an external person or entity that interacts with the system

f
User

Object

Represents an object in the system or one of its components

aStudent
-------1----

Unit

Represents a subsystem, component, unit, or other logical entity in the system (may or may not be
implemented by objects)

Separator

Represents an interface or boundary between subsystems, components or units (e.g., air interface,
Internet, network)

Separator

Group

Groups related header elements into subsystems or components

Group
3.8 Use Case Diagram
A use case diagram is a graph of actors set of use cases enclosed by a system boundary,
communication associations between the actors and users and generalization among use cases. The use
case model defines the outside(actors) and inside(use case) of the system's behavior.

Use case diagram is quite simple in nature and depicts two types of elements: one representing the
business roles and the other representing the business processes.

Ductor Patient

Figure 3.1: an actor in a use case diagram

To identify an actor, search in the problem statement for business terms that portray roles in the
system. For example, in the statement "patients visit the doctor in the clinic for medical tests," "doctor"
and "patients" are the business roles and can be easily identified as actors in the system.

Use case: A use case in a use case diagram is a visual representation of a distinct business functionality in
a system. The key term here is "distinct business functionality." To choose a business process as a likely
candidate for modelling as a use case, you need to ensure that the business process is discrete in nature.

As the first step in identifying use cases, you should list the discrete business functions in your
problem statement. Each of these business functions can be classified as a potential use case. Remember
that identifying use cases is a discovery rather than a creation. As business functionality becomes clearer,
the underlying use cases become more easily evident. A use case is shown as an ellipse in a use case
diagram (see Figure 3.2).

Figure 3.2: use cases in a use case diagram

Figure 3.2 shows two uses cases: "Make appointment" and "Perform medical tests" in the use case
diagram of a clinic system. As another example, consider that a business process such as "manage patient
records" can in turn have sub-processes like "manage patient's personal information" and "manage
patient's medical information." Discovering such implicit use cases is possible only with a thorough
understanding of all the business processes of the system through discussions with potential users of the
system and relevant domain knowledge

3.9 Activity Diagram

Activity diagrams represent the business and operational workflows of a system. An Activity
diagram is a dynamic diagram that shows the activity and the event that causes the object to be in the
particular state.

So, what is the importance of an Activity diagram, as opposed to a State diagram? A State diagram
shows the different states an object is in during the lifecycle of its existence in the system, and the
transitions in the states of the objects. These transitions depict the activities causing these transitions,
shown by arrows.

An Activity diagram talks more about these transitions and activities causing the changes in the
object states.

Use Case Diagram

A use case diagram is a graph of actors set of use cases enclosed by a system boundary,
communication associations between the actors and users and generalization among use cases. The use
case model defines the outside(actors) and inside(use case) of the system's behavior.
Fig .3.3 Use Case Diagram
3.10 Class Diagram

An object is any person, place, thing, concept, event, screen, or report applicable to your system.
Objects both know things (they have attributes) and they do things (they have methods).

A class is a representation of an object and, in many ways; it is simply a template from which
objects are created. Classes form the main building blocks of an object-oriented application. Although
thousands of students attend the university, you would only model one class, called Student, which would
represent the entire collection of students.

Responsibilities

Classes are typically modeled as rectangles with three sections: the top section for the name of the
class, the middle section for the attributes of the class, and the bottom section for the methods of the class.
Attributes are the information stored about an object, while methods are the things an object or class do.
For example, students have student numbers, names, addresses, and phone numbers. Those are all
examples of the attributes of a student. Students also enroll in courses, drop courses, and request
transcripts. Those are all examples of the things a student does, which get implemented (coded) as
methods. You should think of methods as the object-oriented equivalent of functions and procedures.
Class diagram

Fig 3.4 Class Diagram


3.11 Object diagram

An object diagram in the Unified Modeling Language (UML), is a diagram that shows a complete
or partial view of the structure of a modeled system at a specific time.

An Object diagram focuses on some particular set of object instances and attributes, and the links
between the instances. A correlated set of object diagrams provides insight into how an arbitrary view of a
system is expected to evolve over time. Object diagrams are more concrete than class diagrams, and are
often used to provide examples, or act as test cases for the class diagrams. Only those aspects of a model
that are of current interest need be shown on an object diagram. State chart diagram

State chart diagram is used to describe the states of different objects in its life cycle. So the
emphasis is given on the state changes upon some internal or external events. These states of objects are
important to analyze and implement them accurately.State chart diagrams are very important for describing
the states. States can be identified as the condition of objects when a particular event occurs.

Before drawing a State chart diagram we must have clarified the following points:

• Identify important objects to be analyzed.

• Identify the states.

• Identify the events.


Fig 3.5 Object Diagram
Sequence Diagram

Fig 3.6 Sequence Diagram


Activity Diagram

Fig 3.7 Activity Diagram


State Chart Diagram

Fig State Chart Diagram

application [ database
gui

Fig: Component Diagram


3.12 Deployment Diagram

Deployment diagrams are used to visualize the topology of the physical components
of a system where the software components are deployed.So deployment diagrams are used
to describe the static deployment view of a system. Deployment diagrams consist of nodes
and their relationships.The purpose of deployment diagrams can be described as:

application server

database

Fig.3.8 Deployment Diagram


CHAPTER -4

IMPLEMENTATION

OVERVIEW OF SOFTWARE DEVELOPMENT TOOLS Software

The life-cycle paradigm demands a systematic, sequential approach to software


development that begins at the system level and progresses through requirements analysis,
design, coding, testing and maintenance.

a) Analysis Phase:

The analysis phase consists of two sub phases: planning and requirements definition.
During planning the activities that are performed are - understand the customer's problem,
developing a recommended solution. Requirements definition is concerned with identifying
the basic functions of a software component in a hardware/software/people system.

b) Design Phase:

Design is concerned with identifying software components, specifying relationships


among components, maintaining a record of design decisions. Design consists of architectural
design and detailed design.

i) Architectural Design involves identifying the software components, decoupling and


decomposing them in to processing modules and conceptual data structures and specifying the
interconnection between the components.

ii) Detailed Design is concerned with the details of how to package the processing modules
and how to implement the processing algorithms, data structures and interconnection between
them

c) Implementation Phase:

The implementation phase of software development involves translation of design


specifications source code and debugging, documentation and unit testing of the source code.

d) Testing Phase:

It involves two kinds of testing:

i) In integration testing the individual program units or programs are integrated and tested.
ii) Acceptance Testing involves planning and execution of various types of tests in order to
demonstrations that the implemented software satisfies the stated requirements.

TECHNOLOGY

4.1 Java and it's features

Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank and
Mike Sheridan at SUN Microsystems Incorporation in the year 1991.It took 18 months to
develop the 1st working version. This language was initially called “OAK”, but was renamed
“JAVA” in 1995, many more contributed to the design and evolution of the language.

4.2 Java overview

Java is a powerful but lean object-oriented programming language. It has generated a


lot of excitement because it makes it possible to program for Internet by creating Applets.
Programs that can be embedded in web page. The context of an applet can be an animation
with sound, an interactive game or a ticker tape. With constantly updated stock prices. Applets
can be just little decorations to liven up web page, or they can be serious applications like
Word processor or Spreadsheet.

But Java is more than a programming language for writing Applets. It is being used
more and more for writing standalone applications as well. It is becoming so popular that
many people believe it will become standard language for both general purpose and Internet
programming.

Java is simple, elegant, and powerful and easy-to-use.

Java is actually a platform consisting of 3 components:

Java Programming Language.

Java Library of Classes and Interfaces.

4.3 Android
Android is a software stack for mobile devices that includes an operating system,
middleware and key applications. The android SDK provides the tools and APIs necessary to
begin developing applications on the Android platform using the Java programming language.

4.4 Features
Application framework enabling reuse and replacement of components
> Dalvik virtual machine optimized for mobile devices

> Integrated browser based on the open source WebKit 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
> Media support for common audio, video, and still image formats (MPEG4, H.264,
MP3, AAC, AMR, JPG, PNG, GIF)

> GSM Telephony (hardware dependent)


> Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
> Camera, GPS, compass, and accelerometer (hardware dependent)
> Rich development environment including a device emulator, tools for debugging,
memory and performance profiling, and a plug-in for the Eclipse IDE

4.4.1 Android application

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.

4.4.2 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 Video's 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

Free Type - bitmap and vector font rendering

SQLite - a powerful and lightweight relational database engine available to all applications

4.4.3 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 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.

An Android code editor that helps you write valid XML for your Android manifest and
resource files. It will even export your project into a signed APK, which can be distributed to
users.

To begin developing Android applications in the Eclipse IDE with ADT, you first need
to download the Eclipse IDE and then download and install the ADT plugin. To do so, follow
the steps given in Installing the ADT Plugin.

4.5 Developing in eclipse with ADT:

The Android Development Tools (ADT) plug-in for Eclipse adds powerful extensions
to the Eclipse integrated development environment. It allows you to create and debug Android
applications easier and faster. If you use Eclipse, the ADT plug-in gives you an incredible
boost in developing Android applications:

It gives you access to other Android development tools from inside the Eclipse IDE.
For example, ADT lets you access the many capabilities of the DDMS tool: take screenshots,
manage port-forwarding, set breakpoints, and view thread and process information directly
from Eclipse.

It provides a New Project Wizard, which helps you quickly create and set up all of the
basic files you'll need for a new Android application. It automates and simplifies the process
of building your Android application.

4.5.1 Creating an Android project

The ADT plugin provides a New Project Wizard that you can use to quickly create a new
Android project (or a project from existing code). To create a new project:

1. Select File > New > Project.


2. Select Android > Android Project, and click Next.
3. Select the contents for the project:

Enter a Project Name. This will be the name of the folder where your project is created.

Under Contents, select Create new project in workspace . Select your project workspace
location.

Under Target, select an Android target to be used as the project's Build Target. The
Build Target specifies which Android platform you'd like your application built against.

Unless you know that you'll be using new APIs introduced in the latest SDK, you
should select a target with the lowest platform version possible, such as Android 1.1.

Note: You can change your the Build Target for your project at any time: Right-click the
project in the Package Explorer, select Properties, select Android and then check the desired
Project Target.
Under Properties, fill in all necessary fields.

Enter an Application name. This is the human-readable title for your application — the name
that will appear on the Android device.

Enter a Package name. This is the package namespace (following the same rules as for
packages in the Java programming language) where all your source code will reside.

Select Create Activity (optional, of course, but common) and enter a name for your main
Activity class.

Enter a Min SDK Version. This is an integer that indicates the minimum API Level required to
properly run your application. Entering this here automatically sets the min Sdk Version
attribute in the <uses-sdk> of your Android Manifest file. If you're unsure of the appropriate
API Level to use, copy the API Level listed for the Build Target you selected in the Target tab.

4. Click Finish.
5. Once you complete the New Project Wizard, ADT creates the following folders and
files in your new project:

src/

Includes your stub Activity Java file. All other Java files for your application go here.

<Android Version>/ (e.g., Android 1.1/)

Includes the android.jar file that your application will build against. This is determined
by the build target that you have chosen in the New Project Wizard.

gen/

This contains the Java files generated by ADT, such as your R.java file and interfaces
created from AIDL files.

assets/

This is empty. You can use it to store raw asset files. See Resources and Assets.

res/

A folder for your application resources, such as drawable files, layout files, string
values, etc. See Resources and Assets.

AndroidManifest.xml
The Android Manifest for your project. See The AndroidManifest.xml File.

Default Properties

This file contains project settings, such as the build target. This files is integral to the
project, as such, it should be maintained in a Source Revision Control system. It should
never be edited manually — to edit project properties, right-click the project folder and
select "Properties".

4.5.2 Running your application:

Before you can run your application on the Android Emulator, you must create an
Android Virtual Device (AVD). An AVD is a configuration that specifies the Android
platform to be used on the emulator. You can read more in the Android Virtual Devices
document, but if you just want to get started, follow the simple guide below to create an AVD.

4.5.3 Creating an AVD:

With ADT 0.9.3 and above, the Android SDK and AVD Manager provides a simple
graphical interface for creating and managing AVDs. (If you're using ADT version 0.9.1 or
older, you must use the android tool to create your AVDs—read the AVD guide to Creating an
AVD.)

To create an AVD with the AVD Manager:

Select Window > Android SDK and AVD Manager, or click the Android SDK and AVD
Manager icon (a black device) in the Eclipse toolbar.

In the Virtual Devices panel, you'll see a list of existing AVDs. Click New to create a new
AVD.

Fill in the details for the AVD.

Give it a name, a platform target, an SD card image (optional), and a skin (HVGA is default).

Click Create AVD.

Your AVD is now ready and you can close the AVD Manager. In the next section, you'll see
how the AVD is used when launching your application on an emulator.
For more information about AVDs, read the Android Virtual Devices documentation.

Running your application:

Note: Before you can run your application, be sure that you have created an AVD with
a target that satisfies your application's Build Target. If an AVD cannot be found that meets
the requirements of your Build Target, you will see a console error telling you so and the
launch will be aborted.

To run (or debug) your application, select Run > Run (or Run > Debug) from the
Eclipse main menu. The ADT plugin will automatically create a default launch configuration
for the project.

When you choose to run or debug your application, Eclipse will perform the following:

Compile the project (if there have been changes since the last build).

Create a default launch configuration (if one does not already exist for the project).

Install and start the application on an emulator or device (based on the Deployment
Target defined by the run configuration).

By default, Android application run configurations use an "automatic target" mode for
selecting a device target. For information on how automatic target mode selects a deployment
target, see Automatic and manual target modes below.

If debugging, the application will start in the "Waiting For Debugger" mode. Once the
debugger is attached, Eclipse will open the Debug perspective.

To set or change the launch configuration used for your project, use the launch configuration
manager. See Creating a Launch Configuration for information.

4.5.4 Creating a run configuration:

The run configuration specifies the project to run, the Activity to start, the emulator
options to use, and so on. When you first run a project as an Android Application, ADT will
automatically create a run configuration. The default run configuration will launch the default
project Activity and use automatic target mode for device selection (with no preferred AVD).
If the default settings don't suit your project, you can customize the launch configuration or
even create a new.

To create or modify a launch configuration, follow these steps as appropriate for your Eclipse
version:

Open the run configuration manager.

In Eclipse 3.3 (Europa), select Run > Open Run Dialog (or Open Debug Dialog)

In Eclipse 3.4 (Ganymede), select Run > Run Configurations (or Debug Configurations)

Expand the Android Application item and create a new configuration or open an existing one.

To create a new configuration:

Select Android Application and click the New launch configuration icon above the list (or,
right-click Android Application and click New).

Enter a Name for your configuration.

In the Android tab, browse and select the project you'd like to run with the configuration.

To open an existing configuration, select the configuration name from the list nested below
Android Application.

Adjust your desired launch configuration settings.

In the Target tab, consider whether you'd like to use Manual or Automatic mode when
selecting an AVD to run your application. See the following section on Automatic and manual
target modes).

You can specify any emulator options to the Additional Emulator Command Line Options
field. For example, you could add -scale 96dpi to scale the AVD's screen to an accurate size,
based on the dpi of your computer monitor. For a full list of emulator options, see the Android
Emulator document.

4.6 Designing:

4.6.1 Designing for performance:


An Android application should be fast. Well, it's probably more accurate to say that it
should be efficient. That is, it should execute as efficiently as possible in the mobile device
environment, with its limited computing power and data storage, smaller screen, and
constrained battery life.

4.6.2 Introduction:
Some would argue that much of the advice on this page amounts to "premature
optimization." While it's true that micro-optimizations sometimes make it harder to develop
efficient data structures and algorithms, on embedded devices like handsets you often simply
have no choice. For instance, if you bring your assumptions about VM performance on
desktop machines to Android, you're quite likely to write code that exhausts system memory.
This will bring your application to a crawl — let alone what it will do to other programs
running on the system!

That's why these guidelines are important. Android's success depends on the user
experience that your applications provide, and that user experience depends in part on whether
your code is responsive and snappy, or slow and aggravating. Since all our applications will
run on the same devices, we're all in this together, in a way. Think of this document as like the
rules of the road you had to learn when you got your driver's license: things run smoothly
when everybody follows them, but when you don't, you get your car smashed up.

Before we get down to brass tacks, a brief observation: nearly all issues described
below are valid whether or not the VM features a JIT compiler. If I have two methods that
accomplish the same thing, and the interpreted execution of foo () is faster than bar (), then the
compiled version of foo() will probably be as fast or faster than compiled bar(). It is unwise to
rely on a compiler to "save" you and make your code fast enough.

4.6.3 Avoid creating objects:

Object creation is never free. A generational GC with per-thread allocation pools for
temporary objects can make allocation cheaper, but allocating memory is always more
expensive than not allocating memory.

If you allocate objects in a user interface loop, you will force a periodic garbage
collection, creating little "hiccups" in the user experience.

When extracting strings from a set of input data, try to return a substring of the original
data, instead of creating a copy. You will create a new String object, but it will share the char[]
with the data.

If you have a method returning a string, and you know that its result will always be
appended to a String Buffer anyway, change your signature and implementation so that the
function does the append directly, instead of creating a short-lived temporary object.

An array of ints is a much better than an array of Integers, but this also generalizes to
the fact that two parallel arrays of ints are also a lot more efficient than an array of (int,int)
objects. The same goes for any combination of primitive types.

4.6.4 Use native methods:

When processing strings, don't hesitate to use specialty methods like String.indexOf (),
String.lastIndexOf (), and their cousins. These are typically implemented in C/C++ code that
easily runs 10-100x faster than doing the same thing in a Java loop.

The flip side of that advice is that punching through to a native method is more
expensive than calling an interpreted method. Don't use native methods for trivial
computation, if you can avoid it.

Prefer Virtual Over Interface:


Suppose you have a HashMap object. You can declare it as a HashMap or as a generic
Map:

Map myMap1 = new HashMap();

HashMap myMap2 = new HashMap();

Which is better?

Conventional wisdom says that you should prefer Map, because it allows you to
change the underlying implementation to anything that implements the Map interface.
Conventional wisdom is correct for conventional programming, but isn't so great for
embedded systems. Calling through an interface reference can take 2x longer than a virtual
method call through a concrete reference.

If you have chosen a HashMap because it fits what you're doing, there is little value in
calling it a Map. Given the availability of IDEs that refractor your code for you, there's not
much value in calling it a Map even if you're not sure where the code is headed. (Again,
though, public APIs are an exception: a good API usually trumps small performance
concerns.)

Cache Field Lookup:


Accessing object fields is much slower than accessing local variables. Instead of writing:

for (int i = 0; i < this.mCount; i++)

dumpItem(this.mItems[i]);

You should write: int count = this.mCount;

Item[] items = this.mItems;

for (int i = 0; i < count; i++)

(We're using an explicit "this" to make it clear that these are member variables.)

A similar guideline is never call a method in the second clause of a "for" statement.
For example, the following code will execute the getCount() method once per iteration, which
is a huge waste when you could have simply cached the value as an int:

for (int i = 0; i < this.getCount(); i++)

dumpItems(this.getItem(i));

It's also usually a good idea to create a local variable if you're going to be accessing an
instance field more than once. For example:

protected void drawHorizontalScrollBar(Canvas canvas, int width, int height) {

if (isHorizontalScrollBarEnabled()) {

int size = mScrollBar.getSize(false);

if (size <= 0) {

size = mScrollBarSize;

}
mScrollBar.setBounds(0, height - size, width, height);

mScrollBar.setParams(

computeHorizontalScrollRange(),

computeHorizontalS crollOffset(),

computeHorizontalScrollExtent(), false);

mScrollBar.draw(canvas);

}
That's four separate lookups of the member field mScrollBar. By caching mScrollBar
in a local stack variable, the four member field lookups become four stack variable references,
which are much more efficient.

Incidentally, method arguments have the same performance characteristics as local variables.

4.6.5 Declare Constants Final: Consider the following declaration at the top of a class:

static int intVal = 42;

static String strVal = "Hello, world!";


The compiler generates a class initializer method, called <clinit>, that is executed
when the class is first used. The method stores the value 42 into intVal, and extracts a
reference from the classfile string constant table for strVal. When these values are referenced
later on, they are accessed with field lookups.

We can improve matters with the "final" keyword:

static final int intVal = 42;

static final String strVal = "Hello, world!";


The class no longer requires a <clinit> method, because the constants go into classfile
static field initializes, which are handled directly by the VM. Code accessing intVal will use
the integer value 42 directly, and accesses to strVal will use a relatively inexpensive "string
constant" instruction instead of a field lookup.
Declaring a method or class "final" does not confer any immediate performance
benefits, but it does allow certain optimizations. For example, if the compiler knows that a
"getter" method can't be overridden by a sub-class, it can inline the method call.

You can also declare local variables final. However, this has no definitive performance
benefits. For local variables, only use "final" if it makes the code clearer (or you have to, e.g.
for use in an anonymous inner class).

Designing For Responsiveness:


It's possible to write code that wins every performance test in the world, but still sends
users in a fiery rage when they try to use the application. These are the applications that aren't
responsive enough — the ones that feel sluggish, hang or freeze for significant periods, or take
too long to process input.

In Android, the system guards against applications that are insufficiently responsive
for a period of time by displaying a dialog to the user, called the Application Not Responding
(ANR) dialog. The user can choose to let the application continue, but the user won't
appreciate having to act on this dialog every time he or she uses your application. So it's
important to design responsiveness into your application, so that the system never has cause to
display an ANR to the user.

Designing for Seamlessness:

A common seamlessness problem is when an application's background process — for


example, a service or broadcast receiver — pops up a dialog in response to some event. This
may seem like harmless behavior, especially when you are building and testing your
application in isolation, on the emulator. However, when your application is run on an actual
device, your application may not have user focus at the time your background process displays
the dialog. So it could end up that your application would display it's dialog behind the active
application, or it could take focus from the current application and display the dialog in front
of whatever the user was doing (such as dialing a phone call, for example). That behavior
would not work for your application or for the user.

To avoid these problems, your application should use the proper system facility for
notifying the user — the Notification classes. Using notifications, your application can signal
the user that an event has taken place, by displaying an icon in the status bar rather than taking
focus and interrupting the user.

Don't Interrupt The User:


If the user is running an application (such as the Phone application during a call) it's a
pretty safe bet he did it on purpose. That's why you should avoid spawning activities except in
direct response to user input from the current Activity.

If you have long-running code, running it inline in your Activity will run it on the
event handler thread, effectively blocking the event handler. This will delay input processing,
and result in the ANR dialogs. To avoid this, move your computations to a thread. This Design
for Responsiveness document discusses how to do that.

Design your UI to work with multiple screen resolutions:


Different Android-powered devices will support different screen resolutions. Some
will even be able to change resolutions on the fly, such as by switching to landscape mode. It's
important to make sure your layouts and drawables are flexible enough to display properly on
a variety of device screens.

Fortunately, this is very easy to do. In brief, what you must do is provide different
versions of your artwork (if you use any) for the key resolutions, and then design your layout
to accommodate various dimensions. (For example, avoid using hard-coded positions and
instead use relative layouts.) If you do that much, the system handles the rest, and your
application looks great on any device.

Don't assume touch screen or key board:


Android will support a variety of handset form-factors. That's a fancy way of saying
that some Android devices will have full "QWERTY" keyboards, while others will have 40-
key, 12-key, or even other key configurations. Similarly, some devices will have touchscreens,
but many won't.

When building your applications, keep that in mind. Don't make assumptions about
specific keyboard layouts -- unless, of course, you're really interested in restricting your
application so that it can only be used on those devices.

4.6.6 Do converse the device battery:

A mobile device isn't very mobile if it's constantly plugged into the wall. Mobile
devices are battery-powered, and the longer we can make that battery last on a charge, the
happier everyone is — especially the user. Two of the biggest consumers of battery power are
the processor, and the radio; that's why it's important to write your applications to do as little
work as possible, and use the network as infrequently as possible.

Minimizing the amount of processor time your application uses really comes down to
writing efficient code. To minimize the power drain from using the radio, be sure to handle
error conditions gracefully, and only fetch what you need. For example, don't constantly retry
a network operation if one failed. If it failed once, it's likely because the user has no reception,
so it's probably going to fail again if you try right away; all you'll do is waste battery power.

Users are pretty smart: if your program is power-hungry, you can count on them
noticing. The only thing you can be sure of at that point is that your program won't stay
installed very long.
CHAPTER-5

TESTING

5.1 Software testing


Software testing is a critical element of software quality and assurance and represents
ultimate review of specifications, design and coding. Testing is an exposure of the system to
trial input to see whether it produces correct output.

5.2 Testing phases


Software testing includes the following:

1. Test activities are determined and test data selected

2. The test is conducted and test results are compared with the expected results.

5.2.1 Testing activities


1.INSPECTING COMPONENTS: This finds faults in the individual component through the
manual inspection of its source code.
2.UNIT TESTING: This find faults by isolating an individual component using test stubs and
drivers and by exercising the components using a test case.
3.INTEGRATION TESTING: This finds faults by integrating several components together.
System testing, which focuses on the complete system, its functional and non-functional
requirements and its target environment.

Unit Testing
Unit testing focuses on the building blocks of the software system, that is, objects and
subsystems. They are three motivations behind focusing on components. First, unit testing
reduces the complexity of the overall test activities, allowing us to focus on smaller units of
the system. Unit testing makes it easier to pinpoint and correct faults given that few computers
are involved in this test. Unit testing allows parallelism in the testing activities; that is each
component can be tested independently of one another.

The specific candidates for unit testing are chosen from the object model and the
system decomposition of the system. In principle, all the objects developed during the
development process should be tested. Which is often not feasible because of time and
budget?

Many unit testing techniques have been devised. Some of them are:

Equivalence Testing
It is a black box testing technique that minimizes the number of test cases. The
possible inputs are partitioned into equivalence classes, and a test case is selected for each
class. The assumption of equivalence testing is that the system usually behaves in similar ways
for all members of a class. To test the behaviour associated with an equivalence class, we only
need to test one member of the class. Equivalence testing consists of two steps: identification
of the equivalence classes and selection of the test inputs.

The following criteria are used for the equivalence testing:

1.COVERAGE: Every possible input belongs to one of the equivalent classes.


2.DISJOINTEDNESS: No input belongs to one of the equivalent classes.
3. REPRESENTATION: If the execution demonstrates an error when a particular
member of an equivalence class is used as input, then the same error can be detected by using
any other member of the class as input.

Boundary Testing
Boundary testing is a special case of equivalence testing and focuses on the conditions
at the boundary of the equivalence classes. Rather than selecting any element in the
equivalence class, boundary testing requires that the element be selected from the “edges” of
the equivalence class.

Path testing

Path testing is a white box testing technique that identifies faults in the implementation
of the component. The assumption behind path is that, by exercising all possible paths through
the code at least once, most faults will trigger failures. The identification of paths requires
knowledge of the source code and data structures.

The path testing technique was developed for imperative languages. Object oriented
language introduce several difficulties when using path testing.

1. POLYMORPHISM: Polymorphism enables messages to be bound to different methods


bases on the class of the target. Although this enables developers to reuse code across
a large number of classes, it is also introduce more cases to test.
2. SHORTER METHODS: Methods in object oriented language have the tendency to be
shorter then procedures and functions in imperative languages. This decreases the
likelihood of control flow faults, which can be uncovered using the path testing
technique.

State based testing


Object oriented languages introduce the opportunity for new types of faults in object-
oriented systems.

State based testing is a recent testing technique, which focuses on object-oriented


systems. Most testing technique, which focuses on selecting a number of test inputs for a
given state of the system, exercising a component or a system, and comparing the observed
outputs with java. State based testing focuses on comparing the resulting state of the system
with the expected state. In the context of a class, state-based testing consists of deriving test
cases from the UML state chart diagram for the class.

Integration testing
It detects faults that have not been detected during unit testing, by focusing on small
group of components.

5.3 Test Case Design

The design of tests for software and other engineering products can be as challenging
as the initial design of the product. Test case methods provide the developer with a systematic
approach to testing. Moreover, these methods provide a mechanism that can help to ensure the
completeness of tests and provide the highest like hood for uncovering errors in software.

Test case design methods are divided into two types:

1.White-box testing
2.Black-box testing

5.3.1 White-box testing


White -box testing, sometimes called glass-box testing is a test, case designed method
that uses the control structure of the procedural design to derive test cases. Using white-box
testing methods, the s/w engineer can derive test cases that guarantee that all independent
paths within a module have been exercised at least once. Exercise all logical decisions on their
true and false sides. Execute all loops at their boundaries and within their operational bounds.
Exercise internal data structures to ensure their validity.

Basis path testing is a white-box testing technique. The basis path method enables the
test case designer to derive a logical complexity measure of a procedural design and use this
measure as a guide for defining a basis set are guaranteed to exercise every statement in the
program at least one time during testing.

5.3.2 Black-box testing


Black-box testing ,also called behavioural testing, focuses on the functional
requirements of the s/w. Black-box testing enables the software engineer to derive sets of
input conditions that will fully exercise all functional requirements of a program. It is a
complementary approach that is likely to uncover a different class of errors that white-box
methods could not.

Black-box testing attempted to find errors in the following categories.

• Incorrect or missing functions.


• Interface errors.

• Errors in data structures or external data base access.


• Behavior or performance errors.
• Initialization and termination errors.
CHAPTER 6

OUTPUT SCREENS

Fig :First Screen


Fig: Second screen
Fig.Third screen
Fig: Last screen
CHAPTER 7
CONCLUSION

This application is developed for the android game users for their interest on card
gaming., which helps users to play the game of card with assumptions on higher and lower
numbering on it. This game will be completely based on user assumptions , whether the user
will assumes the correct or not i.e., next card will high or low card. It provides more flexible
to the users while playing the game.
BIBILOGRAPHY

References

We will be using the information collected from websites like

http://developer.android.com/index.html http://www.android-trainer.com/

http://stackoverflow.com/

http://www.google.co.in/

And the guidance from the external guides of coign group

You might also like