Software Archive
Read-only legacy content
17060 Discussions

ajax does not work after compiling intel XDK project v.2611

Wesly_L_
Beginner
951 Views

Google translation.
Good day!

I'm developing an app with local database with intel XDK 2611, which is assigned via ajax, and after the upgrade of cord 3.5 to 4.1.2 and 5.1.1, the app only works during emulation and also after the preview, after the build work no more ... I added "*" in the whitelist and still not working .... I have no more resources to try to work!
any comments are welcome! Could someone help me? ...

Thank you already!

whitelist_0.PNG

0 Kudos
14 Replies
Pamela_H_Intel
Moderator
951 Views

Wesly - please clarify the following:

The AJAX calls worked with Cordova 3.5 and 4.1.2 but fail with 5.1.1?

Which plugins are you using? Have you checked their documentation to ensure that there are no documented limitations with respect to Cordova 5.1.1 and your devices?

Is your local database accessible from outside your network? Can I assume you made no changes to it's permissions since working with Cordova 3.5?

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
951 Views

I am using AJAX to post/request normally, usign CLI 5.1.1 and CW15.

Is the CONNECTION checked in your project?

0 Kudos
Wesly_L_
Beginner
951 Views

Pamela H. (Intel) wrote:

Wesly - please clarify the following:

The AJAX calls worked with Cordova 3.5 and 4.1.2 but fail with 5.1.1?

Which plugins are you using? Have you checked their documentation to ensure that there are no documented limitations with respect to Cordova 5.1.1 and your devices?

Is your local database accessible from outside your network? Can I assume you made no changes to it's permissions since working with Cordova 3.5?

Google translation.
Good afternoon!
The project worked perfectly with cli 3.5 only, after the change will not work anymore, that after the compilation, I'm using only one connection information plugin. I am sending my .rar project for analysis.
thanks for listening!

servidor: http://186.219.242.240:5252/

0 Kudos
Pamela_H_Intel
Moderator
951 Views

@Hamilton - are you using the same plugin - cordova-plugin-network-information ?

0 Kudos
Wesly_L_
Beginner
951 Views

Hamilton Tenório da Silva wrote:

I am using AJAX to post/request normally, usign CLI 5.1.1 and CW15.

Is the CONNECTION checked in your project?

no meu intel xdk nao tem essa opcao de plugim, apos a atualização nao apresentou mais...intelxdkplugin_0.PNG

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
951 Views

Sorry. I remenber about this plugin, but checking now it is not present. Maybe it was in older version.

My app works normally with AJAX. I don´t know why...

 

0 Kudos
Pamela_H_Intel
Moderator
951 Views

Wesly,

I wonder if you've tried debugging in the debug tab? When debugging in the emulator there is no error message shown. But when debugging in the debug tab there are errors. Try debugging with breakpoints to find the issue.

Pamela

0 Kudos
Wesly_L_
Beginner
951 Views

Pamela H. (Intel) wrote:

Wesly,

I wonder if you've tried debugging in the debug tab? When debugging in the emulator there is no error message shown. But when debugging in the debug tab there are errors. Try debugging with breakpoints to find the issue.

Pamela

Boa tarde!

Obrigado pelo indicação, nao conhecia este recurso e identifiquei que estava faltando um plugin.Cordova.Device, isso estava impedindo que meu banco de dados inicializar, e no momento do debug tudo funciona normal, mas quando compilado continua a nao funcionar, nao estou usando plugin.Intel.xdk.Device... os únicos erros encontrados no log estao na imagem abaixo.

 

0 Kudos
PaulF_IntelCorp
Employee
951 Views

Good afternoon!

Thank you for the statement, did not know this resource and identified who was missing a plugin.Cordova.Device , that was preventing my database boot, and at the time of debug everything works okay, but when compiled continues to not work , I'm not using plugin.Intel.xdk.Device ... the only errors found in the log are on the image below.

