Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm currently making an android application that will be used by a certain number of clients. Each client will have an account and will access information from the server. This information is stored in a DB.
My question is what is the best way to create a server side that will, later on, be compatible with other platforms (iOS, Windows, etc.)?
Can I use sockets on different platforms? Or should I create a Web Service?
I found a certain tutorial that I think is explaining a similar thing, but I think it demands a certain amount of knowledge, and I'm totally new to this, and haven't learned this at faculty (I'm good with sockets but I never had much confidence in them, and the idea of sending HTTP requests to the server looks much better).
Can someone divert me to a tutorial or lectures of how this is supposed to be done?
Connection between Android and a server would most easily be done with http requests.
There are several libraries available who make this easy like Retrofit.
For server-side applications you can take a look at Jersey in combination with a tomcat server.
There are of course many applications who can do these... so it comes down to a matter of preference.
There are many web development frameworks that works on many platforms such as spring, vertx, play and many others to name. You can you create rest like api for this purpose. Give all the low level works to the framework. You should not worry about low level details as most off them are handled by frameworks today.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I recently wrote a very simple apk app for a client - that runs nicely on their Android devices. They have since asked for it to be a runnable in web browser app (preferably phone and desktop). What would the best idea for this be?
As it's already in Java- perhaps a web applet? Are there any considerations here?
Or is there anything else that I can use? I've also heard to stay away from emulating the app within a web browser as it can be slow...
Sorry for asking a "unorthodox" question, but I know that SO people normally have a few suggestions that can put me on the right path...
What would the best idea for this be?
Tell the client to go pound sand.
Or, rewrite the entire app in a hybrid app framework, such as Apache Cordova/PhoneGap, so your mobile and Web implementations are similar.
Or, rework your Android app to be a (small) pure-Java JAR of business logic, wrapped in an Android app. Then, implement a server-side Java Web app (e.g., WAR) that leverages that same JAR.
perhaps a web applet?
Not all browsers support those, including roughly 0% of mobile browsers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am at a decision fork where i have to pick whether to use Tomcat or Node.js in my project and need advice from experts on this.
Some questions that i have here are:
Is Tomcat (Java) or Node.js with Typescript better suited to write a RESTful API which gets values form a Database and has to interact with a another java component?
Does Node.js have unit-testing support?
Is it possible to use websockets with Tomcat for another component of the API which pushes Data to the client?
Is the type system of Java better than the system of Typescript (not all dependencies are available in Typescript (or?) and therefore don’t have types?)?
Tomcat and Node.js are really totally different from each other, so there is no one to one comparison.
While Tomcat is a web server, Node.js is a server side runtime environment - and therein lies all the difference. Java - and consequently the web and application servers supporting it - give an architectural foundation to your application which arguably no other technology can offer. On the other hand, the speed, flexibility and simplicity of JavaScript (and therefore Node.js) is a winner.
So the real question you should be asking is - do you want a robust application with solid foundation or a speedy, flexible solution?
There are also a slew of other factors to consider such as memory, performance, maintainability, and the likes.
Here are some links that might help:
Performance comparison
Java vs. Node.js:
Yes Tomcat Support websocket in tomcat. If you have already some written component in java you should use java.
You can use jersey , spring boot to implement your rest webservices.
If you are working with nosql kind of databases then nodejs could be better bet
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm developing a mobile application. For database communication I want to use my existing way: WCF Data Service (which is an OData service).
I'm not often programming with java, but I thought this will not be a problem. Failed.
My first try was the odata4j library. All the time I got NullPointerExceptions (I tried really small things like getEntities. It took about one hour to recognize that the documentation is outdated and ODataConsumer.create(..) does not longer exist and you need to use ODataJerseyConsumer).
Then I tried to use a class I found in the internet: RestClient which is available here. I did some modification and in the end it was working, but it does not support odata functionallity (queries like $filter, $oderby, ...) and for each request I need a new instance.. so I'm not happy with it.
Then I tried my own implementation with HttpClient and JSONObject classes. It is a lot of code to do things like I want to and it is very uncomfortable.
So the question is: Is there another library you can recommend that I missed? Do you have any hints how to implement my own "OData Consumer library" or do you want me to invest more time into odata4j?
I found myself in a very similar situation just a month ago.
I recommend that you go back to OData4j for Android development. When you run into issues or get confused, post to the OData4j forum. John Spurlock, the create of OData4j, personally responds to almost all of the posts there. When I was having issues (I created a producer, not a consumer), he was VERY patient and prompt in his responses.
OData4j doesn't have the nearly as many tutorials as it should. So take good notes of the steps you go through and then share your expertise afterwards!!
As for iOS development with OData, the best out there is OData4ObjC. Unfortunately, the current version was abandoned about a year ago and therefore doesn't support iOS 6. I've updated the code and samples to work. it can be found here.
Good luck! And let me know how it goes! I'm considering making an Android app that integrates OData also. :)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am planning to develop a web application using GWT, but before that I need to make few clarifications. The web app what I am developing should be compatible with Mobile phone browsers considerable smart phone browsers.
I googled a lot to know this but I did not find supporting or sufficient documentations.
If GWT doesnt support what would be the other framework, which is open source java based framework?
There is no big problem with mobile websites build using GWT, it generates standard javascript + html. There is some libraries that can help you build mobile site, like http://code.google.com/p/gwt-mobile-webkit/. And you can write any widget you wish.
But keep in mind that GWT will generate very heavy target files, sometimes few megabytes long. So if you target audience uses GPRS for accessing your site, it could be problematic for them.
There is also other web-framework, that are GWT based: http://vaadin.com/home.
It have great collection of UI components, and currently authors are extending it to be more mobile friendly.
You could also try a different route with Context Framework. I think it suites better to mobile web developing because it is more lightweight solution. I have made a journey planner (in Finnish) with it and it was tailored especially to touch screen phones. You can find it here.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I recently came across Heroku, which looks extremely cool. You just upload your app and you're done; it scales without further intervention. Unfortunately, Heroku is for Ruby and our app is in Java.
It's a webapp, implemented as a .war file. We want it to scale automatically across clusters of servers maintained entirely by other people.
We've spoke to Rackspace. They have "Rackspace Cloudsites" which does this for Wordpress. They have no intention of supporting Java app servers in this way.
What else is out there?
The key to scalability is not the infrastructure (only). You can use various cloud offers:
Google App Engine
Amazon EC2
Heroku
CloudFoundry
VMForce (upcoming)
etc..
But if your application is not inherently scalable, the cloud won't help you.
In fact, strictly speaking, scalability is a property of the application, and it means that the application starts supporting higher load by simply adding hardware. The cloud offers you the "adding hardware" part. The rest is your responsibility.
Now, how to achieve scalability of your application is a huge topic. High scalability is a good resource for such articles.
Now Heroku supports Java. Great value for service/price :)
Take a look at Google App Engine. In your case, the App Engine Java Overview will be helpful. You can also build App Engine applications using Python.
Google App Engine does this. It's all Java and Javascript (converted from Java when needed) too.