カテゴリー
SugiBlog Webエンジニアのためのお役立ちTips

位置情報を更新し、通知を出す

クラス直下で宣言

private PendingIntent pi;
LocationManager mLocationManager;
ReceiveLocation receiver;

onCreate内に以下を記述

mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
receiver = new ReceiveLocation();

//指定したIntentに反応するようにReceiverにIntentFilterを登録
final IntentFilter filter = new IntentFilter();
filter.addAction("com.android.practice.ACTION_LOCATION_UPDATE");
registerReceiver(receiver, filter);

続きを読む…»

3,417 views

メモ

デジタル署名
http://www.adamrocker.com/blog/232/signing_for_publish_android_application.html
バグ報告
http://www.adamrocker.com/blog/288/bug-report-system-for-android.html

1,299 views

端末毎に表示サイズを変更させる [Androidアプリ開発 #05] 補足


端末毎に表示サイズを変更させる [Androidアプリ開発 #05]
で書いた表示サイズについて、
3.4インチ端末でもテストしましたが、正常に表示が最適化されていました。

1,549 views

画面の縦横向きの対応

横向き(landscape)に対応するには、リソースに「layout-land」ディレクトリを追加し、
その中にレイアウトファイルを格納します。
すると、端末が横向きになったときに、自動的に認識してくれます。

1,686 views

位置情報プロバイダの状態を取得

LocationManager mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);

// GPSプロバイダ状態取得
if(!mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
 //無効状態
} else {
 //有効状態
}

// ネットワーク(3GまたはWi-Fi)プロバイダ状態取得
if(!mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)){
 //無効状態
} else {
 //有効状態
}
2,734 views