2

I am planning on writing a GWT application that will deploy to web and mobile web, as well apps on native devices. To do this I will first compile my GWT into JavaScript, and then use the GWT-Phonegap library to help bridge that JavaScript to be compatible with the PhoneGap API.

My only concern here is with codesplitting. With normal browsers, GWT allows developers to specify fragments that can be downloaded at different times between client and server. This prevents large apps from being downloaded as one big monolith and taking forever to startup inside the browser.

But with native apps (built by PhoneGap), the user will download the app from a marketplace and expect all the code (100%) to be downloaded at that time.

So I ask: how does GWT-Phonegap handle codesplitting and fragments? Do codesplitting commands get ignored somehow?

IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756

2 Answers2

2

Since a phoneGap app is actually a WebBrowser component packaged with the javascript and the html, I would guess that it would work like it did in the browser. The only difference would be that all communication for "downloading" the code would be local in the same device.

Spiff
  • 3,873
  • 4
  • 25
  • 50
  • Thanks @user905474 (+1) - what is this `WebBrowser` component and where is it defined? Is this a part of the PhoneGap SDK? Is it a JavaScript construct? Can you point me to some documentation on it? From your answer it *sounds* like its an embedded web browser of some kind (that PhoneGap embeds inside the native binary). If that's the case, then when you say "*the code would be local in the same device*", do you just mean that the frontend code (HTML/CSS/JS, etc.) would just be "downloaded" from the embebded browser to some embedded client? If not please clarify for me. Thanks again! – IAmYourFaja Sep 07 '12 at 21:43
  • Correction - above, I meant to write "...from the embedded **server** to some embedded client?" – IAmYourFaja Sep 07 '12 at 21:50
  • @4herpsand7derpsago: "From your answer it sounds like its an embedded web browser of some kind (that PhoneGap embeds inside the native binary)" Yes that's correct. The web client and a web control are packaged together. The server does not run in the mobile device. As far as I know you the server part does not have to be packaged. So you can use the same gwt web app and create a different packaging for each mobile platform. – Spiff Sep 08 '12 at 16:38
0

With Phonegap you put all your resources into the app (HMTML, CSS, JavaScript). If you are using gwt-phonegap you will just take the complete compiler out put (that you would normally put inside a war file) and put it into your app. So there is no real issue with code splitting since the javascript is deployed locally.

Daniel Kurka
  • 7,973
  • 2
  • 24
  • 43