Strategies for Popular Number Puzzles

Sudoku Solver for Android - Build Log

Build Progress

Latest build and upgrade development is at the end of the page

I'm very excited about this project. I started out by aiming to complete the app withing two man weeks and with all the testing and extra bits I think I think it's about 16-17 days.

I'm feeling pretty confident this solver app for Android can be done quickly and painlessly. All the hard work has been done over the years building up the Core Engine that drives the website solvers. Most of that code will port over to android even though it is written in C/C++ and Java is the language of Apps. I'm also approaching the App with variants in mind from the start. That is, Jigsaw, Sudoku X and Killer ought to be built in now rather than bolted on later.

Day 1 - 13th December 2012
Unlike my first app which was all lists and data display pages I need a drawing canvas to draw the board on and get all the numbers in. So today was all about the 2D drawables library and how to fit it into a view. Almost all tutorials and examples do this for a full page but dont show how to do this in a layout with other components. Got there.

Day 2 - 14th December 2012
Now I have all this code, some 25,000 lines. Gotta build an interface between the C code and the java UI. Downloaded the NDK (Native Development Kit) and the JNI (Java Native Interface) and re-set up my project as a joint Java/C++ project. A zillion settings. Got the javah program to generate headers. Took all evening but, it can talk to the C code. My only worry is that its going to recompile all the code every time even though the C code is fixed and working and wont change.

Day 3 - 15th December 2012
Got the Core Engine talking to the UI passing sudoku data back and forth. Imported the example Sudokus into a little app database. Build the main screen for selecting tasks.

Day 4 - 16th December 2012
Went Christmas shopping today so I only had time to do....loads. Built the activity screen for the samples and it now loads samples onto the solver screen. Created a class to hold the documentation structure and imported all 40 pages and 150 odd diagrams. I think I'll reverse the black style to paper for this app. Found a way to override the WebViewClient click handler so I can transfer all the documentation sudoku strings straight to the solver but treat other links as normal.

Day 5 - 18th December 2012
Implemeted the Daily Puzzles feed so they can be imported into the app. Started on the databases for storing saved games and entering new puzzles.

Day 6 - 20th December 2012
Implemented favourites for storing any puzzle entered and storage for the current puzzle so undo/redo can access previous steps. Started on processing the data back from the sovler to highlight eliminated candidates, chains and colored cells etc.

Day 7 - 26th December 2012
Only able to grab a few hours here and there over Christmas (adds up to day) but I've finished displaying colored cells, highlighted candidates and chains. Added screens to allow the de-selection off strategies as per the online solver. Plugged in the Grader and Solution count functions.

Day 8 - 27th December 2012
All day on the app. Added preferences for coloring numbers and purging daily feed puzzles. Finished the chain and candidate cell coloring. Started on new puzzle editing. Added the alternative coordinate system.

Day 9 - 28th December 2012
Merged the blank and new puzzle screens into one and got all the saving and name of puzzles sorted. Added the help and about us page but todo to write the text. Think I got copy/paste working from the copy buffer but it's hard to test as picking text up from a web page is not easy in android. If it does work the app will try and detect a puzzle definition in the copied text.

Day 10 - 30th December 2012
Badly stuck on the undo/redo stack. It seems items in the ArrayList<> are being overwritten mysteriously. The whole approach to arrays of objects and having to use clone() seems very flawed in java and confirms my appreciation of C. At least with pointers theres no ambiguity about what is copied and what is merely referenced. So close to finishing. All thats left is the tablet layout and graphical buttons.

Day 11 - 2nd January 2013
Finished! Well, enough to take the app to testing. Oh, and one more day to figure out the Tablet layout. So not quite there but close. Figured out my cloning problems, it required defensive copying of mutable objects, very new concepts to me. Added Hints, cell editing and number highlighting. Fixed all the issues with the undo/redo stack. Hints could use some more work depending on feedback. Created a button skin. I would like to give this version to phone testers so if you are interested, let me know.

7th January 2013
Lots of head scratching these last few days. Several people with Android 2.2 have reported instant crashes and I've duplicated the problem in my emulator. There was a big jump in the operating system when 2.3 was released and many things were done differently, so the challenge is to create a single build thats backwardly compatible not just to 2.3 but 2.2 or 2.1. I've traced the difference to dependencies and as I don't need them, removed them. Viola, working 2.2 version.

Beta Update v 1.53 - 10 January
1) Fixed a bug that stopped the strategy [i] information button from showing the documentation pages for easy strats
2) Moved the “save to favourites” up to stop it being hidden by keyboard
3) Long press in Favourites allows deletion of that puzzle
4) Increased the font size of the strategy results, moved buttons down, results space vertically flexible and uses remaining space
5) Sleep screen turned off on solver page
6) Choose strategys - tick boxes tick if the row is also tapped
Also, please note, I am still working on the Tablet large screen version. It will work but it’s not worth testing as this will radically change. I’m interested in smart phone sizes.

Beta Update v 1.56 - 13 January
1) New skin and icons. Difficulty color coded icons added to lists
2) Bug fixes

Beta Update v 1.57 - 14 January
1) Candidate editing – the popup better aligned to the cell being edited
2) New high contrast cell color/numbering in preferences (for color impaired sight)

