【iPhone/Android】富士山 にいくなら「富士山」アプリ 🏔

GPSが内蔵されたスマホと地図を連携させるのは非常に便利ですが。

「富士山行くなら間違いなくこのアプリがいいよ。」とあちこちから言われます。

きつい登山中にややこしい画面操作のアプリは使うのが面倒ですが。

【iPhone/Android】富士山にいくなら「富士山」アプリ

👉 「富士山 - 富士登山に役立つ地図アプリ」をApp Storeで hatena-bookmark

【iPhone/Android】富士山にいくなら「富士山」アプリ
👉 富士山 - 富士登山に役立つ地図アプリ - Google Play のアプリ hatena-bookmark

【iPhone/Android】富士山にいくなら「富士山」アプリ

【iPhone/Android】富士山にいくなら「富士山」アプリ

富士山に特化しているので、すごく良いです。

登山口へのアクセス方法や山小屋、天気の情報もすぐに確認できます。

製造元は「ヤマレコ」さんです。

👉 ヤマレコ-登山やハイキング、クライミングなどの記録を共有できる、登山の総合コミュニティサイト hatena-bookmark

WEBブラウザでもアクセスできます。

 

🏔 いちいちスマホを操作する余裕がない

実際、登山中は、疲労、汗、格納場所、手袋などでいちいちスマホを手で操作するのが面倒すぎます。

水を飲む時のペットボトルの取り出しや蓋の開閉でさえだるい。

そんなとき、現在の状況を音声で教えてくれる機能が便利です。

【iPhone/Android】富士山にいくなら「富士山」アプリ

他人のスマホから時刻と標高の音声を聞くことが多かったのですが、

このアプリだったんですね!

今年は、このアプリで登ってみたいと思います!


【Android Studio】[File] - [Project Structure] - [Suggestions] で「Update」する dependencies の妥当性 💉

Suggestions に表示されてるので Update する。

androidx.navigation:navigation-compose が 2.7.0-beta02 で NG だが 2.7.0-beta01 で OK な件


androidx.navigation:navigation-compose:2.7.0-beta01

  ↓

androidx.navigation:navigation-compose:2.7.0-beta02

はい、NG です。

androidx.navigation:navigation-compose が 2.7.0-beta02 で NG だが 2.7.0-beta01 で OK な件

なんでや!?

 

💉 エラーメッセージ 「5 issues were found when checking AAR metadata」

エラーメッセージを見てみる。


5 issues were found when checking AAR metadata:


  1.  Dependency 'androidx.navigation:navigation-common:2.7.0-beta02' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.

      :app is currently compiled against android-33.

      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 8.0.1 is 33.

      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdk of at least 34.

      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).


  2.  Dependency 'androidx.navigation:navigation-runtime:2.7.0-beta02' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.

      :app is currently compiled against android-33.

      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 8.0.1 is 33.

      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdk of at least 34.

      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).

  3.  Dependency 'androidx.navigation:navigation-common-ktx:2.7.0-beta02' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.

      :app is currently compiled against android-33.

      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 8.0.1 is 33.

      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdk of at least 34.

      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).

  4.  Dependency 'androidx.navigation:navigation-runtime-ktx:2.7.0-beta02' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.

      :app is currently compiled against android-33.

      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 8.0.1 is 33.

      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdk of at least 34.

      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).

  5.  Dependency 'androidx.navigation:navigation-compose:2.7.0-beta02' requires libraries and applications that
      depend on it to compile against version 34 or later of the
      Android APIs.

      :app is currently compiled against android-33.

      Also, the maximum recommended compile SDK version for Android Gradle
      plugin 8.0.1 is 33.

      Recommended action: Update this project's version of the Android Gradle
      plugin to one that supports 34, then update this project to use
      compileSdk of at least 34.

      Note that updating a library or application's compileSdk (which
      allows newer APIs to be used) can be done separately from updating
      targetSdk (which opts the app in to new runtime behavior) and
      minSdk (which determines which devices the app can be installed
      on).

長いですが要するに、


androidx.navigation:navigation-compose:2.7.0-beta02

が依存している以下、


androidx.navigation:navigation-common:2.7.0-beta02
androidx.navigation:navigation-runtime:2.7.0-beta02
androidx.navigation:navigation-common-ktx:2.7.0-beta02
androidx.navigation:navigation-runtime-ktx:2.7.0-beta02

は、


Android API 34

以上を必要としているので使えません。

ということのよう。

 

💉 なぜ私は、Android API 33 だったけか

「Flamingo」なのでそれが最新安定版。

androidx.navigation:navigation-compose が 2.7.0-beta02 で NG だが 2.7.0-beta01 で OK な件

Android Studio Flamingo | 2022.2.1 を使ってる場合、33 までです。

👉 Android Studio Flamingo | 2022.2.1  |  Android Developers hatena-bookmark

 

💉 まとめ

Android Studio の Suggestion ダイアログ

androidx.navigation:navigation-compose が 2.7.0-beta02 で NG だが 2.7.0-beta01 で OK な件


[File]

  |

[Project Structue]

  |

[Suggestions]

は、Android Studio までを含めた全ての依存性を考慮していない

Version Catalog (toml) ですが、なんだか不便です。

👉 【Android Studio Flamingo】dependencies をバージョンアップデートするときに確認するべき3つの相性 hatena-bookmark


【WordPress】自分のブログで「無効なトラフィック」を発生させないための Adsense タグ記述

混乱してます。

方法はいろいろあると思いますが、

まずは、

管理者のアクセス時には広告を表示させない。

ということがシンプル。

 

📝 WordPress 組み込み関数によるタグ記述

以下を使うといい。


current_user_can( string $capability, mixed $args ): bool

