private async void ConfirmBooking(object sender, RoutedEventArgs e) { Geolocator locator = new Geolocator(); var position = await locator.GetGeopositionAsync(); CabsAPI api = new CabsAPI(); string token = Windows.Storage.ApplicationData.Current.LocalSettings.Values["Token"].ToString(); BookingDetailsResponse booking = await api.BookCab(token, position.Coordinate.Point.Position.Latitude.ToString(), position.Coordinate.Point.Position.Longitude.ToString()); if (booking.Code == ResponseCode.SUCCESS) { var drivername = booking.BookingData.DriverDetails.Name; var drivercontact = booking.BookingData.DriverDetails.Phone_Number; var driverpic = booking.BookingData.DriverDetails.Picture_Url; var carmake = booking.BookingData.VehicleDetails.Make; var carmodel = booking.BookingData.VehicleDetails.Model; var carnumber = booking.BookingData.VehicleDetails.License_Plate; Dictionary <string, object> Parameters = new Dictionary <string, object>(); Parameters.Add("time", TimeData.Text); Parameters.Add("price", PriceData.Text); Parameters.Add("distance", DistanceData.Text); Parameters.Add("driverName", drivername); Parameters.Add("driverContact", drivercontact); Parameters.Add("driverPic", driverpic); Parameters.Add("carMake", carmake); Parameters.Add("carModel", carmodel); Parameters.Add("carNumber", carnumber); Parameters.Add("source", SrcBox.Text); Parameters.Add("destination", DestBox.Text); Frame.Navigate(typeof(Home.CabBookingDetails), Parameters); } else { await new MessageDialog("Error retrieving Driver Info").ShowAsync(); return; } }
private async Task SendCompletionMessageForBookFromXtoY(string source, string destination) { string gettingCabsFromXtoY = "Getting Details of your " + source + " and " + destination; await ShowProgressScreen(gettingCabsFromXtoY); CabsAPI api = new CabsAPI(); string token = Windows.Storage.ApplicationData.Current.LocalSettings.Values["Token"].ToString(); string loadingCabsFromXtoY = "Loading Details of cabs from " + source + " and " + destination; await ShowProgressScreen(loadingCabsFromXtoY); PlacesResponse sResponse = await api.GetPlaceLocation(source.ToLower(), token); PlacesResponse dResponse = await api.GetPlaceLocation(destination.ToLower(), token); //ReadSpeech(new MediaElement(), sResponse.Location.Latitude + " ok " + dResponse.Location.Longitude); PriceEstimateResponse pRespone = await api.GetEstimate(token, sResponse.Location.Latitude, sResponse.Location.Longitude, dResponse.Location.Latitude, dResponse.Location.Longitude); var userMessage = new VoiceCommandUserMessage(); var cabTiles = new List <VoiceCommandContentTile>(); List <CabEstimate> cabsAvaialble = pRespone.Estimates; CabEstimate cabSelected; if (cabsAvaialble == null) { string foundNoCabs = "Sorry No Cabs Found"; userMessage.DisplayMessage = foundNoCabs; userMessage.SpokenMessage = foundNoCabs; } else { string message = "Ok! I have found the following Cabs for you"; userMessage.DisplayMessage = message; userMessage.SpokenMessage = message; cabSelected = await AvailableList(cabsAvaialble, "Which cab do you want to book?", "Book the selected cab?"); var userPrompt = new VoiceCommandUserMessage(); VoiceCommandResponse response; string BookCabToDestination = "Booking " + cabSelected.Provider + " with " + cabSelected.Type + " from " + source + " to " + destination + " arriving in " + cabSelected.Eta + " with " + cabSelected.CurrentEstimate.LowRange + " to " + cabSelected.CurrentEstimate.HighRange + " cost estimation"; userPrompt.DisplayMessage = userPrompt.SpokenMessage = BookCabToDestination; var userReprompt = new VoiceCommandUserMessage(); string confirmBookCabToDestination = "Confirm booking"; userReprompt.DisplayMessage = userReprompt.SpokenMessage = confirmBookCabToDestination; response = VoiceCommandResponse.CreateResponseForPrompt(userPrompt, userReprompt); var voiceCommandConfirmation = await voiceServiceConnection.RequestConfirmationAsync(response); if (voiceCommandConfirmation != null) { if (voiceCommandConfirmation.Confirmed == true) { string BookingCabToDestination = "Booking cab"; await ShowProgressScreen(BookingCabToDestination); BookingDetailsResponse booking = await api.BookCab(token, sResponse.Location.Latitude, sResponse.Location.Longitude); var userMessage1 = new VoiceCommandUserMessage(); string BookCabInformation = "Cab booked. your cab driver " + booking.BookingData.DriverDetails.Name + "will be arriving shortly."; //Vehicle number :"+ booking.BookingData.VehicleDetails.License_Plate; userMessage.DisplayMessage = userMessage.SpokenMessage = BookCabInformation; var cabShow = new VoiceCommandContentTile(); cabShow.ContentTileType = VoiceCommandContentTileType.TitleWithText; cabShow.Title = cabSelected.Type; cabShow.TextLine1 = "ETA : " + cabSelected.Eta; cabShow.TextLine2 = "Estimated Fare: " + cabSelected.CurrentEstimate.LowRange + "-" + cabSelected.CurrentEstimate.HighRange; cabShow.TextLine3 = "Call driver at " + booking.BookingData.DriverDetails.Phone_Number; cabTiles.Add(cabShow); userMessage1.DisplayMessage = userMessage1.SpokenMessage = BookCabInformation; response = VoiceCommandResponse.CreateResponse(userMessage1, cabTiles); await voiceServiceConnection.ReportSuccessAsync(response); } else { userMessage = new VoiceCommandUserMessage(); string BookingCabToDestination = "Cancelling cab request..."; await ShowProgressScreen(BookingCabToDestination); string keepingTripToDestination = "Cancelled."; userMessage.DisplayMessage = userMessage.SpokenMessage = keepingTripToDestination; response = VoiceCommandResponse.CreateResponse(userMessage); await voiceServiceConnection.ReportSuccessAsync(response); } } } }
private async Task SendCompletionMessageForCostEstimate(string source, string destination) { string slat, slng, dlat, dlng, token, mDisplay; slat = slng = dlng = dlat = null; var mUserMessage = new VoiceCommandUserMessage(); var mUserPrompt = new VoiceCommandUserMessage(); VoiceCommandResponse mResponseError; VoiceCommandContentTile mCabTile = new VoiceCommandContentTile(); CabsAPI mCabsApi = new CabsAPI(); GeoResponse mGeoResp; List <VoiceCommandContentTile> mCabTiles = new List <VoiceCommandContentTile>(); token = Windows.Storage.ApplicationData.Current.LocalSettings.Values["Token"].ToString(); if (destination.Equals("")) { await ShowProgressScreen("Insufficient Info"); mDisplay = "Sorry no destination provided Please enter a valid destination"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); } else { mGeoResp = await mCabsApi.GeoCodingResult(token, destination); if (mGeoResp.Code == ResponseCode.SUCCESS) { dlat = mGeoResp.Position.Latitude; dlng = mGeoResp.Position.Longitude; } else { mDisplay = "Destination not found"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); await voiceServiceConnection.ReportFailureAsync(mResponseError); } } mGeoResp = await mCabsApi.GeoCodingResult(token, source); if (mGeoResp.Code == ResponseCode.SUCCESS) { slat = mGeoResp.Position.Latitude; slng = mGeoResp.Position.Longitude; } else { mDisplay = "Source not found"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); await voiceServiceConnection.ReportFailureAsync(mResponseError); } string EstimatingCabsFromXtoY = "Getting cost Details from " + source + " to " + destination; await ShowProgressScreen(EstimatingCabsFromXtoY); CabsAPI api = new CabsAPI(); string loadingCabsFromXtoY = "Loading Details of cabs from " + source + " to " + destination; await ShowProgressScreen(loadingCabsFromXtoY); GeoResponse sResponse = await api.GeoCodingResult(token, source); GeoResponse dResponse = await api.GeoCodingResult(token, destination); PriceEstimateResponse pResponse = await api.GetEstimate(token, slat, slng, dlat, dlng); var userMessage = new VoiceCommandUserMessage(); var cabTiles = new List <VoiceCommandContentTile>(); List <CabEstimate> cabsAvaialble = pResponse.Estimates; CabEstimate cabSelected; if (cabsAvaialble == null) { string foundNoCabs = "Sorry No Cabs Found"; userMessage.DisplayMessage = foundNoCabs; userMessage.SpokenMessage = foundNoCabs; } else { string message = "Ok! I have found the following Cabs for you"; userMessage.DisplayMessage = message; userMessage.SpokenMessage = message; cabSelected = await AvailableList(cabsAvaialble, "Which cab do you want to book?", "Book the selected cab?"); var userPrompt = new VoiceCommandUserMessage(); VoiceCommandResponse response; string BookCabToDestination = "Booking " + cabSelected.Provider + " with " + cabSelected.Type + " from " + source + " to " + destination + " arriving in " + cabSelected.Eta + " with " + cabSelected.CurrentEstimate.LowRange + " to " + cabSelected.CurrentEstimate.HighRange + " cost estimation"; userPrompt.DisplayMessage = userPrompt.SpokenMessage = BookCabToDestination; var userReprompt = new VoiceCommandUserMessage(); string confirmBookCabToDestination = "Confirm booking"; userReprompt.DisplayMessage = userReprompt.SpokenMessage = confirmBookCabToDestination; response = VoiceCommandResponse.CreateResponseForPrompt(userPrompt, userReprompt, cabTiles); var voiceCommandConfirmation = await voiceServiceConnection.RequestConfirmationAsync(response); if (voiceCommandConfirmation != null) { if (voiceCommandConfirmation.Confirmed == true) { BookingDetailsResponse booking = await api.BookCab(token, sResponse.Position.Latitude, sResponse.Position.Longitude); string BookingCabToDestination = "Booking cab"; await ShowProgressScreen(BookingCabToDestination); var cabShow = new VoiceCommandContentTile(); cabShow.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText; if (cabSelected.Provider.Equals("UBER")) { cabShow.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ContosoCabs.VoiceCommandService/img/uber.png")); } else { cabShow.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ContosoCabs.VoiceCommandService/img/ola.png")); } cabShow.Title = cabSelected.Type; cabShow.TextLine1 = "ETA : " + cabSelected.Eta; cabShow.TextLine2 = "Estimated Fare: " + cabSelected.CurrentEstimate.LowRange + "-" + cabSelected.CurrentEstimate.HighRange; cabShow.TextLine3 = "Call driver at " + booking.BookingData.DriverDetails.Phone_Number; cabTiles.Add(cabShow); var userMessage1 = new VoiceCommandUserMessage(); string BookCabInformation = "Cab booked. your cab driver " + booking.BookingData.DriverDetails.Name + "will be arriving shortly."; //Vehicle number :"+ booking.BookingData.VehicleDetails.License_Plate userMessage.DisplayMessage = userMessage.SpokenMessage = BookCabInformation; userMessage1.DisplayMessage = userMessage1.SpokenMessage = BookCabInformation; response = VoiceCommandResponse.CreateResponse(userMessage1, cabTiles); await voiceServiceConnection.ReportSuccessAsync(response); } else { userMessage = new VoiceCommandUserMessage(); string BookingCabToDestination = "Cancelling cab request..."; await ShowProgressScreen(BookingCabToDestination); string keepingTripToDestination = "Cancelled."; userMessage.DisplayMessage = userMessage.SpokenMessage = keepingTripToDestination; response = VoiceCommandResponse.CreateResponse(userMessage); await voiceServiceConnection.ReportSuccessAsync(response); } } } }
private async Task SendCompletionMessageForBookToCustomLocation(string location) { string slat, dlat, slng, dlng; GeoResponse locationResponse; string gettingCabsToDesiredLocation = "Getting Details of " + location; await ShowProgressScreen(gettingCabsToDesiredLocation); CabsAPI api = new CabsAPI(); string token = Windows.Storage.ApplicationData.Current.LocalSettings.Values["Token"].ToString(); string loadingCabsToDesiredLocation = "Loading Details of cabs to " + location; await ShowProgressScreen(loadingCabsToDesiredLocation); Geolocator locator = new Geolocator(); var userMessage1 = new VoiceCommandUserMessage(); locator.DesiredAccuracyInMeters = 50; var position = await locator.GetGeopositionAsync(); slat = position.Coordinate.Point.Position.Latitude.ToString(); slng = position.Coordinate.Point.Position.Longitude.ToString(); string latlng1 = slat + "," + slng; ReverseGeoResposne reverse = await api.GetReverseCodingResultlatlng(token, latlng1); locationResponse = await api.GeoCodingResult(token, location); dlat = locationResponse.Position.Latitude; dlng = locationResponse.Position.Longitude; PriceEstimateResponse Responseprice = await api.GetEstimate(token, slat, slng, dlat, dlng); List <CabEstimate> desiredList = Responseprice.Estimates; var sortedCabs = desiredList.OrderBy(o => o.CurrentEstimate.HighRange); var userMessage = new VoiceCommandUserMessage(); var cabTiles = new List <VoiceCommandContentTile>(); if (desiredList == null) { string foundNoCabs = "Sorry No Cabs Found"; userMessage.DisplayMessage = foundNoCabs; userMessage.SpokenMessage = foundNoCabs; } else { string message = "Ok! I have found the Best Cab for you"; userMessage.DisplayMessage = message; userMessage.SpokenMessage = message; var cabsNeeded = desiredList[0]; var cabShow = new VoiceCommandContentTile(); cabShow.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText; if (cabsNeeded.Provider.Equals("UBER")) { cabShow.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ContosoCabs.VoiceCommandService/img/uber.png")); } else { cabShow.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ContosoCabs.VoiceCommandService/img/ola.png")); } cabShow.AppContext = cabsNeeded; cabShow.Title = cabsNeeded.Provider; cabShow.TextLine1 = cabsNeeded.Type; cabShow.TextLine2 = "ETA : " + cabsNeeded.Eta; cabShow.TextLine3 = "Estimated Fare: " + cabsNeeded.CurrentEstimate.LowRange + "-" + cabsNeeded.CurrentEstimate.HighRange; cabTiles.Add(cabShow); var userPrompt = new VoiceCommandUserMessage(); VoiceCommandResponse response1; string source; try { source = reverse.FormattedAddress.Substring(0, reverse.FormattedAddress.IndexOf(", Hyderabad")); } catch { source = reverse.FormattedAddress; } string BookCabToDestination = "Booking " + cabsNeeded.Provider + " with " + cabsNeeded.Type + " from " + source + " to " + location + " arriving in " + cabsNeeded.Eta + cabsNeeded.CurrentEstimate.LowRange + " to " + cabsNeeded.CurrentEstimate.HighRange + " cost estimation"; userPrompt.DisplayMessage = userPrompt.SpokenMessage = BookCabToDestination; var userReprompt = new VoiceCommandUserMessage(); string confirmBookCabToDestination = "confirm booking"; userReprompt.DisplayMessage = userReprompt.SpokenMessage = confirmBookCabToDestination; response1 = VoiceCommandResponse.CreateResponseForPrompt(userPrompt, userReprompt, cabTiles); var voiceCommandConfirmation = await voiceServiceConnection.RequestConfirmationAsync(response1); if (voiceCommandConfirmation != null) { if (voiceCommandConfirmation.Confirmed == true) { BookingDetailsResponse booking = await api.BookCab(token, slat, slng); string BookCabInformation = "Cab booked. your cab driver " + booking.BookingData.DriverDetails.Name + " will be arriving shortly."; userMessage1 = new VoiceCommandUserMessage(); //userPrompt.DisplayMessage = userPrompt.SpokenMessage = BookCabInformation; userMessage.DisplayMessage = userMessage.SpokenMessage = BookCabInformation; userMessage1.DisplayMessage = userMessage1.SpokenMessage = BookCabInformation; var response = VoiceCommandResponse.CreateResponse(userMessage1, cabTiles); await voiceServiceConnection.ReportSuccessAsync(response); } else { userMessage = new VoiceCommandUserMessage(); string BookingCabToDestination = "Cancelling cab request..."; await ShowProgressScreen(BookingCabToDestination); string keepingTripToDestination = "Cancelled."; userMessage.DisplayMessage = userMessage.SpokenMessage = keepingTripToDestination; response1 = VoiceCommandResponse.CreateResponse(userMessage); await voiceServiceConnection.ReportSuccessAsync(response1); } } } }
private async Task SendCompletionMessageForBookCheapestFromXtoY(string mSource, string mDest) { string slat, slng, dlat, dlng, token, mDisplay; slat = slng = dlng = dlat = null; var mUserMessage = new VoiceCommandUserMessage(); var mUserPrompt = new VoiceCommandUserMessage(); VoiceCommandResponse mResponseError, mResponseSuccess, mResponseUserPrompt; VoiceCommandContentTile mCabTile = new VoiceCommandContentTile(); CabsAPI mCabsApi = new CabsAPI(); GeoResponse mGeoResp; Geolocator mLocator; ReverseGeoResposne mRevGeoResp; PriceEstimateResponse mPriceEstResp; BookingDetailsResponse mBookingDetailsResp; CabEstimate mCabToDisplay; List <CabEstimate> mCabEstimate; List <VoiceCommandContentTile> mCabTiles = new List <VoiceCommandContentTile>(); token = Windows.Storage.ApplicationData.Current.LocalSettings.Values["Token"].ToString(); if (mDest.Equals("")) { await ShowProgressScreen("Insufficient Info"); mDisplay = "Sorry no destination provided Please enter a valid destination"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); } else { mGeoResp = await mCabsApi.GeoCodingResult(token, mDest); if (mGeoResp.Code == ResponseCode.SUCCESS) { dlat = mGeoResp.Position.Latitude; dlng = mGeoResp.Position.Longitude; } else { mDisplay = "Plese enter proper Destination"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); await voiceServiceConnection.ReportFailureAsync(mResponseError); } } if (mSource.Equals("")) { mLocator = new Geolocator(); mLocator.DesiredAccuracyInMeters = 50; var mPosition = await mLocator.GetGeopositionAsync(); slat = mPosition.Coordinate.Point.Position.Latitude.ToString(); slng = mPosition.Coordinate.Point.Position.Longitude.ToString(); mRevGeoResp = await mCabsApi.GetReverseCodingResultlatlng(token, slat + "," + slng); if (mRevGeoResp.Code == ResponseCode.SUCCESS) { try { mSource = mRevGeoResp.FormattedAddress.Substring(0, mRevGeoResp.FormattedAddress.IndexOf(", Hyderabad")); } catch { mSource = mRevGeoResp.FormattedAddress; } } else { mDisplay = "Source not found with current location"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); await voiceServiceConnection.ReportFailureAsync(mResponseError); } } else { mGeoResp = await mCabsApi.GeoCodingResult(token, mSource); if (mGeoResp.Code == ResponseCode.SUCCESS) { slat = mGeoResp.Position.Latitude; slng = mGeoResp.Position.Longitude; } else { mDisplay = "Source not found"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); await voiceServiceConnection.ReportFailureAsync(mResponseError); } } if (slat != "" && slng != "" && dlat != "" && dlng != "") { mDisplay = "Looking for best cab providers from " + mSource.ToUpperInvariant() + " to " + mDest.ToUpperInvariant(); await ShowProgressScreen(mDisplay); mDisplay = "Booking cheapest cab from " + mSource.ToUpperInvariant() + " to " + mDest.ToUpperInvariant(); await ShowProgressScreen(mDisplay); mPriceEstResp = await mCabsApi.GetEstimate(token, slat, slng, dlat, dlng); if (mPriceEstResp.Code == ResponseCode.SUCCESS) { mCabEstimate = mPriceEstResp.Estimates; if (mCabEstimate.Count != 0) { string mDisplay1 = "Ok I have found the cheapest cab for you. Shall i book it?"; mUserPrompt.DisplayMessage = mUserPrompt.SpokenMessage = mDisplay1; mDisplay = "Shall i book it"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mCabTile.ContentTileType = VoiceCommandContentTileType.TitleWith68x68IconAndText; mCabToDisplay = mCabEstimate[0]; if (mCabToDisplay.Provider.Equals("UBER")) { mCabTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ContosoCabs.VoiceCommandService/img/uber.png")); } else { mCabTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///ContosoCabs.VoiceCommandService/img/ola.png")); } mCabTile.Title = mCabToDisplay.Provider; mCabTile.TextLine1 = "Type : " + mCabToDisplay.Type; mCabTile.TextLine2 = "ETA : " + mCabToDisplay.Eta; mCabTile.TextLine3 = "Estimated Fare : " + mCabToDisplay.CurrentEstimate.LowRange + "-" + mCabToDisplay.CurrentEstimate.HighRange; mCabTiles.Add(mCabTile); mResponseUserPrompt = VoiceCommandResponse.CreateResponseForPrompt(mUserPrompt, mUserMessage, mCabTiles); var voiceCommandConfirmation = await voiceServiceConnection.RequestConfirmationAsync(mResponseUserPrompt); if (voiceCommandConfirmation.Confirmed) { mBookingDetailsResp = await mCabsApi.BookCab(token, slat, slng); mDisplay = "Successfully booked." + mCabToDisplay.Type + " Your cab driver " + mBookingDetailsResp.BookingData.DriverDetails.Name + " will be arriving in " + mCabToDisplay.Eta; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseSuccess = VoiceCommandResponse.CreateResponse(mUserMessage, mCabTiles); await voiceServiceConnection.ReportSuccessAsync(mResponseSuccess); } else { var userMessage = new VoiceCommandUserMessage(); string BookingCabToDestination = "Cancelling cab request..."; await ShowProgressScreen(BookingCabToDestination); string keepingTripToDestination = "Cancelled."; userMessage.DisplayMessage = userMessage.SpokenMessage = keepingTripToDestination; var response1 = VoiceCommandResponse.CreateResponse(userMessage); await voiceServiceConnection.ReportSuccessAsync(response1); } } else { mDisplay = "Sorry there are no cabs available right now"; mUserMessage.DisplayMessage = mUserMessage.SpokenMessage = mDisplay; mResponseError = VoiceCommandResponse.CreateResponse(mUserMessage); await voiceServiceConnection.ReportFailureAsync(mResponseError); } } } }
protected override async void OnCreate(Bundle savedInstanceState) { if (!isOnline()) { mErrorDialog.Show(); } else { for (int i = 0; i < 2; i++) { mOptions[i] = new MarkerOptions(); } base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_confirmed_booking); Drawable upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha); upArrow.SetColorFilter(Resources.GetColor(Resource.Color.white), PorterDuff.Mode.SrcAtop); etaval = Intent.GetStringExtra("eta"); high = Intent.GetStringExtra("high"); low = Intent.GetStringExtra("low"); time = Intent.GetStringExtra("time"); sourcestring = Intent.GetStringExtra("source"); type = Intent.GetStringExtra("type"); deststring = Intent.GetStringExtra("destination"); provider = Intent.GetStringExtra("provider"); capacity = Intent.GetStringExtra("capacity"); distance = Intent.GetStringExtra("distance"); fare = Intent.GetStringExtra("fare"); mSharedPreferences = GetSharedPreferences(Constants.MY_PREF, 0); SupportActionBar.SetHomeAsUpIndicator(upArrow); SupportActionBar.SetDisplayHomeAsUpEnabled(true); token = mSharedPreferences.GetString("token", " "); mLoadingDialog = new LoadingDialog(this, Resource.Drawable.main); mLoadingDialog.SetCancelable(false); Window window = mLoadingDialog.Window; window.SetLayout(WindowManagerLayoutParams.MatchParent, WindowManagerLayoutParams.MatchParent); window.SetBackgroundDrawable(new ColorDrawable(Resources.GetColor(Resource.Color.trans))); SpannableString s = new SpannableString("Successfully Booked"); typeface = Typeface.CreateFromAsset(this.Assets, "JosefinSans-SemiBold.ttf"); s.SetSpan(new TypefaceSpan("Amaranth-Regular.ttf"), 0, s.Length(), SpanTypes.ExclusiveExclusive); s.SetSpan(new ForegroundColorSpan(this.Resources.GetColor(Resource.Color.title)), 0, s.Length(), SpanTypes.ExclusiveExclusive); this.TitleFormatted = s; mSource = FindViewById <TextView>(Resource.Id.sourcetext); mDest = FindViewById <TextView>(Resource.Id.destinationtext); eta = FindViewById <TextView>(Resource.Id.eta); dist = FindViewById <TextView>(Resource.Id.dist); price = FindViewById <TextView>(Resource.Id.price); etatext = FindViewById <TextView>(Resource.Id.etavalue); disttext = FindViewById <TextView>(Resource.Id.distvalue); pricetext = FindViewById <TextView>(Resource.Id.pricevalue); drivertext = FindViewById <TextView>(Resource.Id.drivername); cartype = FindViewById <TextView>(Resource.Id.cartype); carnumber = FindViewById <TextView>(Resource.Id.carnumber); mProvider = FindViewById <ImageView>(Resource.Id.cabprovider); mDriver = FindViewById <ImageView>(Resource.Id.driverimage); mPhone = FindViewById <ImageView>(Resource.Id.phoneimage); mPhone.SetOnClickListener(this); mSource.SetTypeface(typeface, TypefaceStyle.Normal); mDest.SetTypeface(typeface, TypefaceStyle.Normal); eta.SetTypeface(typeface, TypefaceStyle.Normal); etatext.SetTypeface(typeface, TypefaceStyle.Normal); price.SetTypeface(typeface, TypefaceStyle.Normal); pricetext.SetTypeface(typeface, TypefaceStyle.Normal); dist.SetTypeface(typeface, TypefaceStyle.Normal); disttext.SetTypeface(typeface, TypefaceStyle.Normal); drivertext.SetTypeface(typeface, TypefaceStyle.Normal); cartype.SetTypeface(typeface, TypefaceStyle.Normal); carnumber.SetTypeface(typeface, TypefaceStyle.Normal); mSource.Text = sourcestring.ToUpperInvariant(); mDest.Text = deststring.ToUpperInvariant(); etatext.Text = etaval; disttext.Text = distance; pricetext.Text = low + "-" + high; if (provider.Equals("Uber", StringComparison.InvariantCultureIgnoreCase)) { mProvider.SetImageResource(Resource.Drawable.uber); } else { mProvider.SetImageResource(Resource.Drawable.ola); } mcab = new CabsAPI(); mLoadingDialog.Show(); GeoResponse mResponse1 = await mcab.GeoCodingResult(token, sourcestring); GeoResponse mResponse2 = await mcab.GeoCodingResult(token, deststring); if (mResponse1.Code == ResponseCode.SUCCESS && mResponse2.Code == ResponseCode.SUCCESS) { slat = mResponse1.Position.Latitude.ToString(); slng = mResponse1.Position.Longitude.ToString(); dlat = mResponse2.Position.Latitude.ToString(); dlng = mResponse2.Position.Longitude.ToString(); BookingDetailsResponse mResBooking = await mcab.BookCab(token, slat, slng); if (mResBooking.Code == ResponseCode.SUCCESS) { mLoadingDialog.Dismiss(); if (provider.Equals("Uber", StringComparison.InvariantCultureIgnoreCase)) { drivertext.Text = mResBooking.BookingData.DriverDetails.Name; cartype.Text = mResBooking.BookingData.VehicleDetails.Make + " " + mResBooking.BookingData.VehicleDetails.Model; carnumber.Text = mResBooking.BookingData.VehicleDetails.License_Plate; ImageLoader.Instance.DisplayImage(mResBooking.BookingData.DriverDetails.Picture_Url, mDriver); phonenumner = mResBooking.BookingData.DriverDetails.Phone_Number; } else { phonenumner = "8110020055"; } } else { } } sourcepos = new LatLng(Convert.ToDouble(slat), Convert.ToDouble(slng)); destpos = new LatLng(Convert.ToDouble(dlat), Convert.ToDouble(dlng)); setupGoogleMap(); } }