Phonegap local build from scratch

0
Hi, I’ve installed Phonegap locally on my PC and I’ve created a Phonegap project, set up a condig.xml and created a config folder and I’ve set in a property file with an url property pointing to the url of my Mendix app on de the Mendix server. But when I build my app and run it on my mobile device, the index.htm I get to see is just the default page generated by Phonegap, it looks like it is not even getting to the mendix server, or what am I not doing right?
asked
7 answers
2

Does this help? https://docs.mendix.com/howto6/building-a-mendix-hybrid-mobile-app-for-windows-phone

2.5 describes URL redirect for your Index.html

answered
1

Mendix has a template for creating phonegap wrappers here.  But you can download a preconfigured setup of this template by going to sprintr > your app > Deploy / Mobile App > publish for mobile app stores and select the option to do it yourself. This will download a phonegap wrapper which already correctly points to the selected environment.

answered
1

See Lennards comment. That is the recommended approach.

 on the page where you can download your app there is also a link to https://github.com/mendix/hybrid-app-template/ which describes more.

Also note, that you can use just Cordova.

answered
1

Hi Miguel,

Check out our video tutorial on this subject: 

https://www.youtube.com/watch?v=7ic625u2YJE

Instead of selecting the 'build in the cloud' option, select 'do it yourself' if you want to change the Phonegap package yourself (additional plugins, etc). 

answered
0

because i am not working in a licenced cloud node, there no way to get the preconfigured setup. i have got the hybrid-app-template but i am having aproblem with this line 'var mxapp = require("mendix-hybrid-app-base"); ' in the entry.js file. the cordova app is blocking on that. so how to get and initialize the mx client in the javascript?

answered
0

Hi, thanks,

I could build it from scratch. now when i run the app on a mobile device i keep getting the error log as below. do any one have any clue?

The key "viewport-fit" is not recognized and ignored.
entry.js:43 Received Event: deviceready
index.html:3 Uncaught SyntaxError: Unexpected token {
es6.promise.js:97 Unhandled promise rejection Error: Failed to setup directory locations: unsupported platformmessage: "Failed to setup directory locations: unsupported platform"stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }__proto__: des6.promise.js:97 (anonymous function)

 

answered
0

Solution for me was to include the following line in config.xml:

<plugin name="cordova-plugin-file" source="npm" spec="4.2.0" />

answered