android: added ActivityResultCallback (pull req)

Monkey Forums/Monkey Programming/android: added ActivityResultCallback (pull req)

AdamRedwoods(Posted 2013) [#1]
Hi,

I've added a github pull request to Monkey Develop to add in the onActivityResultsCallback() to the game activity in Android.

this should allow things like camera, IAP, contact lists, etc. to call and get data back.
this solution is good since it does not need a new target, although coders will still need to modify manifest.xml for permissions.

here's my test code. seems to work (may need to add camera permission beyond test device).

camera_intent_test.monkey


native/androidcamera.java



Duke87(Posted 2015) [#2]
I get
-compile:
[javac] Compiling 3 source files to C:\Programmieren\MonkeyPro77c\Camera\camera_intent_test.buildv77c\android\bin\classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] C:\Programmieren\MonkeyPro77c\Camera\camera_intent_test.buildv77c\android\src\com\monkeycoder\monkeygame\MonkeyGame.java:3649: error: cannot find symbol
[javac] class c_MonkeyCamera extends MonkeyCamera{
[javac] ^
[javac] symbol: class MonkeyCamera
[javac] C:\Programmieren\MonkeyPro77c\Camera\camera_intent_test.buildv77c\android\src\com\monkeycoder\monkeygame\MonkeyGame.java:3021: error: cannot find symbol
[javac] if(m_camera.CheckCameraHardware()){
[javac] ^
[javac] symbol: method CheckCameraHardware()
[javac] location: variable m_camera of type c_MonkeyCamera
[javac] C:\Programmieren\MonkeyPro77c\Camera\camera_intent_test.buildv77c\android\src\com\monkeycoder\monkeygame\MonkeyGame.java:3026: error: cannot find symbol
[javac] m_camera.LaunchCamera();
[javac] ^
[javac] symbol: method LaunchCamera()
[javac] location: variable m_camera of type c_MonkeyCamera
[javac] Note: C:\Programmieren\MonkeyPro77c\Camera\camera_intent_test.buildv77c\android\src\com\monkeycoder\monkeygame\MonkeyGame.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 3 errors
[javac] 3 warnings

BUILD FAILED
C:\Android\android-sdk\tools\ant\build.xml:710: The following error occurred while executing this line:
C:\Android\android-sdk\tools\ant\build.xml:723: Compile failed; see the compiler error output for details.

Total time: 1 second
TRANS FAILED: Android build failed.

when i try to compile. I really could need this feature