It's described in the following link how to setup the project:
First you have to start the cassandra
https://github.com/MiraLak/accelerometer-rest-to-cassandra#start-cassandra
Then you start the application
https://github.com/MiraLak/accelerometer-rest-to-cassandra#start-the-application
Then try if this all works:
https://github.com/MiraLak/accelerometer-rest-to-cassandra#use-the-api
If you are having trouble making the requests, try some app like
https://www.getpostman.com/ It makes it very easy to send the requests to your application that you just started if you followed the above links.
After you tried out sending in the requests and that you verified that it all works on localhost you have to find your local ip address.
I guess your phone will be on the same net (or even wireless) so you have to find out your local ip of your computer ... I guess this link will do:
https://www.google.com/?q=how+to+find+my+local+ip
Once you find your local ip you have to update the URLs
In your REST API requests, change the localhost part with the ip address that you've found i.e. :
/POST http://localhost:8080/activity/acceleration
will become (If your local computer address is 192.168.1.1
)
/POST http://192.168.1.1:8080/activity/acceleration
I think this should do it, comment if you are stuck somewhere.
Also note that port 8080 might not be allowed on your local network or even at pc's firewall. So this might not work right away. You would have to google a bit on how to open a certain port on your pc.
The best would be to open a browser on your phone and just type in the url:
http://localhost:8080/activity/acceleration
(don't forget to exchange localhost with your local ip address)
Should this work you are all set.
If by any chance you are using the emulator then this answer might help:
Accessing localhost:port from Android emulator