MKMapView, Google Maps API and traffic information - iphone

By the time you finish reading this question, it will become obvious to you that I'm pretty new to this development. But I've got a quick question here. I think I (unfortunately, sorta) know the answer, but I figured I'd ask, anyway:
I'm working on an app in which I'd like to display traffic data from Google Maps into a map. Easy enough, it seems. I can easily put the a MKMapView and center it on the desired location. I can also create a custom Google Maps API that I can look at on my browser, and it would display the traffic data with the GTrafficOverlay object.
Now...
Can I use the API traffic data (in Javascript) and parse it into the MKMapView implementation? I don't think so... right?
So, my only other option is to do a UIWebView instead, right? I just link to that page, and I'm good to go.
Also... Is there a major drawback to doing that? I know I lose a bit of the built-in interface, but beyond that, it doesn't seem to be that huge a difference, right?
And, also, if I want to use that Google Code API, how do I implement it in place? Do I have to have that HTML file somewhere in a server, or can I have it as part of my resources, or what?
Sorry about all the questions, but thanks in advance for any suggestions y'all might have!

You can't parse the javascript into the MKMapView implementation directly.
Yes you can use a UIWebView. I've only had a brief look at that, and it was pretty nasty with default behaviour, because both the web view and the map view try to respond to drag events etc. There is probably a way of tuning that out - you would want to look for SDK2.x examples as there was no other maps solution then.
This post may also provide a lot of help.

Related

How do I use SAPUI5 SDK?

I am four months incumbent to SAPUI5. I know the basics of SAPUI5 and am able to create application from scratch. However , this is true only for the controls that I am familiar with(I refer google/SAPUI5 SDK). Lately, I am realizing if it is brand new control for me, I have to spend a lot of time using SAPUI5 SDK going after the API reference, documentation and samples.
My question is could you please let me know how do I use SDK effectively ? For example, I need to know the method when a cell is clicked in sap.m.Table or an event for selection. How do I use documentation, API reference for it ?
Kindly help!
Whatever you are doing is correct, API reference has everything you need.
I can tell you the tricks I did while working on SAPUI5:
Every time you visit a reference about a particular control, watch out from where it has been inherited. This gives an edge, most control will have basic handlers at the parent control which can be reused in child controls. Example sap.ui.core.Element, this is like Grandfather of many controls. Spend time to understand this kind of controls.
Use browser console as your playground, create a particular object you are playing with, then use .and see what are the methods which are exposed.
Aggregations tell you about what is the kind of content a control can take in.
There is no other magic to this. Trust me, over a period of time, you will be very much faster in figuring out what fits.
~Cheers
When I work with new controls it helped me to take a look at the control samples first and its coding. This gives me a good quick overview.
Then I take a closer look at the API to that control to find out more about the properties, aggregations and events.
Sometimes I build a quick and simple example app for a certain control. This helps me to find out how the control is supposed to work.
As already mentioned, there is no way that works for everyone and it'll take some time.
You'll find your best way of working with it.

Creating overlays for different apps in OSX

I want to create an app for OSX which would work as an addon (displaying some overlaying information) to other app. Something like Poker Tracker for example - it shows extra information for poker games while playing on tables.
Just wondering is it possible using Swift? Can you point me to some direction what to look for? some libraries helping with such case? Never developed anything for OSX but keen to learn.
Thanks in advance.
Just wondering is it possible using Swift?
Yes, you can use Swift to create macOS applications. It's not magic, though -- your Swift code can only do things that are actually possible.
Can you point me to some direction what to look for?
Look for an API that lets other apps interact with the host application. That API will define what your "add on" application can reasonably do.
Without some sort of API or scripting interface, it's going to be very difficult to write a program that interacts with the host application. The best option is probably the Accessibility API in macOS. Accessibility is meant as an assistive technology, but it's often repurposed for tasks like automated testing. You might be able to use it to gain some level of control over the host app.
As far as I know it doesn't expose any API, so it would need to be image scraped.
This is really a tall order, and doubly so if you're asking basic questions about language capabilities. I think you'd have much better luck creating an efficient user interface so that the user could enter the relevant information directly, e.g. what cards the other users are showing, bet sizes, etc.

