Skip to main content

Hundred - a number game updated

Shataka - my number game which is very simple but really good, has been updated.

First of all, its name is changed to "Hundred". Because that is the aim of the game, right?

There are some UI changes too. May be for better :) :)

And I have added a how to section, which guides the user step by step.

The game has a grid of 9 cells , 3 rows and 3 columns. The aim of the game is to fill this grid with  numbers so that each row and each column adds up to 100. And all the required numbers are given at the bottom of the grid.

In this version( v 3.0), in level 1,  6 numbers are already provided in the grid. (In older versions 3 numbers were filled in the grid). So user needs to fill only 3 more numbers. So level 1 is pretty easy. You can see that in the above screen shot, 2nd row and 3rd column are already filled and their sums are 100.

In level 2, 5 numbers are provided and user should fill the remaining 4. And so on.

From level 8 onwards, the game is slightly more challenging. Now the sum is different each time, its value is shown at the top of the grid.

From level 15, the sum should be 1000.

I think, better than you explaining the concepts, it is better you download it and see it for yourself.

OK, I used mockupsjar to create some nice screen frames. But you should know that, android studio provides with option of frames when you are taking screen shot. All screen shots except for first one were created using android studio.

If you are looking for a place to create feature graphic - you know that it is essential, norio site lets you create the feature graphic. But I used GIMP instead,

And do not forget to select both check boxes when you are trying to create a release version apk and studio asks you whether you want to sign jar files or entire apk.

And after you shrink the files using proguard, you may need to use few " -keep" lines in your proguard.txt file. I was unable to drop numbers into cells in my release version!


Popular posts from this blog

Simple ListView Adapter and list item select

When you are using a listview in your applications many a times you will write your own adapter to display item. But if your list is very simple showing a list of strings, you can use inbuilt adapters like ArrayAdapter, SimpleCursorAdapter etc.

ArrayAdapterLet us look at an example

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ListView android:layout_height="wrap_content" android:id="@+id/listView1" android:layout_width="match_parent" android:layout_margin="20dp"> </ListView> </LinearLayout>

And add these lines to the onCreate method of the activity.

super.onCreate(savedInstanceState); …

Drawables in Android - Layer drawable

Let us see how to use layer drawable. You can have two or more bitmaps on different layers to create such a drawable

Using xml:

You should use layer-list in your xml file to create layerdrawable. Here is layer.xml
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android=""> <item> <bitmap android:src="@drawable/whiteicon" android:gravity="top|left"/> </item> <item> <bitmap android:src="@drawable/blueicon" android:gravity="top|left"/> </item> <item> <bitmap android:src="@drawable/redicon" android:gravity="top|left"/> </item> </layer-list>
We are using three different bitmaps whiteicon.png, redicon.png and blueicon.png which are present in /res/drawable/mdpi folder. All these are of different sizes and aligned to top left. This drawab…

DatePickers in Android

DatePicker is a view which lets the user select a date showing a calendar or 3 spinners for dd, mm and yy.

Let us see how to use this.
Easy Method: To use a DatePicker you can use DatePickerDialog. This can be created and shown programmatically too.

publicvoidonCreate(Bundle b){/*********/ Button btn =(Button)findViewById(; btn.setOnClickListener(new View.OnClickListener(){@OverridepublicvoidonClick(View v){ showPickerDialog();}});}privatevoidshowPickerDialog(){ DatePickerDialog dtPickerDlg =new DatePickerDialog(this,this, 2017,10,20);;}

In our xml file, let us have a button and in the onclick listener of the button, let us display the date picker dialog - we call showPickerDialog.

In showPickerDialog,  we are using a random date to initialize.

The first  parameter is the context. Second parameter is the class which implements the interface OnDateSetListener. Next three parameters are year, month (Jan is 0) and …