I should have said Cordova, which refers to the framework and plugins, rather 
than PhoneGap, which these days is just Adobe’s distribution mechanism and 
which we no longer use.

In Cordova we have one page - index.html -  and it is very basic. It displays a 
splash screen. It has some javascript which, on device ready, redirects to the 
server-side login page. From there on it’s all Tapestry pages served from the 
server-side. The Tapestry pages can include Cordova plugins to access things 
like sound, the camera, and the ability to launch other apps.

When you read the code below, keep in mind that we currently target only iOS. I 
can’t recall why it shows then hides the splashscreen in quick succession. It 
might be a workaround.

We deploy this simple one page app to Apple’s App Store.

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0 
<http://www.apache.org/licenses/LICENSE-2.0>
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
var app = {
    // Application Constructor
    initialize: function() {
        this.bindEvents();
    },
    // Bind Event Listeners
    //
    // Bind any events that are required on startup. Common events are:
    // 'load', 'deviceready', 'offline', and 'online'.
    bindEvents: function() {
        //console.log("> bindEvents - start");
        document.addEventListener('deviceready', this.onDeviceReady, false);
        //console.log("> bindEvents - end");
    },
    // deviceready Event Handler
    //
    // The scope of 'this' is the event. In order to call the 'receivedEvent'
    // function, we must explicity call 'app.receivedEvent(...);'
    onDeviceReady: function() {
        // See http://www.iperform.nl/en/blog/post/cordova-ios-7-statusbar-fix 
<http://www.iperform.nl/en/blog/post/cordova-ios-7-statusbar-fix>
        StatusBar.overlaysWebView(false);
        
        app.receivedEvent('deviceready');
    },
    receivedEvent: function(id) {
        navigator.splashscreen.show();
        //console.log('Received Event: ' + id);

        navigator.splashscreen.hide();
        location.replace("https://ZZdomainZZ/myapp/login";);
    }
};


> On 2 Aug 2016, at 4:19 PM, Carlos Montero Canabal 
> <carlosmonterocana...@gmail.com> wrote:
> 
> Hi Geoff,
> 
> Can you tell us how you use Tapestry with PhoneGap? My questions are about 
> how you embed T5 app into PhoneGap system that requires simple html/js. Do 
> you do “Save as” the main IndexPage of Tapestry5 on browser  and put it on 
> PhoneGap project? And deploy the t5 app to manage all the zone updates?
> 
> Regards
> 
> Carlos Montero
> 
>> El 2/8/2016, a las 5:54, JumpStart <geoff.callender.jumpst...@gmail.com> 
>> escribió:
>> 
>> Totally agree. 
>> 
>> Most recently I’ve built an extensive tablet app using T5.4 + PhoneGap. 
>> 
>> It’s massively AJAX, but I didn’t have to think about it very much - thanks 
>> to Zones.
>> 
>> It employs only 5 pages instead of a few hundred - thanks to components and 
>> Zones. SPA without pain!
>> 
>> The small amount of custom JavaScript is done as components and is beautiful 
>> (I'd never before thought that possible) - thanks to T5.4 using RequireJS.
>> 
>> It runs so fast - fast enough to fool most into believing it is a native app 
>> - thanks to Zones, RequireJS, and T5.4’s asset handling (and AWS)!
>> 
>> But most of all, it has been a joy to build, and it has let me focus on the 
>> domain most of the time, which I can’t say is true of any other framework 
>> I’ve used (not even GWT).
>> 
>> Tapestry, and especially Tapestry 5.4, I take my hat off to you.
>> 
>> Geoff
>> 
>>> On 29 Jul 2016, at 8:38 PM, Qbyte Consulting <qbyteconsult...@gmail.com> 
>>> wrote:
>>> 
>>> After years of Tapestry focus I finally got around to checking out how
>>> others are building web apps these days. Spring MVC + REST and Angular seem
>>> to be flavours of the day and can create some quite slick solutions. These
>>> approaches are still full of boilerplate code, but things are looking a lot
>>> better than the early days of Struts.
>>> 
>>> So far as I can see Tapestry and maybe GWT are still the only one stop shop
>>> for cutting out the boiler plate code and having a focus on domain driven
>>> design with components instead of these pattern centric low level
>>> approaches.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
> 

Reply via email to