This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.sakurafish.example.myexamplemashreceive" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk android:minSdkVersion="7" /> | |
<application | |
android:icon="@drawable/ic_launcher" |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.sakurafish.android.example.myexamplechooseimage" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk android:minSdkVersion="7" /> | |
<application | |
android:icon="@drawable/ic_launcher" |
This file contains hidden or 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
package com.sakurafish.android.example.myexamplelistondialog; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.AdapterView; |
This file contains hidden or 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
<?xmlversion="1.0"encoding="utf-8"?> | |
<manifestxmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.yochiyochi.android.UntouchableTimer" ←Javaパッケージ名、世界でたった一つであること。 | |
android:versionCode="6" ← マーケットにアップデートするたびにカウントアップするべき数 | |
android:versionName="1.0" ← アプリのバージョン(ここは自分で決める) | |
android:installLocation="preferExternal" > ← インストールする場所(SDカード優先) | |
<uses-sdkandroid:minSdkVersion="8"/> ← ターゲットのバージョンこれ以下の機種にはインストール出来ない | |
<uses-permissionandroid:name="android.permission.RECORD_AUDIO"/> ← 音声認識を使用する権限を与える。 |
This file contains hidden or 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
//インスタンス変数を宣言 | |
AudioManager am; | |
SeekBar ringVolSeekBar; | |
TextView ringVolText; | |
// アラーム音量 | |
am = ( AudioManager ) getSystemService( Context.AUDIO_SERVICE ); | |
//現在の音量を取得します | |
int ringVolume = am.getStreamVolume( AudioManager.STREAM_MUSIC ); // 音量の取得 |
This file contains hidden or 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
public class SettingActivity extends PreferenceActivity { | |
@Override | |
publicvoid onCreate( Bundle savedInstanceState ) { | |
super.onCreate( savedInstanceState ); | |
// XML で Preference を設定 | |
addPreferencesFromResource( R.xml.preference ); | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | |
<PreferenceCategory android:title="@string/pref_cattitle_sound"> | |
<ListPreference | |
android:title="@string/pref_title_sound" | |
android:summary="@string/pref_summary_sound" | |
android:key="@string/pref_key_sound" | |
android:entries="@array/entries" | |
android:entryValues="@array/entryValues" | |
android:dialogTitle="@string/pref_title_sound" |
This file contains hidden or 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
/*** | |
* プリファレンスの値を読み込む | |
* | |
*/ | |
privatevoid loadSetting() { | |
//自分で定義したプリファレンスファイルを使用することも出来ますが、デフォルトのプリファレンスを利用しています | |
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences( this ); | |
// アプリのバージョン情報 |
This file contains hidden or 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
//inflaterを使ってxmlリソースファイルを読み込んでメニューを作成する。 | |
@Override | |
publicboolean onCreateOptionsMenu( Menu menu ) { | |
super.onCreateOptionsMenu( menu ); | |
MenuInflater inflater = getMenuInflater(); | |
//インフレートしています | |
inflater.inflate( R.menu.option_menu, menu ); | |
returntrue; | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<menu | |
xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item | |
android:title="@string/menu_title_setting" | |
android:id="@+id/menu_setting" | |
android:orderInCategory="1" | |
android:icon="@android:drawable/ic_menu_preferences"></item> | |
<item | |
android:title="@string/menu_title_help" |