Reputation: 109
I am developing an Android app using thin client architecture.
Some basic use cases on the client side are:
The server's responsibilities are processing the data and sending back the result. I wrote a functional prototype server using java and its socket api to validate the app's feasibility. Now I am considering to publish this app, apparently sockets are not a good idea for my app because it is the lowest level api java provides in term of network communication, a lot bugs could happen when I scale this project to accommodate hundreds of users. Since it is the first time I am planning to publish an app, I really want to get some help from those who developed this kind of apps before, please advise the technologies you would use for it. I am considering tomcat, is that acceptable in practice?
One limitation of my app is that the server has to be able to execute java code easily, because the processing part I wrote is in java and it is using a dozen other jar files written by other developers.
Upvotes: 2
Views: 171
Reputation: 719281
Without details of what your application does, and your functional and non-functional requirements. It is next to possible to advise you. So I'll restrict myself to generalities.
Socket-level programming is not inherently buggy. It is (in some respects) harder, but you can write reliable socket code.
Using higher level protocols and abstractions can simplify things, allowing you to implement larger more complicated systems faster. But only if the abstraction / protocol matches what you are actually trying to do. (For example, HTTP is a poor match for peer-to-peer systems.)
The higher level protocols and frameworks also have performance penalties ... compared with a "lean and mean" lower level implementation.
Finally, HTTP (specifically) has the advantage that it is ubiquitous. Browsers support it, and there are lots of server side and the like tools. And the chances are best that security folks will let it through firewalls.
The specific things you are asking about can all be done in a variety of ways. Some ways are better from a scalability perspective, to a point. But real scalability requires good design and hard work rather than picking the "right" technology.
We can't tell you whether Tomcat is a good (or good enough) choice without understanding your actual problem.
Upvotes: 1
Reputation: 5900
authorizing a user
You can use OAuth for this.
waiting a user to input some data
Android has a bunch of different input options from EditText to Checkbox to RadioButtons, etc. Look on the Android API and there are plenty of tutorials out there for these things.
sending user input to the server
Instead of sockets I suggest building a RESTful API for your app, you should take a look at DropWizard. It's java based and I found it very easy to use.
scale this project to accommodate hundreds of users
Simple answer: Put everything on Amazons Elastic Cloud, if the server runs out of resources then Amazon will automatically add an extra machine to cope, and remove machines if they're no longer needed.
Upvotes: 1