DMXzone Cordova Builder Support Product Page

Answered

Data is retrieved in emulator but not on Device

Asked 27 May 2015 19:27:02
2
have this question
27 May 2015 19:27:02 Brad Lawryk posted:
When I preview in an emulator the data is displayed correctly, but when I view on my device after running in xCode I don't get any data on the device.

Replies

Replied 27 May 2015 19:45:53
27 May 2015 19:45:53 Teodor Kuduschiev replied:
Hi Brad,
Please send the page that you pack as an app to so we can check what is wrong there.
Replied 27 May 2015 19:57:50
27 May 2015 19:57:50 Brad Lawryk replied:
I am sure the issue is here:

<script type="text/javascript">
/* dmxDataSet name "sourceOpenJobs" */
jQuery.dmxDataSet(
{"id": "sourceOpenJobs", "url": "WorkBCPGAPI:8888/dmxDatabaseSources/connTestKopar.php", "data": {"limit": "25"}, "siteName": "Work BC PG Mobile App API", "dataSourceType": "database", "dataType": "jsonp"}
);
/* END dmxDataSet name "sourceOpenJobs" */
</script>

It's trying to get data from my local server instead of the remote server.
Replied 27 May 2015 19:59:17
27 May 2015 19:59:17 Brad Lawryk replied:
Does this mean an app has to also be hosted and live on a remote server? If so is this not a security issue?

Sites I have packaged up with Phonegap have been entirely self contained.
Replied 27 May 2015 20:00:50
27 May 2015 20:00:50 Teodor Kuduschiev replied:
Well, then setup your data source properly and pointing to remote Data API site, just as described in the following tutorial: www.dmxzone.com/go/22827/building-mobile-apps-with-html5-data-bindings-and-dmxzone-database-connector
That is how you build dynamic, database-driven apps - Your app is the client, that connects to the remote Data API site.
Replied 27 May 2015 20:17:00
27 May 2015 20:17:00 Brad Lawryk replied:
I did follow that video. I have an API site created and uploaded to the live server with the connection details. I even have some test sources uploaded on my api site.

I can't add sources from the API site to the cordova site and if I had a source to the cordova site using the remote connection it wants to get the info from my local server.
Replied 27 May 2015 20:30:34
27 May 2015 20:30:34 Teodor Kuduschiev replied:
When you are done setting up your remote data API site (site definition in DW and the database connection) open your Cordova Site. Then when creating the Data Source into the Cordova site, make sure to select the remote site definition in the Site menu. Please double check this...
Replied 27 May 2015 20:38:13
27 May 2015 20:38:13 Brad Lawryk replied:
Yes Teodor, I have done that a hundred times over trying to get this to work. I understand how that works. I can connect to the data in my static site no problem. It all works perfectly in the emulators through cordova builder and through xCode. All the data shows up as it should in the emulator. There is no problem there.

The problem is on the devices that the data does not show up.
Replied 27 May 2015 20:44:43
27 May 2015 20:44:43 Teodor Kuduschiev replied:
Of course, as the datasource points to:"url": "WorkBCPGAPI:8888/....
Please check your data API site definition... How is your remote server set up? It seems it is pointing to this local address, otherwise the extension won't generate such an url for the datasource.
Replied 27 May 2015 20:50:20
27 May 2015 20:50:20 Brad Lawryk replied:
I have it set up like any other dynamic site.

I have a remote server set up with the proper server settings for it and I have a local server set up as the testing server. It seems to always want to choose the testing server.
Replied 27 May 2015 21:01:40
27 May 2015 21:01:40 Teodor Kuduschiev replied:
So,does setting the remote server as both remote and testing, solve the data source url issue? (When you change the site definition settings, please reapply the data source on cordova site)
Replied 27 May 2015 21:08:33
27 May 2015 21:08:33 Brad Lawryk replied:
I just tried that too. Setting the remote as remote and testing, although it now puts the correct path in, it prevents the data from showing at all even in the emulators. I am currently restarting all from scratch again.
Replied 27 May 2015 21:11:18
27 May 2015 21:11:18 Teodor Kuduschiev replied:
If the path is correct now, then please send us the html page, that you pack as an app to so we can debug the connection.
Replied 19 Jun 2015 23:26:28
19 Jun 2015 23:26:28 Brad Lawryk replied:
I have solved this issue, Teodor.

Note: It seems to work if I create the recordset while in the app. If I create the recordset while in the API site and try calling it in the app it does not work.

So the solution is to create your recordset in the app site not your app API site.
Replied 05 Oct 2023 06:48:50
05 Oct 2023 06:48:50 User  replied:
Experience the future of C++ certification with the all-new C++ Institute CLA-11-03 [2023] exam! Elevate your programming skills and validate your expertise in the latest C++ standards. Our cutting-edge exam format ensures a comprehensive evaluation of your knowledge, covering advanced topics like multi-threading, smart pointers, and more. Gain an edge in the competitive IT landscape by showcasing your proficiency in C++. Join thousands of successful professionals who have unlocked their potential with C++ Institute certification. Don't miss this opportunity to be part of the Real exam experiences of C++ Institute CLA-11-03 [2023] success story. Prepare for the future and excel in your career with us!

Reply to this topic