গেম স্টেট এপিআই-এর মাধ্যমে, আপনি সিস্টেমকে জানাতে পারেন যে গেমটি বর্তমানে কী করছে (উদাহরণস্বরূপ: লোডিং লেভেল, তীব্র নেটওয়ার্ক গেমপ্লে, ইন-গেম মেনু রেন্ডারিং, বিজ্ঞাপন দেখানো ইত্যাদি)। এই মূল্যবান তথ্য দিয়ে, সিস্টেম সেই অনুযায়ী সম্পদ এবং শক্তি অপ্টিমাইজ করতে সক্ষম হবে।
জাভা
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.S){// Get GameManager from SystemServiceGameManagergameManager=Context.getSystemService(GameManager.class);GameStategameState=newGameState(false,GameState.MODE_GAMEPLAY_UNINTERRUPTIBLE);gameManager.setGameState(gameState);}
ডকুমেন্টেশন সারাংশে আপনি সিস্টেমকে অবহিত করতে পারেন এমন মোডগুলি দেখুন। ভবিষ্যতে যখন বিভিন্ন সম্পদ ব্যবহারের ধরণ আবিষ্কৃত হবে তখন তালিকাটি বাড়বে।
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 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-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Game State API\n\n**Released**:\n\nAndroid 13 (API Level 33) - [Java](/reference/android/app/GameState)\n\nWith Game State API, you can let the system know what the game is currently\ndoing (for example: loading levels, intense networked gameplay, rendering\nin-game menu, showing ads, etc). With this valuable information, the system is\nbe able to optimize resources and power accordingly. \n\n### Java\n\n if ( Build.VERSION.SDK_INT \u003e= Build.VERSION_CODES.S ) {\n // Get GameManager from SystemService\n GameManager gameManager =\n Context.getSystemService(GameManager.class);\n GameState gameState = new GameState(false,\n GameState.MODE_GAMEPLAY_UNINTERRUPTIBLE);\n gameManager.setGameState(gameState);\n }\n\nCheck out the modes you can notify the system in the documentation\n[Summary](/reference/android/app/GameState#summary).\nIt is possible that the list will grow when different resource consumption\npatterns is discovered in the future."]]