Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT-Mobile - Compile time user.agent values

    smartGWT-mobile
    GWT 2.5
    Android browser

    Attempted opening browser with Samsung Galaxy tab browser and got the message in the browser :

    Code:
    ERROR : Possible problem with your *.gwt.xml module file.
    
    The compile time user.agent value (android) does not match the runtime user.agent value (safari).  Expect more errors.
    Still got the message after updating the *.gwt.xml file as below :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
    
    <module rename-to="airtime">
    
    
      <!-- Inherit the core Web Toolkit stuff.                        -->
      	<inherits name='com.google.gwt.user.User'/>
    	<inherits name="com.google.gwt.i18n.I18N"/>
        <inherits name="com.smartgwt.tools.SmartGwtTools"/> 
        <inherits name="com.smartgwtpower.tools.Tools"/>     
      	<inherits name="com.smartgwt.mobile.SmartGwtMobile"/>
        <inherits name="com.smartgwtpower.SmartGwtPower"/>
    
    
    	<extend-property name="user.agent" values="android" fallback-value="safari"/>
    	<extend-property name="user.agent" values="ipad" fallback-value="safari"/>
    	<extend-property name="user.agent" values="iphone" fallback-value="safari"/>
    
        <!-- this is where the application starts -->
        <entry-point class='com.reliable.app.client.MobileGreetingPage'/>
     </module>
    The extend-property lines were added. Let me know the correct approach.

    #2
    Having made those changes, you probably need to run a GWT compile.

    Note your module file makes no sense - mixed imports from SmartGWT and SmartGWT.mobile. See the user_guide for SmartGWT.mobile for how modules should be arranged.

    Comment


      #3
      I've cleaned up my *.gwt.xml file , so it looks like the below now :

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
      
      <module rename-to="airtime">
      
      
        <!-- Inherit the core Web Toolkit stuff.                        -->
      
        	<inherits name="com.smartgwt.mobile.SmartGwtMobile"/>
      
      
      	<extend-property name="user.agent" values="android" fallback-value="safari"/>
      	<extend-property name="user.agent" values="ipad" fallback-value="safari"/>
      	<extend-property name="user.agent" values="iphone" fallback-value="safari"/>
      
          <!-- this is where the application starts -->
          <entry-point class='com.reliable.app.client.MobileGreetingPage'/>
       </module>
      Still receiving the error message previously mentioned when running on the GalaxyTab.

      Let me know your thoughts on having this fired up on this browser.

      As mentioned before, it works fine on both Chrome and Safari on Windows so I'm in a position to start some development, but I want to at least have this fired up on this device as it will be my immediate target.

      Comment


        #4
        You appear to still be using the old, buggy DTD. Use the new one.

        Comment


          #5
          I've used the new 2.5 DTD , but problem persists. See below (2nd line in the .gwt.xml file):
          Code:
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd">
          
          <module rename-to="airtime">
            	<inherits name="com.smartgwt.mobile.SmartGwtMobile"/>
          
          	<extend-property name="user.agent" values="android" fallback-value="safari"/>
          	<extend-property name="user.agent" values="ipad" fallback-value="safari"/>
          	<extend-property name="user.agent" values="iphone" fallback-value="safari"/>
          
              <entry-point class='com.reliable.app.client.MobileGreetingPage'/>
           </module>
          The web.xml file is as follows (see the dtd within as well ) :
          Code:
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE web-app
              PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
              "http://java.sun.com/dtd/web-app_2_3.dtd">
          
          <web-app>
          
            <!-- Default page to serve -->
            <welcome-file-list>
              <welcome-file>AIRTIME.html</welcome-file>
            </welcome-file-list>
          
          
          </web-app>
          Also, I've done a GWT compile (bulletproof) and built war using ant . The message shows on both the emulator and physical device. However, it proceeds to work with emulator (after the identical message is displayed), but not so with the physical device.

          No one else is complaining, so it must be my setup.


          In summary :

          1. The smartgwt-mobile.jar is in my classpath
          2. the .gwt.xml is as you see it above
          3. the web.xml is as above
          4. GWT_HOME pointing to correct location during build process
          5. GWT COMPILE done each time (i think this is implicit in the ant war job, but i run it nonetheless)
          6. Web archive built with ant ( ant war)
          7. All works fine on browser (Safari and Chrome)
          8. Receive aforementioned message on Samsung GalaxyTab device (test and target device)

          Any further assistance will be appreciated.

          Comment


            #6
            Ah, we thought you were still having the stale DTD issue but this warning message is different. It should be eliminated if you use tomorrow's nightly build.

            Comment


              #7
              I have the same problem

              I have the same problem
              Tested it today, but problem was not solved.
              I will try it again tomorrow.

              Comment


                #8
                It still isn't working ... still receiving the aforementioned response on the Samsung GalaxyTab browser. Did the patch make it to today's release ?

                Comment


                  #9
                  Yes, the patch is present.

                  A few things to check: you may have the user.agent set in one of your GWT modules to speed compilation. Look for something like this:

                  <set-property name="user.agent" value="safari"/>

                  If present it needs to be removed in order to test non-Safari UAs.

                  Also, in your airtime GWT module you have.

                  <extend-property name="user.agent" values="android" fallback-value="safari"/>
                  <extend-property name="user.agent" values="ipad" fallback-value="safari"/>
                  <extend-property name="user.agent" values="iphone" fallback-value="safari"/>

                  These aren't needed - they are in already in the SmartGwtMobile module.

                  If you ultimately can't get past the warning, GWT allows the warning to be disabled by adding to the GWT module file:

                  <set-configuration-property name="user.agent.runtimeWarning" value="false"/>

                  If that is added and after re-compiling, the warning still appears, then there may be a caching issue.

                  Comment


                    #10
                    Problem solved for me but...

                    For me the problem seems to be solved.
                    The popup about the compile time user.agent no longer appears.

                    However,

                    When I add
                    <set-property name="user.agent" value="safari" />
                    to my xml file, the GWT compiler generates 1 permutation
                    Application works fine in desktop safari, but in safari on my iphone (IOS 6) a blank screen is shown.

                    When I set the value like
                    <set-property name="user.agent" value="safari,iphone" />
                    The compiler generates 3 permutations.
                    Application works fine in safari on desktop and on iphone, as well as a web app added to the home screen.
                    On my ipad (ipad 1 IOS5.1) a blank screen is shown in safari and as a web app added to the home screen.

                    When I set the value like
                    <set-property name="user.agent" value="safari,iphone,ipad" />
                    The compiler generates 5 permutations.
                    Application works fine in safari on deskop, ipad and iphone, as well as a web app added to the home screen on iphone and ipad.

                    I expected that
                    <set-property name="user.agent" value="safari" />
                    would work for all platforms, because all platforms safari is used.
                    Further, when I added ,iphone,ipad to the user.agent property, I expected that the compiler would fallback to safari so that only one permutation would be generated instead of 5.
                    Last edited by hromkes; 18 Jan 2013, 04:34.

                    Comment


                      #11
                      The problem is resolved. I actually had a stale version of the smartgwt-mobile.jar in my WEB-INF/lib.

                      Thank much for the effort here.

                      I however have a strange issue now.

                      The sample "helloworld" (just so that we are both working with known sources) works fine in both emulator and physical device
                      The PUBLIC showcase (ie on your website) works as expected on BOTH the emulator and the physical device
                      The sample "showcase" works as expected in the emulator, HOWEVER, I seem to be getting a blank screen ( or the background image only) on the actual device. No errors reported, just a "blank" screen. My airtime project (which was a scaled down version of the showcase) suffered the same fate.

                      Let me know your thoughts on this issue.
                      Last edited by richardwasim; 18 Jan 2013, 03:56.

                      Comment


                        #12
                        @hromkes That's not how GWT user.agent values work. On an iphone, the user-agent is iphone, and if you have not generated a permutation for iphone, you will get a blank screen. It doesn't matter than iphone happens to use Mobile Safari, GWT is either generates and loads a permutation for iphone or does not.

                        Comment


                          #13
                          @richardwsim your issue should be fixed for tomorrow's build.

                          Comment


                            #14
                            Thanks much Isomorphic. This issue is now resolved.

                            The application works in browser,emulator and actual device.

                            Now onto next steps.

                            Comment

                            Working...
                            X