new compilation mode for android system
This commit is contained in:
parent
1b51dc051e
commit
236784a6d3
2
Build
2
Build
@ -1 +1 @@
|
||||
Subproject commit 9c3bc9ecb3d34caa2351555d79d3b783affb19a6
|
||||
Subproject commit f0785e65dcabf471d1a60282522738ff2ff00903
|
@ -75,7 +75,7 @@ public class __PROJECT_NAME__ extends Activity {
|
||||
private Thread mAudioThread;
|
||||
|
||||
static {
|
||||
System.loadLibrary("__PROJECT_PACKAGE__");
|
||||
System.loadLibrary("__PROJECT_NAME__");
|
||||
}
|
||||
|
||||
@Override protected void onCreate(Bundle savedInstanceState)
|
||||
@ -98,7 +98,7 @@ public class __PROJECT_NAME__ extends Activity {
|
||||
ApplicationInfo appInfo = null;
|
||||
PackageManager packMgmr = getPackageManager();
|
||||
try {
|
||||
appInfo = packMgmr.getApplicationInfo("com.__PROJECT_VENDOR__.__PROJECT_PACKAGE__", 0);
|
||||
appInfo = packMgmr.getApplicationInfo("__PROJECT_ORG_TYPE__.__PROJECT_VENDOR__.__PROJECT_PACKAGE__", 0);
|
||||
} catch (NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("Unable to locate assets, aborting...");
|
||||
|
@ -40,9 +40,10 @@ EWOL_TMP_PATH:=$(LOCAL_PATH)
|
||||
$(FILE_ABSTRACTION_DEST): $(FILE_ABSTRACTION)
|
||||
@mkdir -p $(dir $(EWOL_TMP_PATH)/$@)
|
||||
@cp -f $(FILE_ABSTRACTION) $(EWOL_TMP_PATH)/$@
|
||||
@sed -i "s|__PROJECT_VENDOR__|$(PROJECT_VENDOR)|" $(EWOL_TMP_PATH)/$@
|
||||
@sed -i "s|__PROJECT_NAME__|$(PROJECT_NAME)|" $(EWOL_TMP_PATH)/$@
|
||||
@sed -i "s|__PROJECT_PACKAGE__|$(PROJECT_PACKAGE)|" $(EWOL_TMP_PATH)/$@
|
||||
@sed -i "s|__PROJECT_ORG_TYPE__|$(call convert-special-char,$(CONFIG___EWOL_APPL_ORGANISATION_TYPE__))|" $(EWOL_TMP_PATH)/$@
|
||||
@sed -i "s|__PROJECT_VENDOR__|$(call convert-special-char,$(CONFIG___EWOL_APPL_COMPAGNY__))|" $(EWOL_TMP_PATH)/$@
|
||||
@sed -i "s|__PROJECT_NAME__|$(call convert-special-char,$(CONFIG___EWOL_APPL_NAME__))|" $(EWOL_TMP_PATH)/$@
|
||||
@sed -i "s|__PROJECT_PACKAGE__|$(call convert-special-char,$(CONFIG___EWOL_APPL_NAME__))|" $(EWOL_TMP_PATH)/$@
|
||||
|
||||
|
||||
# this is the abstraction file for Android
|
||||
|
@ -38,6 +38,7 @@ static jobject javaObjectActivity = 0;
|
||||
static jmethodID javaClassActivityEntryPoint = 0; // basic methode to call ...
|
||||
static jmethodID javaClassActivityEntryPoint__CPP_keyboardShow = 0; // basic methode to call ...
|
||||
static jmethodID javaClassActivityEntryPoint__CPP_keyboardHide = 0; // basic methode to call ...
|
||||
static jmethodID javaClassActivityEntryPoint__CPP_OrientationChange = 0;
|
||||
// generic classes
|
||||
static jclass javaDefaultClassString = 0; // default string class
|
||||
|
||||
@ -101,6 +102,58 @@ void SendJava_KeyboardShow(bool showIt)
|
||||
g_JavaVM->DetachCurrentThread();
|
||||
}
|
||||
|
||||
|
||||
void SendJava_OrientationChange(bool showIt)
|
||||
{
|
||||
EWOL_DEBUG("C->java : call java");
|
||||
if (NULL == g_JavaVM) {
|
||||
EWOL_DEBUG("C->java : JVM not initialised");
|
||||
return;
|
||||
}
|
||||
JNIEnv *JavaVirtualMachinePointer_tmp;
|
||||
int status = g_JavaVM->GetEnv((void **) &JavaVirtualMachinePointer_tmp, JNI_VERSION_1_6);
|
||||
if (status == JNI_EDETACHED) {
|
||||
JavaVMAttachArgs lJavaVMAttachArgs;
|
||||
lJavaVMAttachArgs.version = JNI_VERSION_1_6;
|
||||
lJavaVMAttachArgs.name = "EwolNativeThread";
|
||||
lJavaVMAttachArgs.group = NULL;
|
||||
status = g_JavaVM->AttachCurrentThread(&JavaVirtualMachinePointer_tmp, &lJavaVMAttachArgs);
|
||||
if (status != JNI_OK) {
|
||||
EWOL_DEBUG("C->java : AttachCurrentThread failed : " << status);
|
||||
return;
|
||||
}
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
}
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
|
||||
if (NULL == JavaVirtualMachinePointer) {
|
||||
EWOL_DEBUG("C->java : JVM not initialised");
|
||||
return;
|
||||
}
|
||||
|
||||
//Call java ...
|
||||
JavaVirtualMachinePointer->CallVoidMethod(javaObjectActivity, javaClassActivityEntryPoint__CPP_OrientationChange);
|
||||
|
||||
// manage execption :
|
||||
if (JavaVirtualMachinePointer->ExceptionOccurred()) {
|
||||
EWOL_DEBUG("C->java : EXEPTION ...");
|
||||
JavaVirtualMachinePointer->ExceptionDescribe();
|
||||
JavaVirtualMachinePointer->ExceptionClear();
|
||||
}
|
||||
|
||||
// Finished with the JVM.
|
||||
g_JavaVM->DetachCurrentThread();
|
||||
}
|
||||
|
||||
|
||||
void SendSystemMessage(const char * dataString)
|
||||
{
|
||||
EWOL_DEBUG("C->java : send message to the java : \"" << dataString << "\"");
|
||||
@ -183,8 +236,7 @@ extern "C"
|
||||
|
||||
|
||||
/* Call to initialize the graphics state */
|
||||
|
||||
void Java_com___PROJECT_VENDOR_____PROJECT_PACKAGE_____PROJECT_NAME___ActivityParamSetArchiveDir( JNIEnv* env, jobject thiz, jint mode, jstring myString)
|
||||
void Java___PROJECT_ORG_TYPE_____PROJECT_VENDOR_____PROJECT_PACKAGE_____PROJECT_NAME___ActivityParamSetArchiveDir( JNIEnv* env, jobject thiz, jint mode, jstring myString)
|
||||
{
|
||||
// direct setting of the date in the string system ...
|
||||
jboolean isCopy;
|
||||
@ -197,8 +249,7 @@ extern "C"
|
||||
}
|
||||
}
|
||||
|
||||
void Java_com___PROJECT_VENDOR_____PROJECT_PACKAGE_____PROJECT_NAME___ActivitySetJavaVortualMachineStart( JNIEnv* env, jclass classBase, jobject obj)
|
||||
//void Java_com___PROJECT_VENDOR_____PROJECT_PACKAGE_____PROJECT_NAME___ActivitySetJavaVortualMachineStart( JNIEnv* env)
|
||||
void Java___PROJECT_ORG_TYPE_____PROJECT_VENDOR_____PROJECT_PACKAGE_____PROJECT_NAME___ActivitySetJavaVortualMachineStart( JNIEnv* env, jclass classBase, jobject obj)
|
||||
{
|
||||
EWOL_DEBUG("*******************************************");
|
||||
EWOL_DEBUG("** Set JVM Pointer **");
|
||||
@ -206,9 +257,9 @@ extern "C"
|
||||
JavaVirtualMachinePointer = env;
|
||||
// get default needed all time elements :
|
||||
if (NULL != JavaVirtualMachinePointer) {
|
||||
javaClassActivity = JavaVirtualMachinePointer->FindClass("com/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__" );
|
||||
javaClassActivity = JavaVirtualMachinePointer->FindClass("__PROJECT_ORG_TYPE__/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__" );
|
||||
if (javaClassActivity == 0) {
|
||||
EWOL_DEBUG("C->java : Can't find com/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__ class");
|
||||
EWOL_DEBUG("C->java : Can't find __PROJECT_ORG_TYPE__/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__ class");
|
||||
// remove access on the virtual machine :
|
||||
JavaVirtualMachinePointer = NULL;
|
||||
return;
|
||||
@ -216,25 +267,33 @@ extern "C"
|
||||
// get the activity object :
|
||||
javaClassActivityEntryPoint = JavaVirtualMachinePointer->GetStaticMethodID(javaClassActivity, "eventFromCPP", "([Ljava/lang/String;)V" );
|
||||
if (javaClassActivityEntryPoint == 0) {
|
||||
EWOL_DEBUG("C->java : Can't find com/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__.eventFromCPP" );
|
||||
EWOL_DEBUG("C->java : Can't find __PROJECT_ORG_TYPE__/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__.eventFromCPP" );
|
||||
// remove access on the virtual machine :
|
||||
JavaVirtualMachinePointer = NULL;
|
||||
return;
|
||||
}
|
||||
javaClassActivityEntryPoint__CPP_keyboardShow = JavaVirtualMachinePointer->GetMethodID(javaClassActivity, "CPP_keyboardShow", "()V" );
|
||||
if (javaClassActivityEntryPoint__CPP_keyboardShow == 0) {
|
||||
EWOL_DEBUG("C->java : Can't find com/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__.CPP_keyboardShow" );
|
||||
EWOL_DEBUG("C->java : Can't find __PROJECT_ORG_TYPE__/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__.CPP_keyboardShow" );
|
||||
// remove access on the virtual machine :
|
||||
JavaVirtualMachinePointer = NULL;
|
||||
return;
|
||||
}
|
||||
javaClassActivityEntryPoint__CPP_keyboardHide = JavaVirtualMachinePointer->GetMethodID(javaClassActivity, "CPP_keyboardHide", "()V" );
|
||||
if (javaClassActivityEntryPoint__CPP_keyboardHide == 0) {
|
||||
EWOL_DEBUG("C->java : Can't find com/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__.CPP_keyboardHide" );
|
||||
EWOL_DEBUG("C->java : Can't find __PROJECT_ORG_TYPE__/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__.CPP_keyboardHide" );
|
||||
// remove access on the virtual machine :
|
||||
JavaVirtualMachinePointer = NULL;
|
||||
return;
|
||||
}
|
||||
javaClassActivityEntryPoint__CPP_OrientationChange = JavaVirtualMachinePointer->GetMethodID(javaClassActivity, "CPP_OrientationChange", "(I)V" );
|
||||
if (javaClassActivityEntryPoint__CPP_OrientationChange == 0) {
|
||||
EWOL_DEBUG("C->java : Can't find __PROJECT_ORG_TYPE__/__PROJECT_VENDOR__/__PROJECT_PACKAGE__/__PROJECT_NAME__.CPP_OrientationChange" );
|
||||
// remove access on the virtual machine :
|
||||
JavaVirtualMachinePointer = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
//javaObjectActivity = JavaVirtualMachinePointer->NewGlobalRef(obj);
|
||||
javaObjectActivity = obj;
|
||||
|
||||
@ -247,7 +306,7 @@ extern "C"
|
||||
}
|
||||
}
|
||||
}
|
||||
void Java_com___PROJECT_VENDOR_____PROJECT_PACKAGE_____PROJECT_NAME___ActivitySetJavaVortualMachineStop( JNIEnv* env )
|
||||
void Java___PROJECT_ORG_TYPE_____PROJECT_VENDOR_____PROJECT_PACKAGE_____PROJECT_NAME___ActivitySetJavaVortualMachineStop( JNIEnv* env )
|
||||
{
|
||||
EWOL_DEBUG("*******************************************");
|
||||
EWOL_DEBUG("** Remove JVM Pointer **");
|
||||
|
@ -49,13 +49,15 @@ namespace ewol
|
||||
int64_t ticTime;
|
||||
bool display;
|
||||
bool drwingDone;
|
||||
const char * m_displayName;
|
||||
bool m_displayFPS;
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param ---
|
||||
* @return ---
|
||||
*/
|
||||
Fps(void)
|
||||
Fps(const char * displayName, bool displayFPS)
|
||||
{
|
||||
startTime = -1;
|
||||
nbCallTime = 0;
|
||||
@ -69,6 +71,8 @@ namespace ewol
|
||||
ticTime = 0;
|
||||
display = false;
|
||||
drwingDone = false;
|
||||
m_displayName = displayName;
|
||||
m_displayFPS = displayFPS;
|
||||
}
|
||||
/**
|
||||
* @brief Destructor
|
||||
@ -117,17 +121,21 @@ namespace ewol
|
||||
avg_idle += processTimeLocal;
|
||||
}
|
||||
if (true == display) {
|
||||
EWOL_DEBUG("display property : " << nbDisplayTime << "/" << nbCallTime << "fps");
|
||||
if (nbDisplayTime>0) {
|
||||
EWOL_DEBUG("Time Drawind : " << (float)((float)min / 1000.0) << "ms "
|
||||
<< (float)((float)avg/(float)nbDisplayTime / 1000.0) << "ms "
|
||||
EWOL_DEBUG(m_displayName << " : Active : "
|
||||
<< (float)((float)min / 1000.0) << "ms "
|
||||
<< (float)((float)avg / (float)nbDisplayTime / 1000.0) << "ms "
|
||||
<< (float)((float)max / 1000.0) << "ms ");
|
||||
}
|
||||
if (nbCallTime-nbDisplayTime>0) {
|
||||
EWOL_DEBUG("Time idle : " << (float)((float)min_idle / 1000.0) << "ms "
|
||||
<< (float)((float)avg_idle/(float)(nbCallTime-nbDisplayTime) / 1000.0) << "ms "
|
||||
EWOL_DEBUG(m_displayName << " : idle : "
|
||||
<< (float)((float)min_idle / 1000.0) << "ms "
|
||||
<< (float)((float)avg_idle / (float)(nbCallTime-nbDisplayTime) / 1000.0) << "ms "
|
||||
<< (float)((float)max_idle / 1000.0) << "ms ");
|
||||
}
|
||||
if (true == m_displayFPS) {
|
||||
EWOL_DEBUG("FPS : " << nbDisplayTime << "/" << nbCallTime << "fps");
|
||||
}
|
||||
max = 0;
|
||||
min = 99999999999999LL;
|
||||
avg = 0;
|
||||
|
@ -447,40 +447,52 @@ void eSystem::ClipBoardArrive(ewol::clipBoard::clipboardListe_te clipboardID)
|
||||
}
|
||||
|
||||
|
||||
static ewol::Fps l_FpsSystem;
|
||||
static ewol::Fps l_FpsSystemEvent( "Event ", false);
|
||||
static ewol::Fps l_FpsSystemContext( "Context ", false);
|
||||
static ewol::Fps l_FpsSystem( "Draw ", true);
|
||||
|
||||
bool eSystem::Draw(bool displayEveryTime)
|
||||
{
|
||||
int64_t currentTime = ewol::GetTime();
|
||||
// FPS display system
|
||||
l_FpsSystem.Tic();
|
||||
if (true == isGlobalSystemInit) {
|
||||
// process the events
|
||||
l_FpsSystemEvent.Tic();
|
||||
ewolProcessEvents();
|
||||
// call all the widget that neded to do something periodicly
|
||||
ewol::widgetManager::PeriodicCall(currentTime);
|
||||
|
||||
// Remove all widget that they are no more usefull (these who decided to destroy themself)
|
||||
ewol::EObjectManager::RemoveAllAutoRemove();
|
||||
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
|
||||
// check if the user selected a windows
|
||||
if (NULL == tmpWindows) {
|
||||
// TODO : Display a stipid texture
|
||||
} else {
|
||||
if (NULL != tmpWindows) {
|
||||
// Redraw all needed elements
|
||||
tmpWindows->OnRegenerateDisplay();
|
||||
// check if the regenerate is needed ...
|
||||
if( true == ewol::widgetManager::IsDrawingNeeded()
|
||||
}
|
||||
l_FpsSystemEvent.IncrementCounter();
|
||||
l_FpsSystemEvent.Toc();
|
||||
bool needRedraw = ewol::widgetManager::IsDrawingNeeded();
|
||||
|
||||
l_FpsSystemContext.Tic();
|
||||
if (NULL != tmpWindows) {
|
||||
if( true == needRedraw
|
||||
|| true == displayEveryTime) {
|
||||
ewol::resource::UpdateContext();
|
||||
l_FpsSystemContext.IncrementCounter();
|
||||
}
|
||||
}
|
||||
l_FpsSystemContext.Toc();
|
||||
|
||||
l_FpsSystem.Tic();
|
||||
if (NULL != tmpWindows) {
|
||||
if( true == needRedraw
|
||||
|| true == displayEveryTime) {
|
||||
l_FpsSystem.IncrementCounter();
|
||||
tmpWindows->SysDraw();
|
||||
}
|
||||
}
|
||||
l_FpsSystem.Toc();
|
||||
glFlush();
|
||||
}
|
||||
// FPS display system
|
||||
l_FpsSystem.Toc();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user