스토리지 인터페이스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
게임 및 저장 데이터를 유지하는 메서드
메서드
clear()
키-값 쌍이 있는 경우 모두 삭제합니다.
getItem(key)
주어진 키와 연결된 현재 값, 또는 주어진 키가 없는 경우 null을 반환합니다.
removeItem(key)
주어진 키에 키-값 쌍이 있는 경우 해당 키-값 쌍을 삭제합니다.
setItem(key, value)
이전에 키의 키-값 쌍이 없었던 경우 키-값으로 식별되는 쌍의 값을 설정하여 새로운 키-값 쌍을 생성합니다.
요건
- 사용자가 레벨 완료 등 중요한 진전을 이루었을 때 게임에서 이 인터페이스를 통해 진행 상황을 저장해야 합니다.
- 게임이 시작할 때 게임에서 저장된 진행 상황을 복원해야 합니다.
- 게임이 게임의 이전 버전에서 저장된 진행 상황을 복원할 수 있어야 합니다.
- 저장된 게임의 전체 크기는 3MiB보다 작아야 하며 500KiB보다 작은 것이 좋습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-12-24(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"]],["최종 업데이트: 2024-12-24(UTC)"],[[["Games must utilize the provided interface (`clear()`, `getItem()`, `removeItem()`, `setItem()`) for saving player progress, especially upon significant events like completing a level."],["Games are required to automatically load and apply any saved progress when launched, ensuring continuity for the player."],["Saved game data must be compatible with prior game versions, allowing players to seamlessly continue progress from older builds."],["All saved game data for a user should not exceed 3 MiB in total size, and ideally be kept under 500 KiB to optimize storage space and loading times."]]],[]]