Android 向けの開発(Go バージョン)
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android(Go バージョン)デバイスで使用するアプリを作成する際には、パフォーマンスの最適化とリソース使用量に特別な注意が必要です。Android(Go バージョン)向けの開発では、主なコンポーネントである、オペレーティング システム(OS)と Google Play ストアの 2 つを理解する必要があります。
オペレーティング システムの互換性
Android(Go バージョン)向けの開発では、OS 認識型アプリを開発することが非常に重要です。OS 認識型とは、アプリが Android(Go バージョン)ユーザーを検出して適応できることを意味します。たとえば、isLowRamDevice()
フラグを使用すると、メモリの少ないデバイスで実行されているかどうかを検出し、それに応じた動作を行うことができます。
ユーザーの OS を把握することで、他のアプリに重ねて描画することやマルチディスプレイを使用することなど、Go デバイスで利用できない機能を制限できます。Go でのアプリ制限の全一覧については、Android との違いをご覧ください。
起動後の RAM の重要性
システムや Play ストアのアプリから、プロセスやタスクをバックグラウンドで永続的に実行できる場合があります。たとえば、デバイスが再起動したときには、ユーザーのデバイスで実行される多くのサービスやアプリからの要件となっている場合がある BOOT_COMPLETED
ブロードキャストが発生します。この永続的なブロードキャストにより、デバイスのメモリが少ないことが原因で、アプリが起動しない、またはフォアグラウンド タスクがエラーになる可能性があります。
ユーザーのデバイスのすべてのアプリが、使用できるメモリ量に直接影響します。こうしたアプリがブロードキャストまたはサービスを開始する場合、ユーザーのデバイスで起動後に使用できるシステムメモリの量がエンドユーザーのエクスペリエンスに直接影響を与えるため、Android(Go バージョン)アプリがそれを照会することが必須となります。
デベロッパーの選択肢
デベロッパーがアプリに関する決定を行う際には、Android(Go バージョン)の制限を踏まえ、アプリが動作するようにする必要があります。場合によっては、ユーザーが特定の機能を無効できるようにするだけでは不十分です。アプリによっては、そのような機能が正常な動作に必要な場合もあります。Android(Go バージョン)の一般的な制限事項については、Android との違いをご覧ください。
Google Play ストア
Google Play ストアの外観、使用感、動作は、Android(Go バージョン)と Android で変わりません。ただし、Go デバイスでは、Android(Go バージョン)に最適化されたアプリが Play ストアのおすすめに表示される場合があります。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# Develop for Android (Go edition)\n\nBuilding applications for use on Android (Go edition) devices requires special\nattention to performance optimizations and resource usage. There are two main\ncomponents to understand when building for Android (Go edition): the operating\nsystem (OS) and the Google Play Store.\n\nOperating system compatibility\n------------------------------\n\nIt's very important to develop an *OS-aware* app when developing for Android\n(Go edition). By OS-aware, we mean that your app can detect and adapt to\nAndroid (Go edition) users. For instance, the\n[`isLowRamDevice()`](/reference/android/app/ActivityManager#isLowRamDevice())\nflag enables your app to detect whether it is running on a low-memory device\nand behave accordingly.\n\nBy knowing the OS of your users, you can limit certain functionalities that\naren't available on Go devices, like drawing over other apps or using\nmulti-display. For a full list of app limitations on Go, see\n[Differences from Android](/guide/topics/androidgo#differences-from-android).\n\n### Importance of POST-boot RAM\n\nThere are instances where processes and tasks can run persistently in the\nbackground, either from the system or apps from the Play Store. For example,\nwhen a device restarts, there is a `BOOT_COMPLETED` broadcast that might be a\nrequirement from many services or apps running on a user's device. This\npersistent broadcast can lead to apps not launching, or having\nforeground tasks fail, due to low memory on a device.\n\nAll apps on a user's device directly impact memory availability. If\nthese apps initiate broadcasts or services, then it becomes mandatory for\nAndroid (Go edition) apps to query post-boot system memory availability on a\nuser's device as it directly impacts the end-user experience.\n\n### Developer choices\n\nWhen it comes to making choices for your application as a developer, you should\nensure your app can run with Android (Go edition) limitations in mind.\nSometimes, allowing users to simply disable a specific feature is not enough,\nas apps might require those features to be enabled to run properly. For a list\nof the most common limitations on Android (Go edition), see\n[Differences from Android](/guide/topics/androidgo#differences_from_main_android).\n\nGoogle Play Store\n-----------------\n\nThe Google Play Store looks, feels, and operates the same on both Android\n(Go edition) and Android. However, on Go devices, the Play Store may recommend\napps that are optimized for Android (Go edition)."]]