संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
gpg::AndroidInitialization
#include <android_initialization.h>
AndroidInitialization में, शुरू करने वाले तीन फ़ंक्शन शामिल होते हैं. इनमें से किसी एक को कॉल किया जाना चाहिए.
खास जानकारी
मानक Java गतिविधि के मामले में, JNI_OnLoad का इस्तेमाल किया जाना चाहिए. NativeActivity के मामले में जहां JNI_OnLoad को कॉल नहीं किया जाएगा, android_main या ANativeActivity_onCreate का इस्तेमाल किया जाना चाहिए. android_main का इस्तेमाल, android_native_app_glue.h का इस्तेमाल करके NativeActivity बनाते समय किया जाता है. ANativeActivity_onCreate का इस्तेमाल सिर्फ़ local_activity.h के ज़रिए NativeActivity बनाते समय किया जाता है. android_native_app_glue.h औरNative_activity.h डिफ़ॉल्ट Android हेडर हैं.
शुरू करने के सही फ़ंक्शन को किसी भी AndroidPlatformConfiguration इंस्टेंस मेथड को कॉल करने से ठीक पहले कॉल किया जाना चाहिए. साथ ही, GameServices ऑब्जेक्ट को इंस्टैंशिएट किए जाने से पहले कॉल किया जाना चाहिए. किसी एक इनीशियलाइज़ेशन कॉल से पहले AndroidPlatformConfiguration दिया जा सकता है (उदाहरण के लिए, अगर कॉन्फ़िगरेशन ऑब्जेक्ट में ग्लोबल स्कोप है), तो शुरू करने के कॉल से पहले किसी भी तरीके को कॉल नहीं किया जाता है. इन तरीकों को कॉलिंग प्रोग्राम के दौरान सिर्फ़ एक बार कॉल किया जाना चाहिए, न कि हर GameServices ऑब्जेक्ट को बनाए जाने के दौरान.
सार्वजनिक स्टैटिक फ़ंक्शन
|
ANativeActivity_onCreate(ANativeActivity *native_activity, void *savedState, size_t savedStateSize)
|
void
जब NativeActivity.h पर आधारित NativeActivity के साथ Play की गेम सेवाओं का इस्तेमाल किया जा रहा हो, तो Play की गेम सेवाओं के किसी भी दूसरे कॉल से पहले, ANativeActivity_onCreate को आपकी गतिविधि के ANativeActivity_onCreate के दौरान कॉल किया जाना चाहिए.
|
JNI_OnLoad(JavaVM *jvm)
|
void
किसी स्टैंडर्ड Java ऐक्टिविटी के साथ Play की गेम सेवाओं का इस्तेमाल करते समय, डाइनैमिक लाइब्रेरी के JNI_OnLoad को कॉल करते समय JNI_OnLoad को कॉल किया जाना चाहिए.
|
android_main(struct android_app *app)
|
void
android_native_app_glue.h पर आधारित NativeActivity के साथ Play की गेम सेवाओं का इस्तेमाल करते समय, android_main को आपकी गतिविधि के android_main के दौरान, Play की गेम सेवाओं के किसी भी दूसरे कॉल से पहले कॉल किया जाना चाहिए.
|
सार्वजनिक स्टैटिक फ़ंक्शन
ANativeActivity_onCreate
void gpg::AndroidInitialization::ANativeActivity_onCreate(
ANativeActivity *native_activity,
void *savedState,
size_t savedStateSize
)
जब NativeActivity.h पर आधारित NativeActivity के साथ Play की गेम सेवाओं का इस्तेमाल किया जा रहा हो, तो Play की गेम सेवाओं के किसी भी दूसरे कॉल से पहले, ANativeActivity_onCreate को आपकी गतिविधि के ANativeActivity_onCreate के दौरान कॉल किया जाना चाहिए.
JNI_OnLoad
void gpg::AndroidInitialization::JNI_OnLoad(
JavaVM *jvm
)
किसी स्टैंडर्ड Java ऐक्टिविटी के साथ Play की गेम सेवाओं का इस्तेमाल करते समय, डाइनैमिक लाइब्रेरी के JNI_OnLoad को कॉल करते समय JNI_OnLoad को कॉल किया जाना चाहिए.
android_main
void gpg::AndroidInitialization::android_main(
struct android_app *app
)
android_native_app_glue.h पर आधारित NativeActivity के साथ Play की गेम सेवाओं का इस्तेमाल करते समय, android_main को अपनी गतिविधि के android_main के दौरान, Play की गेम सेवाओं के किसी भी दूसरे कॉल से पहले कॉल किया जाना चाहिए.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# gpg::AndroidInitialization Struct Reference\n\ngpg::AndroidInitialization\n==========================\n\n`#include \u003candroid_initialization.h\u003e`\n\n[AndroidInitialization](/games/services/cpp/api/struct/gpg/android-initialization#structgpg_1_1_android_initialization) includes three initialization functions, exactly one of which must be called.\n\nSummary\n-------\n\nIn the case of a standard Java Activity, JNI_OnLoad should be used. In the case of a NativeActivity where JNI_OnLoad will not be called, either android_main or ANativeActivity_onCreate should be used. android_main is used when building a NativeActivity using android_native_app_glue.h. ANativeActivity_onCreate is used when building a NativeActivity using just native_activity.h. android_native_app_glue.h and native_activity.h are default Android headers.\n\nThe appropriate initialization function must be called exactly once before any [AndroidPlatformConfiguration](/games/services/cpp/api/class/gpg/android-platform-configuration#classgpg_1_1_android_platform_configuration) instance methods are called, and it must be called before a [GameServices](/games/services/cpp/api/class/gpg/game-services#classgpg_1_1_game_services) object is instantiated. It is permitted to instantiate a [AndroidPlatformConfiguration](/games/services/cpp/api/class/gpg/android-platform-configuration#classgpg_1_1_android_platform_configuration) before one of the initialization calls (for example, if the configuration object has global scope), as long as no methods are called before the initialization call. These methods need be called only once in the lifetime of the calling program, not once per [GameServices](/games/services/cpp/api/class/gpg/game-services#classgpg_1_1_game_services) object created.\n\n| ### Public static functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ANativeActivity_onCreate](#structgpg_1_1_android_initialization_1a816753e9576f07d1d58f2e94b26ad66c)`(ANativeActivity *native_activity, void *savedState, size_t savedStateSize)` | `void` When using Play Game Services with a NativeActivity which is based on only native_activity.h, ANativeActivity_onCreate should be called during your activity's ANativeActivity_onCreate, before any other Play Game Services calls. |\n| [JNI_OnLoad](#structgpg_1_1_android_initialization_1ae43182cd58941ddc74eb07535c8de97a)`(JavaVM *jvm)` | `void` When using Play Game Services with a standard Java Activity, JNI_OnLoad should be called when the dynamic library's JNI_OnLoad is called. |\n| [android_main](#structgpg_1_1_android_initialization_1ace2b90a82cc0b9ad5aeb7ac73996b100)`(struct android_app *app)` | `void` When using Play Game Services with a NativeActivity which is based on android_native_app_glue.h, android_main should be called during your activity's android_main, before any other Play Game Services calls. |\n\nPublic static functions\n-----------------------\n\n### ANativeActivity_onCreate\n\n```c++\nvoid gpg::AndroidInitialization::ANativeActivity_onCreate(\n ANativeActivity *native_activity,\n void *savedState,\n size_t savedStateSize\n)\n``` \nWhen using Play Game Services with a NativeActivity which is based on only native_activity.h, ANativeActivity_onCreate should be called during your activity's ANativeActivity_onCreate, before any other Play Game Services calls. \n\n### JNI_OnLoad\n\n```c++\nvoid gpg::AndroidInitialization::JNI_OnLoad(\n JavaVM *jvm\n)\n``` \nWhen using Play Game Services with a standard Java Activity, JNI_OnLoad should be called when the dynamic library's JNI_OnLoad is called. \n\n### android_main\n\n```c++\nvoid gpg::AndroidInitialization::android_main(\n struct android_app *app\n)\n``` \nWhen using Play Game Services with a NativeActivity which is based on android_native_app_glue.h, android_main should be called during your activity's android_main, before any other Play Game Services calls."]]