Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Initial import of KITCard Reader 0.9.
Browse files Browse the repository at this point in the history
This is the source code of the initial release on Google's Play Store.

Signed-off-by: Philipp Kern <[email protected]>
  • Loading branch information
pkern committed Sep 7, 2012
0 parents commit fb4bdfb
Show file tree
Hide file tree
Showing 31 changed files with 870 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
33 changes: 33 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>KITCard Reader</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
33 changes: 33 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.Ox539.kitcard.reader"
android:versionCode="8"
android:versionName="0.9" >

<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>

</manifest>
5 changes: 5 additions & 0 deletions THANKS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Kudos go to Fabian Knittel for his persistence in getting the reverse
engineering done.

For the app development thanks go to Isabel Slawik and Daniel Lemcke
who gave valuable tips for the design of the app.
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
1 change: 1 addition & 0 deletions gen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
Binary file added ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-14
Binary file added res/drawable-hdpi/ic_action_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-ldpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_action_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_action_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions res/layout-land/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
android:id="@+id/balances_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:paddingLeft="16sp"
android:paddingRight="32sp"
android:paddingTop="16sp" >

<TextView
android:id="@+id/textView5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/balance"
android:textAppearance="@style/HeadingTextAppearance" />

<TextView
android:id="@+id/balance"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="right"
android:text="0.00 €"
android:textAppearance="@style/BalanceTextAppearance" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="24sp"
android:text="@string/last_transaction"
android:textAppearance="@style/HeadingTextAppearance" />

<TextView
android:id="@+id/lasttransaction"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="0.00 €"
android:textAppearance="@style/BalanceSmallTextAppearance" />
</LinearLayout>

</RelativeLayout>
103 changes: 103 additions & 0 deletions res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:orientation="vertical"
android:paddingLeft="16sp"
android:paddingRight="32sp"
android:paddingTop="16sp" >

<TextView
android:id="@+id/textView5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/balance"
android:textAppearance="@style/HeadingTextAppearance" />

<TextView
android:id="@+id/balance"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="right"
android:text="0.00 €"
android:textAppearance="@style/BalanceTextAppearance" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="24sp"
android:text="@string/last_transaction"
android:textAppearance="@style/HeadingTextAppearance" />

<TextView
android:id="@+id/lasttransaction"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="0.00 €"
android:textAppearance="@style/BalanceSmallTextAppearance" />

<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="64sp"
android:text="@string/details"
android:textAppearance="@style/HeadingTextAppearance" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="16sp" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/card_type"
android:textAppearance="@style/DescriptionTextAppearance" />

<TextView
android:id="@+id/card_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textAppearance="@style/DescriptionTextAppearance" />

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/card_number"
android:textAppearance="@style/DescriptionTextAppearance" />

<TextView
android:id="@+id/cardno"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textAppearance="@style/DescriptionTextAppearance" />
</LinearLayout>

</LinearLayout>
</LinearLayout>

</RelativeLayout>
6 changes: 6 additions & 0 deletions res/menu/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <item android:id="@+id/menu_settings"
android:title="@string/menu_settings"
android:orderInCategory="100"
android:showAsAction="never" /> -->
</menu>
21 changes: 21 additions & 0 deletions res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<resources>
<string name="app_name">KITCard-Leser</string>
<!-- <string name="menu_settings">Einstellungen</string> -->

<!-- Main activity -->
<string name="card_number">Kartennummer</string>
<string name="balance">Kontostand</string>
<string name="last_transaction">Letzte Transaktion</string>
<string name="card_type">Kartentyp</string>
<string name="details">Details</string>

<!-- Card types -->
<string name="student">Student</string>
<string name="employee">Mitarbeiter</string>
<string name="guest">Gast</string>
<string name="unknown">Unbekannt</string>

<!-- Messages -->
<string name="activate_nfc">Bitte aktiviere NFC und drücke Zurück, um zur Applikation zurückzukehren!</string>
<string name="kitcard_read_failed">Das Lesen der KITCard ist fehlgeschlagen!</string>
</resources>
14 changes: 14 additions & 0 deletions res/values-large/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="BalanceTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textSize">96sp</item>
<item name="android:textStyle">bold</item>
</style>

<style name="BalanceSmallTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textSize">86sp</item>
</style>

<style name="DescriptionTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textSize">20sp</item>
</style>
</resources>
5 changes: 5 additions & 0 deletions res/values-v11/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>

<style name="AppTheme" parent="android:Theme.Holo" />

</resources>
5 changes: 5 additions & 0 deletions res/values-v14/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>

<style name="AppTheme" parent="android:Theme.Holo" />

</resources>
21 changes: 21 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<resources>
<string name="app_name">KITCard Reader</string>
<!-- <string name="menu_settings">Settings</string> -->

<!-- Main activity -->
<string name="card_number">Card number</string>
<string name="balance">Balance</string>
<string name="last_transaction">Last transaction</string>
<string name="card_type">Card type</string>
<string name="details">Details</string>

<!-- Card types -->
<string name="student">Student</string>
<string name="employee">Employee</string>
<string name="guest">Guest</string>
<string name="unknown">Unknown</string>

<!-- Messages -->
<string name="activate_nfc">Please activate NFC and press Back to return to the application!</string>
<string name="kitcard_read_failed">KITCard reading failed!</string>
</resources>
23 changes: 23 additions & 0 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="android:Theme.Light">
<item name="android:textAppearance">@style/BalanceTextAppearance</item>
</style>

<style name="BalanceTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textSize">65sp</item>
<item name="android:textStyle">bold</item>
</style>

<style name="BalanceSmallTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textSize">50sp</item>
</style>

<style name="HeadingTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textAllCaps">true</item>
<item name="android:textSize">20sp</item>
</style>

<style name="DescriptionTextAppearance" parent="@android:style/TextAppearance">
<item name="android:textSize">16sp</item>
</style>
</resources>
7 changes: 7 additions & 0 deletions res/xml/nfc_tech_filter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.MifareClassic</tech>
<tech>android.nfc.tech.NfcA</tech>
<tech>android.nfc.tech.NdefFormatable</tech>
</tech-list>
</resources>
23 changes: 23 additions & 0 deletions src/de/Ox539/kitcard/reader/CardType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package de.Ox539.kitcard.reader;

import android.content.res.Resources;

enum CardType {
STUDENT,
EMPLOYEE,
GUEST,
UNKNOWN;

public String toString(Resources res) {
switch(this) {
case STUDENT:
return res.getString(R.string.student);
case EMPLOYEE:
return res.getString(R.string.employee);
case GUEST:
return res.getString(R.string.guest);
default:
return res.getString(R.string.unknown);
}
}
}
Loading

0 comments on commit fb4bdfb

Please sign in to comment.