Title: Incorrect advice in android_support.h file from SDK. · Issue #57 · playgameservices/cpp-android-basic-samples · GitHub
Open Graph Title: Incorrect advice in android_support.h file from SDK. · Issue #57 · playgameservices/cpp-android-basic-samples
X Title: Incorrect advice in android_support.h file from SDK. · Issue #57 · playgameservices/cpp-android-basic-samples
Description: In the gpg-cpp-sdk v 3.0.1 there is a file android/include/gpg/android_support.h This file mentions: * Example code for an Android 4.0+ game using a Java Activity
* In your Java Activity, please add the following. You may need t...
Open Graph Description: In the gpg-cpp-sdk v 3.0.1 there is a file android/include/gpg/android_support.h This file mentions: * Example code for an Android 4.0+ game using a Java Activity
* In your Java Activity, ...
X Description: In the gpg-cpp-sdk v 3.0.1 there is a file android/include/gpg/android_support.h This file mentions: * <h1>Example code for an Android 4.0+ game using a Java Activity</h1> * In your Jav...
Opengraph URL: https://github.com/playgameservices/cpp-android-basic-samples/issues/57
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect advice in android_support.h file from SDK.","articleBody":"In the gpg-cpp-sdk v 3.0.1 there is a file **android/include/gpg/android_support.h**\r\n\r\nThis file mentions:\r\n\r\n```\r\n* \u003ch1\u003eExample code for an Android 4.0+ game using a Java Activity\u003c/h1\u003e\r\n * In your Java Activity, please add the following. You may need to merge this\r\n * code with your existing lifecycle functions.\r\n * \\code\r\n * public class YourActivity extends Activity {\r\n * protected void onActivityResult(int requestCode,\r\n * int resultCode,\r\n * Intent data) {\r\n * super.onActivityResult(requestCode, resultCode, data);\r\n * nativeOnActivityResult(this, requestCode, resultCode, data);\r\n * }\r\n *\r\n * // Implemented in C++.\r\n * private static native void nativeOnActivityResult(\r\n * Activity activity,\r\n * int requestCode,\r\n * int resultCode,\r\n * Intent data);\r\n * }\r\n * \\endcode\r\n * Then, in your native library, add the following forwarding functions.\r\n * \\code\r\n * void Java_com_example_yourapp_YourActivity_nativeOnActivityResult(\r\n * JNIEnv* env,\r\n * jobject thiz,\r\n * jobject activity,\r\n * jint request_code,\r\n * jint result_code,\r\n * jobject data) {\r\n * gpg::AndroidSupport::OnActivityResult(\r\n * env, activity, request_code, result_code, data);\r\n * }\r\n * \\endcode\r\n```\r\n\r\nThese code snippets are incorrect.\r\n\r\nThe Java part of the code defines a static function, without a 'thiz' pointer.\r\n\r\nThe C part of the code defines a non static function, with a 'thiz' pointer.\r\n\r\nThese do not rhyme.\r\n\r\nCausing android studio to warn:\r\n\r\n\r\n\r\nPlease address, @hak ","author":{"url":"https://github.com/stolk","@type":"Person","name":"stolk"},"datePublished":"2019-03-05T17:51:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/57/cpp-android-basic-samples/issues/57"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b0114b96-8603-53b8-4ae9-956abc5f4349 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9170:36A82:11D6AF9:188383B:69694628 |
| html-safe-nonce | 16fba93fbd2a27f4edca8a5bd2897e39255e22fb1f6e1c1922b10dbae48aee93 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTcwOjM2QTgyOjExRDZBRjk6MTg4MzgzQjo2OTY5NDYyOCIsInZpc2l0b3JfaWQiOiI3ODIyNzU5MDAxMjU2OTY5NzY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 853af32554c08ca6cf125dea7ff78e856a6d88859a7d87b9553ea469ee0cdbb9 |
| hovercard-subject-tag | issue:417422763 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/playgameservices/cpp-android-basic-samples/57/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ddd9d6c84be7c3d9d98b6123537c6852e0df2659a2d6281ce85c8c40bbbe010/playgameservices/cpp-android-basic-samples/issues/57 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ddd9d6c84be7c3d9d98b6123537c6852e0df2659a2d6281ce85c8c40bbbe010/playgameservices/cpp-android-basic-samples/issues/57 |
| og:image:alt | In the gpg-cpp-sdk v 3.0.1 there is a file android/include/gpg/android_support.h This file mentions: * Example code for an Android 4.0+ game using a Java Activity* In your Java Activity, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stolk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/playgameservices/cpp-android-basic-samples git https://github.com/playgameservices/cpp-android-basic-samples.git |
| octolytics-dimension-user_id | 4439547 |
| octolytics-dimension-user_login | playgameservices |
| octolytics-dimension-repository_id | 17817139 |
| octolytics-dimension-repository_nwo | playgameservices/cpp-android-basic-samples |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17817139 |
| octolytics-dimension-repository_network_root_nwo | playgameservices/cpp-android-basic-samples |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width