Announcement

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

    SmartGWT + Non Web Java application

    Hi all,

    I remembered my co-worked talking about SmartGWT few months back.. finally I put the effort to look for it today.

    My question is it possible to use SmartGWT with a stand alone (non web) Java application?

    Thanks in advance.

    Regards,
    Jerry.

    #2
    Smart GWT is built using web technologies but you can bundle your app as a standalone desktop app using Titanium or Adobe Air.

    Comment


      #3
      Is there an example using Adobe AIR? I am very much new to GWT. A detailed example would be great to understand the best practices too. I have been googling for a sample with Adobe Air but no luck yet.

      Comment


        #4
        Hello if you are a little patient, i ll post an example here later.

        Regards,

        Alain

        Comment


          #5
          To get SmartGwt to run inside AIR you will have to put the hosted page in an Iframe. This is because of the security restrictions inside the AIR Runtime. You basically can not run things like eval or windiw.setTimeout wich Smart GWT uses a lot, after the document has loaded.

          So let s say you hosted page ist index.html

          you will have to generate another html page say: index2.html
          and add something like this in that page :

          <iframe id="UI"
          src="index.html"
          sandboxRoot="http://example.com/"
          documentRoot="app:/"
          style="width:100%; height:100%"
          allowCrossDomainXHR="yes"
          >
          </iframe>


          and now in the application.xml of your air application you specify index2.html as the startpage of your app:

          <initialWindow>
          <!-- The main HTML file of the application. Required. -->
          <content>index2.html</content>
          <!-- more entries here -->
          </initialWindow>

          the only problem with this is that you will hav to use a natice JS Bridge to access the AIR core API.

          I m working on a project to get around this like i did for EXT-GWT :http://code.google.com/p/gwt4air/

          as soon as i hav a solution i ll post it here.

          hope this could help

          Regards,

          Alain

          Comment


            #6
            Alain,

            Thank you so much for your detailed explanation. My requirement is to develop a stand alone java app from scratch and since I am new to stand alone Java development, I could be over complicating this.

            I know Swing is an option but it is heavy and that is when I did some research and came across SmartGWT. Now, is it good to use SmartGWT to develop an stand alone app from scratch or it is too much overhead to do so??

            Should I look in to any other options? I don't want to prematurely jump in to any thing not knowing that there is an perfect option out there..

            Thanks in advance.

            Jerry.

            Comment


              #7
              It depends.

              SmartGWT has basically the richest set of UI components and databinding systems you'll find anywhere, and when you write a SmartGWT application you are simultaneously creating a web application, desktop application and mobile application - because SmartGWT runs in all these environments.

              If the reason you're writing a Java application is because you want access to local resources on the end user's machine (ability to read and write to the end user's filesystem without using the upload/download interaction commonly used on web sites), then you'll be able to do this via AIR with a little help from Ekambos or some moderate effort on your part, but it's easier with a Swing or other native Java application.

              If you're writing in Java because you like Java and are familiar with it, and it has some value to you that your application is also a web application and mobile application, then yes, SmartGWT is a great choice.

              Comment


                #8
                Hi, I'm evaluating the SmartClient platform, and see that using Java to create Web apps and desktop apps certainly would make the developer's life a lot easier. I'm posting in this thread as it is a little relevant to what is being discussed here.

                If I sign up for the Pro license, then I can use the data binding code without having to write my own. But if I choose to write my own client app on an Android phone (not choosing to go with the browser-based SC app), then is it possible to use the same server-side code to get data from?

                Thanks,
                Rajath

                Comment


                  #9
                  Yes, in fact, it's automatic (you can't help but do it correctly). When you build server-side DataSources, the operations you define are accessible via a REST interface. When accessed this way, validation rules are still run, declarative security checks still operate, customized SQL is used, etc. The protocol supports data paging, advanced filtering, multi-level sort, and error handling.

                  Also, since you mentioned it, there's a diminishing number of reasons to write native applications. These days, a web application on iPhone or Android can:

                  - mimic native look and feel perfectly using CSS3
                  - use native animations such as flips and slides
                  - detect device orientation and orientation change
                  - detect multiple finger gestures
                  - store data permanently on the device (optionally, as SQL tables)
                  - operate 'offline' while the device has no network
                  - be launched from an icon on the device home screen
                  - access GPS coordinates and launch Google Maps
                  - allow the user to initiate phone calls by touching phone numbers

                  "Shim" technologies like Phonegap and Titanium allow a web application to do most of the rest.

                  Comment


                    #10
                    Thank you for your reply.

                    I have downloaded the SmartGWT Pro eval version and trying it out. Some of things I have a doubt in are:

                    1. I was taking a look at the builtinds example and trying it with GAE, but from the post (http://forums.smartclient.com/showthread.php?t=9699&page=2), it looks like the better way is not to go with GAE. Is that right? If so, based on customer experiences, what is a good Java hosting service?

                    2. I am fairly comfortable with Netbeans. Should I continue to work with this, or is it better to switch to Eclipse since, from what i read, support seems to be better in Eclipse.

                    Regards,
                    Rajath

                    Comment


                      #11
                      1. If you go with GAE, there is a GAE-specific sample (separate from built-in-ds) that you should start with.

                      GAE does not support SQL, it uses a non-relational database known as "BigTable", but supports accessing this via JPA. Whether that's acceptable is up to you - certainly, working through JPA makes it much harder to do things that are easy in SQL.

                      As far as comparing different Java hosting services, we'd recommend Googling for advice on that.

                      2. If you look at Google's docs on their GWT plugin and GAE support, they definitely focus on Eclipse first, and more users are using Eclipse with these technologies so it's easier to find advice. But again, it depends on how much trouble you anticipate learning a new IDE.

                      Comment


                        #12
                        With regard to Java hosting services, what are some of the things I should be looking for? For example, mochahost offers tomcat with mysql. Is this alright, or is performance improved with other technologies for SmartGwt?

                        Thanks,
                        Rajath

                        Comment


                          #13
                          We recommend SQL and our SQLDataSource as a first choice of data persistence engine, since it's got less overhead than Hibernate and SQL Templating provides tremendous flexibility and power. Servlet engine has little impact - Tomcat is fine.

                          Comment

                          Working...
                          X