Wesly, looking at the image it appears that you are using the Test tab and weinre to debug. I recommend that you use the Debug tab with a USB-attached device. Please remove the weinre script from your (the weinre script is connecting to http://debug-software.intel.com). The Debug tab will provide a much better debug environment. If you cannot debug with the Debug tab, build your app with "debuggable" equal to "true" in the intelxdk.config.additions.xml file and follow the instructions here: https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#RemoteChromeDevTools

Also, what plugins are part of your app? Can you provide a list of the plugins from your Project tab? For example, like this list:

Screen Shot 2015-10-29 at 2.59.35 PM.png

0 Kudos
Wesly_L_
Beginner
951 Views

Paul F. (Intel) wrote:

Also, what plugins are part of your app? Can you provide a list of the plugins from your Project tab? For example, like this list:

Conforme solicitado, segue a imagem dos plugins. tenho suspeitado que o codigo abaixo nao esta iniciando, pois eu tenho um configurador ajax dentro deste evento.

document.addEventListener("app.Ready", function(){
            
                // Iniciar banco de dados local (DatiJS)
                console.log("dati.initialize()");
                dati.initialize(function(status){
                    // Caso não se conecte...
                    if(status==false){
                        alert("Não foi possível se conectar ao BD.");
                    }
                });
                
				$.ajaxSetup({                    
                    contentType: "application/json; charset=utf-8",
                    timeout :  10000 ,
                    beforeSend:function(){
                        $("#imgAjaxLoader").show();
                    },
                    complete:function(){
                        $("#imgAjaxLoader").hide();
                    }                    
                });
				
            }, false);

intelXDKForum_0.PNG

0 Kudos
Wesly_L_
Beginner
951 Views

Good morning Paul F.

After several tests provided with the help of you, I realized that the Internet data query is ok, what do is contecendo is that Web SQL Database database is not starting ...

Testing in the emulator and debug successfully occur, but after the compilation build the database did not start the apk ...

A sample of the initialization commands that I am using are in the previous post

I thank the help that you guys have offered, and I'm counting with you Thank you!

0 Kudos
PaulF_IntelCorp
Employee
951 Views

Hello Wesly,

It sounds like you are using the built-in WebSQL API. I recommend that you use this SQLite plugin (https://www.npmjs.com/package/cordova-sqlite-storage) under the heading "SQLite Native Storage" in the Featured Plugins list of the Plugins Manager. The problem is that the WebSQL API is inconsistent and poorly supported on mobile devices -- it is unreliable. This SQLite plugin works much better. Please consider adding that plugin and using it, instead of the native implementation.

Based on your comments and a prior post, it appears that you are NOT using the Crosswalk build option. Please DO NOT use the Android option, use the Android-Crosswalk option (Crosswalk for Android build tile). This will provide better consistency across all Android devices and will work as expected with the native WebSQL. Also, the Debug tab uses Crosswalk and can be used to debug with third-party plugins.

0 Kudos
Wesly_L_
Beginner
951 Views

Bom dia!

Com muito trabalho foi resolvido, com a ajuda dos técnicos da Intel(Paul F., Pamela H.) e outros participantes, descobri que o problema não estava no ajax e sim na inicialização do banco de dados WebSql, o a dica que o Paul P. me passou acima é boa porem eu não estou familiarizado ainda com o intel XDk a ponto de entender claramente os plugins.

Resolvido: baixei um projeto exemplo que funcionava normalmente no Cordova 3.5, realizei o upgrade ao abrir ele na ultima versão do intel XDK 2611, removi todos os plugins antigos e adicionei novamente e assim funcionou, porem só funciona com app framework tentei com bootstrap nao funcionou.

outra dica que segui do Paul F. foi a compilação em crosswalk, não conhecia a importância.

Agradeço novamente a equipe da Intel e a todos que participaram em ajudar.

Obrigado!

0 Kudos
PaulF_IntelCorp
Employee
951 Views

Good day!

With hard work has been resolved , with the help of Intel technicians (Paul F. , Pamela H. ) and other participants , found that the problem was not in the ajax , but initialization WebSQL database , the one tip that Paul P . passed me up is good however I 'm not familiar yet with the XDK intel as to clearly understand the plugins.

Resolved: downloaded a sample project that usually worked in Cordova 3.5, performed the upgrade to open it in the latest version of Intel XDK 2611 , removed all the old plugins and added again and so worked , however only works with framework app tried to bootstrap not worked .

Another tip to follow Paul F. was the compilation crosswalk , did not know the importance .

I thank the Intel team again and to everyone who participated in helping .

Thank you!

You're welcome, Wesly. Glad to see that you were able to resolve the issue.

0 Kudos
Reply