Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/janheinrichmerker/android-canteen-balance

Helper library to read out the current balance of canteen cards using NFC.
https://github.com/janheinrichmerker/android-canteen-balance

android android-canteen-balance android-library canteen-cards intercard magnacarta nfc university ximedes

Last synced: 3 months ago
JSON representation

Helper library to read out the current balance of canteen cards using NFC.

Awesome Lists containing this project

README

        

![Icon](http://i.imgur.com/63PHxkq.png)

android-canteen-balance
=======================

[![JitPack](https://jitpack.io/v/com.heinrichreimersoftware/android-canteen-balance.svg)](https://jitpack.io/#com.heinrichreimersoftware/android-canteen-balance)
[![Build Status](https://travis-ci.org/janheinrichmerker/android-canteen-balance.svg?branch=master)](https://travis-ci.org/janheinrichmerker/android-canteen-balance)
[![License](https://img.shields.io/github/license/janheinrichmerker/android-canteen-balance.svg)](https://github.com/janheinrichmerker/android-canteen-balance/blob/master/LICENSE.txt)

Helper library to read out the current balance of canteen cards using NFC.

Supports the following cards:

* [InterCard](http://www.intercard.de/cms/intercard/index.html)
* [Ximedes](https://www.ximedes.com/paytech/) (formerly [MagnaCarta](https://www.ximedes.com/ximedes-press-release/))
([Full list](https://github.com/janheinrichmerker/android-canteen-balance/tree/master#tested-university-cards) of tested universities at the bottom of the page.)

Dependency
----------

*android-canteen-balance* is available on [**jitpack.io**](https://jitpack.io/#com.heinrichreimersoftware/android-canteen-balance)

**Gradle dependency:**
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
```gradle
dependencies {
compile 'com.heinrichreimersoftware:android-canteen-balance:0.1.2'
}
```

How-To-Use
-----

*android-canteen-balance* sends broadcasts whenever a card is detected.
You could either extend `AbstractCardBalanceReceiver` if you want to handle the card balance in the background or `AbstractCardBalanceActivity` if you need the data in an activity.

**Option 1:** Using `AbstractCardBalanceActivity`:
```java
public class CardBalanceActivity extends AbstractCardBalanceActivity{
@Override
protected void onReceiveCardBalance(CardBalance balance) {
//TODO do something with the balance
}
}
```

**Option 2:** Using `AbstractCardBalanceReceiver`:
```java
public class CardBalanceReceiver extends AbstractCardBalanceReceiver{
@Override
protected void onReceiveCardBalance(Context context, CardBalance balance) {
//TODO do something with the balance
}
}
```
Dynamically register an instance of this receiver:
```java
Context.registerReceiver(receiver, new IntentFilter(CardBalance.ACTION_CARD_BALANCE))
```
Or statically publish an implementation in your AndroidManifest.xml:

```xml







```

Changes
-------

See the [releases section](https://github.com/janheinrichmerker/android-canteen-balance/releases) for detailed changelogs.

Open source libraries
-------

*android-canteen-balance* is mainly based on [MensaGuthaben](https://github.com/jakobwenzel/MensaGuthaben) by [@Jakob Wenzel](https://github.com/jakobwenzel) (GNU General Public License v3).
It also uses some methods of [Apache Commons Lang](https://github.com/apache/commons-lang)'s [ArrayUtils.java](https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/ArrayUtils.java) (Apache License 2.0).

Tested university cards
-------

![Map](http://maps.googleapis.com/maps/api/staticmap?autoscale=2&size=700x400&maptype=roadmap&format=png&visual_refresh=true&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C49.89386,+10.88612&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C49.92881,+11.58583&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C52.03541,+8.49634&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C51.44566,+7.2616&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C52.27349,+10.52971&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C53.10675,+8.85203&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C51.80671,+10.34409&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C49.8751,+8.65687&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C49.86643,+8.63843&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C51.02927,+13.72899&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C51.48613,+11.96953&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C52.32123,+9.8152&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C49.41914,+8.67024&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C50.68376,+10.93108&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C50.33604,+7.56956&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C50.93318,+6.94162&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C50.92816,+6.92881&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C51.33857,+12.37846&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C48.78158,+9.17467&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C49.783,+9.97084&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C50.89341,+14.80446&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C47.68951,+9.18685&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C47.66767,+9.17171&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C52.51939,+7.32264&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C52.27130,+8.04431&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C52.39395,+13.13325&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C52.40104,+13.01182)

* [Otto-Friedrich-Universität **Bamberg**](https://www.uni-bamberg.de/)
* [Universität **Bayreuth**](https://www.uni-bayreuth.de/) (only print-/copy-balance visible)
* [Universität **Bielefeld**](https://www.uni-bielefeld.de/) (only newer cards)
* [Ruhr-Universität **Bochum**](http://www.ruhr-uni-bochum.de/) (only newer cards)
* [Technische Universität **Braunschweig**](https://www.tu-braunschweig.de/)
* [Universität **Bremen**](http://www.uni-bremen.de/)
* [Technische Universität **Clausthal**](http://www.tu-clausthal.de/)
* [Technische Universität **Darmstadt**](https://www.tu-darmstadt.de/)
* [Hochschule **Darmstadt**](https://www.h-da.de/)
* [Technische Universität **Dresden**](https://tu-dresden.de/)
* [Martin-Luther-Universität **Halle-Wittenberg**](http://www.uni-halle.de/)
* [Hochschule **Hannover**](http://www.hs-hannover.de/)
* [Ruprecht-Karls-Universität **Heidelberg**](https://www.uni-heidelberg.de/)
* [Technische Universität **Ilmenau**](https://www.tu-ilmenau.de/)
* [Hochschule **Koblenz**](https://www.hs-koblenz.de/)
* [Rheinische Fachhochschule **Köln**](http://www.rfh-koeln.de/)
* [Universität zu **Köln**](http://www.uni-koeln.de/)
* [Universität **Konstanz**](https://www.uni-konstanz.de/)
* [Hochschule **Konstanz** Technik, Wirtschaft und Gestaltung](http://www.htwg-konstanz.de/)
* [Universität **Leipzig**](http://www.uni-leipzig.de/)
* [Hochschule **Osnabrück**](https://www.hs-osnabrueck.de/)
* [Universität **Osnabrück**](https://www.uni-osnabrueck.de/)
* [Hasso-Plattner-Institut **Potsdam**](https://hpi.de/)
* [Universität **Potsdam**](http://www.uni-potsdam.de/)
* [Universität **Stuttgart**](http://www.uni-stuttgart.de/)
* [Julius-Maximilians-Universität **Würzburg**](https://www.uni-wuerzburg.de/)
* [Hochschule **Zittau/Görlitz**](http://www.hszg.de/)

License
-------

```
Copyright (C) 2016 Heinrich Reimer

Authors:
Heinrich Reimer

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see .
```