google-maps-android-api-2

Android PlaceFilter usage with Google Places API

眉间皱痕 提交于 2019-12-05 02:13:33
I am trying to use the Google Places API and I would like to filter my search to only gym types. I am using the code given at https://developers.google.com/places/ public void onPickButtonClick(View v) { // Construct an intent for the place picker try { PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder(); Intent intent = intentBuilder.build(this); // Start the intent by requesting a result, // identified by a request code. startActivityForResult(intent, REQUEST_PLACE_PICKER); } catch (GooglePlayServicesRepairableException e) { // ... } catch

Google Map Gradient Polylines for Android?

二次信任 提交于 2019-12-05 02:02:01
The question of how to do gradient polylines has been asked a number of times, however, I want to know if this comes built in for Android. In the following post, this question is poised and someone answered that as of May 2015, there was still no gradient polylines for Android: colourful polylines in android maps api v2 I have combed through all the documentation I can find and do not see anything about a gradient polyline function. Am I missing it? Because iOS has had this capability for three years now. https://maps-apis.googleblog.com/2014/02/gradient-polylines-and-structured.html I can't

Android Google Maps Api V2, getting the coordinates for the current map center

怎甘沉沦 提交于 2019-12-05 00:26:27
问题 I am using Android Google Maps Api V2 (not MapView or MapActivity) and I am having difficulty getting the coordinates for the center of the map. I was thinking of using @Override public void onCameraChange(CameraPosition arg0) { // TODO Auto-generated method stub geoCodeCenter(/*Location object*/); } but I can't get the lat/long from the CameraPosition object. the camera also has more dimensions as you can look at the map at different pitches now too, so getting the center of for latitude

Google Maps Android API v2 detect long press on map and add marker not working

拟墨画扇 提交于 2019-12-05 00:21:06
I want to add a marker on map with long press. Toast in onMapClick() was display with normal tap. But long press is not working. Toast in onMapLongClick() is not displayed with long press. Also marker is not displayed on map. I'm using SupportMapFragment because I want to use my application on Android 2.x devices. I have tested my app on Nexus One which has Android version 2.3.7. This is my code. public class MainActivity extends FragmentActivity implements OnMapClickListener, OnMapLongClickListener { final int RQS_GooglePlayServices = 1; private GoogleMap myMap; Location myLocation; @Override

android.view.InflateException Error inflating class fragment

99封情书 提交于 2019-12-04 22:23:10
I am trying to solve this problem from 5 days, but still I didn't get it solved. Main Java Code package com.beproject.ourway; import android.app.Fragment; import android.app.FragmentManager; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.FragmentActivity; import android.support.v4.widget.DrawerLayout; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ListView; import android.widget.Toast; public class MainHome extends FragmentActivity{

Implementing polygons with Google maps API V2 in Android

本小妞迷上赌 提交于 2019-12-04 21:25:16
I implemented the Google maps API V2 on Android, I got the map to show and also the polygon to show using this code: public class MainActivity extends FragmentActivity { Polygon polygon; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GoogleMap googleMap; googleMap = ((SupportMapFragment)(getSupportFragmentManager().findFragmentById(R.id.map))).getMap(); LatLng latLng = new LatLng(35.20418,-90.08342); googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); googleMap.addMarker(new MarkerOptions() .position

Android Polyline - Adding point by point

ぐ巨炮叔叔 提交于 2019-12-04 20:07:46
问题 I'm currently having a map, and each 10 meters I use LocationListener to refresh my location and get the new Latitude and Longitude. Now I wish that the route the user is taking will be displayed with a red line. So everytime the OnLocationChange() from LocationListener class is called, I want to update the map with a line between the last location and the new location. So far I've added the following: private void initializeDraw() { lineOptions = new PolylineOptions().width(5).color(Color

Google Maps API v2 not working

此生再无相见时 提交于 2019-12-04 20:02:16
问题 I am trying to build an application using Google Maps API v2 but the thing is, the application keeps giving me force closes although i followed all the required instructions. Here is the android part import android.support.v4.app.FragmentActivity; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapController; import com.google.android.maps.MapView; public class GPSonMap extends FragmentActivity{ MapView map; MapController controller; LocationManager locationManager;

Google maps Android API getting wifi location

こ雲淡風輕ζ 提交于 2019-12-04 19:55:26
So I am working on this app that will get the location of a wifi hotspot by just detecting it using the sensor wifi of the phone (The phone is not actually connecting to the hotspot wifi, it just detect). I was doing some preliminary research before start developing the app, and it seems that the Google Geolocation API will do the work for me. However, it is not free (at least what I understood after reading through the API). I had checked other apps that detects wifi hotspot, and I am just wondering if those apps have their own database with all the wifi hotspot information (SSID, location

Android Maps - animateCamera() method not working proper

自古美人都是妖i 提交于 2019-12-04 19:52:45
问题 Problem: 1) Map getting animated to reach the required location(4th line in code) but it got zoomed to the default location(5th line in code) [leaving the map in the default location at the specified zoom level] 2) I understand why is the problem happening but i don't know how to resolve it. 3) If i change the 4th line to moveCamera instead of animateCamera that will work, but i do want animateCamera() method. Here's the code: map=((MapFragment)getFragmentManager().findFragmentById(R.id.map))