• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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

 
Ranch Hand
Posts: 56
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Saloon Keeper
Posts: 26719
189
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing your ideas! =)
 
Ranch Hand
Posts: 600
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic