iphone, uiwebview with JS (google maps API) - javascript

two question for you:
reading google documentation i've make an html with the JS for make a google maps api call.
I've put this file in my project, and in a TABView i read and render this file in a uiwebview.
Works great but every time i start my app and go to this view i got this message: "appleweb://someID want to use your current location".
Is my fault or is normal? why my authrization is not saved in position auth?
Second: if i must make some other request on my map and passing new data or refreshing existent data is better that i do this via javascript or there's some option in cocoa to refresh my view?

It is surely not your FAULT, and yes it is normal. user location authorization SHOULD NOT be saved because the next time user launches his app he wont be knowing that his current location is being used (just in case he wants to avoid that for whatever reason).
I dont know the answer to you second question but just a suggestion: why don't you use MapKit API provided by apple instead of going with html and js for google maps? It is pretty easy to use and theres enough documentation and sample codes available on ADC.

Related

Google Analytics: Do I need URL address?

I am a complete Google Analytics beginner and would appreciate a help with a basic question.
I am developing HTML, CSS and JavaScript based applications which are further uploaded into an iOS application to present your applications in a fancy way. Therefore my application is a hybrid application (half JS web site, half mobile app).
I would love to see users' activity in my app when they are browsing through it and I thought GA might work well with it - but the problem is, that the outer app doesn't provide me with any URL of my inner JS app (the inner web site's URL is file:///).
At this page (link), I found that URL is not really important, that it is the tracking code which is important. So I used a dummy URL, added the GA snippet into my application and uploaded it in iPresent. I can't see no live activity though... :/ It also says the measuring is not installed (not used at a home page).
So I am wondering - is the URL really important?
Any ideas?
Thanks!
URL (or page path) is only important if you want to report on data based on which URLs your visitors went to.
If you app doesn't use URLs at all, perhaps it fits better with the "app" model where you are sending screen name data instead of page data. You can read more about the differences between web and app views here:
https://support.google.com/analytics/answer/2649553
I found out that URL is not needed. This type of problem can be solved by using GA Measurement Tool
https://developers.google.com/analytics/devguides/collection/protocol/v1/
Validate your hit here:
https://ga-dev-tools.appspot.com/hit-builder/

Hide geolocation of embedded map from user

I want to embed a googlemap in a page but I don't want the user to be able to determine the geolocation by inspecting the code.
I've tried using the Javascript API to insert the map and loading in the Geolocation in a separate JS file which has been minified but the lon-lat are still easily identified.
Any tips on how I might go about doing this?
p.s. I know it sounds like a weird thing to want to do! It's for a puzzle and I don't want people to be able to cheat :-)
How about calling a service to get the geolocations? You could iterate over the results add the markers (I do it with google.maps.event.addListener to include a tooltip as well).
A user would have to inspect the result from the service.
If you want, you can use unique identifiers for your service calls, that are only valid once. A disadvantage would be that page refresh aren't possible anymore, because you would call the service with the same parameters again.

Twitter Cards using Backbone's HTML5 History

I'm working on a web app which uses Backbone's HTML5 History option. In order to avoid having to code everything on the client and on the server, I'm using this method to route every request to index.html
I was wondering if there is a way to get Twitter Cards to work with this setup, as currently it can't read the page as everything is loaded in dynamically with Javascript.
I was thinking about using User Agents to detect whether it's the TwitterBot, and if it is, serving a static version of the page with the required meta-tags. Would this work?
Thanks.
Yes.
At one job we did this for all the SEO/search/facebook stuff etc.
We would sniff the user-agent, and if it was one of the following sniffers
Facebook Open Graph
Google
Bing
Twitter
Yandex
(a few others I can't remember)
we would redirect to a special page that was written to dump all the relevant data about the page for SEO purposes into a nicely formatted (but completely unstyled) page.
This allowed us to retain our google index position and proper facebook sharing even though our site was a total single-page app in backbone.
Yes, serving a specific page for Twitterbot with the right meta data markup will work.
You can test your results while developing using the card's preview tool.
https://dev.twitter.com/docs/cards/preview (with your static URL or just the tags).

Get iPhone location data into a Google Maps

I am looking to develop a feature for a browser app I am developing. I was hoping to get any advice on this topic:
A user walks around with their iphone.
During this time location data is recorded of their walk
This data can then be exported to Google Maps and I can see the route overlaid on a Google Map in my browser.
Is this possible? Where would I start and how would the data be recorded?
Yes, this is possible (assuming you want to use Javascript as it is tagged to your question).
Getting the location data on an iPhone is possible, see this question. You can use the Google Maps API to display a map and draw the recorded path on it. I would rather display the walked route direct in your app rather than exporting/importing coordinates of the recorded route.
Before implementing the App, I would take a look on both Google Maps API and OpenStreemMap API to find out which you like more and fits your needs best. Playing with some examples before implementing your app might be a good point to start with.

PhoneGap Android

I am new to phonegap and android , i wanted to know how to access/make database through
javascript. and the second thing i want to ask is how to make Graphs just using html, css and javascript.
Every information is thankfully accepted.
First off, it is best to post each question separately.
To answer both your questions: the easy way is to use Google API's. With the Database API of Google Gears, you can "persistently store an application user's data" locally, and with the Google Chart Tools you can create graphs by simpy calling a URL with the right parameters. Both should work from any browser, including mobile.

Categories

Resources