Algorithm coding

My project is based on PersonalizedTravelPackageWithMulti-Point-of-InterestRecommendation Based on Crowdsourced User Footprints in which I need to code tyhe TRP Algorithm mentioned there using java progg lang for android studio. How to use JSON/Retrofit with Foursquare apis to obtain venue name lat lng  address checkin counts & rating Im using venue category say history the POIs under history should be acquired with the above mentioned details for the following API:,72.994881&query=history&sw=18.912417,72.82397

any help?

I have understood the following from the code.

LatLng (StartPoint)P;//onLongPress Obtain lat lng of location and transmit using Shared Preferences to TRP
// StartTime Ts;EndTime Te;//Obtain time in minutes from custom timepicker1&timepicker2 || TimeUnit
//Minimal Threshold th=0.3;

User u(Adding user preferences)//History//Hospital//Veg||Nonveg
Array poix;

x= Header of OPENSET;//Parent node of OPENSET
       //Remove x from OPENSET not to traverse again.

for(int y=1,i=0;poix[i];;//i++,y++)
y= poix[i+1];

//SimulateTime=x.t+Move(x,y)+Stay(y);//x.t get timestamp of onMapClick ||
      // obtain the time in minutes from time picker 1
     //Move(x,y) obtain traveltime between two geolocations

if( P(x,y)>Threshold && SimulateTime<Te)//TP(u,x,y)=

   (User preference+Location Popularity)*sgn[Te-SimulateTime]/1+[1-Ps(x,y)*log(Dis(x,y)]

//Add point y LatLng to be transmitted in MapsRoute activity (using Shared Preferences)
//Add point y to path tree