• 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:

Android app connecting to a server in a client/server capacity?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this idea for an app that would require connecting to a server and then downloading a text file (comma delimited). The idea is to have a central server that the app on an android phone can connect to. When it connects, a list of all the text files on the server would come up to choose from. When the android user selects a file, it automatically downloads to the android phone. So the app in question would need to connect to the server, see the list of text files on the server, display the list to the user in presentable fashion, download a specific file chosen by the user, and then finally pull the contents of the file into the app. Also, there would be the ability for individual users to upload additional comma delimited text files. The idea is that any random user of this app would be able to connect to that same server and see the same list. Would something like this be possible? And if so, is there a free way of doing this or would this take renting out server space? I haven't the first clue how something like this would work and would appreciate any helpful advice. Thanks!
 
Rancher
Posts: 43076
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not only is this possible, but it seems very standard fare for a mobile app. But yes, you would need to buy server space. It's possible you might find free server space somewhere, but you'd have to ask yourself whether you could rely on it to be available for the lifetime of the mobile app.
 
Sam Lanza
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Not only is this possible, but it seems very standard fare for a mobile app. But yes, you would need to buy server space. It's possible you might find free server space somewhere, but you'd have to ask yourself whether you could rely on it to be available for the lifetime of the mobile app.



Any advice on a book or website detailing this process? I'd appreciate it.
 
Sam Lanza
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, can you build a Java Server that talks to Android and iphone apps? I'd like to build something where 5 different people with android and iphone phones can be tied together by a Java Server.
 
Ulf Dittmer
Rancher
Posts: 43076
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know that you'd need a book or anything - wouldn't HTTP communication be sufficient? Select a Java hosting company (like one of the ones listed in the ServletsFaq), and write a Java web app using servlets and JSP to handle all the traffic.
 
Sam Lanza
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I don't know that you'd need a book or anything - wouldn't HTTP communication be sufficient? Select a Java hosting company (like one of the ones listed in the ServletsFaq), and write a Java web app using servlets and JSP to handle all the traffic.



This is all very helpful. I appreciate the sage advice.

One last question: From what I understand of web applications, they run on the server and act as the server portion of the client/server architecture. The web applications serve web pages to the client (the browser). This works perfectly well with desktop and laptop computers. Does the concept work the same for iphones, androids, and tablets? Do they essentially get served web pages from the web application like desktop/laptop computers? If I had to guess, your app would have to somehow use the browser in the smart phone/tablet to display the pages served up by the web application. Thanks.
 
Ulf Dittmer
Rancher
Posts: 43076
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Do they essentially get served web pages from the web application like desktop/laptop computers? If I had to guess, your app would have to somehow use the browser in the smart phone/tablet to display the pages served up by the web application.


You could write a mobile web site that displays well on small screens -so that folks could use the browsers on their mobile devices to access it-, but for an app you'd generally create web services (possibly implemented using REST and JSON via a library like Jersey), since the UI would be supplied by the mobile app. The app might use the HttpClient library that's part of Android to access those services.

You could also create a "hybrid" app that embeds the Android-native browser component in your app, thus allowing you to do special things with your web app being displayed within the mobile app. (And you could use other web services provided by the web app on top of that.) The Android class to use in this case is android.webkit.WebView; see http://developer.android.com/guide/webapps/index.html for more details.
 
Won't you be my neighbor? - Fred Rogers. 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