We have been working with CN1 (and even LWUIT) on last years, and now we are experimenting HTML5 based solutions with WebView (on CN1) for more agile presentation layer change cycle.--
Our interface designers accumulate a strong know-how on HTML for multiple devices (basically all sorts of Androids and Ithings), so they expect that the their layout could render exactly as produced on all sorts of mobiles.The clash with Swing's approach of CN1 is clear: we could not rebuild the presentation layer exactly as produce, due the differences on Swing components and HTML redering.So, we are raising this discussion to check a proposed solution before invest in it. Here it goes:
- All the crude data and model actions are kept on server side, accessible through Web Service (JSON based)
- We will use CN1 WebBrowser to render HTML for presentation
- HTMLs are located on server side (client side HTML and assets hierarchically organised seems impossible on CN1)
- All navigation actions on HTML (basically forms and links) are intercepted on CN1, and CN1 code is used to manage all sort of actions that need to be performed (it means that CN1 code has to control user navigation, besides that, have access to filled forms on HTML and interoperate with Web Services).
- I was thinking about let on server only HTML templates, and embed a template engine on CN1 (using data from Web Service to generate final HTML). Another possibility is to let the server do this job, and CN1 only set the parameters on the HTTP request to pull an already complete HTML.
By this way, we are trying to escape from Native vs "HTML5 base solutions" dichotomy, and organize our product development flow respecting separation of concerns (designers vs developers), and keep CN1 cross-platform development.
Anybody seems it possible, impossible, tried something similar? Please, any advice is welcome.
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-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/4042e2df-8586-4c4b-b725-8d490d839546%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
While you technically can build an app this way, you are setting yourself up for a bit of a rocky road. The biggest pitfall is in debugging. If you stick to the pure Java route, errors are easy to identify and fix because you get stack traces leading your directly to the problem. Once you introduce Java to Javascript communication and vice versa, errors will become much more difficult to track down.If you really want to use HTML5, you are probably better to use Cordova.As an aside, I'm not sure what you mean by "The clash with Swing's approach of CN1 is clear: we could not rebuild the presentation layer exactly as produce, due the differences on Swing components and HTML redering."CN1's model for UI is quite flexible for cross-platform mobile development. I haven't experienced any issues with making the UI look good across devices.Steve
On Thu, Jun 19, 2014 at 7:41 AM, <ivan....@gmail.com> wrote:
We have been working with CN1 (and even LWUIT) on last years, and now we are experimenting HTML5 based solutions with WebView (on CN1) for more agile presentation layer change cycle.
Our interface designers accumulate a strong know-how on HTML for multiple devices (basically all sorts of Androids and Ithings), so they expect that the their layout could render exactly as produced on all sorts of mobiles.The clash with Swing's approach of CN1 is clear: we could not rebuild the presentation layer exactly as produce, due the differences on Swing components and HTML redering.So, we are raising this discussion to check a proposed solution before invest in it. Here it goes:
- All the crude data and model actions are kept on server side, accessible through Web Service (JSON based)
- We will use CN1 WebBrowser to render HTML for presentation
- HTMLs are located on server side (client side HTML and assets hierarchically organised seems impossible on CN1)
- All navigation actions on HTML (basically forms and links) are intercepted on CN1, and CN1 code is used to manage all sort of actions that need to be performed (it means that CN1 code has to control user navigation, besides that, have access to filled forms on HTML and interoperate with Web Services).
- I was thinking about let on server only HTML templates, and embed a template engine on CN1 (using data from Web Service to generate final HTML). Another possibility is to let the server do this job, and CN1 only set the parameters on the HTTP request to pull an already complete HTML.
By this way, we are trying to escape from Native vs "HTML5 base solutions" dichotomy, and organize our product development flow respecting separation of concerns (designers vs developers), and keep CN1 cross-platform development.
Anybody seems it possible, impossible, tried something similar? Please, any advice is welcome.
--
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+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/4042e2df-8586-4c4b-b725-8d490d839546%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.