location

How Can I Continue updating my location even when app is killed or removed from background in ios?

♀尐吖头ヾ 提交于 2019-11-29 23:52:51
问题 My app requires to update location continuously, even if app is killed or removed from background. It works fine in foreground and even in background mode.but not working when app is killed. I've tried some code. func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.startLocationService() if ((launchOptions?[UIApplicationLaunchOptionsLocationKey]) != nil) { self.locationmanager = CLLocationManager() self

android: how to fix gps with mock(fake) coordinates?

送分小仙女□ 提交于 2019-11-29 23:24:06
I'm trying to fix GPS programmatically when the GPS signal is not available. I want to do this in order to provide mock coordinates to other apps like google maps and others. I tried to use GPS_PROVIDER and NETWORK_PROVIDER but only with the latter I can get a new location valid for google maps. But this works only the first tima and if I want to re-fix more mock locations google maps doesn't see any change... why?? I have to do a service for what I want to do? public void setLocation(double latitude, double longitude) { //mocLocationProvider = LocationManager.GPS_PROVIDER; mocLocationProvider

Getting the number of satellites from Location object

南笙酒味 提交于 2019-11-29 23:22:40
I'm using a GPS provider and LocationListener.onLocationChanged(Location location) to receive location fixes. Documentation says, that Location.getExtras() contains next key/value pair: satellites - the number of satellites used to derive the fix but on practice I'm getting an empty extra object - there is no any data there. Does it means that I'm getting the A-GPS fixes and not GPS? user1055212 To get the number of satellites used by the GPS engine you need to implement android.location.GpsStatus.Listener and implement its method onGpsStatusChanged() . Example... public void

How does Android determine if an app has “High Battery Use” under “Recent Location Requests”?

空扰寡人 提交于 2019-11-29 23:16:16
As of Kitkat (4.4) Android reports that my app is "High battery use". I use Network Location as well GPS. If I disable GPS, then it seems the app gets marked as "Low battery use". I'm wondering if there are any tips to using GPS while keeping the "Low battery use" label. Perhaps if you poll infrequently enough - or is it hardcoded to GPS = battery killer? EDIT: I understand that changing those parameters will conserve battery life. My question was more of whether Android will recognize these attempts at battery life conservation or will it simply brand my app as high power usage simply because

How to simulate driving a route in real device

梦想与她 提交于 2019-11-29 23:02:38
I have a locations based app and I want to test it without real moving. I know I can provide a kml file of points but I don't want to use emulator, but real device. could you tell me what is the best way to simulate driving a route on the device? I emphasize that I need to simulate an entire route rather than a single point. thank you for giving your time I'm using mock locations in the development of my app. The following two apps have proved reliable in mocking locations (static location & routes) thus far: Lockito I use Lockito to create routes that are snapped to roads . Routes are created

php how to find the location where a user came from?

时间秒杀一切 提交于 2019-11-29 22:40:13
问题 simple question: how to find the location (url) where a user came from before accessing my page? and how to find the location (url) where a user goes after exiting my webpage? any ideas where i should start? thanks 回答1: In PHP, you can use the $_SERVER['HTTP_REFERER'] to know where the user came from. There is no mechanism to know where the user is going, unless they clicked a link on your site to leave your page. (If that is the kind of exit that you want to track, you'll need to rely on

nginx 模块

久未见 提交于 2019-11-29 22:28:32
8.nginx开启目录浏览 提供下载功能 默认情况下,网站返回index指定的主页,但如果该网站不存在主页,则将请求交给autoindex模块 ##### 如果开启autoindex模块,则提供一个下载的页面, 如果没有开启autoindex 则会报错 403 [root@web01 centos]# cat /etc/nginx/conf.d/mirror.oldxu.com.conf server { listen 80; server_name mirror.oldxu.com; charset utf8; #字符集 location / { root /code; index index.html; autoindex on; #开启目录索引,提供下载 autoindex_exact_size off; #以人性化方式显示大小 autoindex_localtime on; #与本地时间保持一致 } } 9.nginx实现访问控制,基于来源IP控制、基于用户名密码控制 示例一.允许特定的IP访问,其他全部拒绝 10.0.0.1 可以正常访问 /centos 10.0.0.100 仅能访问 /ubuntu /redhat [root@web01 ~]# cat /etc/nginx/conf.d/mirror.oldxu.com.conf server { listen 80

第一次个人编程作业

你离开我真会死。 提交于 2019-11-29 22:04:12
1. github地址 2.PSP表格 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning · 计划 10 20 · Estimate · 估计这个任务需要多少时间 10 20 Development · 开发 440 855 · Analysis · 需求分析 (包括学习新技术) 180 240 · Design Spec · 生成设计文档 20 20 · Design Review · 设计复审 10 10 · Coding Standard · 代码规范 (为目前的开发制定合适的规范) 10 15 · Design · 具体设计 20 25 · Coding · 具体编码 180 350 · Code Review · 代码复审 20 15 · Test · 测试(自我测试,修改代码,提交修改) 30 180 Reporting · 报告 70 70 · Test Report · 测试报告 30 30 · Size Measurement · 计算工作量 10 10 · Postmortem & Process Improvement Plan · 事后总结, 并提出过程改进计划 30 30 · 合计 520 945 3.计算模块接口的设计与实现过程 信息收集 收集中国所有省份信息

10.Nginx Rewrite重写

ぐ巨炮叔叔 提交于 2019-11-29 22:03:23
.Rewrite基本概述 1.什么是rewrite Rewrite主要实现url地址重写, 以及地址重定向,就是将用户请求web服务器的地址重新定向到其他URL的过程。 2.Rewrite使用场景 1.地址跳转,用户访问www.xuliangwei.com/class这个URL时,将其定向至一个新的域名class.xuliangwei.com 2.协议跳转,用户通过http协议请求网站时,将其重新跳转至https协议方式 3.伪静态,将动态页面显示为静态页面方式的一种技术, 便于搜索引擎的录入, 同时减少动态URL地址对外暴露过多的参数, 提升更高的安全性。 3.搜索引擎,SEO优化依赖于url路径, 好记的url便于支持搜索引擎录入 3.Rewrite配置示例 #rewrite表达式可以应用在server,location, if标签下 Syntax: rewrite regex replacement [flag]; Default: -- Context: server, location, if #用于切换维护页面场景 #rewrite ^(.*)$ /page/wh.html break; 2.Rewrite标记Flag rewrite指令根据表达式来重定向URI,或者修改URI字符串。 每行rewrite指令最后跟一个flag标记,支持的flag标记有如下表格所示:

Nginx基础

夙愿已清 提交于 2019-11-29 22:02:38
1.nginx开启目录浏览 提供下载功能 默认情况下,网站返回index指定的主页,但如果该网站不存在主页,则将请求交给autoindex模块 如果开启autoindex模块,则提供一个下载的页面, 如果没有开启autoindex 则会报错 403 [root@web01 centos]# cat /etc/nginx/conf.d/mirror.oldxu.com.conf server { listen 80; server_name mirror.oldxu.com; charset utf8; #字符集 location / { root /code; index index.html; autoindex on; #开启目录索引,提供下载 autoindex_exact_size off; #以人性化方式显示大小 autoindex_localtime on; #与本地时间保持一致 } } 2.nginx实现访问控制,基于来源IP控制、基于用户名密码控制 示例一.允许特定的IP访问,其他全部拒绝 10.0.0.1 可以正常访问 /centos 10.0.0.100 仅能访问 /ubuntu /redhat [root@web01 ~]# cat /etc/nginx/conf.d/mirror.oldxu.com.conf server { listen 80;