location

Redirect User to different Website Based on Location (IP Address)

旧巷老猫 提交于 2019-12-18 11:33:40
问题 How to redirect user visiting my sites to location specific sites using the IP Address. I have 3 location specific sites. 1. Europe. 2. US. 3. Asia. In short I wanted to find the location of the client using his IP Address. The solution needs to use Google APIs. 回答1: I got the solution using "google.loader.ClientLocation" here is the code for that if somebody needs it. Check this JSFiddle http://jsfiddle.net/kvishnudev/7Ut65/1/ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

Excessive Alarm Manager wakeups in android with Google Play Services Location

一世执手 提交于 2019-12-18 10:33:32
问题 I received an performance report from Android Vital on Google Play Console about Excessive Alarm Manager wakeups: https://developer.android.com/topic/performance/vitals/wakeup.html I use Location API from Google Play Services to request for location updates in the background. On the report it show that the excessive wake up wakeups was caused by com.google.android.location.ALARM_WAKEUP_LOCATOR from LocationListener. Below the code snippet which causes the alarms: private synchronized void

How to populate an array with information from JSON File and calculate distance?

你说的曾经没有我的故事 提交于 2019-12-18 09:46:51
问题 I have a JSON File here: { "People": [{ "A1": "New York", "B1": "ShoppingMall1", "C1": "43.0757", "D1": "23.6172" }, { "A1": "London", "B1": "ShoppingMall2", "C1": "44.0757", "D1": "24.6172" }, { "A1": "Paris", "B1": "ShoppingMall3", "C1": "45.0757", "D1": "25.6172" }, { "A1": "Bern", "B1": "ShoppingMall4", "C1": "41.0757", "D1": "21.6172" }, { "A1": "Sofia", "B1": "ShoppingMall5", "C1": "46.0757", "D1": "26.6172" } ] } and from this JSON File I have to take the names and the coordinates of

7.Spring MVC静态资源访问

こ雲淡風輕ζ 提交于 2019-12-18 08:51:24
在SpringMVC中常用的就是Controller与View。但是我们常常会需要访问静态资源,如html,js,css,image等。 默认的访问的URL都会被DispatcherServlet所拦截,但是我们希望静态资源可以直接访问。该肿么办呢? 在配置文件:web.xml可以看到: <!-- Processes application requests --> <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>appServlet</servlet-name> <url-pattern>/</url-pattern> <

Spring MVC访问静态资源

好久不见. 提交于 2019-12-18 08:17:27
http://www.cnblogs.com/yank/p/4477204.html SpringMVC访问静态资源 在SpringMVC中常用的就是Controller与View。但是我们常常会需要访问静态资源,如html,js,css,image等。 默认的访问的URL都会被DispatcherServlet所拦截,但是我们希望静态资源可以直接访问。该肿么办呢? 在配置文件:web.xml可以看到: <!-- Processes application requests --> <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet

can't find the exact current location in android

£可爱£侵袭症+ 提交于 2019-12-18 05:46:14
问题 I have use this below code for find the current location but i got that some devices(samsung 7' and 10'inch and nexus 10'inch) exact current locations,but unfoirtunately i can't find the locations in samsung s3. I don't have any idea ,what is issue.no find the locations. here is my code: public class GPSTracker extends Service implements LocationListener { private final Context mContext; //flag for GPS Status boolean isGPSEnabled = false; //flag for network status boolean isNetworkEnabled =

travel time between two locations in Google Map Android API V2

你说的曾经没有我的故事 提交于 2019-12-18 05:05:12
问题 how to display travel time between two locations in Google Map Android API V2, in my program i using JSONParse to display driving distance, but i'm can't to display the display travel time, This example program I made: DirectionActivity.java public class DirectionActivity extends FragmentActivity implements OnMyLocationChangeListener{ private LatLng start; private LatLng end; private String nama; private final String URL = "http://maps.googleapis.com/maps/api/directions/json?"; private

Android calculate distance between two locations [duplicate]

时光怂恿深爱的人放手 提交于 2019-12-18 05:04:22
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to calculate distance between two locations using their longitude and latitude value Before you all give me some education on how the earth is not a perfect sphere and it all changes when you get closer to the poles, which seems to be all I can find on the net. And before asking my father who is an accomplished geographer and my uncle who is a Quantum Physicist who works for NASA and me being a lowly

Region monitoring in ios 7

无人久伴 提交于 2019-12-18 04:23:05
问题 I should use region monitoring in my iOs app for 6 and 7 version. And if my app was closed then system should open it. It works in iOS 6, but not works in iOS 7. I mean, System does not open my app if app was closed in ios 7. About closing app, I mean, kill this app from memory. I use this code: manager = [CLLocationManager new]; manager.delegate = self; [manager startUpdatingLocation]; if ([UIDevice isIOS7OrHigher]) { CLCircularRegion *reg = [[CLCircularRegion alloc]

locationManager.getLastKnownLocation() return null

久未见 提交于 2019-12-18 04:00:08
问题 i dont understand why locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); return the location null. I gave all permission but its reutning null . if (isGPSEnabled) { if (location == null) { locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); Log.d("GPS", "GPS Enabled"); if (locationManager != null) { location = locationManager .getLastKnownLocation(LocationManager.GPS_PROVIDER); if (location != null