Skip to content

Commit

Permalink
Sudoku Capturer Release 1.6:
Browse files Browse the repository at this point in the history
- adding native libraries
- removed opencv manager dependency
- showing ads again
- updated release notes
  • Loading branch information
rladstaetter committed Jun 21, 2015
1 parent 75773bc commit 47dbac1
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 30 deletions.
12 changes: 8 additions & 4 deletions sudoku-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ To install the application on your device, type:

mvn clean install android:deploy


## For App Store upload

For signing and releasing it for the app store:

mvn clean install -Pandroid,sign
Expand All @@ -24,13 +27,16 @@ Make sure you've defined the necessary properties in your settings.xml, namely
android.storepass

Of course, you have to create a corresponding keystore and use your own storepass.


For upload to app store use

target/sudoku-android-aligned.apk.

via the web interface of googles play store.

## TODOS

- create a HUD with a frame so the user knows where to place the sudoku
- show ads only when solution is shown
- translate to chinese
- improvement of detection algorithm for the sudoku corners
- parameter dialog / preferences
Expand All @@ -40,6 +46,4 @@ Of course, you have to create a corresponding keystore and use your own storepas
- progress bar implementieren: entlang dem bild unten einen bar der von rot auf grün wechselt,
und je nach anzahl der erkannten nummern sich langsam füllt
- mini thumb matrix links oben anzeigen von erkannten zahlen
- integrate opencv correctly (maybe even without opencv manager)


Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,42 @@ import _root_.android.widget.{Button, FrameLayout}
import com.google.ads.{AdRequest, AdSize, AdView}
import net.ladstatt.apps.sudoku._
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2
import org.opencv.android.{BaseLoaderCallback, CameraBridgeViewBase, LoaderCallbackInterface, OpenCVLoader}
import org.opencv.android.{CameraBridgeViewBase, OpenCVLoader}
import org.opencv.core._

import scala.concurrent.Await
import scala.concurrent.duration._

object SudokuCapturer {

trait CanLog {

val TAG = "SudokuCapturer"

def logInfo(message: String): Unit = {
Log.i(TAG, message)
()
}

def logError(message: String): Unit = {
Log.e(TAG, message)
()
}

def loadOpenCV(): Unit = {
if (OpenCVLoader.initDebug()) {
logInfo("OpenCV initialized successfully.")
} else {
logError("Could not initialize OpenCV properly.")
}
}
}

object SudokuCapturer extends CanLog {
loadOpenCV()
}

class SudokuCapturer extends Activity with CvCameraViewListener2 {

import net.ladstatt.apps.sudoku.android.SudokuCapturer._
class SudokuCapturer extends Activity with CvCameraViewListener2 with CanLog {

var cameraView: CameraBridgeViewBase = _
var rescanButton: Button = _
Expand All @@ -38,28 +60,20 @@ class SudokuCapturer extends Activity with CvCameraViewListener2 {
var digitLibrary: DigitLibrary = defaultLibrary
var hitCounts: HitCounters = defaultHitCounts

def logInfo(message: String): Unit = {
Log.i(TAG, message)
()
}

def logError(message: String): Unit = {
Log.e(TAG, message)
()
}

val mLoaderCallback: BaseLoaderCallback = new BaseLoaderCallback(this) {
override def onManagerConnected(status: Int) {
status match {
case LoaderCallbackInterface.SUCCESS => {
Log.i(TAG, "OpenCV loaded successfully")
cameraView.enableView()
/*
val mLoaderCallback: BaseLoaderCallback = new BaseLoaderCallback(this) {
override def onManagerConnected(status: Int) {
status match {
case LoaderCallbackInterface.SUCCESS => {
Log.i(TAG, "OpenCV loaded successfully")
cameraView.enableView()
}
case _ => super.onManagerConnected(status)
}
case _ => super.onManagerConnected(status)
}
}
}

*/

def initAssets(): Unit = {
TemplateLibrary.getResourceAsStream = getAssets().open
Expand All @@ -85,7 +99,7 @@ class SudokuCapturer extends Activity with CvCameraViewListener2 {
digitLibrary = defaultLibrary
hitCounts = defaultHitCounts
rescanButton.setVisibility(View.GONE)
// adView.setVisibility(View.GONE)
// adView.setVisibility(View.GONE)
solution = null

}
Expand All @@ -101,6 +115,7 @@ class SudokuCapturer extends Activity with CvCameraViewListener2 {
handler = new Handler()
rescanButton.setVisibility(View.GONE)
adView.setVisibility(View.VISIBLE)
cameraView.enableView()
}

override def onBackPressed(): Unit = {
Expand All @@ -122,7 +137,8 @@ class SudokuCapturer extends Activity with CvCameraViewListener2 {
override def onResume(): Unit = {
super.onResume()
logInfo("onResume called")
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_6, this, mLoaderCallback)
loadOpenCV()
//OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_6, this, mLoaderCallback)
()
}

Expand Down Expand Up @@ -170,7 +186,7 @@ class SudokuCapturer extends Activity with CvCameraViewListener2 {
case s: SSuccess => {
execOnUIThread({
rescanButton.setVisibility(View.VISIBLE)
// adView.setVisibility(View.VISIBLE)
// adView.setVisibility(View.VISIBLE)
})
solution = s.solutionMat
solution
Expand Down
5 changes: 4 additions & 1 deletion sudoku-android/src/site/markdown/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@

## Release 2.1 (unreleased)

- Included OpenCV libraries in the apk, now OpenCV Manager Download necessary anymore
## Release 1.6 (21. 6 2015)

- Included OpenCV libraries in the apk, no separate OpenCV Manager Download necessary anymore
- Ads are shown again permanently

## Release 1.5 (6. April 2015) [VersionCode 7, Version Name 1.5]

Expand Down

0 comments on commit 47dbac1

Please sign in to comment.