Git Product home page Git Product logo

ankimini's Introduction

AnkiMini - A small webserver for mobile devices like the iphone/zaurus
=======================================================================

To install on an iPhone/iPod touch, you'll need a jailbroken phone, wireless
access, and Cydia. If you've installed AnkiMini before, you can skip to the
AnkiMini section of this document.

Cydia prerequisites:
--------------------

Install these first. Note that the place where files are installed can be
small by default, and you might want to install bosstool first and run that.
If you don't, and you run out of space, your device may fail to start and
you'll have to restore it using iTunes. On the other hand, some apps may
not work properly if you use bosstool to move your Applications folder.

1. OpenSSH
2. Setup Tools
3. SQLite v3
4. Python
5. GNU C Compiler
6. iPhone 2.0 Toolchain
7. Erica utilities (for sound)

Note that to install some of these, you'll need to go into the Cydia options
and set yourself as a developer. A 'GUI user' won't show all available
packages.

You may need to add a different repository location to get the Erica
utilities.

Get a terminal:
---------------

You'll then need to ssh into the device. On Windows download a program called
putty. On Linux or OSX, run a command like:

ssh root@1,2,3,4

You'll need to check what IP your device has first by going into the network
settings. Replace '1,2,3,4' with that IP.

On windows, enter 'root' as the username to connect as.

The password is 'alpine', usually. It may vary depending on which jailbreaking
tool you used.

Python prerequisites:
---------------------

First, open safari on your iphone, and surf to pypi.python.org. This will
cache the page address for later.

Then, in the terminal you opened on your computer, you should see a prompt like:

iPod:~ root#

Type the following commands (without the hash). If something appears to be an
error, report it the Anki author.

SQLAlchemy:

# easy_install 'sqlalchemy == 0.4.7p1'

