2

I have spent way too much time just trying to figure out how to use a restful API. There is a lot of information online on how to use the service after it has been implemented but very little in terms of how to actually start to use the services.

I may be thinking way too hard about this.

Basically, I want to create an Android application that uses an online server to store all of its data. This data will be shared by many other users of the same application.

This is for a school project, but the intent of the class is software engineering with UML and Z specifications. The implementation of the actual Android application is just showing how this planning helps create software with less complications.

Well we are now trying to develop this application and cannot get connected with a data source. I have been trying to use Restlet Studio to create the server and android rest implementations.

Restlet Studio creates a AndroidSDK.zip and a restletServerSkeleton.zip.

I am thinking that I´ve to install the server part on my server with maven and include the android part in my application, but cannot figure out how this is done. I don't even know if I am looking at it right.

Once it is installed on both, then how is the whole thing implemented?

I am not looking for someone to answer all my questions, but more to give me links to a good example of an actual implementation of this type of setup.

A basic idea of what I need to do would be appreciated too.

Even guiding me to another Restful service that might provide a clearer concept of what I need to do, would be great.

I am running out of time... less than five days until due.

Thanks for any help with this.

SUB

reixa
  • 6,903
  • 6
  • 49
  • 68
subcan
  • 2,021
  • 2
  • 18
  • 21
  • 5 days is not that long. My approach would be Jersey for the webservice and on Android I would use Volley to handle the communication. For sending objects over network I would use the JSON format. May have a look at those while waiting for better suggestions, can't tell If I would do this in 5 days not knowing more details. http://www.nilzorblog.com/2014/06/building-solid-json-rest-client-in.html – sschrass Jun 04 '15 at 09:11

2 Answers2

0

I haven't used Restlet Studio before,so I checked its website ,it seems like that the Restlet Studio provides you two SDKs,one for android client,the other one for your server.

No matter you use this sdks or not,here's what you have to do :

Set up database on your server,create tables,insert original data if you need;

Write codes to build api on your server; this part do the following things: 1 get parameters from http request send by android client; 2 query database with sql,get the right result for the request; 3 put the result in a JSON String; 4 put the JSON String into the http response ,and send it back to android client;

The android client: 1 build the UI; 2 When user take an action ,for example,in your case,press a button to get inductions to "UML" ,send http request to server; 3 get http response(JSON String,witch contains the introductions to UML); 4 parse the JSON String to what you need(generally java objects); 5 display the introductions on the screen;

The Restlet Studio SDK may help you do some parts above.

Ai Hao
  • 102
  • 5
0

this tutorial shows a complete sample code for a Restlet API deployed on Google App Engine, and an Android client: http://restlet.com/technical-resources/restlet-framework/guide/2.3/introduction/first-steps/first-application

Your Android project is linked to the backend by the URI, and by the annotated interfaces and shared beans. The Server part may be hosted where you want: Google App Engine, or just as standalone Restlet application. At least the Web server need to be reachable from the Android device.

user229044
  • 232,980
  • 40
  • 330
  • 338
Thierry Boileau
  • 866
  • 5
  • 8
  • Thanks Thierry and meagar. I have read this guide, but just cannot wrap my mind around what I am supposed to install on my VPS server and what is installed in my Android app. I have done my project using HttpURLConnection and parsed the json response from my server. This has worked but is a lot of work. From what I have read, the Restful services out there cut all the back-end work down so a developer can just focus on writing the app. – subcan Jun 09 '15 at 08:04