android stopped working.

This commit is contained in:
Vítor Santos Costa 2015-03-04 09:43:37 +00:00
parent 8a4257d80a
commit a9acacd1c5
2 changed files with 20 additions and 6 deletions

View File

@ -5917,8 +5917,10 @@ void Java_pt_up_fc_dcc_yap_JavaYap_load
AAssetManager *mgr = AAssetManager_fromJava(env0, mgr0); AAssetManager *mgr = AAssetManager_fromJava(env0, mgr0);
Yap_jenv = env0; Yap_jenv = env0;
if (mgr == NULL) { if (mgr == NULL) {
__android_log_print(ANDROID_LOG_DEBUG, "YapJava", "Need to print : we're doomed, mgr = 0; bip bip bip");
} else { } else {
GLOBAL_assetManager = mgr; __android_log_print(ANDROID_LOG_DEBUG, "YapJava", "Need to print : we're winning, mgr = %p; yeah", mgr);
GLOBAL_assetManager = mgr;
} }
} }

View File

@ -85,12 +85,12 @@ public class JavaYap extends Activity
} else { } else {
int i=1; int i=1;
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
Log.i(TAG, "q1= "+vs0.text()+"\n"); //Log.i(TAG, "q1= "+vs0.text()+"\n");
} }
while (rc = q.next()) { while (rc = q.next()) {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
Log.i(TAG, "q= "+vs0.text()+"\n"); //Log.i(TAG, "q= "+vs0.text()+"\n");
} }
YAPListTerm vs = vs0; YAPListTerm vs = vs0;
@ -123,7 +123,8 @@ public class JavaYap extends Activity
PackageInfo p = m.getPackageInfo(s, 0); PackageInfo p = m.getPackageInfo(s, 0);
//s = p.applicationInfo.dataDir; //s = p.applicationInfo.dataDir;
AssetManager mgr = getResources().getAssets(); AssetManager mgr = getResources().getAssets();
load(mgr); Log.i(TAG, "mgr=" +mgr + " " + s);
load(mgr);
} catch(NameNotFoundException e) { } catch(NameNotFoundException e) {
Log.e(TAG, "Couldn't find package information in PackageManager", e); Log.e(TAG, "Couldn't find package information in PackageManager", e);
} }
@ -134,10 +135,21 @@ public class JavaYap extends Activity
outputText.setText("Application " + s + "\nPress 'Query' to start...\n"); outputText.setText("Application " + s + "\nPress 'Query' to start...\n");
outputText.setMovementMethod(new ScrollingMovementMethod()); outputText.setMovementMethod(new ScrollingMovementMethod());
scroller = (ScrollView)findViewById(R.id.Scroller); scroller = (ScrollView)findViewById(R.id.Scroller);
eng = new YAPEngine( ); if (BuildConfig.DEBUG) {
Log.i(TAG, "engine done"); Log.i(TAG, "window making done");
}
eng = new YAPEngine( );
if (BuildConfig.DEBUG) {
Log.i(TAG, "engine done");
}
if (BuildConfig.DEBUG) {
Log.i(TAG, "onClearButtonClick called");
}
JavaCallback callback = new JavaCallback( outputText ); JavaCallback callback = new JavaCallback( outputText );
// set the Java Callback // set the Java Callback
if (BuildConfig.DEBUG) {
Log.i(TAG, "before setting callback");
}
eng.setYAPCallback(callback); eng.setYAPCallback(callback);
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
Log.i(TAG, "callback done"); Log.i(TAG, "callback done");