Thanks. I tested and the issue I had with the null origin is now gone. 
Meaning that internalBrowser.setProperty("AllowUniversalAccessFromFileURLs",
 Boolean.TRUE); is now probably correctly taken into account. 
However, I still can't make socket.io to work when using it on a real 
device.
First issue I have is that anything I log in my javascript logger (created 
as a JSobject using JavascriptContext, see my code on github if necessary) 
is not output in the device log (whereas it works fine in the simulator). 
Usual CN1 logs (from Log.p() calls from within the java code) are though. 
So this is kind of anoying to debug properly (as I can't correctly track 
what is happening in the javascript part).
The second issue is that any message I try to send from my CN1 app to my 
server never reach it. On my server log, I can see that the CN1 app now 
correctly create the handshake with the server and seems to correctly 
update the communication from XHR long polling transport to websockets. 
However, any new message that I try to send from the CN1 app to the server 
using this socket just never reach the server (but the connection seems to 
be correctly maintained open as, if I kill the CN1 app, I can see a 
deconnection event to be logged on my server). Actually messages I send 
with socket.io.emit are probably never send (but without a javascript 
logger difficult/impossible to track it down...)

I checked my device adb logcat and here is what I have:

D/CN1SocketIOTest(16239): [EDT] 0:0:0,0 - Codename One revisions: 
d4219a1b829854d15136d1fa3166990e01f1b197
I/ActivityManager( 2315): Displayed 
com.tbdlab.cn1socketiotest/.MyApplicationStub: +400ms
I/Timeline( 2315): Timeline: Activity_windows_visible id: 
ActivityRecord{1f2916fc u0 com.tbdlab.cn1socketiotest/.MyApplicationStub 
t1811} time:686055479
D/CN1SocketIOTest(16239): [EDT] 0:0:0,2 - WARNING: Theme sets the 
commandBehavior constant which is deprecated.  Please update the theme to 
NOT include this theme constant.  Using commandBehavior may cause your app 
to perform in unexpected ways.  In particular, using SIDE command behavior 
in conjunction with Toolbar.setOnTopSideMenu(true) may result in runtime 
exceptions.
D/CN1SocketIOTest(16239): [EDT] 0:0:0,3 - WARNING: 
Display.setCommandBehavior() is deprecated, Using it may result in 
unexpected behaviour. In particular, using COMMAND_BEHAVIOR_SIDE_NAVIGATION 
in conjunction with Toolbar.setOnTopSideMenu(true) may result in runtime 
errors.
D/CN1SocketIOTest(16239): [EDT] 0:0:0,8 - CN1 App started
I/GoogleInputMethod(28089): onFinishInput() : Dummy InputConnection bound
I/GoogleInputMethod(28089): onStartInput() : Dummy InputConnection bound
I/Timeline(16239): Timeline: Activity_idle id: 
android.os.BinderProxy@3b0a177b time:686055495
W/linker  (16239): 
/data/app/com.google.android.webview-1/lib/arm64/libwebviewchromium.so: 
unused DT entry: type 0x6ffffffe arg 0x16450
W/linker  (16239): 
/data/app/com.google.android.webview-1/lib/arm64/libwebviewchromium.so: 
unused DT entry: type 0x6fffffff arg 0x3
D/Codename One(16239): sizechanged: 720 1230 
com.codename1.impl.android.i@2fd05d47
I/WebViewFactory(16239): Loading com.google.android.webview version 
65.0.3325.109 (code 332510950)
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/cr_LibraryLoader(16239): Time to load native libraries: 0 ms (timestamps 
5565-5565)
I/chromium(16239): [INFO:library_loader_hooks.cc(36)] Chromium logging 
enabled: level = 0, default verbosity = 0
I/cr_LibraryLoader(16239): Expected native library version number 
"65.0.3325.109", actual native library version number "65.0.3325.109"
I/cr_BrowserStartup(16239): Initializing chromium process, 
singleProcess=true
I/cr_base (16239): Android Locale: en_US requires .pak files: []
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$7>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$7>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$3>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$3>
D/ConnectivityService( 2315): listenForNetwork for NetworkRequest [ 
id=3794, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]
D/ConnectivityService( 2315): handleRegisterNetworkRequest checking 
NetworkAgentInfo [WIFI () - 175]
D/ConnectivityManager.CallbackHandler(16239): CM callback handler got msg 
524290
D/ConnectivityService( 2315): apparently satisfied.  currentScore=100
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<org.chromium.content.browser.selection.FloatingActionModeCallback>
I/art     (16239): Rejecting re-init on previously-failed class 
java.lang.Class<org.chromium.content.browser.selection.FloatingActionModeCallback>
D/EgretLoader(16239): EgretLoader(Context context)
D/EgretLoader(16239): The context is not activity
D/ConnectivityService( 2315): listenForNetwork for NetworkRequest [ 
id=3795, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]
D/ConnectivityService( 2315): handleRegisterNetworkRequest checking 
NetworkAgentInfo [WIFI () - 175]
D/ConnectivityService( 2315): apparently satisfied.  currentScore=100
D/ConnectivityManager.CallbackHandler(16239): CM callback handler got msg 
524290
D/Codename One(16239): native focus gain
I/System.out(16239): showKeyboard false
E/libEGL  (16239): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
D/BluetoothManagerService( 2315): Message: 20
D/BluetoothManagerService( 2315): Added callback: 
android.bluetooth.IBluetoothManagerCallback$Stub$Proxy@17dcbb8c:true
D/BluetoothAdapter(16239): 167655033: getState() :  mService = null. 
Returning STATE_OFF
W/ContentCatcher(16239): Failed to notify a WebView
I/ViewRootImpl(16239): CPU Rendering VSync enable = true
V/WindowManager( 2315): not Base app: Adding window Window{2500eb8e u0 
com.tbdlab.cn1socketiotest/com.tbdlab.cn1socketiotest.MyApplicationStub} at 
3 of 9
W/AudioCapabilities(16239): Unsupported mime audio/evrc
W/AudioCapabilities(16239): Unsupported mime audio/qcelp
W/VideoCapabilities(16239): Unrecognized profile 2130706433 for video/avc
W/AudioCapabilities(16239): Unsupported mime audio/qcelp
W/AudioCapabilities(16239): Unsupported mime audio/evrc
W/VideoCapabilities(16239): Unsupported mime video/mpeg2
W/VideoCapabilities(16239): Unsupported mime video/mpeg2
W/VideoCapabilities(16239): Unsupported mime video/x-ms-wmv
W/VideoCapabilities(16239): Unsupported mime video/divx
W/VideoCapabilities(16239): Unsupported mime video/divx311
W/Utils   (16239): could not parse size range '64x64-1920X1088'
D/VM_BMS  (  523): wake_lock acquired
D/VM_BMS  (  523): New BMS data - Size=56
D/VM_BMS  (  523): Start process_bms_data
W/VideoCapabilities(16239): Unsupported mime video/divx4
D/VM_BMS  (  523): For batt_temp=180 fcc_mah=4035
D/VM_BMS  (  523): For ocv=4333591 batt_temp=180 soc=98
D/VM_BMS  (  523): fifo_count=5 acc_count=0
D/VM_BMS  (  523): INIT: ocv=4333591 last_ocv=4333591 batt_temp=180 soc=98
D/VM_BMS  (  523): For soc=98 batt_temp=180 slope=9400
D/VM_BMS  (  523): For soc=98 batt_temp=180 rbatt_sf=154
D/VM_BMS  (  523): rbatt_mohm_default=120, rbatt_mohm=184, sf=154 
batt_temp=180
D/VM_BMS  (  523): For ocv=4333645 batt_temp=180 soc=98
D/VM_BMS  (  523): FIFO=0 fifo_avg=4.351626 rbatt=0.194000 slope=0.940000 
ibatt=-0.092825 ocv=4.333645 soc=98 fcc_ah=4.035000 sample_count=128 
sample_interval=70 seq_num=41172
D/VM_BMS  (  523): For soc=98 batt_temp=180 slope=9400
D/VM_BMS  (  523): For soc=98 batt_temp=180 rbatt_sf=154
D/VM_BMS  (  523): rbatt_mohm_default=120, rbatt_mohm=184, sf=154 
batt_temp=180
D/VM_BMS  (  523): For ocv=4333805 batt_temp=180 soc=98
D/VM_BMS  (  523): FIFO=1 fifo_avg=4.387275 rbatt=0.194000 slope=0.940000 
ibatt=-0.276033 ocv=4.333805 soc=98 fcc_ah=4.035000 sample_count=128 
sample_interval=70 seq_num=41172
D/VM_BMS  (  523): For soc=98 batt_temp=180 slope=9400
D/VM_BMS  (  523): For soc=98 batt_temp=180 rbatt_sf=154
D/VM_BMS  (  523): rbatt_mohm_default=120, rbatt_mohm=184, sf=154 
batt_temp=180
D/VM_BMS  (  523): For ocv=4333970 batt_temp=180 soc=98
D/VM_BMS  (  523): FIFO=2 fifo_avg=4.389042 rbatt=0.194000 slope=0.940000 
ibatt=-0.284301 ocv=4.333970 soc=98 fcc_ah=4.035000 sample_count=128 
sample_interval=70 seq_num=41172
D/VM_BMS  (  523): For soc=98 batt_temp=180 slope=9400
D/VM_BMS  (  523): For soc=98 batt_temp=180 rbatt_sf=154
D/VM_BMS  (  523): rbatt_mohm_default=120, rbatt_mohm=184, sf=154 
batt_temp=180
D/VM_BMS  (  523): For ocv=4334182 batt_temp=180 soc=98
D/VM_BMS  (  523): FIFO=3 fifo_avg=4.404951 rbatt=0.194000 slope=0.940000 
ibatt=-0.365336 ocv=4.334182 soc=98 fcc_ah=4.035000 sample_count=128 
sample_interval=70 seq_num=41172
D/VM_BMS  (  523): For soc=98 batt_temp=180 slope=9400
D/VM_BMS  (  523): For soc=98 batt_temp=180 rbatt_sf=154
D/VM_BMS  (  523): rbatt_mohm_default=120, rbatt_mohm=184, sf=154 
batt_temp=180
D/VM_BMS  (  523): For ocv=4334390 batt_temp=180 soc=98
I/SurfaceFlinger(  320): FPS: 35
D/VM_BMS  (  523): FIFO=4 fifo_avg=4.404066 rbatt=0.194000 slope=0.940000 
ibatt=-0.359691 ocv=4.334390 soc=98 fcc_ah=4.035000 sample_count=128 
sample_interval=70 seq_num=41172
I/VM_BMS  (  523): power_supply_update: ocv_uv=4334390 ibatt=-359690 soc=98 
seq_num=41172
D/VM_BMS  (  523): End process_bms_data
D/VM_BMS  (  523): wake_lock released
W/Utils   (16239): could not parse size range '64x64-1920X1080'
W/VideoCapabilities(16239): Unsupported mime video/mp4v-esdp
I/GoogleInputMethod(28089): onFinishInput() : Dummy InputConnection bound
I/GoogleInputMethod(28089): onStartInput() : Dummy InputConnection bound
W/cr_CrashFileManager(16239): 
/data/data/com.tbdlab.cn1socketiotest/cache/WebView/Crash Reports does not 
exist or is not a directory
I/VideoCapabilities(16239): Unsupported profile 4 for video/mp4v-es
D/CN1SocketIOTest(16239): [EDT] 0:0:0,854 - Browser component onload called
V/WLAN_PSA(  381): NL MSG, len[048], NL type[0x11] WNI type[0x5050] len[028]
V/WLAN_PSA(  381): NL MSG, PID: 381
D/CN1SocketIOTest(16239): [EDT] 0:0:1,195 - Browser component onload end
W/chromium(16239): [WARNING:render_frame_host_impl.cc(2750)] 
OnDidStopLoading was called twice.
D/PerfShielderService( 2315): 
com.tbdlab.cn1socketiotest|com.tbdlab.cn1socketiotest/com.tbdlab.cn1socketiotest.MyApplicationStub|188|686056083155557|102|0
D/PerfShielderService( 2315): 
com.tbdlab.cn1socketiotest|com.tbdlab.cn1socketiotest/com.tbdlab.cn1socketiotest.MyApplicationStub|164|686056475839880|148|0
D/MiuiPerfServiceClient( 4323): 
interceptAndQueuing:16239|com.tbdlab.cn1socketiotest|188|102|restricted|null
I/SurfaceFlinger(  320): FPS: 35
D/MiuiPerfServiceClient( 4323): 
interceptAndQueuing:16239|com.tbdlab.cn1socketiotest|164|148|reclaim|null
V/WLAN_PSA(  381): NL MSG, len[4068], NL type[0x1C] WNI type[0x5900] 
len[52239]
V/WLAN_PSA(  381): NL MSG, PID: 381
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4398, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
D/ClClient(13574): Not sending keepalive.  Current connection state=STOPPED
W/        (16328): [ColorAdjust] gammamode=2, cemode=10
W/        (16328): [ColorAdjust] temp_gammavalue=2, temp_cevalue=10
W/        (16328): [ColorAdjust] Don't setGamma!
W/        (16328): [ColorAdjust] Don't setCe!
W/        (16328): [ColorAdjust] Set temp_prefer temp_ce!
I/SurfaceFlinger(  320): FPS: 18
I/MSM-irqbalance(  613): Decided to move IRQ215 from CPU5 to CPU4
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4397, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): Sending ACTION_BATTERY_CHANGED.  level:100, 
scale:100, status:2, health:2, present:true, voltage: 4397, temperature: 
180, technology: Li-ion, AC powered:false, USB powered:true, Wireless 
powered:false, icon:17303157, invalid charger:0
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
D/BatteryController( 3553): action=android.intent.action.BATTERY_CHANGED; 
mCharging=true
I/BatteryInfoReceiver( 3730): ACTION_BATTERY_CHANGED
D/Codename One(16239): native focus loss
I/SurfaceFlinger(  320): FPS: 3
W/chromium(16239): [WARNING:render_frame_host_impl.cc(2750)] 
OnDidStopLoading was called twice.
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4397, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
W/chromium(16239): [WARNING:render_frame_host_impl.cc(2750)] 
OnDidStopLoading was called twice.
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4397, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
I/SurfaceFlinger(  320): FPS: 23
W/chromium(16239): [WARNING:render_frame_host_impl.cc(2750)] 
OnDidStopLoading was called twice.
V/WLAN_PSA(  381): NL MSG, len[4052], NL type[0x1C] WNI type[0x5900] 
len[48143]
V/WLAN_PSA(  381): NL MSG, PID: 381
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4397, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4397, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
V/WLAN_PSA(  381): NL MSG, len[048], NL type[0x11] WNI type[0x5050] len[028]
V/WLAN_PSA(  381): NL MSG, PID: 381
I/SurfaceFlinger(  320): FPS: 8
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4397, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
W/        (16338): [ColorAdjust] gammamode=2, cemode=10
W/        (16338): [ColorAdjust] temp_gammavalue=2, temp_cevalue=10
W/        (16338): [ColorAdjust] Don't setGamma!
W/        (16338): [ColorAdjust] Don't setCe!
W/        (16338): [ColorAdjust] Set temp_prefer temp_ce!
D/BatteryService( 2315): Processing new values: chargerAcOnline=false, 
chargerUsbOnline=true, chargerWirelessOnline=false, batteryStatus=2, 
batteryHealth=2, batteryPresent=true, batteryLevel=100, 
batteryTechnology=Li-ion, batteryVoltage=4397, batteryTemperature=180, 
mBatteryLevelCritical=false, mPlugType=2
D/BatteryService( 2315): zhaoqf_sh batteryServices call state : 0 mPlugType 
: 2
(only the lines for the Thread with ID: 16239 are probably relevant but I 
just kept all in case of...)

As you can see, the last log I have from my CN1 code is [EDT] 0:0:1,195 - 
Browser component onload end (which was callled from a Log.p() call from 
inside the BrowserComponent onLoad page event, see code on github). Any of 
the javascript logs never appeared (I waited for more than 60 in case the 
callbacks where a bit long but didn't see anything appear event though my 
first javascript call is internalBrowser.execute("logger.log(\"SocketIO 
bridge init\")"); so it sould pretty much immediate) 

The only thing I see in this log is W/chromium(16239): 
[WARNING:render_frame_host_impl.cc(2750)] OnDidStopLoading was called 
twice. that appears periodically (If I wait, this message comes back 
multiple times). But as it is just a warning I don't know if it can be the 
cause of my issue...



On Friday, April 6, 2018 at 7:28:47 AM UTC+2, Shai Almog wrote:
>
> FYI this is deployed and should work now.
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/6c66b215-8cee-4451-9f08-68490cf0772f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to