MKRoute shown in US only

I use MapManager to show the route. MKroute doesn't work in my country, but it does in US. Can anyone tell me if this only work in only particular countries or it does work everywhere?
The best i can tell is that, for a route, you need a destination and starting point.
When a coordinate preferably the current user position does not have a POI in map mostly due to the fact that apple maps is not completely mapped in your place. By which i mean its besides from showing some main areas and streets, you have nothing other then this feature will not work.
If you know what i mean, then the alternative solution is Google Maps. It has a vast resource and it has information about things apple does not.
But it comes with a price, you need to learn to use Google Maps API which at this point is documented for Objective-C only.
And the callout is somewhat static in Google Maps which you can customize but the hard way.

iPhone Development - calling external JSON API (will Apple reject?)

Ok guys, so im new to iPhone development, so apologies if this is a silly question, but before i actually create my app i want to know if this is possible, and if Apple will reject this.
(Note this is all theoretical)
So i'd have a API (.NET) that runs on a cloud server somewhere and can return HTML/JSON/XML.
I'll have a website that can access this API and allow customers to do some stuff (but this is not important for this question).
I would then like my iPhone app to make a call to this API which would return JSON data. So my iPhone app might make a call to http://myapp/Foos which would return a JSON string of Foo objects. The iPhone app would then parse this JSON and do some funky stuff with it.
So, that's the background, now the questions:
Is this possible? (that is, call an external cloud API over HTTP, parse JSON response?)
What are the chances of Apple rejecting this application (because it would be calling a non-Apple API)
Are there any limitations (security, libraries, etc) on the iPhone/Objective-C/Cocoa that might hinder this solution? In regards to Security - can you freely make a HTTP (or even HTTPS call) from inside an iPhone app, and parse the response? In regards to libraries - is there sufficient support in Objective-C/Cocoa to accomplish this?
On this website, they seem to be doing exactly what im asking.
Thoughts, suggestions, links would be greatly appreciated...
Yes. It is possible. There are quite a few apps that do similar things.
Slim to none. Apple hinders what languages and libraries you can develop in and run on the phone. They won't limit you based on what external data you pull in to your app.
There shouldn't be any worries here either. You shouldn't run in to security concerns and there are plenty of libraries that you should be able to utilize to make your life much easier.
Good luck!
Yes it's certainly possible, and there are json parsers available already. Secondly, based on what you just described, should the application not break any rules outside of the scope of this question, then there is no reason I can see Apple rejecting it (except perhaps content, ie., don't display any porn or the like :)) ... Finally, you haven't properly described your application to fully answer #3, and I don't dare guess at what you meant, since it may be just a waste of your time. Feel free to expand on your #3 in comments, I'll answer there.
Edit: With regard to your edit of #3 above, yeah you won't have an issue here at all either.

UIWebView - How does tabbed browsing work?

I've a noobish question. How does tabbed browsing work? I mean that you save the current webView with it's content in an array and show it later.
like you can read here http://www.iphonedevsdk.com/forum/iphone-sdk-development/24521-please-need-help-webview.html I made few attempts but no luck so far.
as anyone a nice suggestion? Thanks in advance
Implementing a tabbed web browser is more of a design challenge than a pure programming challenge. You need to consider how the user will switch between different tabs. From a data structure perspective, you can store multiple instances of UIWebView in an array, as you mention.
From a design perspective, you should look at the way Apple implements their web browser. Their approach seems to be more of a multiple window system than a multiple tab system.
One thing to keep in mind, UIWebView's use a lot of RAM, so be careful keeping too many stored in memory.
PS: if you are interested in checking out a tutorial on UIWebView check out this tutorial