android: link with the jni is now ok

This commit is contained in:
Edouard Dupin 2011-12-04 10:36:37 +01:00
parent 0a479ca7ff
commit aa3e79f8d1
3 changed files with 104 additions and 96 deletions

View File

@ -65,7 +65,7 @@ else
$(error you must specify a corect platform : make PLATFORM=$(SUPPORTED_PLATFORM)) $(error you must specify a corect platform : make PLATFORM=$(SUPPORTED_PLATFORM))
endif endif
$(info Build for $(PLATFORM)) $(info Build for PLATFORM=$(PLATFORM))
############################################################################### ###############################################################################
### Compilateur base system ### ### Compilateur base system ###
@ -305,10 +305,14 @@ $(OUTPUT_NAME_DEBUG): $(OBJ) $(MAKE_DEPENDENCE)
@cp $@ $(PROG_NAME) @cp $@ $(PROG_NAME)
endif endif
clean: clean:
@echo $(CADRE_HAUT_BAS) @echo $(CADRE_HAUT_BAS)
@echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS) @echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS)
@echo $(CADRE_HAUT_BAS) @echo $(CADRE_HAUT_BAS)
ifeq ($(PLATFORM), Android)
rm -r bin libs gen obj
else
@echo Remove Folder : $(OBJECT_DIR) @echo Remove Folder : $(OBJECT_DIR)
@rm -rf $(OBJECT_DIR) @rm -rf $(OBJECT_DIR)
@echo Remove File : $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE) @echo Remove File : $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE)
@ -322,10 +326,15 @@ clean:
@rm -f doxygen.log @rm -f doxygen.log
@echo Remove temporary files *.bck @echo Remove temporary files *.bck
@rm -f `find . -name "*.bck"` @rm -f `find . -name "*.bck"`
endif
count: count:
wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"` wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"`
ifeq ($(PLATFORM), Android)
install:
sudo $(PROJECT_SDK)/platform-tools/adb install -r ./bin/EwolActivity-debug.apk
else
install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE) install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
@echo $(CADRE_HAUT_BAS) @echo $(CADRE_HAUT_BAS)
@echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS) @echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS)
@ -342,7 +351,7 @@ install: .encadrer .versionFile $(OUTPUT_NAME_RELEASE)
@mkdir -p /usr/share/edn/images/ @mkdir -p /usr/share/edn/images/
@cp -vf data/imagesSources/icone.png /usr/share/edn/images/ @cp -vf data/imagesSources/icone.png /usr/share/edn/images/
@cp -vf data/imagesSources/delete-24px.png /usr/share/edn/images/ @cp -vf data/imagesSources/delete-24px.png /usr/share/edn/images/
endif
# http://alp.developpez.com/tutoriels/debian/creer-paquet/ # http://alp.developpez.com/tutoriels/debian/creer-paquet/
package: .encadrer package: .encadrer

View File

@ -24,6 +24,11 @@
#include <jni.h>
#include <sys/time.h>
#include <time.h>
#include <android/log.h>
#include <stdint.h>
#include <ewol/Debug.h> #include <ewol/Debug.h>
#include <etk/String.h> #include <etk/String.h>
@ -31,11 +36,6 @@
#include <base/guiAndroid.h> #include <base/guiAndroid.h>
#include <jni.h>
#include <sys/time.h>
#include <time.h>
#include <android/log.h>
#include <stdint.h>
#include <app.h> #include <app.h>
@ -61,36 +61,39 @@ static long _getTime(void)
return (long)(now.tv_sec*1000 + now.tv_usec/1000); return (long)(now.tv_sec*1000 + now.tv_usec/1000);
} }
/* Call to initialize the graphics state */ extern "C"
void Java_com_example_ewolAbstraction_EwolRenderer_nativeInit( JNIEnv* env )
{ {
/* Call to initialize the graphics state */
void Java_com_example_ewolAbstraction_EwolRenderer_nativeInit( JNIEnv* env )
{
EWOL_INFO("Init : Start All Application"); EWOL_INFO("Init : Start All Application");
appInit(); appInit();
gAppAlive = 1; gAppAlive = 1;
sDemoStopped = 0; sDemoStopped = 0;
sTimeOffsetInit = 0; sTimeOffsetInit = 0;
} }
void Java_com_example_ewolAbstraction_EwolRenderer_nativeResize( JNIEnv* env, jobject thiz, jint w, jint h ) void Java_com_example_ewolAbstraction_EwolRenderer_nativeResize( JNIEnv* env, jobject thiz, jint w, jint h )
{ {
currentWidth = w; currentWidth = w;
currentHeight = h; currentHeight = h;
EWOL_INFO("Resize w=" << w << " h=" << h); EWOL_INFO("Resize w=" << w << " h=" << h);
} }
/* Call to finalize the graphics state */ /* Call to finalize the graphics state */
void Java_com_example_ewolAbstraction_EwolRenderer_nativeDone( JNIEnv* env ) void Java_com_example_ewolAbstraction_EwolRenderer_nativeDone( JNIEnv* env )
{ {
EWOL_INFO("Renderer : Close All Application"); EWOL_INFO("Renderer : Close All Application");
appDeinit(); appDeinit();
} }
/* This is called to indicate to the render loop that it should /* This is called to indicate to the render loop that it should
* stop as soon as possible. * stop as soon as possible.
*/ */
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativePause( JNIEnv* env ) void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativePause( JNIEnv* env )
{ {
sDemoStopped = !sDemoStopped; sDemoStopped = !sDemoStopped;
if (sDemoStopped) { if (sDemoStopped) {
/* we paused the animation, so store the current /* we paused the animation, so store the current
@ -101,36 +104,34 @@ void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativePause( JNIEnv* env
* to take care of the pause interval. */ * to take care of the pause interval. */
sTimeOffset -= _getTime() - sTimeStopped; sTimeOffset -= _getTime() - sTimeStopped;
} }
} }
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputMotion( JNIEnv* env, jobject thiz, jint pointerID, jfloat x, jfloat y ) void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputMotion( JNIEnv* env, jobject thiz, jint pointerID, jfloat x, jfloat y )
{ {
EWOL_INFO("Event : Input Motion ID=" << pointerID << " x=" << x << " y=" << y); EWOL_INFO("Event : Input Motion ID=" << pointerID << " x=" << x << " y=" << y);
if (0 == pointerID) { if (0 == pointerID) {
appMove(x,y); appMove(x,y);
} }
} }
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputState( JNIEnv* env, jobject thiz, jint pointerID, jboolean isUp) void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventInputState( JNIEnv* env, jobject thiz, jint pointerID, jboolean isUp)
{ {
if (isUp) { if (isUp) {
__android_log_print(ANDROID_LOG_INFO, "EWOL", "Event : Input ID=%d [DOWN]", pointerID);
EWOL_INFO("Event : Input ID=" << pointerID << " [DOWN]"); EWOL_INFO("Event : Input ID=" << pointerID << " [DOWN]");
} else { } else {
__android_log_print(ANDROID_LOG_INFO, "EWOL", "Event : Input ID=%d [UP]", pointerID);
EWOL_INFO("Event : Input ID=" << pointerID << " [UP]"); EWOL_INFO("Event : Input ID=" << pointerID << " [UP]");
} }
} }
void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventUnknow( JNIEnv* env, jobject thiz, jint eventID) void Java_com_example_ewolAbstraction_EwolGLSurfaceView_nativeEventUnknow( JNIEnv* env, jobject thiz, jint eventID)
{ {
EWOL_WARNING("Event : Unknow ID=" << eventID); EWOL_WARNING("Event : Unknow ID=" << eventID);
} }
/* Call to render the next GL frame */ /* Call to render the next GL frame */
void Java_com_example_ewolAbstraction_EwolRenderer_nativeRender( JNIEnv* env ) void Java_com_example_ewolAbstraction_EwolRenderer_nativeRender( JNIEnv* env )
{ {
long curTime; long curTime;
/* NOTE: if sDemoStopped is TRUE, then we re-render the same frame /* NOTE: if sDemoStopped is TRUE, then we re-render the same frame
@ -147,9 +148,9 @@ void Java_com_example_ewolAbstraction_EwolRenderer_nativeRender( JNIEnv* env )
} }
} }
//__android_log_print(ANDROID_LOG_INFO, "EWOL", "curTime=%ld", curTime);
appRender(curTime, currentWidth, currentHeight); appRender(curTime, currentWidth, currentHeight);
}
} }
@ -159,8 +160,6 @@ void Java_com_example_ewolAbstraction_EwolRenderer_nativeRender( JNIEnv* env )
#undef __class__ #undef __class__
#define __class__ "guiAbstraction" #define __class__ "guiAbstraction"

View File

@ -179,9 +179,9 @@ class FTFontInternal
} }
EWOL_INFO(" unit per EM = " << m_fftFace->units_per_EM); EWOL_INFO(" unit per EM = " << m_fftFace->units_per_EM);
EWOL_INFO(" num of fixed sizes = " << m_fftFace->num_fixed_sizes); EWOL_INFO(" num of fixed sizes = " << m_fftFace->num_fixed_sizes);
EWOL_INFO(" Availlable sizes = " << (int)m_fftFace->available_sizes); //EWOL_INFO(" Availlable sizes = " << (int)m_fftFace->available_sizes);
EWOL_INFO(" Current size = " << (int)m_fftFace->size); //EWOL_INFO(" Current size = " << (int)m_fftFace->size);
} }
public: public:
FTFontInternal(etk::File fontFileName, etk::String fontName) FTFontInternal(etk::File fontFileName, etk::String fontName)