- Using hard-fp
- Immersive mode in android-19 - Fixed local reference release in JNI helper - Misc fixes Change-Id: I3ab19c2b66648bb7a011c462d9d98e75bc136ce6
This commit is contained in:
committed by
Andrew Hsieh
parent
1f1e737907
commit
cc69f210a7
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="11"
|
android:minSdkVersion="11"
|
||||||
android:targetSdkVersion="17" />
|
android:targetSdkVersion="19" />
|
||||||
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
|
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
|
||||||
<application
|
<application
|
||||||
|
|||||||
@@ -13,6 +13,14 @@ LOCAL_CFLAGS :=
|
|||||||
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2
|
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2
|
||||||
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue ndk_helper
|
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue ndk_helper
|
||||||
|
|
||||||
|
ifneq ($(filter %armeabi-v7a,$(TARGET_ARCH_ABI)),)
|
||||||
|
LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
|
||||||
|
LOCAL_LDLIBS += -lm_hard
|
||||||
|
ifeq (,$(filter -fuse-ld=mcld,$(APP_LDFLAGS) $(LOCAL_LDFLAGS)))
|
||||||
|
LOCAL_LDFLAGS += -Wl,--no-warn-mismatch
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
$(call import-module,android/ndk_helper)
|
$(call import-module,android/ndk_helper)
|
||||||
|
|||||||
@@ -11,4 +11,4 @@
|
|||||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=Google Inc.:Google APIs:17
|
target=Google Inc.:Google APIs:19
|
||||||
|
|||||||
@@ -42,10 +42,16 @@ public class TeapotNativeActivity extends NativeActivity {
|
|||||||
{
|
{
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
|
getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
|
||||||
}
|
}
|
||||||
else if(SDK_INT >= 14)
|
else if(SDK_INT >= 14 && SDK_INT < 19)
|
||||||
{
|
{
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||||
}
|
}
|
||||||
|
else if(SDK_INT >= 19)
|
||||||
|
{
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// Our popup window, you will call it from your C/C++ code later
|
// Our popup window, you will call it from your C/C++ code later
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="11"
|
android:minSdkVersion="11"
|
||||||
android:targetSdkVersion="17" />
|
android:targetSdkVersion="19" />
|
||||||
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
|
<uses-feature android:glEsVersion="0x00020000"></uses-feature>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
|
||||||
<application
|
<application
|
||||||
|
|||||||
@@ -12,6 +12,14 @@ LOCAL_CFLAGS :=
|
|||||||
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2
|
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2
|
||||||
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue ndk_helper
|
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue ndk_helper
|
||||||
|
|
||||||
|
ifneq ($(filter %armeabi-v7a,$(TARGET_ARCH_ABI)),)
|
||||||
|
LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
|
||||||
|
LOCAL_LDLIBS += -lm_hard
|
||||||
|
ifeq (,$(filter -fuse-ld=mcld,$(APP_LDFLAGS) $(LOCAL_LDFLAGS)))
|
||||||
|
LOCAL_LDFLAGS += -Wl,--no-warn-mismatch
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
$(call import-module,android/ndk_helper)
|
$(call import-module,android/ndk_helper)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
const int32_t NUM_TEAPOTS_X = 8;
|
const int32_t NUM_TEAPOTS_X = 8;
|
||||||
const int32_t NUM_TEAPOTS_Y = 8;
|
const int32_t NUM_TEAPOTS_Y = 8;
|
||||||
const int32_t NUM_TEAPOTS_Z = 6;
|
const int32_t NUM_TEAPOTS_Z = 8;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
//Shared state for our app.
|
//Shared state for our app.
|
||||||
|
|||||||
@@ -11,4 +11,4 @@
|
|||||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=Google Inc.:Google APIs:17
|
target=Google Inc.:Google APIs:19
|
||||||
|
|||||||
@@ -38,12 +38,20 @@ public class MoreTeapotsNativeActivity extends NativeActivity {
|
|||||||
|
|
||||||
//Hide toolbar
|
//Hide toolbar
|
||||||
int SDK_INT = android.os.Build.VERSION.SDK_INT;
|
int SDK_INT = android.os.Build.VERSION.SDK_INT;
|
||||||
if(SDK_INT >= 11 && SDK_INT < 14) {
|
if(SDK_INT >= 11 && SDK_INT < 14)
|
||||||
|
{
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
|
getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
|
||||||
}else if(SDK_INT >= 14){
|
}
|
||||||
|
else if(SDK_INT >= 14 && SDK_INT < 19)
|
||||||
|
{
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||||
}
|
}
|
||||||
|
else if(SDK_INT >= 19)
|
||||||
|
{
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onPause()
|
protected void onPause()
|
||||||
|
|||||||
@@ -10,6 +10,16 @@ LOCAL_EXPORT_LDLIBS := -llog -landroid -lEGL -lGLESv2
|
|||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue
|
LOCAL_STATIC_LIBRARIES := cpufeatures android_native_app_glue
|
||||||
|
|
||||||
|
|
||||||
|
ifneq ($(filter %armeabi-v7a,$(TARGET_ARCH_ABI)),)
|
||||||
|
LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
|
||||||
|
LOCAL_EXPORT_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
|
||||||
|
LOCAL_EXPORT_LDLIBS += -lm_hard
|
||||||
|
ifeq (,$(filter -fuse-ld=mcld,$(APP_LDFLAGS) $(LOCAL_LDFLAGS)))
|
||||||
|
LOCAL_EXPORT_LDFLAGS += -Wl,--no-warn-mismatch
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
#$(call import-module,android/native_app_glue)
|
#$(call import-module,android/native_app_glue)
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ bool JNIHelper::ReadFile( const char* fileName,
|
|||||||
s.append( fileName );
|
s.append( fileName );
|
||||||
std::ifstream f( s.c_str(), std::ios::binary );
|
std::ifstream f( s.c_str(), std::ios::binary );
|
||||||
|
|
||||||
env->DeleteLocalRef( str_path );
|
|
||||||
env->ReleaseStringUTFChars( str_path, path );
|
env->ReleaseStringUTFChars( str_path, path );
|
||||||
|
env->DeleteLocalRef( str_path );
|
||||||
activity_->vm->DetachCurrentThread();
|
activity_->vm->DetachCurrentThread();
|
||||||
|
|
||||||
if( f )
|
if( f )
|
||||||
@@ -197,8 +197,8 @@ std::string JNIHelper::GetExternalFilesDir()
|
|||||||
const char* path = env->GetStringUTFChars( strPath, NULL );
|
const char* path = env->GetStringUTFChars( strPath, NULL );
|
||||||
std::string s( path );
|
std::string s( path );
|
||||||
|
|
||||||
env->DeleteLocalRef( strPath );
|
|
||||||
env->ReleaseStringUTFChars( strPath, path );
|
env->ReleaseStringUTFChars( strPath, path );
|
||||||
|
env->DeleteLocalRef( strPath );
|
||||||
activity_->vm->DetachCurrentThread();
|
activity_->vm->DetachCurrentThread();
|
||||||
|
|
||||||
pthread_mutex_unlock( &mutex_ );
|
pthread_mutex_unlock( &mutex_ );
|
||||||
@@ -277,9 +277,9 @@ std::string JNIHelper::ConvertString( const char* str,
|
|||||||
|
|
||||||
std::string s = std::string( cparam );
|
std::string s = std::string( cparam );
|
||||||
|
|
||||||
|
env->ReleaseStringUTFChars( object, cparam );
|
||||||
env->DeleteLocalRef( strEncode );
|
env->DeleteLocalRef( strEncode );
|
||||||
env->DeleteLocalRef( object );
|
env->DeleteLocalRef( object );
|
||||||
env->ReleaseStringUTFChars( object, cparam );
|
|
||||||
activity_->vm->DetachCurrentThread();
|
activity_->vm->DetachCurrentThread();
|
||||||
pthread_mutex_unlock( &mutex_ );
|
pthread_mutex_unlock( &mutex_ );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user