👉 current_user_can() | Function | WordPress Developer Resources hatena-bookmark

管理者でログインしている状態を判別したい場合は、


current_user_can('administrator')

で、アクセスしている人を判別できます。

 

📝 WordPress テンプレートに埋め込む場合

自動広告の場合は以下のように埋め込みます。


<?php if (!current_user_can('administrator')): ?>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-XXXXXXXXXX",
    enable_page_level_ads: true
  });
</script>
<?php endif; ?>

自動広告ではない場合でも同じように、


<?php if (!current_user_can('administrator')): ?>
// Adsense コード
<?php endif; ?>

の形式で書けば管理者からのアクセス時には表示されません。

 

📝 WordPress ウィジェットに埋め込む場合

functions.php で定義しておきます。


// functions.php
function adsense_shortcode() {
	$code = '
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXX" crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-XXXXXXXXXX"
     data-ad-slot="YYYYYYYYYY"
     data-ad-format="auto"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
';

  return current_user_can('administrator') ? '' : $code;
}
add_shortcode('adsense', 'adsense_shortcode');

ウィジェット側ではショートコード形式で呼び出します。


<div>[adsense]</div>

管理者でログインしていない場合は空文字を表示します。

 

📝 まとめ

管理者としてログインしていないブラウザでは有効ではありません。

逆にいえば、管理者としてログインしてなければ参照できます。

レイアウトなど確認したいときでも、最小限にしておくべきです。

クリックは当然禁物です。


【WordPress】ダッシュボードの Jetpack 統計 のグラフが読み込み中のまま表示されない 😩

表示されなくなるんです、管理画面のアクセス数のグラフ。

ダッシュボードの Jetpack 統計 のグラフが読み込み中のまま表示されない

 

😩 管理画面新機能に切り替えてから発生

管理画面のどこかで「新機能に切り替えますか」と表示されたので「はい」を押してから、表示できなくなった。

ので、以前の機能に戻す。


管理画面メニュー

 |

Jetpack

 |

設定

 |

トラフィック

 |

Jetpack 統計

 |

「新しい Jetpack 統計情報のエクスペリエンスを有効化」をOFF

ダッシュボードの Jetpack 統計 のグラフが読み込み中のまま表示されない

直接行くなら、URLは以下です。


https://your.wordpress.host/wp-admin/admin.php?page=jetpack#/settings?term=stats

 

😩 400 Bad Request もよく表示される不具合

再度、ONにしようとすると、


設定の更新中にエラーが発生しました。 JsonParseError

と表示されたり、

以下ように表示されて管理画面や公開サイト部分にもアクセスできなくなったり。

「新しい Jetpack 統計情報のエクスペリエンスを有効化」をOFF


400 Bad Request
Request Header Or Cookie Too Large

クッキーを削除するまで管理画面にアクセスできません。

消すしかないので以下から。


chrome://settings/clearBrowserData

 

😩 まとめ

何が原因なのか謎。

根本的に解決はしていません。

一体、なんなんすかね。


【マイナンバー】スマホ用電子証明書がややこしいネーミングで混乱する

データ削除の件も気になっていて、

使ってみようとして少し混乱したので。

👉 スマホのマイナカード機能を止める方法 デジタル庁が案内 端末の初期化ではデータは“消えない” - ITmedia NEWS hatena-bookmark

 

📱 スマホ用電子証明書の有効性確認を行う

以下のサイトを見ながら、まずは確認を行ってみようと。

👉 電子証明書の情報確認 / スマホ用電子証明書の有効性確認を行う | 使い方 hatena-bookmark

練習と思い、上の図を mermaid 記法シーケンス図で書いてみました。


👉 スマホ用電子証明書の有効性確認.md hatena-bookmark

 

📱 「電子証明書」の種類

ちょっと、言葉の意味が分からなくなりました。

以下、上記公式ページから抜粋した「電子証明書」たち。


- スマホ用電子証明書
- あなたの電子証明書
- 利用者証明用電子証明書
- 署名用電子証明書
- 発行元の電子証明書
- スマホ用署名用電子証明書
- スマホ用利用者証明用電子証明書
- あなたのスマホ用電子証明書

....。

直感的に分かりません。

うちのおかんが使えるわけねえだろバカが。

考えられるパターンをある程度書き出してみます。


電子証明書
署名用電子証明書
利用者証明用電子証明書
スマホ用電子証明書
スマホ用署名用電子証明書
スマホ用利用者証明用電子証明書
あなたの電子証明書
あなたの署名用電子証明書
あなたの利用者証明用電子証明書
あなたのスマホ用電子証明書
あなたのスマホ用署名用電子証明書
あなたのスマホ用利用者証明用電子証明書
発行元の電子証明書
発行元の署名用電子証明書
発行元の利用者証明用電子証明書
発行元のスマホ用電子証明書
発行元のスマホ用署名用電子証明書
発行元のスマホ用利用者証明用電子証明書
...

こんなにありました?

 

📱 「あなたの」「発行元の」?

私が混乱したのはこの画面。

「あなたのスマホ用電子証明書」か「発行元のスマホ用電子証明書」どちらのスマホ用電子証明書を

???

「あなたの」

「発行元の」

この2つの言葉が私をさらに混乱させています。

マイナンバーカードデータは、インターネットを利用して、データを照会してから処理を進めますので、「スマホアプリ」でいうところの


「あなたの」→「スマホアプリ内に保存している」

「発行元の」→「クラウド上に登録されている」

と解釈するとなんとなく理解することができました。

 

📱 まとめ

日本語を解読するための表を作っておきます。

そもそも、

「利用者証明」と「署名」と「電子証明書」。

このネーミングが混乱の元。

英語圏やプログラミングでは説明しづらくない?

直感的に使えるネーミングは大事。