In the last tutorial, we created a google maps app which is showing a fixed location near nigeria. In this part, I will show you how to show your current location and you will also learn how to search for a particular address or place. #android #androiddev #developer #googlemaps #maps #learn #tutorial
Yes, I will make more Google Map tutorials after I complete my current MySQL + PHP series. A lot of people have requested me to do more tutorials on Google Maps. So I will surely do it.
Tech Academy Mam your tutorials are so good. please dont ever stop these. And also provide easy way of json parsing in list view (custom and general), text view, etc. Also bottom tab bar(options like-home,music,videos,events,more with icons) in which for each selection of icon ,the content should be display on top. refer this(www.telerik.com/clientsfiles/415597_tabstrip-issue.jpg?sfvrsn=0).
+Tech Academy hello! my app can't find the current location in my emulator although i have installed all the packages which is required by the emulator and it works perfectly fine, it does show the map but not the current location and even to try it more i installed the app in my phone and it still doesn't work. i have followed each step of yours kindly tell me the solution.
ty mam.. your first video on google map helped me complete my sample map and here am i again watching your tutorials. They are so easy and amazing. You are great, ty again :)
Hi! I'm trying to follow your tutorials but most of the code is now deprecated. May you please give me an alternative to mMap.setMyLocationEnabled(true); ? As I am getting this error: call requires permissions that may be rejected by the user
Thank you so much It is useful for me. Excuse me, How can I show all list about where I want to know when I'm typing lectures in TextView? After that I will choose one that isn't at get(0). Thanks again. Tam
I implemented the code exactly as you said. But when I enter a location in the text and press search the application is closing saying unfortunately demMaps is closed.
Hmm, I want to ask something. How that button search can work ? I found some error that called "java.lang.IllegalStateException: Could not find a method Onclick(View)", help me please.. thankyou
I have a button in my app and an EditText field where people can insert a postal code. When I hit the button, the map does not updates to the location of the postalcode address. Is this because it's a postal code but I rather need to insert stuff like "White House" or something?
hello, excellent tutorial, works for me well, but for example when I do not have internet stops and closes the application, anyone know how to fix that?
Hello , iam trying to do the same on android studio but iam having some problems something with the SDK tools and the versions i use because i use exactly the same words with you, if you can help me somehow i would appreciate it!!! iam having a "manifest merger failed"
great tutorial ... tho strange ... it seems like onSearch(View view) method is never used??? says my Android Studio, what am I doing wrong? i dont understand where you declare that function to be used or why yours works. Please enlighten me
I have a question can someone pliiz answer me if i uses google map application can i still make other layout to create a complete app like login and register and google map ???
Hey Thanks for this video. I have followed your steps but facing problem of app unfortunately stopped by clicking search button. I have wrote onSearch method out of onMapReady method.. Please help me!!
hi, i'm a beginner with android studio, and i'm working on a project in which i use google maps, i followed every step like you did, but while running my application, it doesn't show the little blue circle that indicates my location, and i searched in google for any solution, but in vain; i hope you will answer me :)
Hi Tech Academy, I'm not having setUpMapIf Needed library in my MapsActivity.java file,as I'm unable to find the command setUpMapIfNeeded();, also when I type the necessary command ,I get red lines everywhere, can anybody help me out with this coed ,also I'm not getting any marker in my emulator , I'm open to suggestions,please help me out.Also the min sdk version thatI'm using is 17, and the android studio version is 2.1 and I'm using a googlemaps acitivity, I still don't understand why I'm not getting the setUpMapIfNeeded command and also the rest of the inbuilt code snippet. This is the code snippet that I'm getting: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); } } It's not the same code as yours and I'm unable to get the marker as well, please help me out.
jimoo4 You can check if the edittext string is empty or not by using "isEmpty()" function. And if it is empty then you can show a popup message stating that the user has not entered anything.
Hi , thanks for your answer. I did this EditText etLocationA = (EditText) findViewById(R.id.etLocationA); String strLocationA = etLocationA.getText().toString(); List lAddressA = null; boolean didItWork = true; if (mLocA != null) mLocA.remove(); Geocoder gcA = new Geocoder(this); try { lAddressA = gcA.getFromLocationName(strLocationA, 1); } catch (IOException e) { didItWork = false; e.printStackTrace(); and it worked.Tech Academy
or you can just change this line if (location != null || !location.equals("")) instead of 'OR' write 'AND' like this if (location != null && !location.equals("")) this will work plus you can also give a toast message if the edittext is empty.
Hey, thank you for the fast reply :) . Im currently doing your Google Maps | Calculate Distance Between 2 Locations Tutorial from 18.07.2017. Do i need to start from the very first tutorial to handle this?? i just want to have distance from my current location to my searched address. I have the search bar, the search button, and the "to" button. Searching is working properly, and getting current location also. Im getting current location with statement: mMap.setMyLocationEnabled(true); But then i add the "To" Button. I used if statements to handle the button clicks. I initialize all the markers like you and call the Location.Distance.Between. method. i cant find in this tutorial where you initialize the latitude and longtitude from the current location??? e.g. mMap.getMyLocation().getLatitude() is not working. How do you get the current location latitude and longtitude??? Thank you in advance. If you want i can send you fast email with my code.
The first 4 parts of the updated google maps tutorials are for getting current location, 5th part is for adding the search bar which you already did. You don't need to watch the nearby places tutorials if you don't want to add that functionality. I fetched the latitude and longitude values in onLocationChanged method. Watch the first 4 parts and update your code accordingly. Actually just parts 2-4. I am not doing anything in the first part. It is just for setting up API key and creating a new app and testing it.
You can implement the class by GoogleMap.OnMarkerClickListener and then in the onMapReady method, write map.setOnMarkerClickListener(this). Refer my updated google maps series. I have used this in that tutorial.