This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 存在するRingtoneの名称を取得 | |
RingtoneManager ringtoneManager = new RingtoneManager(getApplicationContext()); | |
Cursor cursor = ringtoneManager.getCursor(); | |
while (cursor.moveToNext()) { | |
Log.d(TAG, "Ringtone Title: " + cursor.getString(RingtoneManager.TITLE_COLUMN_INDEX)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "タイトル"); | |
//intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false); // サイレントは見せない | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_ALARM); // アラーム音 | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false);// デフォルトは表示しない | |
if (mUri != null) { | |
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, mUri); // 選択済みを選択する | |
} | |
startActivityForResult(intent, RINGTONE_PICKER); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
if (resultCode == RESULT_OK) { | |
if (requestCode == RINGTONE_PICKER) { | |
// RINGTONE_PICKERからの選択されたデータを取得する | |
mUri = (Uri) data.getExtras().get(RingtoneManager.EXTRA_RINGTONE_PICKED_URI); | |
Ringtone ringtone = RingtoneManager.getRingtone(getApplicationContext(), mUri); | |
TextView ringView = (TextView) findViewById(R.id.ringtone); | |
ringView.setText(ringtone.getTitle(getApplicationContext())); | |
ringtone.setStreamType(AudioManager.STREAM_ALARM); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- NFCを使用する為のパーミッションを付与 --> | |
<uses-permission android:name="android.permission.NFC" /> | |
<!-- マーケットで、NFC対応端末にのみ表示させる --> | |
<uses-feature android:name="android.hardware.nfc" android:required="true" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- NFC NDEF text --> | |
<intent-filter> | |
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> | |
<category android:name="android.intent.category.DEFAULT"/> | |
<data android:mimeType="text/plain" /> | |
</intent-filter> | |
<!-- NFC NDEF http --> | |
<intent-filter> | |
<action android:name="android.nfc.action.NDEF_DISCOVERED"/> | |
<category android:name="android.intent.category.DEFAULT"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> | |
<tech-list> | |
<tech>android.nfc.tech.IsoDep</tech> | |
</tech-list> | |
<tech-list> | |
<tech>android.nfc.tech.NfcA</tech> | |
</tech-list> | |
<tech-list> | |
<tech>android.nfc.tech.NfcB</tech> | |
</tech-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* IDmを取得する | |
* @param intent | |
* @return | |
*/ | |
private String getIdm(Intent intent) { | |
String idm = null; | |
StringBuffer idmByte = new StringBuffer(); | |
byte[] rawIdm = intent.getByteArrayExtra(NfcAdapter.EXTRA_ID); | |
if (rawIdm != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# libusb | |
wget http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2/download | |
tar zxvf libusb-1.0.9.tar.bz2 | |
cd libusb-1.0.9 | |
./configure | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# libusb-compat | |
wget http://sourceforge.net/projects/libusb/files/libusb-compat-0.1/libusb-compat-0.1.4/libusb-compat-0.1.4.tar.bz2/download | |
tar zxvf libusb-compat-0.1.4.tar.bz2 | |
cd libusb-compat-0.1.4 | |
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# libnfc | |
wget http://libnfc.googlecode.com/files/libnfc-1.6.0-rc1.tar.gz | |
tar zxvf libnfc-1.6.0-rc1.tar.gz | |
cd libnfc-1.6.0-rc1 | |
./configure --with-drivers='all' --enable-doc | |
make | |
sudo make install | |
# ドキュメントの生成 | |
make doc |
OlderNewer