Академический Документы
Профессиональный Документы
Культура Документы
APPLICATION DEVELOPMENT
2015
ii
The professor Kyunghee Lee has examined the dissertation entitled: Android Game
Application Development (the same image finding android game) presented by Bandula
Madusanka Padmaperuma, a candidate for the degree of bachelor of Computer Science.
Adviser, Supervisor & Examiner: November, 2015
Kyunghee Lee
Professor
Department of Computer Science
Pai Chai University, South Korea.
Declaration of authorship
I hereby certify that this thesis and project I am submitting on the subject of android
programming. Also, this is entirely my own original works.
Signature of candidate:
iii
TABLE OF CONTENTS
Abstract.......................................................................................................................................
1. Introduction .............................................................................................................................
2. The progress of mobile game ..........................................................................................
2.1 Overview .......................................................................................................................
2.2 Soft-wear Platform for Mobile Applications ...............................................
2.3 Android ..........................................................................................................................
2.4 The Android Platform ..............................................................................................
2.5 Application frame work ..........................................................................................
v
1
2
2
4
5
5
6
7
7
7
7
8
8
8
9
9
iv
List of Figures
Figure 2.1 Global iOS &Android Time Spent per App Category ...................................................... 2
Figure 2.4 Android platform............................................................................................................................... 5
Figure 2.5 Activity life cycle ............................................................................................................................... 6
Figure 3.3 Logical relations ............................................................................................................................. 7
Figure 4.1 Start frame ........................................................................................................................................ 8
Figure 4.2 Game selection frame .................................................................................................................... 8
Figure 4.3 Game playing frames ..................................................................................................................... 9
Figure 4.4 Game wining frame ......................................................................................................................... 9
Figure 5.1 Game screen .................................................................................................................................... 10
Figure 5.2 Screen Flow Chart ......................................................................................................................... 12
Figure 6.1 On click event code ....................................................................................................................... 13
Figure 7.1 Emulator test .................................................................................................................................. 14
Figure 7.2 Practical mobile phone test ........................................................................................................ 15
List of Tables
Table 2.2 Market Shares of mobile operating system (CANALYS,2012) ........................................ 04
Table 7.1 Simulator Test .................................................................................................................................... 14
Table 7.2 Practical mobile phone test.......................................................................................................... 15
ABSTRACT
Today, mobile phones play an important role in our daily life. The reason is the
development of Smart Phones and mobile applications. People use smart phones because
smart phones are able to do a lot of things such as sending Emails, communication and
taking photos. With the development of the hardware of mobile phones, the quality and
popularity of smart phone games have increased. Android platform takes the biggest part
of the smart phone market. Therefore, the aim of my thesis and project is to get familiar
with Android smart phone and implement an application that can run on an actual Android
smart phone.
To achieve this aim, I have planned to develop a mobile phone game on Android
platform. The name of the game is the same image finding game. In this game, player
has to complete his android screen with the same images by clicking or touching his
phone. To build this game, I have used Android studio soft-wear (Android SDK), emulator
and actual android smart phone. Also, I have used JAVA, XML programing languages.
Keywords: Android, Android Studio, Android SDK, emulator, (JAVA, XML)
vi
1.
INTRODUCTION
The smart mobile phones have lots of functions such as sending E-mails, searching on
the internet, chatting, taking photos, recording videos, translating text and so on are some
typical application areas. However, mobile games are playing one of the most essential
roles in those functions. Especially, mobile games use as relaxation activities that you can
easily participate with your fingertips.
The trends of mobile phones are changing and evolving all the time. As a result of that, the
hardware of our mobile phone is getting more and more powerful today. Therefore, the games
have also become more and more attractive and realistic. However, the graphics are not the
only important issue for a game. Games are for playing, so the most important point of a
game is how to control the game. Usually, we used the keyboard to play the Snake.
Figure 2.1 : Global iOS &Android Time Spent per App Category
As we can see from Figure 2.1, games take up 43% percent of peoples smart phone
time. It is the biggest part among all categories of applications. Actually, this situation is
not only with those smart phones. I believe that all kinds of mobile phones have game
function, even the most basic phone. Therefore, everyone is able to play a game with their
mobile phone.
The main reason of this increase is the popularity of games and the lack of time for
recreational activities. As a result of those reasons, people trend to enjoy mobile games as
their recreation. For instance, in China, after a whole day work, most of the citizens have to
go back home by public transportations. So, what can people do while they are waiting for
a bus or taking a metro? The answer is that most of them play games. On the other hand,
because of the low capacity of network in crowded buses and subways, offline games have
further strengthened the top position of games. Therefore, mobile gaming has more users
and it is growing more rapidly than other platforms.
.
Mobile platform
Alteration
Android
68.1 %
47.6 %
+ 20.5 %
iOS
16.4 %
18.9 %
- 2.5 %
BlackBerry
5.4 %
11.6 %
- 6.2 %
Symbian
4.1 %
16.8 %
- 12.7 %
Windows Phone
3.2. %
1.2 %
+2%
Others
2.9 %
3.9 %
-1%
The market shares in Table 2.2 Indicate that the most smartphones were running with
an Android platform. Apple's iOS with 16.4 percent has fallen slightly against Android.
RIM's Blackberry and Symbian experienced a dramatic loss. Microsoft's Windows Phone
was able to gain more market shares and it is expected to grow further. The marketing
and advertising company Nielsen provides another analysis of market shares which show
that the situation on the United States smartphone market are in accordance with the
results from Canalys. According to their data published in June 2012 Android is running
on a majority of 51.8 percent of the smartphones owned in the United States and iOS has
a comparatively larger market share than worldwide with 34.3 percent. The other
platforms account for 14 percent altogether with 8.1 percent of devices that are running
BlackBerry. Therefore, it is essential to develop and learn more about android
applications for a big market.
2.3 Android
Android is a light-weight Linux-based open-source software platform. It has an operating
system, middleware, and key applications. It was developed for the use on mobile devices
under the leadership of Google and has become the most popular and widespread
operating system on smartphones. Developing applications for Android is possible for
anyone with basic knowledge of the Java programming language and all tools for software
development are available for free. Applications can be published on the Google Play Store.
For that, publisher requires an account which costs 25 U.S. dollars.
Application that displays an interface as a single screen page is called an Activity, which
is derived from the Android specific class Android.app.Activity. Hence, an application
usually consists of several Activity classes that handle functionalities like launching an
application or user input and evoke each other. Similar to other Android components, an
Activity class runs through different states which have corresponding class methods.
These states are called the Activity life cycle.
3.1 Description
The game is named the same image finding game. The reason is player has to complete
his smart phone screen with same images in order to win this game.
Image 1
Image2
Image3
Image4
Image5
Image6
Image7
Image8
Image9
image10
4. GAME OPERATIONS
4.1 Start Frame
The frame 1 is used as a start frame. It is not a very important frame for this game.
However, it contains the name of the game. Additionally, the start frame also gives an
impression to the player (See Figure 4.1). Here, programmer uses click event as a
function. When player touches anywhere in the screen, the frame will go to select game
frame (game choosing frame).
10
This
is
the
image that you
have to find.
You need to complete
whole screen by
clicking each image
Then after, player needs to click the front image. Then, winner screen going to
appear. Which means player has won the game.
11
12
6. IMPLEMENTATIONS
6.1 On Click Event (To change images)
This is the Java Code that I have used for On Click Action. Here, programmer uses click
event as a function. When a player is clicking an image button, image changes to random
image. Until player finds the right image, player has to click continuously.
if (event.getAction() == MotionEvent.ACTION_UP) {
Toast.makeText(getApplicationContext(),
"clicked ", Toast.LENGTH_SHORT).show();
a = (int) (Math.random() * imageIDs.length);
ImageView1.setBackgroundResource(imageIDs[a]);
}
return true;
}
});
13
7. PROGRAM TESTS
After implementing the program, I tested the program in the two environments. First
using the simulator and second using a real phone.
Hardware
Laptop: hp
CPU: Intel i5 2430M
Memory: 4GB
Software
Android Studio,
Emulator
14
Hardware
Platform
Android 2.3
I tested the same functions as in simulator test. Figure 7.2 shows the game while it is
running on the real mobile phone.
15
8. CONCLUSIONS
The aim of my final thesis is to develop an application for Android platform and test it on
an actual smart phone. As a result, I have developed the game which is called The Same
Image Finding. Actually, the result of the test proves that this game can successfully run
on an actual smart phone. Therefore, the aim is achieved.
Before I choose this topic, I did not know anything about Android application
programming. So, I took very long time to practice and learn how to develop an Android
application by using Android Studio soft-wear. Actually, there were lots of errors and
mistakes when I test by myself. However, after I overcame and finished this game, I really
learned lots of knowledge.
According to the limitation of the time. I am not able to implement more several of
functions in my game. Even though this game has met the requirements of the project
and it looks not bad. Finally, I want to make more interesting mode and some special
items in this game in the future.
16
9. REFERENCE.
)/ (www.tutorialspoit.com)
17