android externals

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller, LCMark

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Fri Aug 09, 2013 11:54 am

@monte: I just tried (a slightly modified) revTestExternal built from runrevmark/feature-externals_api_v5 and loaded in 6.1.1-rc-2 on Mac Desktop IDE, and both Post and Send seem to work fine. The test is pretty simple admittedly just:

Code: Select all

	LCObjectRef t_target;
	LCContextMe(&t_target);
	
	LCObjectPost(t_target, "handlePost", "");
	LCObjectSend(t_target, "handleSend", "");
	
	LCObjectRelease(t_target);
So maybe its an interaction with something else - if you could track down a recipe / give more details I'm sure its easily fixed.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Fri Aug 09, 2013 11:08 pm

OK, I'll try and come up with a recipe.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Sat Aug 10, 2013 11:55 am

I'm a little confused on fetch__java_string why we don't need to do something like:

Code: Select all

for (int i = 0; i < t_char_count; i ++) {
    t_jchar_value[i] = (jchar)t_cstring_value[i];
}
I've fixed a couple of bugs but I still need to implement default__java_string. I was going to base if on fetch__java_string but as I can't understand how it could be working I'm hesitant...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Fri Aug 23, 2013 7:18 am

I'm investigating a crash when trying to use an android external with LC Commercial 6.1.1 rc 2. That's the version that got the engine changes isn't it? logcat's not telling me anything other than the crash seems to happen just after the external is loaded. Are you having any trouble there?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Fri Aug 23, 2013 10:54 am

This is what I see in the log

D/dalvikvm( 1949): Trying to load lib /data/data/com.leapingbrain.modmobile/lib/libmergAndroid.so 0x413c0a18
D/dalvikvm( 1949): Shared lib '/data/data/com.leapingbrain.modmobile/lib/libmergAndroid.so' already loaded in same CL 0x413c0a18
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Fri Aug 23, 2013 11:39 am

Can you post a bit more context from the logcat? What's logged after the 'already loaded' message? If you send me the project source etc. so I can build here, I'll be happy to take a look into it (stuff like this is quite tricky to track down on Android...)

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Fri Aug 23, 2013 12:37 pm

I'll check your test project against commercial first just to make sure it's not something odd I'm doing with the ant based built I'm nutting out. There was two more lines after that log but they didn't seem relevant. It's getting late so I'll post them in the morning.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Sat Aug 24, 2013 4:51 am

OK, tried with revtestexternal from the repo built with your build script with commercial rc3 and I get the same. Those two log lines appear to be the last relevant ones:

Code: Select all

