Professional Documents
Culture Documents
Higher and Lower Card Gaming
Higher and Lower Card Gaming
BACHELOR OF TECHNOLOGY
In
B.PRIYANKA (17S45A0503)
N.M.JOSHMITHA (17S45A0504 )
M.HARISH (17S45A0502)
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.
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.
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
CHAPTER 2
SYSTEM ANALYSIS 2
CHAPTER 3
SYSTEM DESIGN 5
3.3UML DIAGRAMS 6
IMPLEMENTATION 22
TECHNOLOGY 23
4.3 Android 24
4.4 Features 24
4.4.2 Libraries 25
4.6 Designing 32
4.6.1 Designing for performance 32
4.6.2 Introduction 32
CHAPTER 5
TESTING 40
CHAPTER 6
OUTPUT SCREENS 44
CHAPTER 7
CONCLUSION 48
BIBILOGRAPHY 49
LIST OF FIGURES
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.
CHAPTER 2
SYSTEM ANALYSIS
Problem Definition
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 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.
Hardware Requirements are Ram is 1GB Ram and above ,Hard Disk is 50GB and aboveAnd
Processor is Dual core and above.
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.
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.
3. Changing Number:
This module generates the random number on the user click on higher or lower.
This module displays user with the top 5 game scorers by referring the database.
Technologies used:
IDE : Eclipse
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.
1. Modularity and partitioning: software is designed such that, each system should consists of
hierarchy of modules and serve to partition into separate function.
4. Shared use: avoid duplication by allowing a single module is called by other that need the function it
provides
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.
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.
The Unified Modelling Language (UML) is a standard language for writing software blue prints.
• 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.
• 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.
• 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.
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
• 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
------------------------------
Fig: Generalization
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
f
User
Object
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
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
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 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
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.
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
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:
application [ database
gui
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
IMPLEMENTATION
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:
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:
d) Testing Phase:
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
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.
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.
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
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:
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
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
SQLite - a powerful and lightweight relational database engine available to all applications
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.
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.
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:
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.
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".
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.
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.)
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.
Give it a name, a platform target, an SD card image (optional), and a skin (HVGA is default).
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.
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.
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:
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.
Select Android Application and click the New launch configuration icon above the list (or,
right-click Android Application and click New).
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.
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.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.
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.
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.
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.)
dumpItem(this.mItems[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:
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:
if (isHorizontalScrollBarEnabled()) {
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:
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).
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.
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.
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.
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.
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.
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
2. The test is conducted and test results are compared with the expected results.
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.
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.
Integration testing
It detects faults that have not been detected during unit testing, by focusing on small
group of components.
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.
1.White-box testing
2.Black-box testing
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.
OUTPUT SCREENS
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
http://developer.android.com/index.html http://www.android-trainer.com/
http://stackoverflow.com/
http://www.google.co.in/