Setting Pickup Location and Destination Seperately

Ufinix Academy
A free video tutorial from Ufinix Academy
Learn programming and app development
4.3 instructor rating • 4 courses • 4,844 students

Learn more from the full course

Xamarin Android Uber Clone App with C# and Firebase

Learn advanced Xamarin Android concepts by building a fully complete and functional Uber Clone app using Firebase

15:26:55 of on-demand video • Updated July 2020

  • Learn to build complete Uber Clone apps (driver and passenger) with C#, Xamarin and Firebase
  • Learn to create, remove, update and delete records in Firebase Database
  • Save and handle data locally using Shared Preferences
  • Learn how to use Google Location and Map services in your Apps
  • Learn to find direction from one point to the other with Google Direction Api
  • Learn to find place address with Location Coordinates using Google Geocoding API
  • Learn advanced usage of C# Lambda Expressions
  • Learn advanced usage and creation of custom C# Event handlers
  • Learn to create and design beautiful User Interfaces
  • Understand how to create Local Notifications using Android Notification Manager
  • Learn to make asynchronous WebCallls using Rest Api
  • Learn to initiate a phone call from your app using Native Intents
English [Auto] So guys walk onto this class in our last lines we learned how to find a place address using their location coordinates so we in such a way that we will move the map we get a new point in your last year in order to coordinate and we use it to get an address of that particular place and updated. So for most to this points we'll update you and get the police address of this so which really comes in handy by disposition you challenge. Well we will we use our search so everything just scatters right so it doesn't really help us in any way. So we need to make it in such a way that we can select to set our big obligation and we can select to set our destination. OK. So that is where we are going to be doing this class. All right. So without much ado let's get right into it. So the first thing we need to do is to get the reference of our radio buttons OK and to do that we want to define a new radio button and radio button because the radio OK so let's go ahead and reference the radio buttons. OK so we'll go to our connected use function or connect control function rather so I'm going to say pick up radio I want to radio button signed you by Andy Bob speak of radio so let's do the same thing for our destination radio so now we are done with this we need to set up event handler click event handler so I pick up radio on Destination RADIO OK so to do that you're going to save people peak of radio clique here so as it is same for Destination radio so into so when we keep our pick of Radio wants to do the following OK in say peak of radio I checked what's a true destination radio to checked we're going to force all right. So let's go ahead and do the same for our destination radio. So now we're done with this. So to be able to achieve a situation whereby we click or disappoint it should be set in our police address as our pickup location where we take our destination and review it should be set in our new address to our destination point to be able to do this we need some kind of separation some kind of flag. All right so we need to send some flag so you can actually use a boolean or an integral value to define flags. But for the case of this class I need to go was tomorrow. OK. So we get to go up. So let's go ahead and set some flags on the flag. I'm going to send is St. address request whenever this address request is one we assume that we as Jimmy so whenever our so whatever our address request is one when I take it that's one to send our application. And when they address requests as to wanting to be there we're trying to set our destination point so we will actually be switching the address required for a one to two whenever we kick back of radio button and the destination review button. Okay so let's go back to pick up ready to click arena said the address. We can always say the address requires to be able to one at this point but we all know that when we log into the app one wants to set festival is peak application. So here we're gonna say address request a call to 2. OK so now that we've done setting this address request we need to go to our camera. I do an event handler and we need to implement that down. OK. So we can say if I just request a call to 1 then that as well is a queue. This. So else if and just request a quarter to this is where we set for our destination point. But we need to set this up fast. We need to define this right. So let's just go right up and define that this nation. OK. Let's go back to our camera. I do sorry guys for the movement. So we're going to say destination lunch. What's the main map. Camera position on target. So now the next thing we need to do we're going to say destination test the test a quote to a weight map helper don't define coordinate address and we're going to pass it. Destination launch. All right. So this would solve the problem. Well this is not the only problem that we need to solve. We need to solve the fact that when we search for a place using the place site to complete it will move the map and it cause some disruptions as well. So for instance let's say we'll put this space so we can see that the place actually produces own results and the map I do of event and we produce another result as well which actually dad is saying but we need to stop that. Okay. So where are we in taking address for map. I do come in. I do want that to be and when we are taking from place such or the complete one that to be as well. Right. So to do that we need to set up a new flag. Right this time around. We'll call it we'll go to our section where we are defined in our flags. So we're going to define a new one. All right. So this camera is going to be a boolean value when I call it. Take address from such okay and this is actually going to be force by default because when you don't want to take address from such when we log into the wanting to be of ACT our our camera I do we find the event that gets our address for us. So now pick up for a deal. We're going to need to set we take address from Satch to force a tick address from such a report to force. Going to do the same for our destination radio button take address from science to be a to force so let's go to where we did our setup for police search to complete to make some edits there. All right. So in this place we're going to do some things OK we're going to say take address from such you're gonna say this is true OK we need to uncheck our pick of radio pick of radio into on checking and came in our destination and we do need to uncheck it as well okay. So getting copy this code and putting in this place. So this would actually do the magic for us. OK. So that will suffice for now. So the next thing we need to do will be to set up a different caller is caller futile for our center market. Well we have sets in our destination one day that had to be red. And let me go back to send our our peak application when the market to be green. OK. So we need to get a reference of our center America. Right. So to do that we're gonna go to tall and define a new image view. OK. And I'm gonna say he means you Malka K. writes All I need to get a reference of I sense a marker. So let's go to our connect controllers function so we're gonna say Senator Marco the quote to Senator McCain. OK so now that we have that. So when we click on pick up radio once the college always change to GREENE OK. So I'm going to say Senator Santa Monica dot sets goal of you to so I'm going to say Connor we need to get a reference of the Cole class in Engineering graphics. I'm going to say call on dot dark green and just go ahead and use that green. OK so this is always a deed to call and the next one. It said this too red. OK. So at this point when I started to read OK so I haven't read it. So that in who wants to do this is in a set of four plus stature to complete. OK so again incentives to green as well and these would be to read some guys that's all we need to do. So before we go on testing or app let's just go through our code and ensure that everything checks out well. OK so everything seems fine here. We need to go to our camera. I do event handler so at this point we need to check the flag that says Take address from such. So it is only when take address or such is a quarter horse and that is when will we will we actually get a function. We are trying to get a method that will help us get our coordinate address. OK so to do that we're going to say if not take address from such. So it is the beauty of using flags. OK. We're going to include this. This particular code block you know if statement OK in this way everything is set OK so let's go ahead and see verify or this stuff's OK. Everything seems normal I'm fine. So let's go ahead and run an app and show that everything checks out well ban so everything seems to be working well came good. So let's set our destination works well walks x1. So our address is being faced just the way we expect it. OK head back here as you can see the color of our map I just changed right. So let's try to use autocomplete such and see what happens as you can see that you can see the address has been sent and nothing is affected everything still remains normal. So guys this is how straightforward it is to combine these two together. All right. And I really hope you enjoyed the class. So guys see you in the next class.