Learn to create an Anagram Game for Android

Anagram Game for Android

Create the User Interface

To start, we are going to create the User Interface of our Anagram game. In our User Interface, we will have a TextView to display the anagram. Then, an EditText to let the users to enter the word they found. And finally both buttons : one to validate the word entered and another to start a new game.

Core of the Anagram Game

Now, we can create the core of our game : the Anagram class. We will use this class to generate new words to find and to shuffle the word to find. Note that the list of words used for the game will be defined in this class :

Code of the Main Activity

Now, we can write the Java code of the main activity. The code is pretty simple. We get references of the views in the onCreate method. Then we install OnClickListener for both buttons.

Play to our Anagram Game

Now, it’s time to play to our Anagram Game. We launch the Anagram Game on an Android device and we see the following screen :

Anagram Game in action

--

--

Entrepreneur / Developer / Blogger / Author. In Bitcoin We Trust: https://inbitcoinwetrust.substack.com/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sylvain Saurel

Sylvain Saurel

Entrepreneur / Developer / Blogger / Author. In Bitcoin We Trust: https://inbitcoinwetrust.substack.com/