└── FCFReaderForPasori
├── .classpath
├── .project
├── AndroidManifest.xml
├── README-utf8-jp.txt
├── bin
├── AndroidManifest.xml
├── FCFReaderForPasori.apk
├── classes.dex
├── classes
│ └── jp
│ │ └── ac
│ │ └── kumamoto_u
│ │ └── cc
│ │ ├── fcf
│ │ ├── FCFService.class
│ │ ├── Felica.class
│ │ ├── FelicaArea.class
│ │ ├── FelicaCard.class
│ │ ├── FelicaService.class
│ │ ├── KumadaiService.class
│ │ └── Pasori.class
│ │ └── fcfreaderforpasori
│ │ ├── AttendanceActivity$1.class
│ │ ├── AttendanceActivity.class
│ │ ├── BuildConfig.class
│ │ ├── ChallengeActivity.class
│ │ ├── ConfigActivity.class
│ │ ├── Installation.class
│ │ ├── LogViewActivity.class
│ │ ├── MainActivity$1.class
│ │ ├── MainActivity$2.class
│ │ ├── MainActivity.class
│ │ ├── MyApplication.class
│ │ ├── MyHandler.class
│ │ ├── Prefs$1.class
│ │ ├── Prefs$2.class
│ │ ├── Prefs$3.class
│ │ ├── Prefs$4.class
│ │ ├── Prefs.class
│ │ ├── R$array.class
│ │ ├── R$attr.class
│ │ ├── R$drawable.class
│ │ ├── R$id.class
│ │ ├── R$layout.class
│ │ ├── R$menu.class
│ │ ├── R$string.class
│ │ ├── R$style.class
│ │ ├── R$xml.class
│ │ └── R.class
├── jarlist.cache
├── res
│ ├── drawable-hdpi
│ │ ├── ic_action_search.png
│ │ └── ic_launcher.png
│ ├── drawable-ldpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ ├── ic_action_search.png
│ │ └── ic_launcher.png
│ └── drawable-xhdpi
│ │ ├── ic_action_search.png
│ │ └── ic_launcher.png
└── resources.ap_
├── gen
└── jp
│ └── ac
│ └── kumamoto_u
│ └── cc
│ └── fcfreaderforpasori
│ ├── BuildConfig.java
│ └── R.java
├── ic_launcher-web.png
├── libs
└── android-support-v4.jar
├── license.txt
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ ├── ic_action_search.png
│ └── ic_launcher.png
├── drawable-ldpi
│ └── ic_launcher.png
├── drawable-mdpi
│ ├── ic_action_search.png
│ └── ic_launcher.png
├── drawable-xhdpi
│ ├── ic_action_search.png
│ └── ic_launcher.png
├── layout
│ ├── activity_challenge.xml
│ ├── activity_config.xml
│ ├── activity_main.xml
│ ├── attendance.xml
│ ├── logview.xml
│ ├── tab1.xml
│ ├── tab2.xml
│ └── tab3.xml
├── menu
│ └── menu.xml
├── values-ja
│ └── strings.xml
├── values-v11
│ └── styles.xml
├── values
│ ├── strings.xml
│ └── styles.xml
└── xml
│ ├── device_filter.xml
│ └── settings.xml
└── src
└── jp
└── ac
└── kumamoto_u
└── cc
├── fcf
├── FCFService.java
├── Felica.java
├── FelicaArea.java
├── FelicaCard.java
├── FelicaService.java
├── KumadaiService.java
└── Pasori.java
└── fcfreaderforpasori
├── AttendanceActivity.java
├── ChallengeActivity.java
├── ConfigActivity.java
├── Installation.java
├── LogViewActivity.java
├── MainActivity.java
├── MyApplication.java
├── MyHandler.java
└── Prefs.java
/FCFReaderForPasori/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | FCFReaderForPasori
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
11 |
17 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
36 |
37 |
41 |
42 |
45 |
46 |
49 |
50 |
53 |
54 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/README-utf8-jp.txt:
--------------------------------------------------------------------------------
1 | ・FCFReaderForPaSoRiについて
2 |
3 | USBホスト機能を備えたAndroid 3.2以降のAndroidタブレットとPaSoRiリーダーを組み
4 | 合わせた
5 | FCFキャンパスカード用のICカード読取りソフトです。スタンドアロンの出席登録端末と
6 | して
7 | 使うことを想定しています。
8 |
9 | 本アプリはAndroidタブレットとPaSoRiリーダーの組み合わせによるFCFキャンパスカー
10 | ド読取り動作の実証を目的としたもので、
11 | 本体内に記録されたデータの機密性・完全性については何ら特別な対処は行っていません。
12 | したがって、実業務への利用を
13 | 想定したものではありません。
14 |
15 | 本ソフト自体の不具合、ならびにタブレット本体の盗難・紛失・破損に伴って本体内に記
16 | 録されたデータの機密性・完全性が
17 | 失われることに十分留意の上ご利用ください。
18 |
19 | ・本ソフトの機能
20 |
21 | 本ソフトには以下の機能があります:
22 |
23 | (1)FCFキャンパスカードの読取り機能
24 |
25 | FCFキャンパスフォーマットに対応したICカードをかざすと、学生番号・現在時
26 | 刻が
27 | ログに保存されます。
28 |
29 | 注:FCFキャンパスカードでないICカードをかざしても何も起きません
30 |
31 | (2)出席受付け時刻設定機能
32 |
33 | 出席登録の開始・終了時間を指定することができます。
34 |
35 | (3)画面ロック機能
36 |
37 | 出席登録受付け中に誤って画面操作をしてしまわないよう、操作画面をロックす
38 | ることができます。
39 | 暗唱番号を入力して画面ロックを解除します。なお、暗唱番号の初期値は「0000」
40 | です。
41 |
42 |
43 | ・動作環境
44 |
45 | 以下の機器での動作を確認しています。ただし、状況によってはPaSoRiリーダーがAndroid
46 | に
47 | うまく認識されないことがあります。その場合はUSBケーブルの抜き出し、アプリの再起
48 | 動などの操作を
49 | 行ってください。
50 |
51 | (1)Androidタブレット
52 |
53 | GalaxyNoteSC-05D(Android4.0,5.3インチ)
54 | Nexus 7(Android 4.1, 7インチ)
55 | ICONIA A500(Android 3.2, 10.1インチ)
56 |
57 | (2)PaSoRiリーダー
58 |
59 | RC-S360(スティック型)
60 | RC-S370(卓上設置型)
61 |
62 | ・使い方
63 |
64 | (1)アプリのインストール
65 |
66 | 本アプリ(FCFReaderForPaSoRi)をAndroidタブレットにインストールします。
67 | Androidタブレットで以下のURIにアクセスし、本アプリのバイナリをダウンロード・インストールしてください:
68 |
69 | https://github.com/nagai-takayuki/Android/raw/master/FCFReaderForPasori/bin/FCFReaderForPasori.apk
70 |
71 | (2)PaSoRiリーダーの接続
72 |
73 | PaSoRiリーダーをタブレットのUSBポートに接続してください。USB OTG対応タ
74 | ブレットの場合は
75 | 接続にUSB OTGケーブルも必要になります。
76 |
77 | (3)FCFReaderForPaSoRiの起動
78 |
79 | 本アプリを起動します。
80 |
81 | (4)ICカードの読取り
82 |
83 | (4-1)画面右上の設定メニューから「設定」を選択します
84 |
85 | カード読取り時のビープON/OFF,暗唱番号変更を行います
86 |
87 | 必要な設定を行ったら「Backキー」を押してメイン画面に戻ります
88 |
89 | (4-2)出席受付け時刻の設定
90 |
91 | メイン画面上部の「出席設定」をクリックし、出席受付け開始時刻、出席受付け
92 | 時間を設定します。
93 |
94 | 出席受付時間を「0分」に設定すると、「受付締切なし」の意味になります。
95 |
96 | (4-3)出席受付開始
97 |
98 | メイン画面上部の「出席登録」をクリックすると、出席登録画面になります。
99 |
100 | 出席登録受付け中の画面操作を禁止したい場合は、画面右上の「画面ロック」を
101 | クリックしてください。
102 |
103 | 操作画面のロックを解除するには、画面右上の「画面ロック解除」をクリックし
104 | てください。
105 | 暗唱番号を正しく入力すると画面ロックが解除されます。
106 |
107 | (4-4)出席記録閲覧
108 |
109 | メイン画面上部の「出席ログ」をクリックすると、出席記録閲覧画面になります。
110 | ログの表示項目は「打刻時刻,タイムゾーン,ユーザ区分,学生番号,カード有効期
111 | 限」となっています。
112 |
113 | (4-5)終了操作
114 |
115 | 本アプリを手動で終了される場合は画面右上の設定メニューから「終了」を選択
116 | します。
117 | 主にアプリケーションを多重起動してしまった場合に利用します。
118 |
119 | (4-6)出席記録の消去
120 |
121 | 画面右上の設定メニューから「設定」を選択します
122 |
123 | 「出席ログ消去」の項目をクリックすると出席記録が消去されます。
124 |
125 | ・出席ログの読み出し方法
126 |
127 | 出席ログはAndroidタブレット本体のアプリケーション用領域にFCF.logという
128 | ファイル名で保存されています。
129 | AndroidタブレットをPCにMTPデバイスとして接続することで出席ログを読み出
130 | すことができます。
131 |
132 | 例えば、Nexus7の場合では
133 | /Android/data/jp.ac.kumamoto_u.cc.fcfreaderforpsori/files/FCF.log
134 | に出席ログが保存されています。
135 |
136 | ・注意事項
137 |
138 | (1)デバッグ出力について
139 |
140 | 本ソフトの動作状況確認、並びにICカードに対する不正なアクセスを行っていな
141 | いことを明らかにするため、
142 | Android標準のログ機能を用いたデバッグ出力を行っています。このデバッグ出
143 | 力にはPaSoRiリーダーとやりとりしたデータ、
144 | 画面ロック解除用の暗唱番号等が含まれます。
145 |
146 | デバッグ出力の内容はadb USB protocolに対応したツール(Eclipse上のAndroid
147 | 開発環境など)で表示させることができます。
148 |
149 | (1)PaSoRiリーダーの認識に失敗した場合の症状
150 |
151 | 出席登録画面に「Pasoriリーダーの初期中です」と表示されたままになっている
152 | 場合は、
153 | Pasoriリーダーの認識に失敗しています(本アプリを多重起動した場合によくこ
154 | の症状が出ます)。
155 | この場合はUSBケーブルを抜き出しする、多重起動されているアプリを終了させ
156 | るなどの操作を
157 | 行ってください。
158 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
11 |
17 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
36 |
37 |
41 |
42 |
45 |
46 |
49 |
50 |
53 |
54 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/FCFReaderForPasori.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/FCFReaderForPasori.apk
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes.dex
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FCFService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FCFService.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/Felica.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/Felica.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FelicaArea.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FelicaArea.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FelicaCard.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FelicaCard.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FelicaService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/FelicaService.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/KumadaiService.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/KumadaiService.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/Pasori.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcf/Pasori.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/AttendanceActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/AttendanceActivity$1.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/AttendanceActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/AttendanceActivity.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/BuildConfig.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/ChallengeActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/ChallengeActivity.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/ConfigActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/ConfigActivity.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Installation.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Installation.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/LogViewActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/LogViewActivity.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MainActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MainActivity$1.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MainActivity$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MainActivity$2.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MainActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MainActivity.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MyApplication.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MyApplication.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MyHandler.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MyHandler.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$1.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$2.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$3.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$3.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$4.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs$4.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$array.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$array.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$attr.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$drawable.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$id.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$layout.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$menu.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$menu.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$string.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$style.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$xml.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R$xml.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/classes/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R.class
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependecy. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/res/drawable-hdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/res/drawable-hdpi/ic_action_search.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/res/drawable-mdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/res/drawable-mdpi/ic_action_search.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/res/drawable-xhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/res/drawable-xhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/bin/resources.ap_
--------------------------------------------------------------------------------
/FCFReaderForPasori/gen/jp/ac/kumamoto_u/cc/fcfreaderforpasori/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/FCFReaderForPasori/gen/jp/ac/kumamoto_u/cc/fcfreaderforpasori/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
9 |
10 | public final class R {
11 | public static final class array {
12 | public static final int duration_list=0x7f060000;
13 | }
14 | public static final class attr {
15 | }
16 | public static final class drawable {
17 | public static final int ic_action_search=0x7f020000;
18 | public static final int ic_launcher=0x7f020001;
19 | }
20 | public static final class id {
21 | public static final int analogClock1=0x7f09000f;
22 | public static final int buttonChallengeCancel=0x7f090007;
23 | public static final int buttonChallengeOK=0x7f090005;
24 | public static final int button_reset=0x7f090009;
25 | public static final int digitalClock1=0x7f090010;
26 | public static final int durationSpinner=0x7f09000b;
27 | public static final int editText1=0x7f090002;
28 | public static final int linearLayout1=0x7f090000;
29 | public static final int linearLayout2=0x7f090001;
30 | public static final int logTextView=0x7f090014;
31 | public static final int logViewTab=0x7f090012;
32 | public static final int menu=0x7f090018;
33 | public static final int quit=0x7f09001b;
34 | public static final int sample1=0x7f090015;
35 | public static final int sample2=0x7f090016;
36 | public static final int sample3=0x7f090017;
37 | public static final int screenlock=0x7f090019;
38 | public static final int scrollView1=0x7f090013;
39 | public static final int settings=0x7f09001a;
40 | public static final int startTimePicker=0x7f090008;
41 | public static final int tab1=0x7f09000c;
42 | public static final int tab2=0x7f09000d;
43 | public static final int tab3=0x7f09000e;
44 | public static final int textChallengeNumber=0x7f090004;
45 | public static final int textChallengeResult=0x7f090006;
46 | public static final int textView1=0x7f090003;
47 | public static final int textView2=0x7f09000a;
48 | public static final int textView3=0x7f090011;
49 | }
50 | public static final class layout {
51 | public static final int activity_challenge=0x7f030000;
52 | public static final int activity_config=0x7f030001;
53 | public static final int activity_main=0x7f030002;
54 | public static final int attendance=0x7f030003;
55 | public static final int logview=0x7f030004;
56 | public static final int tab1=0x7f030005;
57 | public static final int tab2=0x7f030006;
58 | public static final int tab3=0x7f030007;
59 | }
60 | public static final class menu {
61 | public static final int menu=0x7f080000;
62 | }
63 | public static final class string {
64 | public static final int app_name=0x7f050000;
65 | public static final int attendance_title=0x7f050004;
66 | public static final int detectPasori_summary=0x7f050016;
67 | public static final int detectPasori_title=0x7f050015;
68 | public static final int enableBeep_summary=0x7f05000c;
69 | public static final int enableBeep_title=0x7f05000b;
70 | public static final int hello_world=0x7f050001;
71 | public static final int label_cancel=0x7f050026;
72 | public static final int label_reset=0x7f050025;
73 | public static final int lockNumber_summary=0x7f050012;
74 | public static final int lockNumber_title=0x7f050011;
75 | public static final int logDelete_summary=0x7f050014;
76 | public static final int logDelete_title=0x7f050013;
77 | public static final int logview_title=0x7f050005;
78 | public static final int menu_settings=0x7f050002;
79 | public static final int msg_already_closed=0x7f05001a;
80 | public static final int msg_correct_lockNumber=0x7f05001d;
81 | public static final int msg_enter_lockNumber=0x7f05001c;
82 | public static final int msg_loading_data=0x7f05001f;
83 | public static final int msg_no_data_found=0x7f050020;
84 | public static final int msg_not_opened=0x7f050018;
85 | public static final int msg_now_initializing=0x7f050017;
86 | public static final int msg_place_card=0x7f050019;
87 | public static final int msg_really_delete_log=0x7f05001b;
88 | public static final int msg_wrong_lockNumber=0x7f05001e;
89 | public static final int preference_title=0x7f050006;
90 | public static final int quit_title=0x7f05000a;
91 | public static final int readKumadaiID_summary=0x7f05000e;
92 | public static final int readKumadaiID_title=0x7f05000d;
93 | public static final int readerName_summary=0x7f050010;
94 | public static final int readerName_title=0x7f05000f;
95 | public static final int screenlock_title=0x7f050007;
96 | public static final int screenunlock_title=0x7f050008;
97 | public static final int settings_title=0x7f050009;
98 | public static final int title_activity_challenge=0x7f050027;
99 | public static final int title_activity_config=0x7f050021;
100 | public static final int title_activity_main=0x7f050003;
101 | public static final int title_duration_minute=0x7f050024;
102 | public static final int title_end_time=0x7f050023;
103 | public static final int title_start_time=0x7f050022;
104 | }
105 | public static final class style {
106 | public static final int AppTheme=0x7f070000;
107 | }
108 | public static final class xml {
109 | public static final int device_filter=0x7f040000;
110 | public static final int settings=0x7f040001;
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/ic_launcher-web.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/FCFReaderForPasori/license.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
--------------------------------------------------------------------------------
/FCFReaderForPasori/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-12
15 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/drawable-hdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/res/drawable-hdpi/ic_action_search.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/drawable-mdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/res/drawable-mdpi/ic_action_search.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/drawable-xhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/res/drawable-xhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nagai-takayuki/Android/0cfefdb4e8864e15c26368f3b8815b738598ab21/FCFReaderForPasori/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/activity_challenge.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
20 |
21 |
29 |
30 |
38 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
59 |
60 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/activity_config.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
18 |
19 |
26 |
27 |
31 |
32 |
38 |
39 |
40 |
44 |
45 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
19 |
23 |
24 |
28 |
29 |
30 |
34 |
35 |
36 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/attendance.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
15 |
16 |
23 |
24 |
25 |
32 |
33 |
40 |
41 |
48 |
49 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/logview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
26 |
27 |
31 |
32 |
35 |
36 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/tab1.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/tab2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/layout/tab3.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/values-ja/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | FCFReaderForPasori
4 | 設定
5 | FCFReaderForPasori
6 |
7 | 出席登録
8 | 出席ログ
9 | 設定
10 | 出席設定
11 |
12 | 画面ロック
13 | 画面ロック解除
14 |
15 | 設定
16 | 終了
17 |
18 | ビープ音
19 | FCFカード読み取り成功時にビープ音を鳴らします
20 |
21 | 熊本大学ID読み取り
22 | 熊本大学IDを読み取ります
23 |
24 | リーダー名
25 | このリーダーの名前を設定します
26 |
27 | 暗証番号
28 | 操作ロック解除用の暗証番号を登録します
29 |
30 | 出席ログ消去
31 | 出席ログを消去します
32 |
33 | Pasoriリーダ検出
34 | Pasoriリーダを検出します
35 |
36 | Pasoriリーダーの初期化中です
37 | 出席登録開始までしばらくお待ち下さい
38 | カードをかざして下さい
39 | 出席登録は閉めきりました
40 | 本当に出席ログを消去しますか?
41 | 暗証番号を入力してください
42 | 暗証番号が一致しませした
43 | 暗証番号が一致しませんでした
44 | データの読み込み中です
45 | 記録されているデータはありません
46 |
47 | 受付開始時刻
48 | 受付終了時刻
49 | 受付期間(分)
50 |
51 | リセット
52 | キャンセル
53 |
54 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | FCFReaderForPasori
4 | Hello world!
5 | Settings
6 | FCFReaderForPasori
7 | Attendance
8 | LogView
9 | Preference
10 | screen lock
11 | screen unlock
12 | settings
13 | quit
14 | enableBeep
15 | Beep when IC card is read
16 | readKumadaiID
17 | Read KumadaiID in IC Card
18 | readerName
19 | The nickname of this reader
20 | lockNumber
21 | Reader lock number
22 | deleteLog
23 | Delete FCF log
24 | detectPasori
25 | Detect Pasori Reader
26 | Now initializing Pasori
27 | Check-in starts later. Wait for a moment.
28 | Place your card on Pasori Reader.
29 | Check-in already closed.
30 | Do you really delete log ?
31 |
32 | Enter Lock Number
33 | Lock Number Confirmed.
34 | Your number is wrong.
35 |
36 | Loading data ...
37 | No data found.
38 |
39 | ConfigActivity
40 | Start Time
41 | End Time
42 | Duration
43 | Reset
44 | Cancel
45 |
46 |
47 | 0
48 | 1
49 | 10
50 | 20
51 | 30
52 | 40
53 | 50
54 | 60
55 | 70
56 | 80
57 | 90
58 |
59 |
60 | ChallengeActivity
61 |
62 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/xml/device_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/res/xml/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
15 |
16 |
20 |
21 |
26 |
31 |
32 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcf/FCFService.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcf;
12 |
13 | import java.text.Normalizer;
14 | import java.text.Normalizer.Form;
15 |
16 |
17 | import android.util.Log;
18 |
19 | public class FCFService extends FelicaArea {
20 |
21 | FCFService() {
22 | super();
23 | // TODO Auto-generated constructor stub
24 | }
25 |
26 | private static final String TAG = "FCFService";
27 |
28 | public static final int FCF_DATA_LENGTH = 16 * 4;
29 |
30 | public static final int SYSTEM_CODE = 0xFE00;
31 | public static final int SERVICE_CODE = 0x1A8B;
32 |
33 | String userType;
34 | String userID;
35 | String publishCount;
36 | String sex;
37 | String name;
38 | String schoolCode;
39 | String publishDate;
40 | String expireDate;
41 |
42 | public static int systemCode(){
43 | return SYSTEM_CODE;
44 | }
45 |
46 | public static int serviceCode(){
47 | return SERVICE_CODE;
48 | }
49 |
50 | public static FCFService create(FelicaService service) {
51 | FCFService fcf = null;
52 |
53 | fcf = new FCFService();
54 |
55 | return create(service,fcf);
56 | }
57 |
58 | public static FCFService create(FelicaService service, FCFService fcf) {
59 | // FCFService fcf = null;
60 |
61 | byte data[] = service.data();
62 |
63 | if((data == null) || (data.length < FCF_DATA_LENGTH)) {
64 | return null;
65 | }
66 |
67 | // fcf = new FCFService();
68 |
69 | int offset = 0;
70 | fcf.userType = "" + (char)data[0] + (char)data[1];
71 |
72 | offset = 2;
73 | fcf.userID = "" + (char)data[offset] + (char)data[offset+1] + (char)data[offset+2] + (char)data[offset+3] +
74 | (char)data[offset+4] + (char)data[offset+5] + (char)data[offset+6] + (char)data[offset+7];
75 |
76 | offset = 14;
77 | fcf.publishCount = "" + (char)data[offset];
78 |
79 | offset = 15;
80 | fcf.sex = "" + (char)data[offset];
81 |
82 | offset = 16;
83 | int nameLength = 16;
84 | fcf.name = "";
85 | for(int i=0;i= 0xA1) && (val <= 0xDF)){
94 | // val is Japanese kana
95 |
96 | // c.f. http://charset.7jp.net/jis0201.html
97 | int utf16Kana = 0xFF61 + (val - 0xA1);
98 | fcf.name += (char)utf16Kana;
99 | } else {
100 | fcf.name += '?';
101 | }
102 | }
103 | fcf.name = Normalizer.normalize(fcf.name, Form.NFKC);
104 |
105 | offset = 32;
106 | fcf.schoolCode = "" + (char)data[offset] + (char)data[offset+1] + (char)data[offset+2] + (char)data[offset+3] +
107 | (char)data[offset+4] + (char)data[offset+5] + (char)data[offset+6] + (char)data[offset+7];
108 |
109 | offset = 40;
110 | fcf.publishDate = "" + (char)data[offset] + (char)data[offset+1] + (char)data[offset+2] + (char)data[offset+3] +
111 | (char)data[offset+4] + (char)data[offset+5] + (char)data[offset+6] + (char)data[offset+7];
112 |
113 | offset = 48;
114 | fcf.expireDate = "" + (char)data[offset] + (char)data[offset+1] + (char)data[offset+2] + (char)data[offset+3] +
115 | (char)data[offset+4] + (char)data[offset+5] + (char)data[offset+6] + (char)data[offset+7];
116 |
117 | return fcf;
118 | }
119 |
120 | public String userType() {
121 | return userType;
122 | }
123 |
124 | public void setUserType(String userType) {
125 | this.userType = userType;
126 | }
127 |
128 | public String userID() {
129 | return userID;
130 | }
131 |
132 | public void setUserID(String userID) {
133 | this.userID = userID;
134 | }
135 |
136 | public String publishCount() {
137 | return publishCount;
138 | }
139 |
140 | public void setPublishCount(String publishCount) {
141 | this.publishCount = publishCount;
142 | }
143 |
144 | public String sex() {
145 | return sex;
146 | }
147 |
148 | public void setSex(String sex) {
149 | this.sex = sex;
150 | }
151 |
152 | public String name() {
153 | return name;
154 | }
155 |
156 | public void setName(String name) {
157 | this.name = name;
158 | }
159 |
160 | public String schoolCode() {
161 | return schoolCode;
162 | }
163 |
164 | public void setSchoolCode(String schoolCode) {
165 | this.schoolCode = schoolCode;
166 | }
167 |
168 | public String publishDate() {
169 | return publishDate;
170 | }
171 |
172 | public void setPublishDate(String publishDate) {
173 | this.publishDate = publishDate;
174 | }
175 |
176 | public String expireDate() {
177 | return expireDate;
178 | }
179 |
180 | public void setExpireDate(String expireDate) {
181 | this.expireDate = expireDate;
182 | }
183 |
184 | public String toString(){
185 | StringBuffer s = new StringBuffer();
186 | s.append("userType="+userType);
187 | s.append('\n');
188 | s.append("userID="+userID);
189 | s.append('\n');
190 | s.append("publishCount="+publishCount);
191 | s.append('\n');
192 | s.append("sex="+sex);
193 | s.append('\n');
194 | s.append("name="+name);
195 | s.append('\n');
196 | s.append("schoolCode="+schoolCode);
197 | s.append('\n');
198 | s.append("publishDate="+publishDate);
199 | s.append('\n');
200 | s.append("expireDate="+expireDate);
201 |
202 | return s.toString();
203 | }
204 |
205 | public void show(){
206 | String s = toString();
207 | Log.d(TAG, s);
208 | }
209 | }
210 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcf/Felica.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcf;
12 |
13 |
14 | import java.io.ByteArrayOutputStream;
15 |
16 | import android.util.Log;
17 |
18 | public class Felica {
19 |
20 | private static boolean debug = false;
21 |
22 | private static final String TAG = "Felica";
23 |
24 | public static final int FELICA_IDM_LENGTH = 8;
25 | public static final int FELICA_PMM_LENGTH = 8;
26 | public static final int FELICA_BLOCK_LENGTH = 16;
27 |
28 | public static final int FELICA_POLLING_ANY = 0xffff;
29 | public static final int FELICA_POLLING_SUICA = 0x0003;
30 | public static final int FELICA_POLLING_EDY = 0xfe00;
31 |
32 | public static final int FELICA_SYSTEM_CODE_COMMON_AREA = 0xFE00;
33 |
34 | public static final int FELICA_SERVICE_CODE_FCF = 0x1A8B;
35 |
36 | public static final byte FELICA_CMD_POLLING = 0x00;
37 | public static final byte FELICA_CMD_SEARCH_SERVICE_CODE = 0x0a;
38 | public static final byte FELICA_CMD_REQUEST_SYSTEM = 0x0c;
39 | public static final byte FELICA_CMD_READ_WITHOUT_ENCRYPTION = 0x06;
40 |
41 | private static byte RC_S370_NORMAL_OFFSET = 4;
42 | private static byte RC_S370_POLLING_OFFSET = 5;
43 |
44 | Pasori pasori;
45 |
46 | static int BUFFER_SIZE = 255;
47 | private byte response[] = new byte[BUFFER_SIZE+1];
48 | private byte responseLength;
49 |
50 | byte h8(int val) {
51 | return (byte)((val >> 8) & 0xFF);
52 | }
53 |
54 | byte l8(int val) {
55 | return (byte)(val & 0xFF);
56 | }
57 |
58 | public void dump_response(){
59 | StringBuffer message = new StringBuffer("dump_response");
60 | for(int i=0;i 0) {
84 | for(int i=0;i 255) {
257 | break;
258 | }
259 | }
260 | }
261 |
262 | public byte[] readSingleBlockWithoutEncryption(FelicaCard card, int serviceCode, int blockIndex){
263 | byte blockData[] = null;
264 |
265 | byte command = FELICA_CMD_READ_WITHOUT_ENCRYPTION;
266 | byte commandLength = 1;
267 |
268 | byte serviceNumber = 1;
269 | byte serviceNumberLength = 1;
270 | byte serviceCodeListLength = (byte)(serviceNumber * 2);
271 | byte blockNumber = 1;
272 | byte blockNumberLength = 1;
273 | byte blockListLength = (byte)(blockNumber * 2);
274 |
275 | byte argumentLength = (byte)(serviceNumberLength + serviceCodeListLength + blockNumberLength + blockListLength);
276 |
277 | byte felicaCommand[] = new byte[commandLength + FELICA_IDM_LENGTH + argumentLength];
278 | felicaCommand[0] = command;
279 | int offset = 1;
280 | byte IDm[] = card.IDm();
281 | for(int i=0;i> 4) & 0x0F;
31 | l = val & 0x0F;
32 |
33 | char uChar = (char)( u < 10 ? '0' + u : 'A' + (u-10));
34 | char lChar = (char)( l < 10 ? '0' + l : 'A' + (l-10));
35 |
36 | return ""+uChar+lChar;
37 | }
38 |
39 | FelicaArea(){
40 | ID = 0x00;
41 | attribute = 0;
42 | code = 0;
43 | }
44 |
45 | FelicaArea(int data) {
46 | code = data;
47 | ID = (code >> 6);
48 | // attribute = (code & 0x3F);
49 | attribute = code;
50 |
51 | if(debug) {
52 | Log.d(TAG, "FelicaArea code=" + Integer.toHexString(code));
53 | Log.d(TAG, "FelicaArea attribute=" + Integer.toHexString(attribute));
54 | }
55 |
56 | }
57 |
58 | public int code(){
59 | return code;
60 | }
61 |
62 | public int attribute(){
63 | return attribute;
64 | }
65 |
66 | public int ID(){
67 | return ID;
68 | }
69 |
70 | void clearData(){
71 | data = new byte[0];
72 | }
73 |
74 | void setData(byte _data[]){
75 | data = _data;
76 | }
77 |
78 | public byte[] data(){
79 | return data;
80 | }
81 |
82 | private String blockDataString(int blockIndex) {
83 | StringBuffer buffer = new StringBuffer();
84 | int offset = blockIndex * Felica.FELICA_BLOCK_LENGTH;
85 |
86 | for(int i=0;i> 4) & 0x0F;
42 | l = val & 0x0F;
43 |
44 | char uChar = (char)( u < 10 ? '0' + u : 'A' + (u-10));
45 | char lChar = (char)( l < 10 ? '0' + l : 'A' + (l-10));
46 |
47 | return ""+uChar+lChar;
48 | }
49 |
50 | FelicaCard(){
51 | IDm = new byte[FELICA_IDM_LENGTH];
52 | PMm = new byte[FELICA_PMM_LENGTH];
53 | }
54 |
55 | public byte[] IDm(){
56 | return IDm;
57 | }
58 |
59 |
60 | public byte[] PMm(){
61 | return PMm;
62 | }
63 |
64 | public void setIDm(byte data[], int offset){
65 | if((data != null) && (offset >= 0) && ((data.length-offset) >= FELICA_IDM_LENGTH)) {
66 | for(int i=0;i= 0) && ((data.length-offset) >= FELICA_PMM_LENGTH)) {
74 | for(int i=0;i= 0);
190 | }
191 |
192 | public boolean hasService(int serviceCode) {
193 | return (indexOfService(serviceCode) >= 0);
194 | }
195 |
196 | public boolean hasSameIDm(FelicaCard card){
197 | boolean flag = false;
198 |
199 | if(card == null) {
200 | return flag;
201 | }
202 |
203 | byte IDm1[] = this.IDm();
204 | byte IDm2[] = card.IDm();
205 |
206 | flag = true;
207 | for(int i=0;i> 4) & 0x0f) * 10 + (v & 0x0f);
60 |
61 | return val;
62 | }
63 |
64 | public byte[] receiveBuffer(){
65 | return receiveBuffer;
66 | }
67 |
68 | public byte receiveBufferLength(){
69 | return receivedPayloadLength;
70 | }
71 |
72 | public boolean init(UsbDevice device) {
73 | boolean isSuccess = false;
74 |
75 | Log.d(TAG, "init " + device);
76 |
77 | if(device == null) {
78 | Log.d(TAG, "init device is null.");
79 |
80 | return isSuccess;
81 | }
82 | usbDevice = device;
83 |
84 | int interfaceCount = device.getInterfaceCount();
85 | Log.d(TAG, "init interfaceCount=" + interfaceCount);
86 |
87 |
88 | if (device.getInterfaceCount() != 1) {
89 | Log.e(TAG, "could not find interface");
90 | return isSuccess;
91 | }
92 | usbInterface = device.getInterface(0);
93 |
94 | // device should have one endpoint
95 | int endpointCount = usbInterface.getEndpointCount();
96 | Log.d(TAG, "init endpointCount=" + endpointCount);
97 |
98 | if (usbInterface.getEndpointCount() != RCS_S370_ENDPOINT_COUNT) {
99 | Log.e(TAG, "could not find endpoint");
100 | return isSuccess;
101 | }
102 |
103 | UsbEndpoint ep0;
104 | UsbEndpoint ep1;
105 |
106 | ep0 = usbInterface.getEndpoint(0);
107 | ep1 = usbInterface.getEndpoint(1);
108 | int ep0Type = ep0.getType();
109 | int ep1Type = ep1.getType();
110 |
111 | int ep0Direction = ep0.getDirection();
112 | int ep1Direction = ep1.getDirection();
113 |
114 | Log.e(TAG, "ep0Type="+ep0Type);
115 | Log.e(TAG, "ep1Type="+ep1Type);
116 | Log.e(TAG, "ep0Direction="+ep0Direction);
117 | Log.e(TAG, "ep1Direction="+ep1Direction);
118 |
119 | if (ep0Type != RCS_S370_ENDPOINT0_TYPE) {
120 | Log.e(TAG, "endpoint 0 is not bulk transfer type");
121 | return isSuccess;
122 | }
123 |
124 | if (ep1Type != RCS_S370_ENDPOINT1_TYPE) {
125 | Log.e(TAG, "endpoint 1 is not bulk transfer type");
126 | return isSuccess;
127 | }
128 |
129 | if (ep0Direction != RCS_S370_ENDPOINT0_DIRECTION) {
130 | Log.e(TAG, "direction of endpoint 0 is not USB_DIR_OUT");
131 | return isSuccess;
132 | }
133 |
134 | if (ep1Direction != RCS_S370_ENDPOINT1_DIRECTION) {
135 | Log.e(TAG, "direction of endpoint 1 is not USB_DIR_IN");
136 | return isSuccess;
137 | }
138 |
139 | output = ep0;
140 | input = ep1;
141 | isSuccess = true;
142 |
143 | return isSuccess;
144 | }
145 |
146 | public boolean open(UsbManager manager, UsbDevice device) {
147 | boolean isSuccess = false;
148 |
149 | isSuccess = this.init(device);
150 | if(isSuccess == false) {
151 | Log.d(TAG, "open FAIL");
152 |
153 | return isSuccess;
154 | }
155 |
156 | if((manager != null) && (usbDevice != null)) {
157 | UsbDeviceConnection connection = manager.openDevice(usbDevice);
158 | if (connection != null && connection.claimInterface(usbInterface, true)) {
159 | usbManager = manager;
160 | usbDevice = device;
161 | usbConnection = connection;
162 | isSuccess = true;
163 |
164 | Log.d(TAG, "open SUCCESS");
165 | } else {
166 | usbConnection = null;
167 | isSuccess = false;
168 |
169 | Log.d(TAG, "open FAIL");
170 | }
171 | }
172 |
173 | return isSuccess;
174 | }
175 |
176 | public void pasori_receive(){
177 | int n;
178 |
179 | if(debug) {
180 | Log.d(TAG, "pasori_receive now receive");
181 | }
182 | n = usbConnection.bulkTransfer(input, receive_packet, BUFFER_SIZE, RECEIVE_TIMEOUT_IN_MS);
183 | receivedPacketLength = (byte)(n & 0xFF);
184 |
185 | if(debug) {
186 | Log.d(TAG, "pasori_receive receiveLength="+receivedPacketLength);
187 | dump_receive_data();
188 | }
189 | }
190 |
191 |
192 | private void pasori_send(byte data[], int length){
193 | int n;
194 |
195 | if(debug) {
196 | dump_send_data(data,length);
197 | }
198 |
199 | n = usbConnection.bulkTransfer(output, data, length, SEND_TIMEOUT_IN_MS);
200 |
201 | if(debug) {
202 | Log.d(TAG, "pasori_send before ACK n="+n);
203 | }
204 |
205 | // get ACK
206 | if(debug) {
207 | Log.d(TAG, "pasori_send CHECK ACK");
208 | }
209 |
210 | pasori_receive();
211 |
212 | if(debug) {
213 | Log.d(TAG, "pasori_send GET ACK");
214 | }
215 | }
216 |
217 | byte checksum(byte data[], int length) {
218 | int sum = 0;
219 |
220 | for(int i=0;i 0) {
198 | checkStartTime = true;
199 | } else {
200 | checkStartTime = false;
201 | }
202 |
203 | if ((endTimestamp > 0) && (endTimestamp > startTimestamp)) {
204 | checkEndTime = true;
205 | } else {
206 | checkEndTime = false;
207 | }
208 |
209 | //saveSessionLog(TAG_SESSION_ACTIVATED);
210 | application.flushExternalStorage();
211 |
212 | Log.d(TAG, "onResume: startTimestamp=" + startTimestamp);
213 | Log.d(TAG, "onResume: endTimestamp=" + endTimestamp);
214 | }
215 |
216 | public void onClick(View v) {
217 | }
218 |
219 | public void saveFCFLog(FCFService service) {
220 |
221 | if (service == null) {
222 | return;
223 | }
224 |
225 | String userID = service.userID();
226 | String name = service.name();
227 | String userType = service.userType();
228 | String schoolCode = service.schoolCode();
229 | String expireDate = service.expireDate();
230 |
231 | String separator = "\t";
232 | String logString;
233 |
234 | String prefix = logTimestampFormat.format(new Date());
235 |
236 | logString = prefix + separator + userType + separator + userID
237 | + separator + schoolCode + separator + expireDate + separator
238 | + name;
239 |
240 | Log.d(TAG, logString);
241 | saveLog(logString);
242 | }
243 |
244 | public void saveSessionLog(String status) {
245 |
246 | if (status == null) {
247 | return;
248 | }
249 |
250 | String separator = "\t";
251 | String logString;
252 |
253 | String prefix = logTimestampFormat.format(new Date());
254 |
255 | logString = prefix + separator + status;
256 |
257 | Log.d(TAG, logString);
258 | saveLog(logString);
259 | }
260 |
261 | public void saveLog(String logData) {
262 | try {
263 | boolean append = true;
264 | File sdcardDirectory = getBaseContext().getExternalFilesDir(null);
265 | sdcardDirectory.mkdirs();
266 | String filePath = sdcardDirectory.getAbsolutePath()
267 | + File.separator + LOG_FILENAME;
268 |
269 | Log.d(TAG, "saveLog filePath=" + filePath);
270 | // OutputStream out =
271 | // openFileOutput(LOG_FIELNAME,MODE_WORLD_READABLE|MODE_APPEND);
272 | PrintWriter writer = new PrintWriter(new OutputStreamWriter(
273 | new FileOutputStream(filePath, append), "UTF-8"));
274 | writer.append(logData);
275 | writer.append("\r\n");
276 | writer.flush();
277 | writer.close();
278 | } catch (IOException e) {
279 | Log.d(TAG, "saveLog exception=" + e);
280 |
281 | e.printStackTrace();
282 | }
283 | }
284 |
285 | public void confirm(FCFService service) {
286 | if ((service != null) && (service.userID() != null)) {
287 | beep();
288 | }
289 | }
290 |
291 | public void beep() {
292 | boolean doesBeep = Prefs.isBeepEnabled(getBaseContext());
293 |
294 | if (doesBeep == false) {
295 | return;
296 | }
297 |
298 | if (toneGenerator != null) {
299 | int sound = ToneGenerator.TONE_PROP_BEEP;
300 |
301 | sound = ToneGenerator.TONE_SUP_PIP;
302 | sound = ToneGenerator.TONE_SUP_CONFIRM;
303 | sound = ToneGenerator.TONE_PROP_BEEP;
304 | toneGenerator.startTone(sound);
305 | }
306 | }
307 |
308 | public void beepError() {
309 | boolean doesBeep = Prefs.isBeepEnabled(getBaseContext());
310 |
311 | if (doesBeep == false) {
312 | return;
313 | }
314 |
315 | if (toneGenerator != null) {
316 | int sound = ToneGenerator.TONE_PROP_NACK;
317 |
318 | // toneGenerator.startTone(sound);
319 | }
320 | }
321 |
322 | private Felica felica() {
323 | MyApplication application = (MyApplication) getApplication();
324 |
325 | return application.felica();
326 | }
327 |
328 | public void readFelica() {
329 | FelicaCard card = null;
330 | Felica felica = felica();
331 |
332 | if (acceptCheckin == false) {
333 | updateStatus();
334 | /*
335 | * userIDView.setText(statusMessage); nameView.setText("");
336 | * kumadaiIDView.setText("");
337 | */
338 | redrawStatus();
339 | lastCard = null;
340 |
341 | return;
342 | }
343 |
344 | if (felica != null) {
345 | card = felica.polling();
346 |
347 | if (card != null) {
348 | felica.request_system_code(card);
349 | } else {
350 | updateStatus();
351 | /*
352 | * userIDView.setText(statusMessage); nameView.setText("");
353 | * kumadaiIDView.setText("");
354 | */
355 | redrawStatus();
356 |
357 | lastCard = null;
358 | }
359 | }
360 |
361 | readFCF = !Prefs.doesReadKumadaiID(getBaseContext());
362 |
363 | if (readFCF) {
364 | readFCFData(felica, card);
365 | } else {
366 | readKumadaiData(felica, card);
367 | }
368 | }
369 |
370 | public void dumpFelicaService(Felica felica, FelicaCard card,
371 | int serviceCode) {
372 |
373 | if (debug) {
374 | Log.d(TAG, "onClick areaNumber=" + card.areaNumber());
375 | Log.d(TAG, "onClick serviceNumber=" + card.serviceNumber());
376 | Log.d(TAG,
377 | "onClick dumpFelicaService="
378 | + Integer.toHexString(serviceCode));
379 | }
380 |
381 | int serviceIndex = card.indexOfService(serviceCode);
382 | felica.readServiceDataWithoutEncryption(card, serviceIndex);
383 | FelicaService service = card.services()[serviceIndex];
384 |
385 | if (debug) {
386 | service.showData();
387 | }
388 | }
389 |
390 | public void dumpFelicaServices(Felica felica, FelicaCard card) {
391 |
392 | felica.search_service(card);
393 | Log.d(TAG, "onClick areaNumber=" + card.areaNumber());
394 | Log.d(TAG, "onClick serviceNumber=" + card.serviceNumber());
395 |
396 | FelicaService services[] = card.services();
397 | for (int i = 0; i < card.serviceNumber(); i++) {
398 | FelicaService service;
399 |
400 | service = services[i];
401 | int serviceCode = service.code();
402 | Log.d(TAG,
403 | "onClick readService=" + Integer.toHexString(serviceCode));
404 |
405 | /*
406 | * if(service.isReadableWithoutEncryption()){
407 | * felica.readSingleBlockWithoutEncryption(card, serviceCode, 0); }
408 | */
409 |
410 | felica.readServiceDataWithoutEncryption(card, i);
411 |
412 | if (debug) {
413 | service.showData();
414 | }
415 | }
416 | }
417 |
418 | public void readFCFData(Felica felica, FelicaCard card) {
419 | FelicaCard fcfCard = null;
420 |
421 | // select FCF system
422 | if (card != null) {
423 | int systemCode = Felica.FELICA_SYSTEM_CODE_COMMON_AREA;
424 |
425 | if (card.hasSystem(systemCode)) {
426 | Log.d(TAG,
427 | "onClick polling systemCode="
428 | + Integer.toHexString(systemCode));
429 | fcfCard = felica.polling(systemCode);
430 | if (fcfCard != null) {
431 | felica.search_service(fcfCard);
432 | }
433 | } else {
434 | Log.d(TAG,
435 | "onClick no system exists for systemCode="
436 | + Integer.toHexString(systemCode));
437 | fcfCard = null;
438 | }
439 | }
440 |
441 | // dump service data
442 | if (fcfCard != null) {
443 | int serviceCode = FCFService.serviceCode();
444 | if (fcfCard.hasService(serviceCode)) {
445 | dumpFelicaService(felica, fcfCard, serviceCode);
446 | int serviceIndex = fcfCard.indexOfService(serviceCode);
447 | FelicaService service = fcfCard.services()[serviceIndex];
448 |
449 | FCFService fcf = FCFService.create(service);
450 |
451 | String userID;
452 | String name;
453 |
454 | if (fcf != null) {
455 | if (debug) {
456 | fcf.show();
457 | }
458 | userID = fcf.userID();
459 | name = fcf.name();
460 | } else {
461 | userID = "";
462 | name = "";
463 |
464 | Log.d(TAG, "onClick FAILED to read FCF data");
465 | }
466 |
467 | userIDView.setText(userID);
468 | nameView.setText(name);
469 | kumadaiIDView.setText("");
470 |
471 | if (lastCard != null) {
472 | if (fcfCard.hasSameIDm(lastCard) == false) {
473 | saveFCFLog(fcf);
474 | confirm(fcf);
475 | }
476 | } else {
477 | saveFCFLog(fcf);
478 | confirm(fcf);
479 | }
480 |
481 | lastCard = fcfCard;
482 | } else {
483 | beepError();
484 | Log.d(TAG, "onClick no service exists for serviceCode="
485 | + Integer.toHexString(serviceCode));
486 | }
487 | }
488 | }
489 |
490 | public void readKumadaiData(Felica felica, FelicaCard card) {
491 | FelicaCard kumadaiCard = null;
492 |
493 | // select Kumadai system
494 | if (card != null) {
495 | int systemCode = KumadaiService.systemCode();
496 |
497 | if (card.hasSystem(systemCode)) {
498 | Log.d(TAG,
499 | "onClick polling systemCode="
500 | + Integer.toHexString(systemCode));
501 | kumadaiCard = felica.polling(systemCode);
502 | if (kumadaiCard != null) {
503 | felica.search_service(kumadaiCard);
504 | }
505 | } else {
506 | Log.d(TAG,
507 | "onClick no system exists for systemCode="
508 | + Integer.toHexString(systemCode));
509 | kumadaiCard = null;
510 | beepError();
511 | }
512 | }
513 |
514 | // dump service data
515 | if (kumadaiCard != null) {
516 | int serviceCode = KumadaiService.serviceCode();
517 | if (kumadaiCard.hasService(serviceCode)) {
518 | dumpFelicaService(felica, kumadaiCard, serviceCode);
519 | int serviceIndex = kumadaiCard.indexOfService(serviceCode);
520 | FelicaService service = kumadaiCard.services()[serviceIndex];
521 |
522 | if (service != null) {
523 | KumadaiService kumadai = KumadaiService.create(service);
524 | if (debug) {
525 | kumadai.show();
526 | }
527 |
528 | String userID = kumadai.userID();
529 | String name = kumadai.name();
530 | String kumadaiID = kumadai.kumadaiID();
531 |
532 | if (userID != null) {
533 | userIDView.setText(userID);
534 | nameView.setText(name);
535 | kumadaiIDView.setText(kumadaiID);
536 | }
537 |
538 | if (lastCard != null) {
539 | if (kumadaiCard.hasSameIDm(lastCard) == false) {
540 | saveFCFLog(kumadai);
541 | confirm(kumadai);
542 | }
543 | } else {
544 | saveFCFLog(kumadai);
545 | confirm(kumadai);
546 | }
547 |
548 | lastCard = kumadaiCard;
549 | } else {
550 | beepError();
551 | }
552 | } else {
553 | Log.d(TAG, "onClick no service exists for serviceCode="
554 | + Integer.toHexString(serviceCode));
555 |
556 | beepError();
557 |
558 | }
559 |
560 | }
561 | }
562 |
563 | public void displayHandlerID(MyHandler handler) {
564 | if (handler != null) {
565 | String id = handler.id();
566 |
567 | kumadaiIDView.setText(id);
568 | }
569 | }
570 |
571 | public void displayHandlerTiming(MyHandler handler) {
572 | if (handler != null) {
573 | Date now = new Date();
574 |
575 | kumadaiIDView.setText("" + now.getTime());
576 | }
577 | }
578 |
579 | public void updateStatus() {
580 | int newStatus = -1;
581 |
582 | long timestamp = System.currentTimeMillis();
583 | statusMessage = msgPlaceYourCard;
584 |
585 | //Log.d(TAG, "updateStatus attendStatus="+attendStatus);
586 |
587 | MyApplication application = (MyApplication) getApplication();
588 | if (application.pasori() == null) {
589 | newStatus = this.STATUS_NOW_INITIALIZING;
590 | attendStatus = newStatus;
591 | statusMessage = msgNowInitializing;
592 | statusSubMessage = "";
593 | acceptCheckin = false;
594 |
595 | return;
596 | }
597 |
598 | if (checkStartTime) {
599 | if (timestamp < startTimestamp) {
600 | newStatus = this.STATUS_NOT_OPENED;
601 | statusMessage = msgNotOpened;
602 | statusSubMessage = this.getString(R.string.title_start_time) +
603 | displayTimestampFormat.format(new Date(startTimestamp));
604 | acceptCheckin = false;
605 | } else {
606 |
607 | newStatus = this.STATUS_PLACE_YOUR_CARD;
608 | statusMessage = msgPlaceYourCard;
609 | statusSubMessage = "";
610 | acceptCheckin = true;
611 | }
612 | }
613 |
614 | if (checkEndTime) {
615 | if (timestamp > endTimestamp) {
616 |
617 | newStatus = this.STATUS_ALREADY_CLOSED;
618 | statusMessage = msgAlreadyClosed;
619 | statusSubMessage = this.getString(R.string.title_end_time) +
620 | displayTimestampFormat.format(new Date(endTimestamp));
621 |
622 | acceptCheckin = false;
623 | }
624 | }
625 |
626 | if(newStatus > 0) {
627 | if((attendStatus != this.STATUS_PLACE_YOUR_CARD) && (newStatus == this.STATUS_PLACE_YOUR_CARD)){
628 | saveSessionLog(TAG_SESSION_STARTED);
629 | }
630 |
631 | if((attendStatus != this.STATUS_ALREADY_CLOSED) && (newStatus == this.STATUS_ALREADY_CLOSED)){
632 | saveSessionLog(TAG_SESSION_FINISHED);
633 | }
634 |
635 | attendStatus = newStatus;
636 | }
637 | }
638 |
639 | public void redrawStatus() {
640 | userIDView.setText(statusMessage);
641 | nameView.setText(statusSubMessage);
642 | kumadaiIDView.setText("");
643 | }
644 | }
645 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/ChallengeActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import android.os.Bundle;
14 | import android.app.Activity;
15 | import android.content.Context;
16 | import android.util.Log;
17 | import android.view.Menu;
18 | import android.view.View;
19 | import android.widget.Button;
20 | import android.widget.TextView;
21 |
22 | public class ChallengeActivity extends Activity implements View.OnClickListener {
23 |
24 | private static final String TAG = "ChallengeActivity";
25 |
26 | TextView challengeNumberView;
27 | TextView challengeResultView;
28 | Button challengeButton;
29 | Button cancelButton;
30 |
31 | String msgWrongLockNumber;
32 | String msgCorrectLockNumber;
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_challenge);
38 |
39 | challengeNumberView = (TextView) findViewById(R.id.textChallengeNumber);
40 | challengeResultView = (TextView) findViewById(R.id.textChallengeResult);
41 |
42 | challengeButton = (Button) findViewById(R.id.buttonChallengeOK);
43 | challengeButton.setOnClickListener(this);
44 |
45 | cancelButton = (Button) findViewById(R.id.buttonChallengeCancel);
46 | cancelButton.setOnClickListener(this);
47 |
48 | msgWrongLockNumber = this.getString(R.string.msg_wrong_lockNumber);
49 | msgCorrectLockNumber = this.getString(R.string.msg_correct_lockNumber);
50 |
51 | }
52 |
53 | @Override
54 | public void onResume() {
55 | super.onResume();
56 |
57 | challengeResultView.setText("");
58 | }
59 |
60 | public void onClick(View v) {
61 | if (v == challengeButton) {
62 | doChallenge();
63 | }
64 |
65 | if (v == cancelButton) {
66 | // Back to previous activity
67 | finish();
68 | }
69 | }
70 |
71 | public void doChallenge() {
72 | String challengeNumber = challengeNumberView.getText().toString();
73 | String lockNumber = Prefs.lockNumber(this);
74 |
75 | Log.d(TAG, "doChallenge challengeNumber=" + challengeNumber);
76 | Log.d(TAG, "doChallenge lockNumber=" + lockNumber);
77 |
78 | if ((challengeNumber == null) || !challengeNumber.equals(lockNumber)) {
79 | challengeResultView.setText(msgWrongLockNumber);
80 | } else {
81 | // Lock Number is correct. Unlock application
82 | challengeResultView.setText(msgCorrectLockNumber);
83 | MyApplication application = (MyApplication) getApplication();
84 | application.setLockMode(false);
85 |
86 | // Back to previous activity
87 | finish();
88 | }
89 |
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/ConfigActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import java.util.Calendar;
14 |
15 | import android.os.Bundle;
16 | import android.app.Activity;
17 | import android.util.Log;
18 | import android.view.Menu;
19 | import android.view.MotionEvent;
20 | import android.view.View;
21 | import android.widget.AdapterView;
22 | import android.widget.AdapterView.OnItemSelectedListener;
23 | import android.widget.ArrayAdapter;
24 | import android.widget.Button;
25 | import android.widget.Spinner;
26 | import android.widget.TextView;
27 | import android.widget.TimePicker;
28 | import android.widget.TimePicker.OnTimeChangedListener;
29 |
30 | // http://www.adakoda.com/android/000104.html
31 | // http://d.hatena.ne.jp/Korsakov/20100704/1278221724
32 | // http://android.keicode.com/basics/ui-spinner.php
33 |
34 | public class ConfigActivity extends Activity implements View.OnClickListener,
35 | OnTimeChangedListener, OnItemSelectedListener {
36 |
37 | private static final String TAG = "ConfigActivity";
38 |
39 | TimePicker startTimePicker;
40 | //TimePicker endTimePicker;
41 | Button resetButton;
42 | Spinner durationSpinner;
43 |
44 | int startHour = 0;
45 | int startMinute = 0;
46 | int duration = 0;
47 |
48 | String[] durations;
49 |
50 | @Override
51 | public void onCreate(Bundle savedInstanceState) {
52 | super.onCreate(savedInstanceState);
53 | setContentView(R.layout.activity_config);
54 | durations = getResources().getStringArray(R.array.duration_list);
55 |
56 | startTimePicker = (TimePicker) findViewById(R.id.startTimePicker);
57 | durationSpinner = (Spinner) findViewById(R.id.durationSpinner);
58 |
59 | startTimePicker.setIs24HourView(true);
60 | startTimePicker.setOnTimeChangedListener(this);
61 | resetStartTimePicker();
62 |
63 | /*
64 | endTimePicker = (TimePicker) findViewById(R.id.endTimePicker);
65 | endTimePicker.setIs24HourView(true);
66 | */
67 |
68 | resetButton = (Button) findViewById(R.id.button_reset);
69 | resetButton.setOnClickListener(this);
70 |
71 | ArrayAdapter adapter = new ArrayAdapter(this,
72 | android.R.layout.simple_spinner_item, durations);
73 | adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
74 |
75 | durationSpinner.setAdapter(adapter);
76 | durationSpinner.setOnItemSelectedListener(this);
77 |
78 | }
79 |
80 | @Override
81 | public void onPause() {
82 | final int MINUTE_IN_MILLIS = 60 * 1000;
83 | super.onPause();
84 |
85 | // save configuration in MyApplication
86 | Calendar startCalendar = Calendar.getInstance();
87 | startCalendar.set(Calendar.HOUR_OF_DAY, startHour);
88 | startCalendar.set(Calendar.MINUTE, startMinute);
89 | startCalendar.set(Calendar.SECOND, 0);
90 |
91 | long startTimestamp = startCalendar.getTimeInMillis();
92 | long endTimestamp = startTimestamp + duration * MINUTE_IN_MILLIS;
93 |
94 | Calendar endCalendar = Calendar.getInstance();
95 | endCalendar.setTimeInMillis(endTimestamp);
96 |
97 | MyApplication application = (MyApplication) getApplication();
98 | application.saveAttendanceDuration(startCalendar,endCalendar);
99 | }
100 |
101 | public void onClick(View v) {
102 | if (v == resetButton) {
103 | resetStartTimePicker();
104 | }
105 | }
106 |
107 | @Override
108 | public boolean onTouchEvent(MotionEvent event) {
109 | Log.d(TAG, "onTouchEvent: event=" + event);
110 |
111 | return false;
112 | }
113 |
114 | public void resetStartTimePicker() {
115 | int hourOfDay = 0;
116 | int minute = 0;
117 |
118 | Calendar calendar = Calendar.getInstance();
119 | hourOfDay = calendar.get(Calendar.HOUR_OF_DAY);
120 | minute = calendar.get(Calendar.MINUTE);
121 |
122 | startHour = hourOfDay;
123 | startMinute = minute;
124 |
125 | startTimePicker.setCurrentHour(hourOfDay);
126 | startTimePicker.setCurrentMinute(minute);
127 |
128 | // reset duration spinner too
129 | durationSpinner.setSelection(0);
130 | }
131 |
132 | @Override
133 | public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
134 | startHour = hourOfDay;
135 | startMinute = minute;
136 |
137 | Log.d(TAG, "onTimeChanged: startTime=" + startHour + ":" + startMinute);
138 | }
139 |
140 | @Override
141 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
142 | Spinner spinner = (Spinner) parent;
143 | String item = (String) spinner.getSelectedItem();
144 |
145 | duration = Integer.parseInt(item);
146 | Log.d(TAG, "onItemSelected: duration=" + duration);
147 | }
148 |
149 | @Override
150 | public void onNothingSelected(AdapterView> parent) {
151 | Log.d(TAG, "onNothingSelected: duration=" + duration);
152 | }
153 |
154 | }
155 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Installation.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import java.io.File;
14 | import java.io.FileOutputStream;
15 | import java.io.IOException;
16 | import java.io.RandomAccessFile;
17 | import java.util.UUID;
18 |
19 | import android.content.Context;
20 |
21 | // This code is copied from the following page:
22 | // http://android-developers.blogspot.jp/2011/03/identifying-app-installations.html
23 |
24 | public class Installation {
25 | private static String sID = null;
26 | private static final String INSTALLATION = "INSTALLATION";
27 |
28 | public synchronized static String id(Context context) {
29 | if (sID == null) {
30 | File installation = new File(context.getFilesDir(), INSTALLATION);
31 | try {
32 | if (!installation.exists())
33 | writeInstallationFile(installation);
34 | sID = readInstallationFile(installation);
35 | } catch (Exception e) {
36 | throw new RuntimeException(e);
37 | }
38 | }
39 | return sID;
40 | }
41 |
42 | private static String readInstallationFile(File installation) throws IOException {
43 | RandomAccessFile f = new RandomAccessFile(installation, "r");
44 | byte[] bytes = new byte[(int) f.length()];
45 | f.readFully(bytes);
46 | f.close();
47 | return new String(bytes);
48 | }
49 |
50 | private static void writeInstallationFile(File installation) throws IOException {
51 | FileOutputStream out = new FileOutputStream(installation);
52 | String id = UUID.randomUUID().toString();
53 | out.write(id.getBytes());
54 | out.close();
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/LogViewActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import java.io.File;
14 | import java.io.FileInputStream;
15 | import java.io.FileOutputStream;
16 | import java.io.IOException;
17 | import java.io.OutputStreamWriter;
18 | import java.io.PrintWriter;
19 | import java.text.SimpleDateFormat;
20 |
21 | import android.app.Activity;
22 | import android.app.AlertDialog;
23 | import android.content.DialogInterface;
24 | import android.os.Bundle;
25 | import android.util.Log;
26 | import android.view.View;
27 | import android.widget.Button;
28 | import android.widget.TextView;
29 |
30 | public class LogViewActivity extends Activity implements View.OnClickListener {
31 |
32 | private static final String TAG = "LogViewActivity";
33 |
34 | String LOG_FILENAME = "FCF.log";
35 |
36 | private static String msgLoadingData;
37 | private static String msgNoDataFound;
38 |
39 | TextView logView;
40 | private Button deleteButton;
41 | private Button reloadButton;
42 | AlertDialog.Builder logDeleteDialog;
43 |
44 | @Override
45 | protected void onCreate(Bundle savedInstanceState) {
46 | super.onCreate(savedInstanceState);
47 | setContentView(R.layout.logview);
48 |
49 | msgNoDataFound = this.getString(R.string.msg_no_data_found);
50 | msgLoadingData = this.getString(R.string.msg_loading_data);
51 |
52 | logView = (TextView) findViewById(R.id.logTextView);
53 |
54 | /*
55 | * deleteButton = (Button) findViewById(R.id.deleteButton);
56 | * deleteButton.setOnClickListener(this);
57 | *
58 | * reloadButton = (Button) findViewById(R.id.reloadButton);
59 | * reloadButton.setOnClickListener(this);
60 | */
61 | logView.setText(msgLoadingData);
62 |
63 | // createAlertDialog();
64 |
65 | showLogData(logView);
66 | }
67 |
68 | @Override
69 | public void onResume() {
70 | super.onResume();
71 | showLogData(logView);
72 | }
73 |
74 | /*
75 | void createAlertDialog() {
76 | logDeleteDialog = new AlertDialog.Builder(this);
77 | logDeleteDialog.setTitle("Log Delete");
78 | logDeleteDialog.setMessage("Are really deleting log ?");
79 | logDeleteDialog.setPositiveButton("Yes",
80 | new DialogInterface.OnClickListener() {
81 | public void onClick(DialogInterface dialog, int which) {
82 | deleteLogData();
83 | logView.setText("deleted.");
84 | }
85 | });
86 | logDeleteDialog.setNegativeButton("No",
87 | new DialogInterface.OnClickListener() {
88 | public void onClick(DialogInterface dialog, int which) {
89 | // Do nothing.
90 | }
91 | });
92 | }
93 | */
94 |
95 | public void onClick(View v) {
96 | if (v == deleteButton) {
97 | logDeleteDialog.show();
98 | }
99 |
100 | if (v == reloadButton) {
101 | showLogData(logView);
102 | }
103 | }
104 |
105 | /*
106 | void deleteLogData() {
107 | File sdcardDirectory = getBaseContext().getExternalFilesDir(null);
108 | String filePath = sdcardDirectory.getAbsolutePath() + File.separator
109 | + LOG_FILENAME;
110 |
111 | try {
112 | File logFile = new File(filePath);
113 | if (logFile.exists()) {
114 | boolean flag = logFile.delete();
115 | }
116 | } catch (Exception e) {
117 | Log.d(TAG, "deleteLogData: exception=" + e);
118 | }
119 | }
120 | */
121 |
122 | void showLogData(TextView logView) {
123 | File sdcardDirectory = getBaseContext().getExternalFilesDir(null);
124 | String filePath = sdcardDirectory.getAbsolutePath() + File.separator
125 | + LOG_FILENAME;
126 | String logStr = null;
127 | try {
128 | File logFile = new File(filePath);
129 |
130 | if (logFile.exists()) {
131 | FileInputStream istream = new FileInputStream(filePath);
132 | byte[] buffer = new byte[istream.available()];
133 | istream.read(buffer);
134 | istream.close();
135 | // �擾�ł��镶����
136 | // new String(readBytes);
137 | logStr = new String(buffer);
138 | } else {
139 | logStr = msgNoDataFound;
140 | }
141 | } catch (Exception e) {
142 | logStr = "Exception=" + e;
143 | }
144 |
145 | logView.setText(logStr);
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MainActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import java.util.HashMap;
14 | import java.util.Iterator;
15 |
16 | import android.app.Activity;
17 | import android.app.AlertDialog;
18 | import android.app.Dialog;
19 | import android.app.TabActivity;
20 | import android.content.DialogInterface;
21 | import android.content.Intent;
22 | import android.hardware.SensorManager;
23 | import android.hardware.usb.UsbDevice;
24 | import android.hardware.usb.UsbManager;
25 | import android.net.Uri;
26 | import android.os.Bundle;
27 | import android.os.Environment;
28 | import android.preference.Preference;
29 | import android.util.Log;
30 | import android.view.KeyEvent;
31 | import android.view.LayoutInflater;
32 | import android.view.Menu;
33 | import android.view.MenuInflater;
34 | import android.view.MenuItem;
35 | import android.widget.TabHost;
36 | import android.widget.TextView;
37 | import android.widget.TimePicker;
38 | import android.widget.TabHost.TabSpec;
39 |
40 | // see. http://www.androidhive.info/2011/08/android-tab-layout-tutorial/
41 | // http://stackoverflow.com/questions/3011361/alertdialog-input-text
42 | // http://techbooster.jpn.org/andriod/ui/1140/
43 | // https://sites.google.com/a/techdoctranslator.com/jp/android/guide/ui/dialogs
44 |
45 | public class MainActivity extends TabActivity {
46 |
47 | private static final String TAG = "MainActivity";
48 |
49 | private String titleScreenLock;
50 | private String titleScreenUnlock;
51 | private MenuItem quitMenu;
52 | private MenuItem settingsMenu;
53 | private MenuItem screenLockMenu;
54 |
55 | static final int DIALOG_CHALLENGE_ID = 0;
56 |
57 | Dialog challengeDialog;
58 | private boolean challengeResult = false;
59 |
60 | @Override
61 | public void onCreate(Bundle savedInstanceState) {
62 | super.onCreate(savedInstanceState);
63 | setContentView(R.layout.activity_main);
64 | initializeTab();
65 |
66 | titleScreenLock = this.getString(R.string.screenlock_title);
67 | titleScreenUnlock = this.getString(R.string.screenunlock_title);
68 |
69 | quitMenu = (MenuItem) findViewById(R.id.quit);
70 | settingsMenu = (MenuItem) findViewById(R.id.settings);
71 | }
72 |
73 | @Override
74 | public void onStart() {
75 | super.onStart();
76 | MyApplication application = (MyApplication) getApplication();
77 |
78 | application.detectPasori();
79 | }
80 |
81 | @Override
82 | public void onResume() {
83 | super.onResume();
84 |
85 | Intent intent = getIntent();
86 | Log.d(TAG, "intent: " + intent);
87 | String action = intent.getAction();
88 |
89 | MyApplication application = (MyApplication) getApplication();
90 | if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action)) {
91 | application.pasoriAttached(intent);
92 | } else if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) {
93 | application.pasoriDettached(intent);
94 | }
95 |
96 | invalidateOptionsMenu();
97 | if (application.isLockMode()) {
98 | setTabEnabled(false);
99 | } else {
100 | setTabEnabled(true);
101 | }
102 |
103 | }
104 |
105 | @Override
106 | public boolean onCreateOptionsMenu(Menu menu) {
107 | getMenuInflater().inflate(R.menu.menu, menu);
108 |
109 | return true;
110 | }
111 |
112 | @Override
113 | public boolean onOptionsItemSelected(MenuItem item) {
114 | switch (item.getItemId()) {
115 | case R.id.screenlock:
116 | MyApplication application = (MyApplication) getApplication();
117 | Log.d(TAG,
118 | "screenlockSelected: isLocked=" + application.isLockMode());
119 |
120 | // invalidateOptionsMenu();
121 | if (application.isLockMode()) {
122 | startActivity(new Intent(this, ChallengeActivity.class));
123 |
124 | /*
125 | if (success) {
126 | application.setLockMode(false);
127 | item.setTitle(titleScreenLock);
128 |
129 | // enable tabs
130 | setTabEnabled(true);
131 | }
132 | */
133 | } else {
134 | application.setLockMode(true);
135 | item.setTitle(titleScreenUnlock);
136 |
137 | // disable tabs
138 | setTabEnabled(false);
139 | }
140 | return true;
141 | case R.id.settings:
142 | startActivity(new Intent(this, Prefs.class));
143 |
144 | return true;
145 | case R.id.quit:
146 | quit();
147 |
148 | return true;
149 | }
150 |
151 | return false;
152 | }
153 |
154 | public boolean onPrepareOptionsMenu(Menu menu) {
155 | MyApplication application = (MyApplication) getApplication();
156 |
157 | Log.d(TAG, "onPrepareOptionsMenu: isLocked=" + application.isLockMode());
158 | Log.d(TAG, "onPrepareOptionsMenu: menu=" + menu);
159 |
160 | MenuItem quitMenu = menu.findItem(R.id.quit);
161 | MenuItem settingsMenu = menu.findItem(R.id.settings);
162 | MenuItem screenLockMenu = menu.findItem(R.id.screenlock);
163 |
164 | Log.d(TAG, "onPrepareOptionsMenu: quitMenu=" + quitMenu);
165 | Log.d(TAG, "onPrepareOptionsMenu: settingsMenu=" + settingsMenu);
166 | Log.d(TAG, "onPrepareOptionsMenu: settingsMenu=" + screenLockMenu);
167 |
168 | if(quitMenu == null) {
169 | getMenuInflater().inflate(R.menu.menu, menu);
170 | }
171 |
172 | if (application.isLockMode()) {
173 | if(screenLockMenu != null) {
174 | screenLockMenu.setTitle(titleScreenUnlock);
175 | }
176 |
177 | if(quitMenu != null) {
178 | quitMenu.setEnabled(false);
179 | }
180 |
181 | if(settingsMenu != null) {
182 | settingsMenu.setEnabled(false);
183 | }
184 | } else {
185 | if(screenLockMenu != null) {
186 | screenLockMenu.setTitle(titleScreenLock);
187 | }
188 |
189 | if(quitMenu != null) {
190 | quitMenu.setEnabled(true);
191 | }
192 |
193 | if(settingsMenu != null) {
194 | settingsMenu.setEnabled(true);
195 | }
196 | }
197 |
198 | return true;
199 | }
200 |
201 | protected Dialog onCreateDialog(int id) {
202 | Dialog dialog;
203 | switch (id) {
204 | case DIALOG_CHALLENGE_ID:
205 | // do the work to define the pause Dialog
206 | challengeDialog = createChallengeDialog();
207 | dialog = challengeDialog;
208 | break;
209 | default:
210 | dialog = null;
211 | }
212 | return dialog;
213 | }
214 |
215 | Dialog createChallengeDialog() {
216 |
217 | AlertDialog dialog;
218 | String title = getString(R.string.logDelete_title);
219 |
220 | AlertDialog.Builder builder = new AlertDialog.Builder(this);
221 | builder.setMessage("Are you sure you want to exit?")
222 | .setCancelable(false)
223 | .setPositiveButton("OK", new DialogInterface.OnClickListener() {
224 | public void onClick(DialogInterface dialog, int id) {
225 | dialog.cancel();
226 | challengeResult = true;
227 | }
228 | })
229 | .setNegativeButton("Cancel",
230 | new DialogInterface.OnClickListener() {
231 | public void onClick(DialogInterface dialog, int id) {
232 | dialog.cancel();
233 | challengeResult = false;
234 | }
235 | });
236 | dialog = builder.create();
237 |
238 | return dialog;
239 | }
240 |
241 | public void initializeTab() {
242 | String title;
243 |
244 | // TabHostインスタンスを取得
245 | TabHost tabHost = getTabHost();
246 |
247 | // Tab for LogView
248 | title = this.getString(R.string.logview_title);
249 | TabSpec logViewSpec = tabHost.newTabSpec(title);
250 | // logViewSpec.setIndicator("Videos",
251 | // getResources().getDrawable(R.drawable.icon_videos_tab));
252 | logViewSpec.setIndicator(title);
253 |
254 | Intent logViewIntent = new Intent(this, LogViewActivity.class);
255 | logViewSpec.setContent(logViewIntent);
256 |
257 | // Tab for AttendanceView
258 | title = this.getString(R.string.attendance_title);
259 | TabSpec attendanceSpec = tabHost.newTabSpec(title);
260 | // attendanceSpec.setIndicator("Videos",
261 | // getResources().getDrawable(R.drawable.icon_videos_tab));
262 | attendanceSpec.setIndicator(title);
263 |
264 | Intent attendanceIntent = new Intent(this, AttendanceActivity.class);
265 | attendanceSpec.setContent(attendanceIntent);
266 |
267 | // Tab for Preference
268 | title = this.getString(R.string.preference_title);
269 | TabSpec preferenceSpec = tabHost.newTabSpec(title);
270 | // preferenceSpec.setIndicator("Videos",
271 | // getResources().getDrawable(R.drawable.icon_videos_tab));
272 | preferenceSpec.setIndicator(title);
273 |
274 | Intent preferenceIntent = new Intent(this, Prefs.class);
275 | preferenceSpec.setContent(preferenceIntent);
276 |
277 | // Tab for Config
278 | title = this.getString(R.string.title_activity_config);
279 | TabSpec configSpec = tabHost.newTabSpec(title);
280 | // preferenceSpec.setIndicator("Videos",
281 | // getResources().getDrawable(R.drawable.icon_videos_tab));
282 | configSpec.setIndicator(title);
283 |
284 | Intent configIntent = new Intent(this, ConfigActivity.class);
285 | configSpec.setContent(configIntent);
286 |
287 | tabHost.addTab(configSpec); // Adding config tab
288 | tabHost.addTab(attendanceSpec); // Adding attendance tab
289 | tabHost.addTab(logViewSpec); // Adding logView tab
290 | // tabHost.addTab(preferenceSpec); // Adding preference tab
291 |
292 | // Test: disable preference tab
293 | // getTabHost().getTabWidget().getChildAt(2).setEnabled(false);
294 | }
295 |
296 | public void setTabEnabled(boolean flag) {
297 | getTabHost().getTabWidget().getChildAt(0).setEnabled(flag);
298 | getTabHost().getTabWidget().getChildAt(1).setEnabled(flag);
299 | getTabHost().getTabWidget().getChildAt(2).setEnabled(flag);
300 | }
301 |
302 | public void quit() {
303 | /*
304 | * handler = null; if(pasori != null){ pasori.reset(); }
305 | */
306 | MyApplication application = (MyApplication) getApplication();
307 | application.flushExternalStorage();
308 |
309 | finish();
310 | }
311 |
312 | @Override
313 | public boolean dispatchKeyEvent(KeyEvent event) {
314 | MyApplication application = (MyApplication) getApplication();
315 |
316 | if (event.getAction() == KeyEvent.ACTION_DOWN) {
317 | if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
318 | if (application.isLockMode()) {
319 | return false;
320 | }
321 | }
322 | }
323 | return super.dispatchKeyEvent(event);
324 | }
325 |
326 | public boolean challenge() {
327 | // challengeDialog.show();
328 | showDialog(DIALOG_CHALLENGE_ID);
329 |
330 | // return true;
331 |
332 | return challengeResult;
333 | }
334 |
335 | }
336 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MyApplication.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import java.util.Calendar;
14 | import java.util.HashMap;
15 | import java.util.Iterator;
16 |
17 | import jp.ac.kumamoto_u.cc.fcf.Felica;
18 | import jp.ac.kumamoto_u.cc.fcf.Pasori;
19 |
20 | import android.app.Application;
21 | import android.content.Context;
22 | import android.content.Intent;
23 | import android.hardware.usb.UsbConstants;
24 | import android.hardware.usb.UsbDevice;
25 | import android.hardware.usb.UsbDeviceConnection;
26 | import android.hardware.usb.UsbEndpoint;
27 | import android.hardware.usb.UsbManager;
28 | import android.net.Uri;
29 | import android.os.Environment;
30 | import android.util.Log;
31 |
32 | // http://techbooster.jpn.org/andriod/application/2353/
33 | // http://yuki312.blogspot.jp/2011/11/activity.html
34 |
35 | public class MyApplication extends Application {
36 |
37 | private static final String TAG = "MyApplication";
38 | private String _instanceID;
39 |
40 | private static String deviceListString;
41 |
42 | private UsbManager mUsbManager;
43 | private UsbDevice mDevice;
44 | private UsbDeviceConnection mConnection;
45 | private UsbEndpoint mEndpointIntr;
46 |
47 | static final int RCS_S370_VENDOR_ID = 0x054c;
48 | static final int RCS_S370_PRODUCT_ID = 0x02e1;
49 |
50 | static final int RCS_S370_ENDPOINT_COUNT = 2;
51 | static final int RCS_S370_ENDPOINT0_TYPE = UsbConstants.USB_ENDPOINT_XFER_BULK;
52 | static final int RCS_S370_ENDPOINT1_TYPE = UsbConstants.USB_ENDPOINT_XFER_BULK;
53 |
54 | private UsbEndpoint pasori_ep0;
55 | private UsbEndpoint pasiri_ep1;
56 |
57 | private Pasori pasori;
58 | private Felica felica;
59 |
60 | private Calendar startTime;
61 | private Calendar endTime;
62 |
63 | private boolean isLocked = false;
64 |
65 | @Override
66 | public void onCreate() {
67 | _instanceID = Installation.id(getBaseContext());
68 | Log.d(TAG, "onCreate: instanceID=" + _instanceID);
69 |
70 | mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
71 |
72 | detectPasori();
73 | }
74 |
75 | public String instanceID() {
76 | return _instanceID;
77 | }
78 |
79 | public String deviceListString() {
80 | return deviceListString;
81 | }
82 |
83 | public void flushExternalStorage() {
84 | // update sdcard storage
85 | sendBroadcast(new Intent(
86 | Intent.ACTION_MEDIA_MOUNTED,
87 | Uri.parse("file://" + Environment.getExternalStorageDirectory())));
88 | }
89 |
90 | public void detectPasori() {
91 | // detect Pasori hardware
92 | // enumerate USB Devices
93 |
94 | pasori = null;
95 |
96 | HashMap deviceList = mUsbManager.getDeviceList();
97 | deviceListString = deviceList.values().toString();
98 | Iterator deviceIterator = deviceList.values().iterator();
99 | Log.d(TAG, "detectPasori: deviceList=" + deviceListString);
100 | while (deviceIterator.hasNext()) {
101 | UsbDevice device = deviceIterator.next();
102 | int vendorID = device.getVendorId();
103 | int productID = device.getProductId();
104 | Log.d(TAG, "detectPasori: deviceName=" + device.getDeviceName());
105 | Log.d(TAG, "detectPasori: vendorID=" + vendorID);
106 | Log.d(TAG, "detectPasori: vendorID=" + productID);
107 |
108 | if ((vendorID == RCS_S370_VENDOR_ID)
109 | && (productID == RCS_S370_PRODUCT_ID)) {
110 | setDevice(device);
111 | }
112 | }
113 | }
114 |
115 | private void setDevice(UsbDevice device) {
116 | boolean status = false;
117 |
118 | Log.d(TAG, "setDevice device=" + device);
119 | Log.d(TAG, "setDevice pasori=" + pasori);
120 |
121 | mDevice = device;
122 | if (pasori == null) {
123 | pasori = new Pasori();
124 | status = pasori.open(mUsbManager, mDevice);
125 | } else {
126 | // We already have Pasori device.
127 | status = true;
128 | }
129 |
130 | Log.d(TAG, "setDevice status=" + status);
131 |
132 | if (status == true) {
133 | pasori.init_test();
134 | pasori.version();
135 | felica = new Felica(pasori);
136 | } else {
137 | pasori = null;
138 | }
139 |
140 | }
141 |
142 | public Pasori pasori() {
143 | return pasori;
144 | }
145 |
146 | public Felica felica() {
147 | return felica;
148 | }
149 |
150 | public void pasoriAttached(Intent intent) {
151 | String action = intent.getAction();
152 |
153 | // Log.d(TAG, "deviceName: " + device.getDeviceName());
154 | if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action)) {
155 | UsbDevice device = (UsbDevice) intent
156 | .getParcelableExtra(UsbManager.EXTRA_DEVICE);
157 | setDevice(device);
158 | }
159 | }
160 |
161 | public void pasoriDettached(Intent intent) {
162 | String action = intent.getAction();
163 |
164 | if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) {
165 | UsbDevice device = (UsbDevice) intent
166 | .getParcelableExtra(UsbManager.EXTRA_DEVICE);
167 | if (mDevice != null && mDevice.equals(device)) {
168 | setDevice(null);
169 | }
170 | }
171 | }
172 |
173 | public void saveAttendanceDuration(Calendar start, Calendar end) {
174 | startTime = start;
175 | endTime = end;
176 | }
177 |
178 | public long startTimeInMillis(){
179 | if(startTime != null) {
180 | return startTime.getTimeInMillis();
181 | }
182 |
183 | return -1;
184 | }
185 |
186 | public long endTimeInMillis(){
187 | if(endTime != null) {
188 | return endTime.getTimeInMillis();
189 | }
190 |
191 | return -1;
192 | }
193 |
194 | public boolean isLockMode(){
195 | return isLocked;
196 | }
197 |
198 | public void setLockMode(boolean flag) {
199 | isLocked = flag;
200 | }
201 | }
202 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/MyHandler.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import java.util.Date;
14 |
15 | import android.os.Handler;
16 |
17 | public class MyHandler extends Handler {
18 | private String handlerID;
19 |
20 | private static int TIMEOUT_MESSAGE = 1;
21 | private static int INTERVAL_MS = 1000;
22 |
23 | private boolean doesContinue = true;
24 |
25 | MyHandler(){
26 | super();
27 | Date now = new Date();
28 | handlerID = now.toString();
29 | }
30 |
31 | MyHandler(int milliseconds){
32 | this();
33 | setIntervalInMills(milliseconds);
34 | }
35 |
36 | public String id(){
37 | return handlerID;
38 | }
39 |
40 | public void setIntervalInMills(int milliseconds){
41 | INTERVAL_MS = milliseconds;
42 | }
43 |
44 | public void next(){
45 | if(doesContinue) {
46 | sendEmptyMessageDelayed(TIMEOUT_MESSAGE,INTERVAL_MS);
47 | }
48 | }
49 |
50 | public void start(){
51 | doesContinue = true;
52 | sendEmptyMessage(TIMEOUT_MESSAGE);
53 | }
54 |
55 | public void stop(){
56 | doesContinue = false;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/FCFReaderForPasori/src/jp/ac/kumamoto_u/cc/fcfreaderforpasori/Prefs.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013 Takayuki Nagai.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the GNU Public License v3.0
5 | * which accompanies this distribution, and is available at
6 | * http://www.gnu.org/licenses/gpl.html
7 | *
8 | * Contributors:
9 | * Takayuki Nagai - initial API and implementation
10 | ******************************************************************************/
11 | package jp.ac.kumamoto_u.cc.fcfreaderforpasori;
12 |
13 | import java.io.File;
14 |
15 | import android.app.AlertDialog;
16 | import android.content.Context;
17 | import android.content.DialogInterface;
18 | import android.content.SharedPreferences;
19 | import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
20 | import android.os.Bundle;
21 | import android.preference.EditTextPreference;
22 | import android.preference.Preference;
23 | import android.preference.Preference.OnPreferenceClickListener;
24 | import android.preference.PreferenceActivity;
25 | import android.preference.PreferenceManager;
26 | import android.util.Log;
27 | import android.view.View;
28 | import android.widget.Button;
29 |
30 | public class Prefs extends PreferenceActivity implements
31 | OnSharedPreferenceChangeListener {
32 |
33 | private static final String TAG = "Prefs";
34 |
35 | private static final String OPT_READ_KUMADAI_ID = "readKumadaiID";
36 | private static final boolean DEFAULT_READ_KUMADAI_ID = false;
37 |
38 | private static final String OPT_ENABLE_BEEP = "enableBeep";
39 | private static final boolean DEFAULT_ENABLE_BEEP = true;
40 |
41 | private static final String OPT_LOCK_NUMBER = "lockNumber";
42 | private static final String DEFAULT_LOCK_NUMBER = "0000";
43 |
44 | private Preference detectPasoriPreference;
45 | private Preference logDeletePreference;
46 | AlertDialog.Builder logDeleteDialog;
47 |
48 | String LOG_FILENAME = "FCF.log";
49 |
50 | void createAlertDialog() {
51 |
52 | String title = getString(R.string.logDelete_title);
53 | logDeleteDialog = new AlertDialog.Builder(this);
54 | logDeleteDialog.setTitle(title);
55 |
56 | String msg = getString(R.string.msg_really_delete_log);
57 | logDeleteDialog.setMessage(msg);
58 | logDeleteDialog.setPositiveButton("Yes",
59 | new DialogInterface.OnClickListener() {
60 | public void onClick(DialogInterface dialog, int which) {
61 | deleteLogData();
62 | }
63 | });
64 | logDeleteDialog.setNegativeButton("No",
65 | new DialogInterface.OnClickListener() {
66 | public void onClick(DialogInterface dialog, int which) {
67 | // Do nothing.
68 | }
69 | });
70 | }
71 |
72 | @Override
73 | protected void onCreate(Bundle savedInstanceState) {
74 | super.onCreate(savedInstanceState);
75 | addPreferencesFromResource(R.xml.settings);
76 |
77 | OnPreferenceClickListener logDeleteListner = new OnPreferenceClickListener() {
78 | public boolean onPreferenceClick(Preference preference) {
79 | Log.d(TAG, "OnPreferenceClickListener: clicked preference="
80 | + preference);
81 | logDeleteDialog.show();
82 |
83 | return true;
84 | }
85 | };
86 |
87 | OnPreferenceClickListener detectPasoriListener = new OnPreferenceClickListener() {
88 | public boolean onPreferenceClick(Preference preference) {
89 | Log.d(TAG, "OnPreferenceClickListener: clicked preference="
90 | + preference);
91 |
92 | MyApplication application = (MyApplication) getApplication();
93 | application.detectPasori();
94 |
95 | if(detectPasoriPreference != null) {
96 | detectPasoriPreference.setSummary(application.deviceListString());
97 | }
98 | return true;
99 | }
100 | };
101 |
102 | createAlertDialog();
103 |
104 | logDeletePreference = (Preference) findPreference("logDeletePreference");
105 | logDeletePreference.setOnPreferenceClickListener(logDeleteListner);
106 |
107 | detectPasoriPreference = (Preference) findPreference("detectPasoriPreference");
108 | detectPasoriPreference
109 | .setOnPreferenceClickListener(detectPasoriListener);
110 |
111 | refreshPreference();
112 | }
113 |
114 | @Override
115 | protected void onResume() {
116 | super.onResume();
117 | getPreferenceScreen().getSharedPreferences()
118 | .registerOnSharedPreferenceChangeListener(this);
119 | }
120 |
121 | public void refreshPreference() {
122 | EditTextPreference readerNamePreference = (EditTextPreference) getPreferenceScreen()
123 | .findPreference("readerName");
124 | readerNamePreference.setSummary(readerNamePreference.getText());
125 | }
126 |
127 | public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
128 | String key) {
129 | Log.d(TAG, "onSharedPreferenceChanged: key=" + key);
130 |
131 | refreshPreference();
132 | }
133 |
134 | public static boolean doesReadKumadaiID(Context context) {
135 | return PreferenceManager.getDefaultSharedPreferences(context)
136 | .getBoolean(OPT_READ_KUMADAI_ID, DEFAULT_READ_KUMADAI_ID);
137 | }
138 |
139 | public static boolean isBeepEnabled(Context context) {
140 | return PreferenceManager.getDefaultSharedPreferences(context)
141 | .getBoolean(OPT_ENABLE_BEEP, DEFAULT_ENABLE_BEEP);
142 | }
143 |
144 | public static String lockNumber(Context context) {
145 | return PreferenceManager.getDefaultSharedPreferences(context)
146 | .getString(OPT_LOCK_NUMBER, DEFAULT_LOCK_NUMBER);
147 | }
148 |
149 | void deleteLogData() {
150 | File sdcardDirectory = getBaseContext().getExternalFilesDir(null);
151 | String filePath = sdcardDirectory.getAbsolutePath() + File.separator
152 | + LOG_FILENAME;
153 |
154 | try {
155 | File logFile = new File(filePath);
156 | if (logFile.exists()) {
157 | boolean flag = logFile.delete();
158 | }
159 | } catch (Exception e) {
160 | Log.d(TAG, "deleteLogData: exception=" + e);
161 | }
162 | }
163 |
164 | }
165 |
--------------------------------------------------------------------------------