I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 0, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (4, 4, 4, 4, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (4, 4, 4, 4, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (4, 4, 4, 4, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (4, 4, 4, 4, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (4, 4, 4, 4, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (4, 4, 4, 4, 16, 0)
D/AwesomePlayer(  119): Failed to open file, all profile flags have to set through setprop method.
I/AwesomePlayer(  119): Profile flag is set to 0
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 16, 8)
D/AwesomePlayer(  119): Failed to open file, all profile flags have to set through setprop method.
I/AwesomePlayer(  119): Profile flag is set to 0
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 5, 5, 1, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 8, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (5, 6, 5, 0, 0, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 0, 16, 0)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 0, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 0, 0, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 0, 16, 8)
I/revandroid(18003): OpenGLView: Found EGLConfig  (8, 8, 8, 0, 16, 0)
I/revandroid.SensorModule(18003): gyroscope sensor: android.hardware.Sensor@413d21c8
I/revandroid(18003): CT Calendar
D/dalvikvm(18003): GC_CONCURRENT freed 334K, 7% free 6168K/6599K, paused 16ms+2ms, total 49ms
V/Sensors (  425): setDelay - sensor Accelerometer (handle 4), rate 200 ms (5.00 Hz)
V/Sensors (  425): setDelay - sensor Accelerometer (handle 4), rate 200 ms (5.00 Hz)
D/dalvikvm(18003): Trying to load lib /data/data/com.yourcompany.yourapp/lib/librevtestexternal.so 0x413bddb8
D/dalvikvm(18003): Shared lib '/data/data/com.yourcompany.yourapp/lib/librevtestexternal.so' already loaded in same CL 0x413bddb8
I/InputReader(  425): Reconfiguring input devices.  changes=0x00000004
I/InputReader(  425): Device reconfigured: id=1, name='elantech_touchscreen', surface size is now 1280x800, mode is 3
I/InputReader(  425): Device reconfigured: id=3, name='atmel-maxtouch', surface size is now 1280x800, mode is 1
D/WindowManager(  425): adjustConfigurationLw, config:{1.0 0mcc0mnc (no locale) sw800dp w1280dp h752dp xlrg land ?uimode ?night finger qwerty/v/v -nav/v} mLidState:1 mHasDockFeature:true mHasHallSensorFeature:true config.hardKeyboardHidden:1
I/ActivityManager(  425): Config changed: {1.0 0mcc0mnc en_AU sw800dp w1280dp h752dp xlrg land finger qwerty/v/v -nav/h s.15}
D/WindowManager(  425): adjustConfigurationLw, config:{0.0 0mcc0mnc (no locale) sw800dp w1280dp h752dp xlrg land ?uimode ?night finger qwerty/v/v -nav/v} mLidState:1 mHasDockFeature:true mHasHallSensorFeature:true config.hardKeyboardHidden:1
W/InputMethodManagerService(  425): Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41899370 (uid=1000 pid=719)
D/AwesomePlayer(  119): Failed to open file, all profile flags have to set through setprop method.
I/AwesomePlayer(  119): Profile flag is set to 0
D/AwesomePlayer(  119): Failed to open file, all profile flags have to set through setprop method.
I/AwesomePlayer(  119): Profile flag is set to 0
W/InputMethodManagerService(  425): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@416fe388 attribute=null
D/dalvikvm(  425): WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm(  425): GC_EXPLICIT freed 576K, 26% free 12832K/17223K, paused 11ms+8ms, total 121ms
D/AlarmManager(  425): Triggered Alarm 4175b580 ELAPSED_REALTIME_WAKEUP IntentSender{41c2cb90: PendingIntentRecord{416ec918 com.google.android.gms broadcastIntent}}
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Sat Aug 24, 2013 8:39 am

Here's some info:
https://groups.google.com/forum/#!topic ... TZIfxRtpek
http://stackoverflow.com/questions/1571 ... pen-on-ndk

According to MCAndroidSystem::LoadModule there should be a log MCLog("LoadModule(%s) - %p\n", p_path, t_result) after the external is loaded which is why I assume you asked for logs after that.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Mon Aug 26, 2013 9:43 am

@monte: Hmmm - this is slightly strange. I tried with Community 6.1.1 (rc 3) and it also failed to build a working android standalone when including the external... At first I thought it might be a release build issue (rather than debug), but if I build 6.1.1 Community (rc 3) direct from the github repository all seems well. This could be a build issue with the Android engine when doing production builds, so I'll investigate that today.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Mon Aug 26, 2013 9:50 am

OK, thanks for looking into it.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Thu Aug 29, 2013 1:09 pm

@monte: Okay think I've tracked this down - it seems to be a build issue when doing the production builds meaning the android engine wasn't getting built correctly. It should be fixed in 6.1.1-rc-4.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Thu Aug 29, 2013 9:19 pm

OK, great, I wonder if that's related to someone's report that childControlIDs didn't work on android? I'm not sure if it was an actual bug report, just someone on the dev list and I haven't had time to test it.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: android externals

Post by LCMark » Fri Aug 30, 2013 10:19 am

@monte: Yes - the problem I fixed would explain that too.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1561
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: android externals

Post by monte » Mon Sep 02, 2013 2:01 am

Is there any possibility we can adjust the standalone builder to deal gracefully with the possibility of an external not being compiled for both mobile platforms. Right now if you have an android only external in copy files you get simulator crashes and linking errors for device builds on iOS. I believe there's a similar situation for iOS externals on android. Actually based on your code in revSaveAsAndroidStandalone and revSaveAsiOSStandalone I can't help wondering if revZipExtractItemToFile is creating an empty file even if the item isn't in the archive which I'd consider a bug if it's true.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Engine Contributors”