--- title: Using PhoneGap Build With Vaadin TouchKit order: 15 layout: page --- [[using-phonegap-build-with-vaadin-touchkit]] = Using PhoneGap Build with Vaadin TouchKit [.underline]#*_Note:_* _Vaadin Touchkit has been discontinued. A community-supported version is available https://github.com/parttio/touchkit[on GitHub]._# At first, using https://build.phonegap.com/[PhoneGap Build] to point to your Vaadin TouchKit apps seems like a breeze. Just create a simple `config.xml` and an `index.html` that redirects to your web site, and you have an app! Unfortunately, simply doing this is not robust. Mobile devices lose connectivity, and when they do your app not only stops working, it may appear to freeze up and have to be killed and restarted to get working again. With the release of TouchKit v3.0.2 though, there is a solution! This article summarizes this solution, which was worked out over months of trial and error on http://dev.vaadin.com/ticket/13250[Vaadin ticket 13250]. ''''' First, server side you need TouchKit v3.0.2. (The needed enhancements and fixes should roll into _v4.0_ at some point, but as of _beta1_ it isn't there.) You also need to ensure that your VAADIN directory resources are being served up by a servlet extending `TouchKitServlet`. If you have a main application extending `VaadinServlet`, this needs to be changed to `TouchKitServlet`. ''''' When your PhoneGap app runs, it loads your provided `index.html` file into an embedded WebKit browser. Only this file has access to the PhoneGap Javascript library, so it handles things like offline-mode detection, and passes this via messages to the iframe containing your server-provided application. [source,html] ....