mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
use resource strings and apis rather than quoted strings for nfc constants
This commit is contained in:
parent
735e42cd90
commit
d119033333
3 changed files with 5 additions and 5 deletions
|
@ -80,7 +80,7 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="application/org.eehouse.android.xw4" />
|
||||
<data android:mimeType="@string/xwords_nfc_mime" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
|
||||
<!-- other -->
|
||||
<string name="default_host">eehouse.org</string>
|
||||
|
||||
<string name="xwords_nfc_mime">application/org.eehouse.android.xw4</string>
|
||||
<string name="invite_host">eehouse.org</string>
|
||||
<string name="invite_prefix">/and/</string>
|
||||
<string name="invite_mime">application/x-xwordsinvite</string>
|
||||
|
|
|
@ -49,14 +49,14 @@ public class NFCUtils {
|
|||
public static void buildAndPush( Activity activity, String data )
|
||||
{
|
||||
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter( activity );
|
||||
String mimeType = activity.getString( R.string.xwords_nfc_mime );
|
||||
NdefMessage msg = new NdefMessage( new NdefRecord[] {
|
||||
new NdefRecord(NdefRecord.TNF_MIME_MEDIA,
|
||||
"application/org.eehouse.android.xw4"
|
||||
new NdefRecord(NdefRecord.TNF_MIME_MEDIA, mimeType
|
||||
.getBytes(Charset.forName("US-ASCII")),
|
||||
new byte[0],
|
||||
data.getBytes(Charset.forName("US-ASCII")))
|
||||
,NdefRecord.
|
||||
createApplicationRecord("org.eehouse.android.xw4")
|
||||
createApplicationRecord( activity.getPackageName() )
|
||||
});
|
||||
nfcAdapter.setNdefPushMessage( msg, activity );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue