google-maps-api-2

Android Geofence only works with opened app

家住魔仙堡 提交于 2019-11-28 19:01:35
I'm doing a serious research on this topic for many days... I saw many topics here too... But unfortunately I couldn't find a solution.... I'm writing an app that uses the new Google API for Geofence... Well, I can handle "ins" and "outs" of a geofence, but only if my app is open! Even if I'm with wifi on, gps on, and 3G on, but the app, it does not trigger any event...Just if the app is open... I'm using exactly the same GeofenceRequester class of the documentation http://developer.android.com/training/location/geofencing.html . Even the class been the same I'll post the code here: package br

Android Google Maps Direction Api - Api key restriction not working

喜欢而已 提交于 2019-11-28 13:40:47
When we are setting a Key restriction to NONE for Google Maps Direction Api, It works fine. But When we set Key restriction to Android apps and provide a proper Package name & SHA-1 certificate - It says Request Declined from Google Api response. Any known solution to this? Directions API is a web service. The restrictions that will work with an API keys for web services are IP restrictions. It is supposed that web services requests are executed on your backend servers. If you need to restrict an API key, the workaround is to create an intermediate server. Your Android application should send

Get current location using json

ぐ巨炮叔叔 提交于 2019-11-28 13:00:30
Hi i a m writing an application whih gets the current latitude and longitude and convert it to corrsponding address.i can get the lattitude and longitutde but how to convert it to the corresponding address using json. i am new to json. i tried some sample codes butnot getting the address This is my code import java.io.IOException; import java.util.List; import java.util.Locale; import android.content.Context; import android.location.Address; import android.location.Geocoder; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager;

Google Maps v2 not loading. Error android.view.InflateException: Binary XML file line.. Error inflating class fragment

狂风中的少年 提交于 2019-11-28 12:17:28
问题 This is my MainActivity. minimum sdk version is 11 in my app. I used the API key in the android manifest file. When I did some minor modifications, it is showing me blank white space instead of map. public class MainActivity extends Activity { // Google Map private GoogleMap googleMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); try { // Loading map initilizeMap(); } catch (Exception e) { e

Google Map API V2 - How do I keep a marker in the center of the screen while user is scrolling the map?

落爺英雄遲暮 提交于 2019-11-28 10:54:04
Google Map API V2 - How do I keep a marker in the center of the screen while user is scrolling the map ? My purpose is to let user choose a location. I use the following code to add a marker (it's from the com.example.mapdemo in Android SDK) mMap.addMarker(new MarkerOptions() .position(new LatLng(0, 0)) .title("Marker")); How do I keep the marker in the center of the screen and then retrieve it's location? I do not think that you can actually keep a marker in the middle of the screen and float it easily. My suggestion is to trick your user. Add your marker image onto the map like a button. you

How to affect the “grace margin” of map.fitBounds()

狂风中的少年 提交于 2019-11-28 10:48:21
In Google maps API v2, map of our country was nicely fitted to 700x400px map with the following: map.getBoundsZoomLevel(<bounds of our country>) But in API v3, the map.fitBounds() method doesn't fit it at that zoom level to 700x400 - it zooms out one level. This means that map.fitBounds() counts with some "grace margin" or something. How can I affect the size of this margin? Here's a solution that will zoom into the map as far as possible without a custom margin. You should be able to adapt it to account for some margin if you want to. My solution is based on this comment in a Google Groups

How can I make a Google Maps API v3 hexagon tiled map, preferably coordinate-based?

…衆ロ難τιáo~ 提交于 2019-11-28 08:48:06
http://econym.org.uk/gmap/example_eshapes.htm has a Google Maps API v2 example of how to tile hexagons, although the implementation scales painfully: it has a center hexagon, then six hexagons adjacent to it in the appropriate directions, then (in quasi-recursion) three hexagons adjacent to one of the hexagons adjacent to the original hexagon. And it has a nice border with transparent fill. How can I create a similar effect, but preferably with tiling so that I specify (without mounds of recursion) that I want a tile six hexagons to the east of the origin and four hexagons 60° north of east

mapFragment.getMap() returns null

人走茶凉 提交于 2019-11-28 08:13:45
问题 I'm trying to get a map from a SupportMapFragment but it returns null. From what I read this could be because the fragment is not yet fully displayed and therefore no map exists?! I tried fixing it using executePendingTransactions() but with no success so far. Any ideas how to fix it? Here is the code private GoogleMap map; private SupportMapFragment mapFragment; @Override public void onCreate( Bundle savedInstanceState ) { //... super.onCreate( savedInstanceState ); setContentView( R.layout

Draw a path on maps following the finger motion path on the device screen

一世执手 提交于 2019-11-28 07:50:12
1)I want to draw a motion path on google map as per the follow of my finger touch points on the area of map. 2)and get the selected area from the map which lies inside the path. Any one have an idea how to achieve it. For reference want to do some thing similar:- I have implemented the same for one of my Application hope that will help you, I have done this with the help of poly line and polygon. activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height=

Increase the api limit in ggmap's geocode function (in R)

半世苍凉 提交于 2019-11-28 05:31:14
I'm trying to use the geocode function from the ggmaps library in R to get coordinates for specific locations. I'm able to use the function fine so far. The issue I'm running into is that I would like to increase my daily limit from 2,500 to 100,000 . The official Google documentation says that this is readily possible if you enable billing on the project, which I'm happy to do. When you proceed with this process, the Google Developers Console gives you a personalized API key. However, the geocode function doesn't have an option to put in this personalized API key. Instead, it asks for the