Merge pull request #4738 from Dhilan007/recover_activity

recover java activity on android.
This commit is contained in:
minggo 2013-12-30 02:16:07 -08:00
commit aa0383ce33
41 changed files with 471 additions and 53 deletions

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.AssetsManagerTest;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,32 @@
package org.cocos2dx.hellocpp;
import android.app.NativeActivity;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -11,7 +11,7 @@
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.simplegame;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -0,0 +1,33 @@
package org.cocos2dx.testcpp;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.cocosdragonjs;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.crystalcraze;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.moonwarriors;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -12,7 +12,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.testjavascript;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.watermelonwithme;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,33 @@
package org.cocos2dx.hellolua;
import android.app.NativeActivity;
import android.graphics.PixelFormat;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,32 @@
package org.cocos2dx.testlua;
import android.app.NativeActivity;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -11,7 +11,7 @@
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,32 @@
package org.cocos2dx.hellocpp;
import android.app.NativeActivity;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,32 @@
package org.cocos2dx.hellojavascript;
import android.app.NativeActivity;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}

View File

@ -10,7 +10,7 @@
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name="android.app.NativeActivity"
<activity android:name=".Cocos2dxActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

View File

@ -1,3 +0,0 @@
No Java files
src/ is required for Android's build.xml to operate correctly.
git does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.

View File

@ -0,0 +1,32 @@
package org.cocos2dx.hellolua;
import android.app.NativeActivity;
import android.os.Bundle;
public class Cocos2dxActivity extends NativeActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//For supports translucency
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
/*const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
//EGL_BLUE_SIZE, 5, -->delete
//EGL_GREEN_SIZE, 6, -->delete
//EGL_RED_SIZE, 5, -->delete
EGL_BUFFER_SIZE, 32, //-->new field
EGL_DEPTH_SIZE, 16,
EGL_STENCIL_SIZE, 8,
EGL_NONE
};*/
//2.Set the format of window
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
}