0

Me and my team is trying to make an android app which is about people leaving reviews.

We are now trying to implement the 'Like' and 'Dislike' button, however, weren't able to find the way to do this.

Is there a way to make these buttons to communicate with the server? We would like to know if there is a way to block duplicate 'like' or 'dislike' clicks.

2 Answers 2

0

You could do so by having a local DB in which you'll save the reveiws the user liked and the distant Id, so anytime you loads the review or anything related to it, and you need to know the "liking" state, you just need to call your local DB with the Id of the article in the where close, and so you'll know if the article has been liked or not. Also for double security, you'll need to save that state too on the distant server, in case the user clear the application cache on his phone. then you'll just have to check if the user liked/disliked it or not Already.

Note that you don't "need" it on the device, but if you do so, you'll avoid some network calls to webservices just to know the state. You could also just direcly ask a webservice which would send you if the user liked already or not.

0

You can always use the block.js which is a jquery code library that blocks div, span etc.
for example:

var div = $("#myDIv");
div.block();

you can also use

div.unblock();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.