From 4893de18f30c52a4c838af7c6ff2f1480b111d86 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 18 Mar 2011 11:01:27 +0800 Subject: [PATCH] [android] HelloWorld supports cocosdenshion --- HelloWorld/android/jni/Android.mk | 1 + HelloWorld/android/jni/helloworld/Android.mk | 4 ++-- .../src/org/cocos2dx/application/ApplicationDemo.java | 1 + .../android/src/org/cocos2dx/lib/Cocos2dxActivity.java | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/HelloWorld/android/jni/Android.mk b/HelloWorld/android/jni/Android.mk index e0d03ee0c2..bdef5abe06 100644 --- a/HelloWorld/android/jni/Android.mk +++ b/HelloWorld/android/jni/Android.mk @@ -3,6 +3,7 @@ include $(CLEAR_VARS) subdirs := $(addprefix $(LOCAL_PATH)/../../../,$(addsuffix /Android.mk, \ cocos2dx \ + CocosDenshion/android \ )) subdirs += $(LOCAL_PATH)/helloworld/Android.mk diff --git a/HelloWorld/android/jni/helloworld/Android.mk b/HelloWorld/android/jni/helloworld/Android.mk index 738111fb7d..647f361e36 100644 --- a/HelloWorld/android/jni/helloworld/Android.mk +++ b/HelloWorld/android/jni/helloworld/Android.mk @@ -11,12 +11,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \ $(LOCAL_PATH)/../../../../cocos2dx/include \ $(LOCAL_PATH)/../../.. -LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi -lcocos2d -llog +LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi -lcocos2d -llog -lcocosdenshion # it is used for ndk-r5 # because the new Windows toolchain doesn't support Cygwin's drive # mapping (i.e /cygdrive/c/ instead of C:/) # LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \ -# -lcocos2d -llog +# -lcocos2d -llog -lcocosdenshion include $(BUILD_SHARED_LIBRARY) \ No newline at end of file diff --git a/HelloWorld/android/src/org/cocos2dx/application/ApplicationDemo.java b/HelloWorld/android/src/org/cocos2dx/application/ApplicationDemo.java index 453ce3bba7..9289e7da35 100644 --- a/HelloWorld/android/src/org/cocos2dx/application/ApplicationDemo.java +++ b/HelloWorld/android/src/org/cocos2dx/application/ApplicationDemo.java @@ -34,6 +34,7 @@ public class ApplicationDemo extends Cocos2dxActivity{ static { System.loadLibrary("cocos2d"); + System.loadLibrary("cocosdenshion"); System.loadLibrary("helloworld"); } } diff --git a/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxActivity.java b/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxActivity.java index 4678ba44f5..0881b2a2f9 100644 --- a/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/HelloWorld/android/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -153,6 +153,9 @@ public class Cocos2dxActivity extends Activity{ if (accelerometerEnabled) { accelerometer.enable(); } + + // resume background music + resumeBackgroundMusic(); } @Override @@ -161,6 +164,9 @@ public class Cocos2dxActivity extends Activity{ if (accelerometerEnabled) { accelerometer.disable(); } + + // pause background music + pauseBackgroundMusic(); } protected void setPackgeName(String packageName) {