Ajax call fails in Intel XDK hybrid mobile App - live deployment - android

I am fighting a big problem here for 2 days. I have created a hybrid mobile app in Intel XDK. The app makes remote Ajax calls to my server. Everything went fine. Tested in Emulator and everything went fine. Also tested in App preview by connecting my Android device to my MAC - this also went fine.
Now, it was time to build and generate the APK file. After I installed the APK in my Android device, all the Ajax calls have failed. It simply shows blank.
I then checked some forums and have also made "Access-Control-Allow-Origin: *" in my server. Even this did not help. My Ajax calls are not responding or is being blocked - I don’t know.
I am using the latest version of Intel XDK. I have also included both the intelxdk.js and xhr.js within the HEAD tag.
USB Debugging is fine and works. But, I have no idea how to debug this live deployment. What else can I try.
Any help would be highly appreciated.

There is a known ajax issue with apk built with latest Intel XDK on Android > 4.4, this is due to the version of Cordova CLI 4.1.2.
In the Intel XDK -> project settings -> build settings for Android, change the Cordova CLI version from 4.1.2 to 3.5 and ajax should work again. We are working on a fix when using latest CLI
Also u dont need intelxdk.js and xhr.js if you are building Cordova builds.

Related

chrome inspector, remote debugging no longer works properly on my mobile app

I have built a progressive web app using Cordova/Ionic. I have been using dev-tools to troubleshoot and analyze my apps inner workings for the better part of 3 years now. In the last few weeks however, i think since Chrome updated to v70+, dev-tools can no longer properly connect and/or manage the app running on my external device (several different test phones).
I have 4 Android test phones, and the same or almost the same issues are happening with dev-tools when connected to each device.
desktop keyboard and mouse do not work anymore - I can't use either to interact with the app on the phone anymore. As well, on some
phones I can't use the element inspector (while on others that does
work). But regardless of phone, I can't use the desktop mouse to
click on app buttons in the web-view. Keyboard does not work on any
of the devices either.
Often, even the native buttons in the app (directly on the phone) won't work if dev-tools has been opened to look at the app. If they
do work, you press the button and like 10-15 seconds later the app
finally responds.
When dev-tools is opened and connected to the device app, the response time of the apps is now extremely slow as well. Sometimes
the app just crashes or I get messages saying "app not responding,
wait or close?"
If I disconnect the phones from the desktop, and/or don't run dev-tools on the app, the app works and responds just fine. Something
specific to dev-tools is causing all these problems.
The different phones have versions 5.1, 6.1.1 and 7.1 running on them for testing purposes. Again, dev-tools worked just fine until a few weeks ago. I recall various small issues impacting performance and web-view rendering in dev-tools, and now all of the above is impacting my ability to troubleshoot and analyze my app (developing).
My environment:
Cordova CLI: 8.0.0
cordova-android: 7.1.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Version: 1.3.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Windows 7 SP1
Node Version: v6.10.3
Chrome: Version 70.0.3538.102 (Official Build) (64-bit)
I can't be certain, but I think all these issues began with Chrome updated itself to v70.+ On a side note, my app uses the "webview-plus" plugin....its an older plugin that enables certain inspection features and UI rendering. I removed it to see if maybe it was conflicting with dev-tools, but all the same problems still persisted.
I have the same issue, it worked fine some months ago, but it is now broken.
As a workaround, I tried to disable screencast, restart the app and then restart devtools and it worked!
Hope this helps!
The real problem is the latest android webview. All the element selection and mouse click doesn't work in latest android webview.
So, uninstall the android webview from Google Play store.
Download the older android webview version around 60
install it via adb with -r flag
adb install -r "/path/to/apk/com.google.android.webview_60.0.3112.78.apk"
This is a workaround until it is fixed in the latest webview.

Ionic template cache doesn't work on device, only in browser

I implemented gulp-angular-templatecache-ionic to my Ionic app, which made my application run significantly faster in my desktop chrome browser, but when I build and deploy (ionic run android) this application to my device (LG Nexus 5x) it is still slow, it looks like nothing has changed, as if the built android version does not use the angular template cache.
I followed this article: http://tombuyse.com/improving-the-performance-of-your-ionic-application/
Any ideas or suggestions how to debug?
Thanks!
In order to debug your WebView app please follow this guide from google
https://developer.chrome.com/devtools/docs/remote-debugging
If your android version is less than 4.4, then you cannot debug through the chrome devtools.
you can instead run an emulator via the adb emulator, you'll need the android sdk and the adb tool.
read more here: https://developer.android.com/studio/run/emulator.html
The default android emulator/simulator is slow, and also need the HAXM accelerator, you can download the Genymotion simulator which is a replacement for the default android emulators, and run faster, also doesn't need to change anything in your hardware configuration
https://www.genymotion.com/

Android Build for socket.io using intel xdk

I use IntelXDK 2015 update for build my apps.
I build an app using "Cordova Hybrid Mobile App Platforms" for "Android Build" option but socket.io didn't worked.
However when I used "Legacy Hybrid Mobile App Platforms" for "Android Build" option, socket.io works
I haven't any idea why that happens
Thanks
Have the same issue. The emulate and test through the intel app preview works like charm but when I build in to Android Cordova app I have the same problem.
Also tried to use "Legacy Hybrid Mobile App Platforms" and works.

Hot Code Push doesn't work on device in Meteor

I'm starting with mobile development with Meteor and currently facing this problem: when running meteor run android-device, any changes made aren't reflected on device, as they were supposed to be.
The project I'm running is the default one - no additional packages or plugins installed. My Meteor version is 1.0.3.1 running on Ubuntu 14.0.4 with only the android platform installed. The device I'm using is a lovely Nexus 4.
Although it doesn't work on device, the Hot Code Push works like a charm on both simulator and browser.
Any clues what is going on? I appreciate any help.

CrossWalk / Cordova build in INTEL XDK gives parsing error on older android OS releases

I'm wanting to us the CrossWalk build with INTEL XDK. It builds fine and runs great on my android phones, but I'm using 4.2.
When I had users try it, any of those using 2.3.6 android releases would have a "parsing error" when they tried to install it.
According to a forum from Crosswalk where someone asked this question the answer was: Crosswalk supports android 2.3.6 through current versions - if you have a problem on an earlier version it is due to a bug in your software. However I have scoured the code & can't find any error.
The same code for the app runs using the cordova build options on all the versions, it's just crosswalk is clearly faster.
Does anyone have any thoughts on possible types of "coding errors" that could cause this -- if this is what is going on? I don't get errors via the chrome js debugger or jslint.
Thanks ;)

Categories

Resources