示例#1
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Display);

            MojioClient client = Globals.client;

            client.PageSize = 15; //Gets 15 results
            MojioResponse <Results <Trip> > response = await client.GetAsync <Trip> ();

            Results <Trip> result = response.Data;

            var    results      = FindViewById <TextView> (Resource.Id.tripResults);
            int    tripIndex    = 1;
            String outputString = "";

            // Iterate over each trip
            foreach (Trip trip in result.Data)
            {
                outputString += string.Format("Trip {0}:", tripIndex) + System.Environment.NewLine + "Start time: " + trip.StartTime.ToString()
                                + System.Environment.NewLine + "End time: " + trip.EndTime.ToString() + System.Environment.NewLine + "Longitude: "
                                + trip.EndLocation.Lng.ToString() + System.Environment.NewLine + "Latitude: " + trip.EndLocation.Lat.ToString()
                                + System.Environment.NewLine + "Max Speed: " + trip.MaxSpeed.Value.ToString() + " km/h"
                                + System.Environment.NewLine + System.Environment.NewLine;
                tripIndex++;
            }
            results.Text = outputString;
        }
        private static List <Mojio.Mojio> GetAllClaimdMojio(MojioClient client)
        {
            // Get all the Mojios under the currented logged on user
            var mojiosResponse = client.GetAsync <Mojio.Mojio>();
            var result         = mojiosResponse.Result;
            var data           = result.Data;
            var mojios         = data.Data;

            // Store all the Mojios
            return(new List <Mojio.Mojio>(mojios));
        }