summaryrefslogtreecommitdiffstats
path: root/samples/browseable/CardReader
diff options
context:
space:
mode:
Diffstat (limited to 'samples/browseable/CardReader')
-rw-r--r--samples/browseable/CardReader/AndroidManifest.xml2
-rw-r--r--samples/browseable/CardReader/_index.jd24
-rw-r--r--samples/browseable/CardReader/res/values-v21/template-styles.xml22
-rw-r--r--samples/browseable/CardReader/res/values/base-strings.xml3
-rw-r--r--[-rwxr-xr-x]samples/browseable/CardReader/res/values/strings.xml0
-rw-r--r--samples/browseable/CardReader/src/com.example.android.cardreader/MainActivity.java13
6 files changed, 38 insertions, 26 deletions
diff --git a/samples/browseable/CardReader/AndroidManifest.xml b/samples/browseable/CardReader/AndroidManifest.xml
index a8ebd133a..ed25c6f56 100644
--- a/samples/browseable/CardReader/AndroidManifest.xml
+++ b/samples/browseable/CardReader/AndroidManifest.xml
@@ -21,7 +21,7 @@
android:versionName="1.0">
<!-- NFC Reader Mode was added in API 19. -->
- <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
+ <!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle -->
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />
diff --git a/samples/browseable/CardReader/_index.jd b/samples/browseable/CardReader/_index.jd
index 9ba051e19..4322b3fb6 100644
--- a/samples/browseable/CardReader/_index.jd
+++ b/samples/browseable/CardReader/_index.jd
@@ -1,20 +1,14 @@
-
-
-
page.tags="CardReader"
sample.group=Connectivity
@jd:body
<p>
- This sample demonstrates how to implement a low-level NFC card reader, for
- reading cards that do not contain NDEF or Android Beam data. This sample is
- designed to read the virtual loyalty card implemented in the <a href=
- "{@docRoot}samples/CardEmulation/index.html">CardEmulation</a> sample.
-</p>
-
-<p>
- In particular, this sample demonstrates how to disable Android Beam, select
- which AIDs the reader is interested in, and establish communication with the
- card. See <a href="{@docRoot}guide/topics/connectivity/nfc/hce.html">Host-based
- Card Emulation</a> for more information on the HCE APIs.
-</p>
+
+ This sample demonstrates how to implement a low-level NFC card reader, for reading cards
+ that do not contain NDEF or Android Beam data. This sample is designed to read the virtual
+ loyalty card implemented in the "CardEmulation" sample.\n\n
+
+ In particular, this sample demonstrates how to disable Android Beam, select which AIDs the
+ reader is interested, and establish communication with the card
+
+ </p>
diff --git a/samples/browseable/CardReader/res/values-v21/template-styles.xml b/samples/browseable/CardReader/res/values-v21/template-styles.xml
new file mode 100644
index 000000000..134fcd9d3
--- /dev/null
+++ b/samples/browseable/CardReader/res/values-v21/template-styles.xml
@@ -0,0 +1,22 @@
+<!--
+ Copyright 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources>
+
+ <!-- Activity themes -->
+ <style name="Theme.Base" parent="android:Theme.Material.Light" />
+
+</resources>
diff --git a/samples/browseable/CardReader/res/values/base-strings.xml b/samples/browseable/CardReader/res/values/base-strings.xml
index ac1248054..efede3bce 100644
--- a/samples/browseable/CardReader/res/values/base-strings.xml
+++ b/samples/browseable/CardReader/res/values/base-strings.xml
@@ -14,9 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<resources>
<string name="app_name">CardReader</string>
<string name="intro_message">
diff --git a/samples/browseable/CardReader/res/values/strings.xml b/samples/browseable/CardReader/res/values/strings.xml
index b1b1a4954..b1b1a4954 100755..100644
--- a/samples/browseable/CardReader/res/values/strings.xml
+++ b/samples/browseable/CardReader/res/values/strings.xml
diff --git a/samples/browseable/CardReader/src/com.example.android.cardreader/MainActivity.java b/samples/browseable/CardReader/src/com.example.android.cardreader/MainActivity.java
index e0280e998..ac6327d30 100644
--- a/samples/browseable/CardReader/src/com.example.android.cardreader/MainActivity.java
+++ b/samples/browseable/CardReader/src/com.example.android.cardreader/MainActivity.java
@@ -14,9 +14,6 @@
* limitations under the License.
*/
-
-
-
package com.example.android.cardreader;
import android.os.Bundle;
@@ -50,10 +47,12 @@ public class MainActivity extends SampleActivityBase {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
- FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
- CardReaderFragment fragment = new CardReaderFragment();
- transaction.replace(R.id.sample_content_fragment, fragment);
- transaction.commit();
+ if (savedInstanceState == null) {
+ FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+ CardReaderFragment fragment = new CardReaderFragment();
+ transaction.replace(R.id.sample_content_fragment, fragment);
+ transaction.commit();
+ }
}
@Override