I am trying to use touchkit with Phone gap . My first aim is to use static files ( generated js files, images etc.) from client side (assets/www folder). Since files cached through cache.manifest file, has size limitation (as far as I know)
To achieve this,
I copied the generated VAADIN folder under the assets/www folder.
I copied the generated html code (before repaintAll is called from serverver side) to the index.html file under the same folder(assets/www).
I edited the appUri value inside index.html to the server url like below:
I’d guess the embedded browser won’t accept the cookie from the server. One easy option is to whitelist the server and just redirect to the server on the index.html. Check out my
blog post about the topic .
If you wish to store static files in “phone gap packages” I think the easiest method would be to use
Vaadin XS based solution. It will over come the cookie issue. The svn version of the add-on (which I suggest to use as the release is quite old) sends session id in UIDL requests so it will work totally without cookies support.
Thank you for your response. After my post I dig into the problem that I faced. When I explicitly define the height of the main window content in pixels. Every thing (more or less) working fine. I am not sure but I think there is a problem updating the height of the window with the browsers height and width at serverside… (that’s happening onBrowserready function at TouchkitApplication class) , setting the height of the window content explicitly is a workaround, If you have any idea on this, I would appreciate…
For static resources especially images, I am using the ExternalResource class. by using this class resources are retrieved from assets/www folder .
Also I dont face any problem with cookie issue , well i mean, I have an sessionid at serverside…
Some layout problems that i see are,
Table is not rendering correctly, no column header names and sort images…
Button texts are not centered, but left aligned…
Any ideas why layouting fails?
Another simple integration, can be just setting the app url in the Activity class onCreate method, and also set loadUrlTimeoutValue property to some higher value 60000 for example in order not to get a timeout error before loading the app…
[code]
public class HelloPhoneGapActivity extends DroidGap {
/** Called when the activity is first created. */ @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setIntegerProperty(“loadUrlTimeoutValue”,
60000 );
Maybe the base theme isn’t loaded properly? That might cause pretty much all the issues you are describing. TouchKits own theme is bundled in the GWT module, but it expects that the base theme added to the host page as well.
On Android you probably are safe with cookie issue. It is only Apple and Microsoft that are by default blocking “third party cookies”. It is kind of Googles interest to be able to track everybody’s actions in the web
You are absolutely right. It worked like a charm Now For android case my application behaves as expected. Ive attached screenshots where you can see the table and button layouting are fine.
For the Cookie issue, I will check the Vaadin cross domain plugin and will share the outcomes in this forum…
And the next step will be gwt-phonegap vaadin integration for accessing device resources… Any experience on this?
Did you get any idea of working with vaadin and phonegap. I am searching for months but still dont know how to achieve this still cant find proper way to integrate. Please give some pointers to get right way.