Developing Apps for iOS, Android and the Desktop - java

We have an existing distributed application used by a small company to manage their customers.
The server side component is deployed in the cloud as a simple Java app that manages a connection to a MySQL database.
The client side is implemented as a Java Swing application deployed using JNLP and communicates with the server side using RMI.
This has worked quite well for us so far, but recently we've been looking at how our customers could access the application from mobile devices, tablets (both iOS and Android) as well as from the desktop.
At the minute I'm thinking we should be looking into developing RESTful web services on the server side to manage access to the MySQL database. On the client side, we could use Googles GWT to provide a quick and easy solution for accessing the services from all platforms. Going forward we could implement native iOS / Android apps to access the web services.
Am I am the right track here? Does anyone have any better approaches? Does anyone have any recommendations as to what tools I should be looking at?
The key thing I am interested in is being able to access the server side from any platform. I really don't want to have to implement separate server side implementations for each

Sounds like you are on the right track with the RESTFul web services. If you go this route, you should be covered for the backend. As long as your frontend can do http requests and handle JSON data you will be fine.
Going forward we could implement native iOS / Android apps to access the web services.
It is possible to design a mobile app for deployment on both android and iOS, this could save time on the development effort. To do that you could use, for example PhoneGap, which creates an abstraction layer over the phone hardware, along with something like jQuery Mobile, in which the UI is developed in HTML5 and javascript, and the same code is deployed via PhoneGap on both devices.
PhoneGap: http://phonegap.com/
jQuery Mobile: http://jquerymobile.com/
if there is some other option that lets you deploy the same frontend on android, iOS, AND the desktop, i would go with that, so that you only have one code base for the frontend.

