location

Android: requestLocationUpdates updates location at most every 45 seconds

好久不见. 提交于 2019-11-28 17:16:37
Background I am writing an Android app whose main function is tracking the user's location and making an alert when the user gets near some point. Therefore I need to update the user's location at regular intervals, and these intervals should get smaller as the user comes closer to the target. So when the user is within, say, 1 km of the target, I want the location to be updated every 20 seconds and so on, until the user arrives. Problem When I test it ( provider = LocationManager.NETWORK_PROVIDER ), a call to requestLocationUpdates(provider, minTime, minDistance, locationListener) with any

How to set the location of WPF window to the bottom right corner of desktop?

半腔热情 提交于 2019-11-28 16:57:57
I want to show my window on top of the TaskBar 's clock when the windows starts. How can I find the bottom right corner location of my desktop? I use this code that works well in windows forms app but does not work correctly in WPF: var desktopWorkingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea; this.Left = desktopWorkingArea.Right - this.Width; this.Top = desktopWorkingArea.Bottom - this.Height; This code works for me in WPF both with Display 100% and 125% private void Window_Loaded(object sender, RoutedEventArgs e) { var desktopWorkingArea = System.Windows.SystemParameters

Get current location address for android app

泄露秘密 提交于 2019-11-28 16:54:27
I do not need to display a map. However, I need to use the gps/3g network to locate my current positions ADDRESS (not long and lat) this will then be added to a automated sms response to inform a person that I currently cant reply, & the include the string address of my current location. I have the sms stuff working, just need to figure out a method of accessing the gps and pulling an address. I have seen sample code for lat/long. Perhaps I need to convert lat/long into an address within the google maps API? I am unsure howto go about it. Any advice/code snippets/similar tutorials welcome!

Is there an offline geocoding framework, library, or database for iOS?

你说的曾经没有我的故事 提交于 2019-11-28 16:15:31
Is there an (offline) Geocoding framework, library or database for iOS? A place to get the data from? I need to be able to geocode street addresses in cities worldwide (or at least in the United States) into latitude and longitude for sunrise and sunset calculations. The information must be in a format that will work on iPhone OS. (Either a database file or written in C/Objective-C) What I would recommend : Get the data from Open Street Maps, the license just implies that you mention the source. There are some OSM extracts for some countries, I don't know if there are some already made for

get the current location fast and once in android

*爱你&永不变心* 提交于 2019-11-28 15:52:51
问题 I have an android application that need device current location (latitude and longitude). I've tried some tutorial on the net and specially some solutions from stack overflow, but they doesn't work well for me. My requirement is so simple: First I need it to be fast and need the location once when I the fragment starts. Second I need it to be as precise as possible, I mean it should use GPS first if GPS is not available then use Network provider. For example, I've tried this solution but it

nginx之location详解

隐身守侯 提交于 2019-11-28 15:51:45
location有定位的意思,根据uri来进行不同的定位,在虚拟主机中是必不可少的,location可以定位网站的不同部分,定位到不同的处理方式上。 location匹配分类 精准匹配 一般匹配 正则匹配 总结 精准匹配 精准匹配以=号为标志 location = /index.htm { root /var/www/html/; index index.htm index.html; } location = /index.htm { root html/; index index.htm index.html; } 精准匹配的优先级要优于一般匹配,所以重启nginx后会打开/var/www/html下面的index.htm而不会打开html下的index.htm 一般匹配 location / { root /usr/local/nginx/html; index index.htm index.html; } location /apis { root /var/www/html; index index.html; } 我们访问http://localhost/apis/ 对于uri的/apis,两个location的pattern都可以匹配它们 即‘/’能够左前缀匹配,"/apis"也能够左前缀匹配 但此时最终访问的是目录/var/www/html下的文件 因为apis

How to draw path as I move starting from my current location using Google Maps

£可爱£侵袭症+ 提交于 2019-11-28 15:49:44
I am trying to draw route as I move from my current location. I am facing a big problem in drawing route dynamically please help me to solve it. I am having marker at my current location in my map. As soon as I start moving I want the map to start drawing lines in the path I move. I do not have two fixed points. Can any one please provide me a solution to over come this. I have seen lot of answers in SO which draws path between two fixed points. But here only my initial point is fixed. I am able to get my current location in my app currently. I tried with the following code but

iPhone indoor location based app

↘锁芯ラ 提交于 2019-11-28 15:42:17
问题 I am researching how to create an app for my work that allows clients to download the app (preferably via the app store) and using some sort of wifi triangulation/fingerprints be able to determine their location for essentially an interactive tour. Now, my question specifically is what is the best route to take for the iPhone? None of the clients will be expected to have jail broken iPhones. To my understanding this requires the use of the wifi data which is a private api therefore not

Using Google Play Services LocationClient in background service

不羁的心 提交于 2019-11-28 15:38:01
问题 My app is designed to track user's location periodically and send it to server, Recently I changed my code with Google play services Location API. I created the locationclient and connected to the service in onStartCommand public int onStartCommand(Intent intent, int flags, int startId) { setUpLocationClientIfNeeded(); if(!mLocationClient.isConnected() || !mLocationClient.isConnecting()) mLocationClient.connect(); return START_STICKY; } and in onConnected method, I send a location request,

Nginx对图片进行防盗链

帅比萌擦擦* 提交于 2019-11-28 15:30:29
这里需要使用两台Linux主机(一台充当防盗链服务器,一台充当盗链服务器),下表是它们所使用的操作系统以及IP地址。 两台Linux主机所使用的操作系统以及IP地址 主机名称 操作系统 IP地址 防盗链服务器 CentOS7.5 192.168.5.23 盗链服务器 CentOS6.10 192.168.5.154 两台Linux主机的Nginx采用yum安装,版本都是1.16.1 一、nginx模块ngx_http_referer_module指令简介 nginx中ngx_http_referer_module模块允许拦截“Referer”请求头中含有非法值的请求,阻止它们访问站点。 需要注意的是伪造一个有效的“Referer”请求头是非常容易的, 因此这个模块的预期目的不在于彻底地阻止这些非法请求,而是为了阻止由正常浏览器发出的大规模此类请求(提高了技术门槛,可以限制多数普通用户)。 还有一点需要注意,即使正常浏览器发送的合法请求,也可能没有“Referer”请求头,所以有时候不能拒绝来源头部“Referer”为空的请求。 防盗链配置语法 语法:valid_referers none | blocked | server_names | string ...; 可以配置在server或者location节点里 参数说明 none:缺少“Referer” 请求头的情况;