(that's a one, not an el)

Check it's installed (nothing should be printed):

iPod:~ root# python -c 'import sqlalchemy'
iPod:~ root#

SimpleJSON:

# apt-get install sudo curl
# curl -o json.tgz http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.7.tar.gz
# tar xzf json.tgz
# cd simplejson-2.0.7
# python setup.py build
# ldid -S build/lib.darwin-10.5-arm-2.5/simplejson/_speedups.dylib
# python setup.py install

Check it's installed:

iPod:~ root# cd
iPod:~ root# python -c 'import simplejson'
iPod:~ root#

AnkiMini:
---------

You need to copy the ankimini.tar.gz directory to your iPod. You can use 'scp'
on Linux and OSX, or the copy tool on the putty homepage if you use Windows.

If you use scp, you can do something like:

scp /path/to/ankimini.tar.gz/on/your/computer [email protected]:

(where 1,2,3,4 is the address you looked up earlier)

Then, in a terminal on your device, do:

$ tar xzf ankimini.tar.gz

Make sure to untar from the device, not your host computer, or you'll lose
permissions on some of the files.

You'll now have an ankimini directory. There is a configuration file there
which you need to copy into your home directory if you haven't before.

# cp ankimini/ankimini-config.py ~/.ankimini-config.py

You'll need to edit that file later to change your sync username and password.
If you are not comfortable with Unix editors, the fastest way would be to copy
the file to your local computer, edit it, and copy it back.

Now you need to copy your deck to the ankimini directory. By default, AnkiMini
looks for a file called 'tango.anki'. You can change this if you edit the
configuration file.

Next we want to test if ankimini runs.

$ ankimini/ankimini
open deck..ankimini/tango.anki done
starting server on port 8000

If that appears, then you can test it. Without closing the terminal you're on,
open Safari on your device, and in the location bar, type:

http://127.0.0.1:8000/

Bookmark this page if it loads.

If everything has gone well, you should be able to review, save and sync. When
you're happy with how things are working, it's time to start AnkiMini again
but ensure it keeps running when you close the terminal session. Go back to
the terminal that AnkiMini is running on, and press Ctrl+C to stop AnkiMini.
Then run it again with:

$ nohup ankimini/ankimini &

Make sure to wait about 30 seconds before testing. You can then close the
terminal. When you want to use Anki in the future, simply load the bookmark
you saved earlier.

Note that if you turn your device off, you'll need to start the Anki server
manually again. Make sure to save before turning off the device.

There is no need to disable the server when you're not using it - it takes up
a little memory, but uses no processing power when you're not actually using
it, so it won't change your battery life.

Multiple decks
--------------

If you have more than one deck, register the deck you want to start with as
before. Then in the location bar, enter URLs the following. All decks should
be in the same directory as the deck you've set as your startup deck.

http://127.0.0.1:8000/switch?d=deck1.anki

http://127.0.0.1:8000/switch?d=deck2.anki

Bookmark each in turn. Visiting the bookmark will save the current deck,
switch to the new deck, and display the next question. It will take a few
seconds to switch between decks.

Starting automatically
----------------------

Instructions from Richard Colley:

1. Create a file /Library/LaunchDaemons/com.Anki.plist and put the following
in it:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
       <key>KeepAlive</key>
       <true/>
       <key>Label</key>
       <string>com.Anki</string>
       <key>ProgramArguments</key>
       <array>
               <string>/bin/sh</string>
               <string>--noediting</string>
               <string>-c</string>
               <string>/var/mobile/ankimini/ankimini</string>
       </array>
       <key>UserName</key>
       <string>mobile</string>
       <key>WorkingDirectory</key>
       <string>/var/mobile/ankimini</string>
</dict>
</plist>

2. launchctl load -w /System/Library/LaunchDaemons/com.Anki.plist

Starting/stopping Anki
----------------------

If you don't want to leave Anki running all the time, you can set it up to
start when you request it, instead.

Instructions from Richard Colley:

Also, once you get this working, you can start and stop the ankimini
server if you change the com.Anki.plist file by setting:

       <key>KeepAlive</key>
       <false/>

Then unload, and load this config.

 root#  launchctl unload -w /Library/LaunchDaemons/com.Anki.plist
 root#  launchctl load -w /Library/LaunchDaemons/com.Anki.plist

Then to start the server:

 root# launchctl start com.Anki

and to stop

 root# launchctl stop com.Anki

status with

 root# launchctl list com.Anki

NB: if you do this, anki won't start on boot.

Then, if you want to be really tricky, you can use BossPrefs to start/
stop ankimini server.  You need to create a file called /Applications/
BossPrefs.app/services/AnkiMini with the following contents:

   launchctl start com.Anki
   launchctl stop com.Anki
   ankimini/main.py
   /var/mobile/ankimini/ankimini.png

Then, start BossPrefs, and you should see a toggle called AnkiMini.
If it is "ON", then ankimini should be running/started.

Changes:
--------

---------------
AnkiMini 1.1.8:
---------------

- set smaller cache size to reduce memory footprint

---------------
AnkiMini 1.1.7:
---------------

- libanki 0.9.9.7.9b

---------------
AnkiMini 1.1.7:
---------------

- libanki 0.9.9.7.9b

---------------
AnkiMini 1.1.6:
---------------

- libanki 0.9.9.7.9

---------------
AnkiMini 1.1.5:
---------------

- libanki 0.9.9.7.6

---------------
AnkiMini 1.1.4:
---------------

- libanki 0.9.9.7

---------------
AnkiMini 1.1.3:
---------------

- new libanki
- fix marking card
- update autostart code to use mobile user, not root user

---------------
AnkiMini 1.1.2:
---------------

- documentation changes
- new libanki

---------------
AnkiMini 1.1.2:
---------------

- new libanki

---------------
AnkiMini 1.1.1:
---------------

- new libanki

---------------
AnkiMini 1.1.0:
---------------

- new button layout
- new libanki

---------------
AnkiMini 1.0.9:
---------------

- rebuild with new libanki

---------------
AnkiMini 1.0.8:
---------------

- rebuild with libanki fix

---------------
AnkiMini 1.0.7:
---------------

- rebuild with libanki fix

---------------
AnkiMini 1.0.6:
---------------

- fix a bug where sound was played twice

---------------
AnkiMini 1.0.5:
---------------

To enable sound support, AnkiMini has to be run as user 'mobile', not user
'root', so you'll need to either copy the files from root's user directory, or
repeat the ankimini page of the installation.

- sound support (see prereq 7 at top of document)
- image support
- check new card count after sync or refresh
- replay sound button
- mark card button
- easier to hit buttons
- more readable stats

---------------
AnkiMini 1.0.4:
---------------

- update due counts when page refreshed
- update due counts after sync

---------------
AnkiMini 1.0.3:
---------------

- support for multiple decks
- make sure to refresh queue when checking if deck is finished
- make sure clock is set correctly when syncing
- latest anki library (new sync screen, scheduling, etc)

---------------
AnkiMini 1.0.2:
---------------

- congratulations page properly displayed when deck finished
- no longer refreshes page on each action (faster)
- hide location bar
- since the location doesn't change, running the anki icon on the home screen
  will reuse an existing window
- icon for the iphone
- latest libanki library

If you're an existing user, please change the bookmark to:

  http://127.0.0.1:8000/

---------------
AnkiMini 1.0.1:
---------------

- much faster syncing - 15-30+ seconds reduced to 3.5 seconds on 4000 card deck
- interface improvements
- new anki library with new scheduling options

-------------
AnkiMini 1.0:
-------------

- initial release

ankimini's People

Contributors

dae avatar typerlc avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.