• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The right way to connect an android app to a server?

 
Ahmad Auada
Ranch Hand
Posts: 56
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been going through a php course for a few days but I'm starting to worry if this is the right thing to learn.
I saw a tutorial where a guy made a login app, that uses some php script that was uploaded on a mysql server. The app connects to the server with the help of volley and it all works fine, but is this the official way of doing things?
I want to enable my app to connect to a server and download pdf files, music files, videos, in addition to text.
Should I continue with the php course, or is there a way to connect to a server using just java? Maybe there is some sort of library?
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no one "right" way. As a rule, anything that runs over HTTP works better, since other protocols such as JMS may use ports which are blocked by one or more firewalls between client and server.

On the Android side, you can always use the java.net classes as implemented for Android - the entire set of methods and services provided by desktop Java may not be there, but the Android JavaDocs will tell you what is available (and on what version of Android). I think you'll find most of the http client functions available, so you won't have to do brute-force network programming just to submit ReST requests or whatever.

On the server side, you can use anything that pleases you. J2EE, nodeJS, PHP, Python/django, even .Net.
 
Sumanth Jois
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Volley is considered to be one of the best way to talk to your server. It doesn't matter what you are using on the server side, I personally think Volley and php are the best in your case as you want to download files etc from server. Volley is faster then any other Http clients.
 
Ahmad Auada
Ranch Hand
Posts: 56
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing your ideas! =)
 
Giovanni Montano
Ranch Hand
Posts: 246
4
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmad Auada wrote:I've been going through a php course for a few days but I'm starting to worry if this is the right thing to learn.
I saw a tutorial where a guy made a login app, that uses some php script that was uploaded on a mysql server. The app connects to the server with the help of volley and it all works fine, but is this the official way of doing things?
I want to enable my app to connect to a server and download pdf files, music files, videos, in addition to text.
Should I continue with the php course, or is there a way to connect to a server using just java? Maybe there is some sort of library?


you may have a look at REST.

You can use Java. The protocol preferred to communicate is JSON and PHP and NODE.js are really used on the mobile backend side.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic