I have been working with GWT projects, and the scenario with GWT is that it is compiled then deployed to a web server (like Tomcat), however I want to try out PhoneGap, so I can develop a Android / Iphone app using a single code base and perhaps using the familiar web-style UI.
If I use GWT with PhoneGap, would the application still need a back-end web server to display the UI?
The answer to your specific question is no, you do not necessarily need the back end web server to display the UI. That does not mean that your application will seamlessly work in phonegap though. If you limit your GWT app to just client side code and call services outside of the GWT app you should be producing a web app that you can grab all of the content of the war minus the WEB-INF directory and drop it into phonegap (or the web server of your choice) and run the app without a java application server. I have had very good success with running my applications on Apache HTTPD Server this way. I have had limited success running it in PhoneGap though. Some parts of the applications function fine, others do not. So you will have to do quite a bit of testing to find out what works and what doesn't and then restrict your work accordingly but in principle it is possible to use GWT for developing a UI to use in PhoneGap.
Related
I'm going to start a new project that has two front ends, a mobile APP and a Web Application.
I was thinking about creating a "rest-api" grails application and consume this "api" from the mobile apps.
But, for the WebApp, is it possible to create a new "angular" Grails app that uses as model the previously generated "rest-api" Grails application and ovoids me to "re-implement the wheel (model)"?
Any articles/documentation how that could be accomplish?
Thanks in advance.
JD Evora
You can use the domain you already have in the new rest api, nothing changes. You may want to add the #Resource annotations.
If there is another app that uses this same domain, I would put in a plugin(as #Joshua suggested), we currently do it for clients which have both admin/cms and final user applications.
In our company,we are currently developing 3 projects with an idea I believe will fit well to your needs, or may help someone else who is starting a similar project
We organized the apps this way:
We've created a grails app with rest-api profile
We've created a grunt/bower/npm project(you could use yoo angular generator, but It had more than we needed)
We've created an android and and ios apps
Advantages we've seen:
The angular application calls the same methods as the mobile apps, there is only one controller, one service, one grails app
The web apps is pure JS and CSS and runs smoothly in the serve(npm
install serve)
You can deploy the web app in any CDN like Amazon Cloud Front and be able to handle a big demand, and you can deploy it quickly
Just in case you don't know, but with grunt and bower you can replace assets pipeline automation.
Hope it helps you!
I successfully created gadget using Getting Started with Gadgets and GWT
I want to know:
Is it possible to work on gadgets in development mode? I want to change the code and see the results. Or i need to compile and publish the gadget every time i change code?
I want my GWT GAE application to be both normal GWT app and a google gadget. When user enters http://mygadget.appspot.com/ i want him to see normal GWT app. But when user access http://mygadget.appspot.com/axogadget/com.axdms.gadget.client.AxObjectGadget.gadget.xml he gets the gadget. Is it posible? Or it has to be 2 different GAE applications? (Normal GWT app and gadget have different functionality). Multiple entry points?
yes using apache shinding, but it is still a hassle.
multiple entry points can work for you but you have to differentiate on how you make your calls to the server. Normal GWT app can use RPC for example but Gadgets must use IoProvider.
How can i make a lotus application an iPhone native apps?
For e.g: eLeave.
The submit or approve action button in the form was created using lotusscript. So how can it work in iOS ? I have no idea how can i extend my lotus application to an iPhone Native Apps. Someone had suggested to use either SOAP or REST via HTTP to communicate between iOS and domino. But i don't even know what can i do with SOAP in my apps.
Pls help.
The suggestions along the lines of SOAP or other HTTP-based access to the data are correct. Since you can't just port a Notes app to the iPhone (for a variety of reasons) or use the Notes Java API classes (since the iPhone doesn't have Java), some form of HTTP access is your best bet. Either traditional Domino web access via forms or XPages are most likely the best way to go, since then you can write your UI in Designer. If you don't want to or can't do that for whatever reason, you're on the hook for writing the UI for your iOS app separately and then connecting to Domino via Web Services or REST functionality.
SOAP Web Services are probably what you want. They have the advantage of being supported directly in Designer - you can create a Web Service Provider in LotusScript or Java in much the same way you would write an Agent or Script Library. You would have to write methods to access and update the data you want, but it would also mean you have full control over what happens. You could re-implement your form-submission code as a web service call that takes the changed data as parameters and then does whatever manipulation you want and creates/saves the document.
It does depend on the version of Lotus/Domino you are running. This could be a start XPages Mobile Controls I am not sure about the "native"here. This is XPages, web based.
Based on your comment, I know of one native application TSAzr. This application uses XPages as web-services on the domino server. A bit more info can be found here dominoGuru
Your follow-up suggests that a mobile-optimised web application will not cut it, and that you want a native application. This means writing a new iOS application, end of story. There are different ways to go about this of course—e.g. you could build a web app and then wrapper it using something like Appcelerator Titanium, or PhoneGap—but ultimately, you need to write something.
As #Jesse Gallagher has already stated, Notes applications can't be ported directly to an iOS device. Apart from anything else, a Lotus Notes client application is a proprietary data store (NSF) sitting within a C and C++-based client built and compiled for the relevant underlying platform (Win or OS X). There is no direct analogue for iOS other than re-coding your app (of course, you could re-use the existing Lotusscript business logic via web service calls, as detailed in earlier answers).
I am about to develop an application for iPhone using Sencha Touch + PhoneGap and I have a few very basic questions:
1)I want to read an XML file which is at the location http://abc.om/app/a3/. I used Sencha to read this xml but its giving me the following error:
XMLHttpRequest cannot load the url. Origin is not allowed by
Access-Control-Allow-Origin.
Is this the right method/approach to use Sencha for reading the XML? If yes, then how do I resolve the above issue? Someone said that Sencha is client side, and it cannot read the Xml out of the domain - is this true? What happens in a mobile application? Should I use Phonegap here?
2)As I am developing an app for the iPhone, how should I check the app
- using Chrome? Or using phonegap each time and then check it on an iPhone?
In general, PhoneGap applications do not suffer from cross-domain security restrictions once they are deployed to a mobile device. The reasons for this are different depending on which platform you are developing for, but for iPhone, it is because the your local PhoneGap assets are loaded into the browser on the iPhone using the file:/// URI; this allows you to get around the cross-domain security restriction. If you are creating a regular web site that is being hosted on a server, then you are restricted by this security policy. It is one of the benefits of creating PhoneGap applications.
I am not 100% familiar with Sencha, but you can use whatever framework on top of the basic XMLHttpRequest object to do cross-domain communication in PhoneGap. Be it Sencha, jQuery, xui, MooTools, etc.
For testing PhoneGap applications, I usually use a combination of my desktop browsers and some extra tooling to help me. In your case, if you load your PhoneGap application locally on your computer into a browser like Safari (which allows you to make XHRs off the file:/// URI), you won't see the cross-domain problems. Safari is one of the few browsers that allows you to do this. Alternatively, you can use a proxy on your local computer and have your local web server make the network requests and proxy them back to your application. I tend to use an awesome tool called sleight, which is a node.js web server that will reverse-proxy requests to a target external domain if the server can't find the requested asset locally on your computer. I'll try to lay out an example use of sleight for you:
Let's assume your PhoneGap application assets are located under ~/src/www, with the app being in index.html
Also assuming you want to access the abc.com domain from your PhoneGap app
You would use sleight like this:
$ cd ~/src/www
$ sleight target=abc.com
Now you have a local web server running that serves up all content under your www directory. From your index.html page now you can dispatch XHRs to http://abc.om/app/a3/, and sleight will proxy those back to you. So you can point your browser to http://localhost:8088/index.html and you'll get your PhoneGap app's index.html.
Sleight is an awesome tool for PhoneGap development as it allows you to test your PhoneGap apps on-the-go locally on your computer.
Regarding question #2:
You can use "chrome --disable-web-security" to bypass the same-domain restriction and run your phonegap application.
Edit: As as Chrome version 48, you should also add the flag "--user-data-dir". See this question.
Regarding question #2, Ronenz's answer works.
Also you can find several extensions of Chrome.
For example, I am using this one, easy to enable and disable:
https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi
I'd like to build a simple native iPhone app with tools traditionally used for web apps.
I would prefer to use something like jQTouch and Rails, but I want it to work offline (not require an internet connection or a server).
Is there a framework that enables simple creation of native iOS aps by encapsulating a lightweight web server and a server-side app framework (Rails or something simpler and more lightweight that can run on a phone), thus allowing you to write the client side code in HTML+JavaScript ?
If there is not such a thing, is there a way to create an app (with HTML+JS) that basically only has a client-side component with persistent data storage?
Thanks.
Have you tried Phonegap?
www.phonegap.com
You write your app in HTML/CSS/JavaScript.
You access the phones APIs through JavaScript - boom!
Also; Appcelerator Titanium would be an option: http://www.appcelerator.com/
-IMO Titanium is more powerful, and offers a more native look.
Why would you want to run a webserver off of the iPhone?
Is it so that you could send back data to the mothership?
Yes, you can included a lightweight http server running in another thread inside your iPhone app, and have your UIWebView connect to it. But unless you are going to do a fancier web server that generates dynamic content, it might be easy to just download your HTML/CSS/Javascript content to a local directory, and then point any URLs to those local files when offline.