location

Change chrome app window location, but not from main.js

无人久伴 提交于 2019-12-23 21:01:40
问题 I have made a window, with a couple of buttons. When I click them, I have a function which fires up. Now my question is how can I change the (same) window to show another html file? I have tried function callback(a) { curr_window = a.contentWindow.location; { as a callback to the window.create function, and click_Function(){ curr_window.assign("html file"); } in a <script></script> inside the HTML file, but that didn't work because (from my googling) main.js isn't executed in the page, so

How does mobile safari determine when to prompt user to share location?

╄→гoц情女王★ 提交于 2019-12-23 20:56:53
问题 I have a mobile web app where I want to track the latest location for a user, but only if they are in a certain area. But, having a little trouble with excessive prompts on the iPhone There's some location initialization code along the lines of: if (firstTime) { navigator.getCurrentPosition(function (coords) { if (coordsAreInTheBox) { storeCoordsForUser(); navigator.watchPosition(); } }); } else if (userInTheBox) { navigator.watchPosition(); } This works as expected on the first load, there

Android Locationprovider takes too long to become temporarily unavailable

我怕爱的太早我们不能终老 提交于 2019-12-23 13:28:08
问题 According to this article ( UPD: link removed as it leads to some crap now), setting the minTime when requesting location updates will cause the provider to set itself to TEMPORARILY_UNAVAILABLE for minTime milliseconds in order to conserve battery power. During this period of inactivity, the GPS provider will turn itself off and the GPS icon will disappear. In my code, I set the minTime to about 30 seconds, but the provider only becomes TEMPORARILY_UNAVAILABLE once every five minutes. When

How to get country name in android?

我与影子孤独终老i 提交于 2019-12-23 12:43:09
问题 Hi I am working with android.I had created a GPS app for getting the current location.Now How can I get the country name from the latitude and longitude value ? is it possible ? please help me and thanks :) here is my code I used public class AndroidGPSTrackingActivity extends Activity { Button btnShowLocation; // GPSTracker class GPSTracker gps; String countryCode,countryName; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R

Android location request PRIORITY_HIGH_ACCURACY has no effect

China☆狼群 提交于 2019-12-23 12:33:03
问题 My Android app needs high accuracy location tracking. On app start, it reads the location settings programmatically and presents a screen if high accuracy is not selected. I adapted Google's official example (https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient) to Kotlin. This works as intended on a Huawei phone, but fails on Samsung S7 and S8: If the user has selected Power balanced , a dialog appears and the location tracking is set to high

Nginx location, alias, rewrite, root

烂漫一生 提交于 2019-12-23 12:25:55
问题 I'm serving /foo/bar/ by way of proxypass and want to continue doing so. However, I would like to serve /foo/bar/baz.swf statically from say /var/www/mystatic/baz.swf and so forth. I was hoping that I could do something like location /foo/bar/(.*) { alias /var/www/mystatic/; } location / { proxy_pass ....; ... } And /foo/bar/ would go to the application server while /foo/bar/(.*) would be served statically. the docs say that I can't do this and need to use a combination of root and rewrite:

How to mock location during a presentation on a real device?

柔情痞子 提交于 2019-12-23 12:16:42
问题 I've read this post about mocking location with custom provider, but I am looking for a way to mock the location during a presentation, is that possible? 回答1: I found an app that is called Location Spoofer 来源: https://stackoverflow.com/questions/2993362/how-to-mock-location-during-a-presentation-on-a-real-device

实例讲解Nginx下的rewrite规则

主宰稳场 提交于 2019-12-23 10:42:55
一.正则表达式匹配,其中: * ~ 为区分大小写匹配 * ~* 为不区分大小写匹配 * !~和!~*分别为区分大小写不匹配及不区分大小写不匹配 二.文件及目录匹配,其中: * -f和!-f用来判断是否存在文件 * -d和!-d用来判断是否存在目录 * -e和!-e用来判断是否存在文件或目录 * -x和!-x用来判断文件是否可执行 三.rewrite指令的最后一项参数为flag标记,flag标记有: 1.last 相当于apache里面的[L]标记,表示rewrite。 2.break本条规则匹配完成后,终止匹配,不再匹配后面的规则。 3.redirect 返回302临时重定向,浏览器地址会显示跳转后的URL地址。 4.permanent 返回301永久重定向,浏览器地址会显示跳转后的URL地址。 使用last和break实现URI重写,浏览器地址栏不变。而且两者有细微差别,使用alias指令必须用last标记;使用proxy_pass指令时,需要使用break标记。Last标记在本条rewrite规则执行完毕后,会对其所在server{......}标签重新发起请求,而break标记则在本条规则匹配完成后,终止匹配。 例如:如果我们将类似URL/photo/123456 重定向到/path/to/photo/12/1234/123456.png rewrite "/photo/(

AngularJS Route Controller Not Reloading

混江龙づ霸主 提交于 2019-12-23 09:43:44
问题 I have a very simple AngularJS app that has two routes in it: #/search #/results When I navigate from one route to another everything works as I'd expected. Any resources that are needed are fetched and the content is displayed perfectly. The problem is when I navigate from one route to the same route (I.e., #/results to #/results) absolutely nothing happens. I understand from the browser's perspective nothing has happened but I'd really like AngularJS to reload the content. This must be very

how to serialize for android.location class?

别等时光非礼了梦想. 提交于 2019-12-23 09:34:13
问题 I'm trying to serialize my location class (using android.location class) but, it gives me an error! 11-21 21:25:37.337: W/System.err(3152): java.io.NotSerializableException: android.location So, I tried to extend the android.location.Location class. private class NewLocation extends Location implements Serializable { private String Provider; private double Latitude, Longitude, Altitude; private float bear; public NewLocation(Location l) { super(l); Provider = l.getProvider(); Latitude = l