replace unused NFC selection
Instead, tell the user to fix the nfc emulation requirements, e.g. installing samsung gear plugin or enabling the nfc settings.
This commit is contained in:
@@ -175,4 +175,4 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,30 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
bindPreferenceSummaryToValue(findPreference("nfc"));
|
Preference internal_nfc = findPreference("internal_nfc");
|
||||||
|
internal_nfc.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= 16) {
|
||||||
|
startActivity(new Intent(android.provider.Settings.ACTION_NFC_SETTINGS));
|
||||||
|
} else {
|
||||||
|
startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Preference gear_nfc = findPreference("gear_nfc");
|
||||||
|
gear_nfc.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
|
String gearPackage = "com.samsung.android.gearoplugin";
|
||||||
|
try {
|
||||||
|
startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("market://details?id="+gearPackage)));
|
||||||
|
} catch (android.content.ActivityNotFoundException e) {
|
||||||
|
startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id="+gearPackage)));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -45,13 +45,6 @@
|
|||||||
<string name="jcardsim">Builtin Java Card Simulator</string>
|
<string name="jcardsim">Builtin Java Card Simulator</string>
|
||||||
<string name="vicc">Remote Virtual Smart Card</string>
|
<string name="vicc">Remote Virtual Smart Card</string>
|
||||||
|
|
||||||
<string-array name="strNFC">
|
|
||||||
<item>@string/nfc</item>
|
|
||||||
<item>@string/gear</item>
|
|
||||||
</string-array>
|
|
||||||
<string name="nfc">Builtin NFC</string>
|
|
||||||
<string name="gear">Samsung Accessory</string>
|
|
||||||
|
|
||||||
<string name="vicc_config_info">If you choose the virtual smart card (VICC) as emulator, you need to start the it on your computer with the `--reversed` flag and configure the connection parameters here accordingly.</string>
|
<string name="vicc_config_info">If you choose the virtual smart card (VICC) as emulator, you need to start the it on your computer with the `--reversed` flag and configure the connection parameters here accordingly.</string>
|
||||||
<string name="hint_vicc_port">VICC Port</string>
|
<string name="hint_vicc_port">VICC Port</string>
|
||||||
<string name="hint_vicc_hostname">VICC Hostname</string>
|
<string name="hint_vicc_hostname">VICC Hostname</string>
|
||||||
|
|||||||
@@ -81,11 +81,23 @@
|
|||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<ListPreference
|
<PreferenceCategory
|
||||||
|
android:title="Near Field Communication"
|
||||||
android:key="nfc"
|
android:key="nfc"
|
||||||
android:title="NFC communication hardware"
|
>
|
||||||
android:defaultValue="@string/nfc"
|
|
||||||
android:entries="@array/strNFC"
|
<Preference
|
||||||
android:entryValues="@array/strNFC" />
|
android:title="Emulation with Built-in NFC"
|
||||||
|
android:summary="NFC needs to be enabled for smart card emulation. Use the wireless settings to enable NFC."
|
||||||
|
android:key="internal_nfc">
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:title="Emulation with Gear's NFC"
|
||||||
|
android:summary="Samsung Gear needs to be installed for using the Gear's NFC emulation capabilities."
|
||||||
|
android:key="gear_nfc">
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
Reference in New Issue
Block a user