I am developing an Android app using Parse.com website. In which whatever user sends data that must be received by receiver, but here I have to use REST api. I succeeded to send data to Parse website but now I have to Push that data with the help of REST api only. I am confused with REST api. Help to solve it.
Asked
Active
Viewed 1,622 times
0
-
what problem you are facing in code? Have u tried implementing it – KOTIOS Jun 25 '13 at 05:41
-
actuallu I am not getting how to start with REST api. If you know some tutotrials regarding this then send me the link. – Looking Forward Jun 25 '13 at 05:49
-
There are ways to do it and it is explained in the tutorial page. https://www.parse.com/docs/android_guide – blganesh101 Jun 25 '13 at 05:44
-
but I have to use REST api only. – Looking Forward Jun 25 '13 at 05:51
-
you can find this also in the tutorials check https://www.parse.com/docs/rest – blganesh101 Jun 25 '13 at 05:53
-
I want to ask you that Is it necessary to make JSON webservice?? – Looking Forward Jun 25 '13 at 05:58
-
JSON is much easier and efficient way to deal with. – blganesh101 Jun 25 '13 at 06:15
-
I am asking that is it compulsary to make JSON webservice with REST api??? – Looking Forward Jun 25 '13 at 06:17
-
Yes!! you need to use JSON webservice – blganesh101 Jun 25 '13 at 06:21
-
Ok. But now my question is how can I deal with Parse.com website? Means, my data are on Parse.com website and I want to retrieve them on android device in app using REST api?? – Looking Forward Jun 25 '13 at 06:25
-
ok, use restdroid to set up rest api implementations https://github.com/PCreations/RESTDroid and then use the library to invoke data as given in the examples in this page https://www.parse.com/docs/rest#objects-retrieving – blganesh101 Jun 25 '13 at 06:33
-
I am not getting about your given solution.can you explain?? – Looking Forward Jun 25 '13 at 07:13
1 Answers
0
You can use a library for that. I would suggest this one https://github.com/kodart/Httpzoid It has clean API and type-safe data.
Here is a simple usage example
Http http = HttpFactory.create(context);
http.post("http://example.com/users")
.data(new User("John"))
.execute();
Or more complex with callbacks
Http http = HttpFactory.create(context);
http.post("http://example.com/users")
.data(new User("John"))
.handler(new ResponseHandler<Void>() {
@Override
public void success(Void ignore, HttpResponse response) {
}
@Override
public void error(String message, HttpResponse response) {
}
@Override
public void failure(NetworkError error) {
}
@Override
public void complete() {
}
}).execute();
It is fresh new, but looks very promising.

Arthur
- 674
- 1
- 8
- 14