Crossword library for Android

Overview

Build Status Sonatype Nexus (Releases) License

Ararat

Ararat is a crossword library for Android, written for and used by alphacross. It includes:

For a demonstration, see the included demo app.

Screenshot

The sample crossword included in the app is Double-A's by Ben Tausig.

Quick Start

Add dependency to app/build.gradle (check to make sure you're using the latest version):

dependencies {
    implementation 'com.github.0xe1f:ararat:1.0.15'
}

Add view to your layout:

<org.akop.ararat.view.CrosswordView
    android:id="@+id/crossword"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Initialize the view in OnCreate():

val crosswordView = findViewById<CrosswordView>(R.id.crossword)
crosswordView.crossword = readPuzzle()

Existing puzzles are usually read from a stream, e.g.:

fun readPuzzle(): Crossword = resources.openRawResource(R.raw.puzzle).use { s ->
    buildCrossword { PuzFormatter().read(this, s) }
}

For the activity to respond to soft keyboard changes, set android:windowSoftInputMode to adjustResize in the manifest:

<activity android:name=".MainActivity"
          android:windowSoftInputMode="adjustResize" />

Keyboard Support

CrosswordView was designed to work with the Android soft keyboard. Unfortunately, with the exception of maybe Google and the AOSP codebase, virtually no one follows the rules of Android IME, including many third-party manufacturers and authors of soft keyboards. They will often mistakenly assume that any view has full support of things like autocorrect and swiping - concepts that don't work in the limited scope of input needed for crosswords, and will ignore any attempts to disable those features.

If you're serious about your own crossword app, your best long term bet is to use your own KeyboardView and have it provide the input instead.

License

Copyright (c) 2014-2019 Akop Karapetyan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Not able to import some .puz files

    Not able to import some .puz files

    http://www.private-eye.co.uk/pictures/crossword/download/?O=D

    Attempting to import a few of the puzzles from the top of the above URL into Alphacross 1.80 results in some failures. I presume they are Across Lite compliant.

    Works: 586 590

    Doesn't: (Import failed - format not recognised) 585 587 588 591

    bug 
    opened by markclowes 3
  • Fix .puz parsing bug

    Fix .puz parsing bug

    Hi, I saw on your Twitter feed that you were having trouble keeping up with maintenance on Alphacross, so I figured I'd send you a PR instead of only reporting this bug.

    In PuzFormatter.kt the Across parsing logic uses <= but the Down parsing logic uses < for some reason, and this breaks puzzles that have a two-letter-long Down clue at the bottom of the grid:

    |Across Lite|Alphacross| |-|-| |acrosslite|alphacross|

    You can go here to download the puz file in the screenshots if you want to see the repro yourself and confirm the fix.

    Thanks for Alphacross, I use it every single day!

    opened by rileynull 2
  • How can I compare the user inserted data with solution

    How can I compare the user inserted data with solution

    After a user completes the crossword I want to compare the user submitted answer with the solution. I want to check how many of his answers were right/wrong. How to do that ??

    opened by abhay222 2
  • Alphacross

    Alphacross "notes" panel not scrollable

    I'm not sure if this is the right place, considering this is merely a repo for the library under alphacross, and not alphacross itself, but I think this is worth a shot.

    Is the "notes" section of a crossword (the one you get by pulling the bottom bar up) not scrollable, or is this an issue on my end? There are some crosswords (mostly imported ones) that have more text there than fits on screen, and I don't see a way to access those contents elsewhere in the app either.

    If it's not an issue on my end, could it be made scrollable?

    opened by MIC132 1
  • Switch from accross to down and vice-versa

    Switch from accross to down and vice-versa

    After all, thanks for this great/usefull work.

    I wanna know how to shitch from accross to down words and vice-versa when the user click on a button.

    Thanks

    opened by levilliard 1
  • [question: alphacross] how to import .puz files?

    [question: alphacross] how to import .puz files?

    Hi. Sorry to bother you. I just installed alphacross v1.96. So far, it looks perfect.. exactly what I wanted. I do have one question though. The description says that it can import external puzzles in .puz (Across Lite) file format.. but I don't see any UI that would allow me to do so. I was hoping that you would be so kind as to quickly explain how to do so.

    ex:

    • Should they be added to one of the directories under: /data/data/org.akop.crosswords/?
    • Is there a way to read them directly off of an external SD card?

    Much thanks!

    invalid 
    opened by warren-bank 1
  • Add unicode support to PuzFormatter

    Add unicode support to PuzFormatter

    Litsoft seems to have switched to using UTF-8 for text fields since version 2.0 of their format.

    AFAICT, major publishers (vz. NYT, LAT, Universal) all still use(d) version 1.3, so this doesn't come up too often, but Crosshare does use the 2.x era format for their puz exports. Their import logic checks whether the version field is at least version 2 in order to interpret the file as UTF-8. I'm not sure where that info came from (@mdirolf ???) but I don't think it's just a Crosshare idiosyncrasy. E.g. there's this tweet from the official Litsoft account.

    Trying to parse these UTF-8 -encoded puzzles as ISO-8859-1 results in a garbled mess. A handful of the puzzles I've seen are borderline unplayable, with clues made up entirely of emojis for example. But here's a relatively straightforward example of the fix:

    screenshots

    Some notes on code minutiae:

    1. I don't think the old verRev line made sense. version.length could never not be 4 - Java counts nulls as part of the string. In any case it was unused so I deleted it.
    2. As soon as we open an InputStreamReader, it's going to suck the whole file into its character decoding buffer. At that point it's too late to open another reader with a charset different from the default. And you can't change the charset of an open reader. So when do we open the reader? It seemed easiest to just wait until we've gotten to the point of reading the version, but that did require duplicating the ensureSkip extension method so that we can skip directly on the InputStream.
    3. I have no idea whether the 2.0 format is supposed to support UTF-8 grids or just clues/titles/descriptions/authors. This code assumes that the grid itself is also UTF-8, but if that's incorrect then this might break things for weird puzzles with special characters in the grid. In particular, I don't think scrambled files would auto-descramble correctly in the presence of special characters in the grid.
    opened by rileynull 0
  • PuzFormatter doesn't account for non-alpha characters

    PuzFormatter doesn't account for non-alpha characters

    PuzFormatter doesn't detect non-alpha characters during solution-reading phase, which prevents entry of non-alpha characters (effectively rendering the puzzle unsolvable).

    Sample puzzle: http://herbach.dnsalias.com/Jonesin/jz170715.puz

    jz170715.puz.zip

    bug 
    opened by 0xe1f 0
  • LA Times 03-03-2017

    LA Times 03-03-2017

    LAT puzzle for March 3 is being read/written incorrectly: http://cdn.games.arkadiumhosted.com/latimes/assets/DailyCrossword/la170303.xml

    Specifically, numbers are often zero, and cell selection is broken.

    bug 
    opened by 0xe1f 0
  • PzzlFormatter fails to parse horizontal-only words

    PzzlFormatter fails to parse horizontal-only words

    PzzlFormatter errors out when parsing cells that start an "across," but not "down" and vice versa, e.g.: http://nytsyn.pzzl.com/nytsyn-crossword/nytsyncrossword?date=160904

    bug 
    opened by 0xe1f 0
Owner
Akop Karapetyan
I write software; usually Android, sometimes macOS. Fan of classic computing/videogames, especially MSX
Akop Karapetyan
Oratio Library for Android Studio helps you simplify your Android TTS codes

Oratio Oratio is a library for Android Studio. This library is useful to a number of developers who are currently making apps using android TTS(Text-T

Jacob Lim 1 Oct 28, 2021
Android Ptrace Inject for all ABIs and all APIs. Help you inject Shared Library on Android.

Android Ptrace Inject 中文可以参考我的注释内容进行理解 我写的注释相对来说比较全面了 How to build Make sure you have CMake and Ninja in your PATH Edit CMakeLists.txt. Set ANDROID_ND

SsageParuders 65 Dec 19, 2022
YouTube Player library for Android and Chromecast, stable and customizable.

android-youtube-player android-youtube-player is a stable and customizable open source YouTube player for Android. It provides a simple View that can

Pierfrancesco Soffritti 2.9k Jan 2, 2023
A highly customizable calendar library for Android, powered by RecyclerView.

CalendarView A highly customizable calendar library for Android, powered by RecyclerView. With this library, your calendar will look however you want

Kizito Nwose 3.4k Jan 3, 2023
View "injection" library for Android.

Kotter Knife Deprecated: This was a terrible idea because it allocates an object for every view reference. Do not use, and do not use anything like it

Jake Wharton 2.2k Dec 28, 2022
Android library that creates app shortcuts from annotations

Shortbread Android library that generates app shortcuts for activities and methods annotated with @Shortcut. No need to touch the manifest, create XML

Matthias Robbers 1.8k Dec 30, 2022
Kotlin library for Android

KAndroid Kotlin library for Android providing useful extensions to eliminate boilerplate code in Android SDK and focus on productivity. Download Downl

Paweł Gajda 890 Nov 13, 2022
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space.

Pdf Viewer For Android A Simple PDF Viewer library which only occupies around 125kb while most of the Pdf viewer occupies upto 16MB space. How to inte

Rajat 362 Dec 29, 2022
[Android Library] Get easy access to device information super fast, real quick

DeviceInfo-Sample Simple, single class wrapper to get device information from an android device. This library provides an easy way to access all the d

Anitaa Murthy 193 Nov 20, 2022
Maildroid is a small robust android library for sending emails using SMTP server

Maildroid ?? Maildroid is a small robust android library for sending emails using SMTP server ?? Key Features • Add to your project • Documentation •

Nedim 174 Dec 22, 2022
Android cryptography library with SecureRandom patches.

EasyCrypt Secure and efficient cryptography library for Android. (Auto fix SecureRandom bugs in API 18 and below.) Note: EasyCrypt uses only secure im

Priyank Vasa 109 Nov 20, 2022
Android calendar library provides easy to use widget with events

Kotlin-AgendaCalendarView Kotlin-AgendaCalendarView based on AgendaCalendarView Kotlin-AgendaCalendarView is a awesome calendar widget with a list of

Ognev Zair 88 Nov 21, 2022
🔓 Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.

EasyPermissions-ktx Kotlin version of the popular googlesample/easypermissions wrapper library to simplify basic system permissions logic on Android M

Madalin Valceleanu 326 Dec 23, 2022
All in 1 picker library for android.

Lassi Lassi is simplest way to pick media (either image, video, audio or doc) Lassi Media picker Key features Simple implementation Set your own custo

MindInventory 137 Dec 30, 2022
With Viola android face detection library, you can detect faces in a bitmap, crop faces using predefined algorithm and get additional information from the detected faces.

Viola Viola android face detection library detects faces automatically from a bitmap, crop faces using the predefined algorithms, and provides supplem

Darwin Francis 58 Nov 1, 2022
Android Spinner Dialog Library supported on both Java and Kotlin, Use for single or multi selection of choice

SpinnerDialog Android Spinner Dialog Library, Use for single or multi selection of choice Android UI Download To include SpinnerDialog in your project

Hamza Khan 55 Sep 15, 2022
Lightweight data loading and caching library for android

ColdStorage A lightweight data loading and caching library for android Quicklinks Feature requests: Got a new requirement? Request it here and it will

Cryptic Minds 41 Oct 17, 2022
Android Library to handle multiple Uri's(paths) received through Intents.

?? Handle Path Oz Android library written in Kotlin, but can be used in Java too. Built to handle a single or multiple Uri (paths) received through In

Murillo Comino 57 Dec 14, 2022