I think your solution (GWT/HTML5) client talking to a server-side "business" layer is a good multi-client solution. RESTful web services are unneccesary in the context of what you have described since the GWT implmentation would take care of the comms between client and server:
GWT client <---> Server (GWT) <---> Database
If you are using a different client implementation (such as iOS), then RESTful services will be very handy indeed (and you wouldn't use GWT):
iOS client <---> Server (RESTful endpoints) <---> Database
HTML5 is becoming provides a decent compromise between broad applicability (many clients) and rich client features. I have seen an article in the past about using PhoneGap and GWT together which sounded like a good strategy for working with GWT (which I like) and gaining access to device-dependent capabilities. All whilst working in an environment where you can (Java-)debug even client code (incredibly useful GWT feature).

Related

Can we use Lync/Skype SDK in Eclipse IDE

I am new to programming with SDK so I wanted to check what is the best way to have an automated interaction between my Java application and Lync.
I did some research online and found this link were you can download and start using the SDK with visual studio. but I want to use Eclipse IDE to do the programming.
SDK download link - https://www.microsoft.com/en-in/download/details.aspx?id=36824
Sandesh Jadhav
This depends a little bit what you wish to perform and which application you wish to write as there exists multiple Lync / Skype for Business SDKs. Based on your posting it looks like you arenĀ“t really sure where to start, so let me create a summary here where you can choose the right SDK from.
With Skype for Business (former known as Lync) you have multiple options to choose from. However it depends if you wish to build an Server or an Client application:
(Source from Screenshot here)
UCWA (is a RESTful Web API that acts on behalf of a single Skype for Business user)
UCMA (is a .NET SDK that provides rich control over a Skype for Business server deployment. It enables applications to automatically route calls and messages, provide automatic responses (IVR or chat bots), record conversations etc.)
Skype for Business / Lync Server SDK
Skype for Business Client (Desktop) API / Lync client managed API
Skype for Business App SDK (designed to work with your iOS and Android app)
Skype Web SDK (set of JavaScript Web APIs and HTML controls that enable you to build web experiences that seamlessly integrate a wide variety of real-time collaboration)
However it depends what you wish to perform and for example if your java application is some kind of mobile one for example.
Depending on your needs you might also have a look into the "Microsoft Bot Framework".

Publish WebService for public access

So, i have some experience developing Java WebServices.
The problem is, all i do is deploy them to localhost.
My question is:
How can we deploy a WebService to a server other than localhost?
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
If i have it in localhost, nobody else but me on my computer can acess it right?...
Thank you for your time
I don't think you'd want to make an application running in your development environment accessible to anybody else around the world for a variety of reasons. Others on your local network could access your local host via its network hostname, but this isn't users around the world.
Let's discuss your two questions individually:
How can we deploy a WebService to a server other than localhost?
You'll want to establish a server environment that is available (on) as much as possible. If you want to keep using Apache Tomcat, you could sign up with a variety of service providers that host Apache Tomcat applications - there are many who offer tiered pricing based on number and size of pre-configured virtual servers (CPU, memory, disk space, and/or monthly data transfer of the application). You could even sign up with a cloud service provider such as Google Cloud, Amazon Web Services, or Microsoft Azure. All provide the tools to build, provision, and manage virtual server(s) which you would then deploy Tomcat and web service application into. Here's a detailed tutorial on setting up a Tomcat virtual server on Azure. You'd then need to manage those server(s), watch them to see how much they're utilized (which will impact how much they cost you per month, by the way).
If server management isn't what you're looking for - you could also explore "serverless" options such as Google AppEngine or AWS Elastic Beanstalk. In this model, you just upload your WAR file and the hosting service manages things like how many servers are needed to handle all the application SOAP requests your users around the world are making. You'll need to read the specifications for each, as you technically aren't providing Tomcat itself - in Google's example, you're actually running in their own proprietary container, so your app may need some changes depending on what it does.
Depending on what hosting or cloud service provider you select, your "how to deploy" steps vary wildly. On the bright side, all offer tutorials on how to specifically deploy applications into them "their way."
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
Once you've settled on a hosting or cloud services provider and have deployed your application, you'll have a URL to reach it, but you'll need to work on getting the word out. There are some open specifications on (SOAP) web service discovery, but more than likely that's not what you're really looking for. You could also submit your WSDL URL to an online API directory such as ProgrammableWeb or Public APIs.
The simplest way to do-it-yourself would be to run a web site that links to the WSDL, then use search engine optimization techniques to list the site on search engines and make it (and the WSDL it links to) relevant to web searches.
Getting fancier, you can treat your web service as a product via an API Management system. At a high level, this works by hiding the real URL to your web service on its server(s) and instead direct clients to a small website for developers where you document, market, facilitate discovery of your service as well as offer a sign up to use it (so you can track and manage who around the world is using your web service). Clients then consume the web service via separate URL behind what's called an API Gateway. You could charge for access or offer it for free but limit the amount of concurrent requests a client can make - after all, you're likely paying your hosting provider for utilization. Some of the cloud service providers Amazon, Azure, standalone API management vendors such as Apigee, Mashery, and many others.

AngularJS/HTML(Frontend) and Java RESTful Service(Backend) Hosting

I am working on a personal project/website for classifieds from scratch using AngularJS/HTML5 for the frontend and a Java REST Api that will communicate with a database.
My main question is what are some good options to host such a site without costing me a fortune as it is after all just for personal experience and fun.
I have some java background and therefore i would want to focus on a Java based REST service. I am also learning Angular for the frontend.
What would be an ideal hosting solution for my purposes?
Any thoughts are welcome.
Thanks
Any service that supports Java applications (i.e. Tomcat) and databases should be suffice. AngularJS is client side JavaScript executed on the browser - so hosting plans shouldn't be impacted by this.
You do not need different hosting plan for angular . You can host angular website in tomcat also along with java rest api. Heroku provides free plan along with limitations.

Set up web services based environment (advice/tips to start)

I am a bit lost because it's my first time assuming this role for a project.
We are making a software which consists in an app developed in Phonegap (for making a service oriented architecture, to make multiplatform easier).
The Phonegap app (and also the admin web) will be consuming constantly web services (every functionality is a service), and is my task to set up and environment to publish the API with the different services. I have heard about JAX-RS and also Spring MVC (I prefer this last option, because the good integration with Tomcat, and knowledge on the framework).
I have more or less clear the architecture (Tomcat+Spring+WebServices), but I am not sure how to start, because of the integration with the mobile app. I obviously want to develop with Java in the server side.
Any advice to start or related?
Thanks too much to all.
I would suggest you go for Apache CXF support for Rest Service.You can deploy the same in a tomcat server.I will suggest you to read the following URLs for better understanding:
http://www.dreamsyssoft.com/blog/blog.php?/archives/7-Simple-JAX-RS-Web-Service-in-Java-with-Spring-and-CXF.html
http://cxf.apache.org/docs/restful-services.html
Hope this helps.

Java Web Apps virtual host

I have just became a partner of a company that has a site developed in JAVA. As part of the agreement they allow me to create a section on their site (so I can take benefit of their traffic), but the development of this section needs to be as less intrusive as possible.
So ideally I would like to implement an independant web application in JAVA (with same layout) with a separate database that runs in the same application server. And in the application server to make a mapping like this:
All the traffic that comes to www.domain.com/MY_FOLDER
its served by my web application, all the rest should be served by my partners site.
I have no experience in JAVA but I found that in php this can be done, so I was wondering if it can be done also in JAVA.
About the application server I dont know yet which one they are using but I guess that are using "resing server" (by caucho: http://www.caucho.com/).
I would really appreciate if you can give me any ideas of how I can achieve this.
Thanks in advance,
Juan
Only one application can listen at a given socket at one time, so you need to have the existing server forward "your" requests to your web application, if it is not Java capable in itself.
The way to do that is not standardized so you will have to talk to the server administrator.
The easiest way to start from scratch with a Java Web Application is in the Netbeans bundle with Glassfish.

Categories