Beta Update v 1.58 - 17 January
Hopefully the final version now!
1) Created a method to edit the clues from a puzzle already in the solver
2) Fixed bugs do do with the undo stack re candidate editing, daily puzzles feed, various others.

Beta Update v 1.59 - 21 January
Figured a way to get tablet sizes into the same app build. I created special versions of the size critical pages, the home page, new puzzle and solver puzzle pages.

Upgrade Development

So I can't wait for the release before starting work on the next phase. This is getting the Sudoku X and Jigsaw Sudoku solvers into the app.

Day 1 - 28th January 2013
I have selected new puzzles for the Sudoku X samples. As new solvers could complicate the user interface I am creating a new first page - which allows the user to pick the solver they want. This page also contains help and preferences. Then I can use the old 'first' page for each puzzle type. It's important to keep seperate the different puzzle variants to avoid confusion. It also means remembering state and progress for three puzzles at a time.

Day 2 - 29th January 2013
Worked on testing the Core Engine to make sure it matches the web site results and ensure this copy of the code is up-to-date. Tripled up all the database tables to keep separate the different puzzles.

16th February 2013
Has a crash report from a user with a 2.2.1 OS level device. One of my beta testers had a similar problem with 2.2.1 and I thought I’d solved it. The core solver engine is written in C/C++ not the native java of Android. This is compiled into a library file. The support for this sort of library file was not fantastic back in 2.2 and before – android thinks it needs to load a bunch of other stuff when in reality it doesn’t. It errors because it cant load my library. Now, I thought I had a workaround but its not working on my emulator today. So rather than having it mysteriously crash on some older devices I’ve uploaded a new version which sets the minimum OS to 2.3. This excludes about 15% of the market place, unforuntately.

3rd March 2013
Had some requests in which I've incorporated.
  • The app now allows candidates to be turned off (which makes it more like a player). When this happens the solver no longer draws on the board but does continue to state results under the board. And when in Edit mode, it drops large numbers onto the board rather than candidates. I can see some people wishing to place their own candidates - I think I need to either make a 'player' page or some kind of player mode. It's difficult to manage two sets of candidate distributions and resolve conflicts between them. Something to think about.
  • For tablets and large screens you can go to preferences an unlock landscape mode. This just applies to the Solver page. Some people have keyboard attachments which require them to be in landscape mode.
  • Some interface touch ups and minor bugs fixed.

14 June 2013 - v1.63
  • Code merge with the strategy Core Engine to 1.95 from 1.90 and brings it inline with the website. Most of the increments were to do with Killer and Jigsaw strategies but it also includes the latest 3D Medusa and the improvements identifying Forcing Chains and many textual updates. Docs refreshed.
  • I've replaced the hover over popup for candidate editing after comments from users. 1 to 9 buttons appear below the board and can remain in place during "take steps". Edit Mode or Highlight Mode is now saved as a preference.

9 July 2013 - v1.64
  • Improved the landscape layout for Nexus 7 devices and those with similar resolutions.
  • Added a second hint level - just the strategy named, for those who thought the first hint level gave too much away.

8 August 2013 - v1.65
  • Update to the Core Engine to merge in the lastest Y-Wing/XYW-Wing/WXYZ-Wing. Brings the App up to 1.97 compared to the website solver.
  • Documentation updates. Added Change Log notes to the Help/About page.

10 November 2013 - v1.66
Replaced the Extended Unique Rectangles strategies in the Core Engine

29 December 2013 - v1.67
Added the Unique Rectangle type 3b to the Core Engine. Fixed a link bug in the samples list.

17 November 2014 - v1.69
  • Added 364 Practice Puzzles that concentrate on specific strategies. Many people have asked for puzzles that contain certain ideas. I'm pleased to include this in the App.
  • Core Engine merge bringing the App up to 2.01a compared to the website solver.

Version 1.70, 19th December 2014

This version is an attempt to fix a run time crash that occurred occasionally on some devices, mostly Samsung. A thorough scan of the code revealed only minor programming error, not enough to cause such widespread failure. This version is also compiled under the latest SDKs. Please let me know if your copy of this app crashes - and especially where in the app. Thank you.

Version 1.72, 29th December 2014

I believe Proguard third party library has been causing all the crashes since 1.69. I have moved all the calls to the core Engine into their own threads in an attempt to return an error rather than crash. Moved the Toast messages into the UI thread (definite fix for some crashes this).

Version 1.73, 22th April 2015
  • On cell editing a LONG click on the 1 to 9 buttons will insert that number.
  • Added a new layout for 976x768 Tablets.
  • Removed Medusa Rule 4 as per website.
  • Refreshed the Documentation. Now includes links to Exemplars.

Version 1.74, 4th July 2015
  • Re-instated BUG strategy just before XY-Chains

Version 1.75, 16th August 2016
  • Added a font size slider bar in Preferences. Allows the numbers on the puzzle board to be sized up.

Version 1.77, 26th November 2017
  • Updates to the core engine sudoku strategies to version 2.12
  • Additional captures in Nice Loop strategies
  • Refresh of the documentation
  • Checked and replaced example puzzles in case outcomes had changed

Article created on 29-January-2013. Views: 10939
This page was last modified on 18-November-2014.
All text is copyright and for personal use only but may be reproduced with the permission of the author.
Copyright Andrew Stuart @ Syndicated Puzzles, Privacy, 2007-2024