Android Development Series (15): "Android small game idiom repeatedly see" the first article

Source: Internet
Author: User

Learning one months of Android, because the summer time to give a friend to write a small game, but also want to test their ability, so that starting from 7th began to write this small game, back and forth with class to today is finally finished, but this little game is written to have a lot of problems, but fortunately, barely able to run up, Some flaws do not care too much, after all, we are not ready to publish for others to download.

apk installation package download link (I put in Baidu cloud disk, you can directly click to download): Http://pan.baidu.com/s/1bnxpQrH

code file Download: (Put in csdn download there, do not need points): http://download.csdn.net/detail/u010800530/8041355

Let's introduce the game rules of the game:

1, in the "Game Interface", in order to click the corresponding idiom (four characters), will appear successful.

Wrong order, or the four-word click cannot form an idiom, it will fail.

2, after clicking on the successful idiom, will pop up a box, this box contains the source of this idiom, explain and so on

(can refer to the "Crazy guess idiom" This app, not to play ads ha)

Unresolved bug:

1, that is, the database is not packaged with the APK installation files, that is, the game has no idiom, you need to click the "Add Idiom" button

(click "Add Idiom", will appear to add the level (1-5), add idioms, add explanations, add source, these are to fill, PS: Which add level options, to write as "1", and must be in this level is best to add 10 idioms to see the most accurate effect)

PS: About this level can be repaired, the database file (lianliankan.db) in the Assets Resource folder, and then read the database, I do not bother to write the bottom.

2, or the first question, is the best one-time add ten idioms, otherwise the interface will come out, but not accurate.

3, the interface old ugly, million hope to see everyone do not abandon, art this artistic live I temporarily still can't get.

Below look at the interface of the virtual machine above, the detailed explanation of the specific code I put in the second article explains:

This is a project view of the projects:

We have defined several packages:

DAO layer, Service layer, Daomain layer, game layer, initialize layer, JUnit layer

DAO: Manipulating Databases

Service: Used to write some methods

Domain: Placing objects

Game: Place Activity window

Initialize: storage Resource Initial Configuration

JUnit: Used to do test cases (this layer can be done without a tube, it is a test when writing code)

Let's introduce how this game works:

First, we create a database that defines three tables:

Checkpoint, idiom, word

checkpoint:Checkid: Representative level (1-5)

idiom:idiomid: The id,idiomexplain of the idiom idiom: The explanation of the idiom idiom, Idiomprov: The source of the idiom idiom,foreigncheckid: foreign Key, Link to the Checkpoint table

Word:wordid: Represents the word's id,wordcontent: the content of the word, Wordlevel: the level that represents the word, Foreignidiomid: foreign key, and idiom table link

The relationship between the three tables: 1 idiom data corresponds to 4 Word data, Wordlevel represents the correct order of the four data being clicked successively.

The relationship of the database has been introduced, the next chapter introduces the design of the core code inside.

First class, and so on the evening to write ~ ~ (not to be continued)

Android Development Series (15): "Android small game idiom repeatedly see" the first article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.