Can I get the users location from an iphone webapp? - iphone

I would like to show a map of things near an iphone user's location. Is there any way to get the latitude/longitude?

You mean from within the Safari browser on the device? I believe it supports the W3C Geolocation API Specification. Additionally, the Safari developer library has information on the subject. I don't know if the two are overlapping or mutually exclusive (I haven't tried), but at least one should work.

Related

Get the mobile number from iPhone settings in titanium appcelerator

I want to fetch the user's phone number from her iPhone settings. I have found so far that this is not supported with any Titanium API. Is there any module or a way to get the phone number that is entered in user's iPhone settings.
Thanks! :)
You can't access that information. Even when you are using Objective-C to create your app, Apple doesn't provide API for that. Take a look on this question.
If you want to collect users phone numbers, you have to ask them for it explaining why you need it.

Filter iTunes search API results

It seems like iTunes search API returns different results than the ones returned when searching on an iPhone device (also results are in different order).
Assuming I want the results to be identical to an iPhone device, how do I do that with the official search API?
Also, is there a way to filter out non-iPhone apps from the search results?
Search API URL
iPhone search URL
The search stack developed for the store is a different algorithm than the search stack for developer tools.
That said, understand some of the following features of the developer tool (Search API) that are helpful:
"sort=popular" is the default order that results are returned. "sort=recent" is the alternative.
"entity=software" will return apps that are available on iPhone, iPod touch and Universal apps (that work on iPad) but if you want all iOS apps you should use "entity=software,iPadSoftware"
Focus your search term on the attribute you are trying to target. If you know your search term is a song title (and not an album name or artist name) then use "attribute=songTerm"
You can use the following API URL to make app store search requests. After acquiring Chomp last year, it was reported that Apple was revamping their internal App Store search algorithms. That may have something to do with the differences you see using the iTunes search API and whatever API the App Store uses. Apple may have developed a separate API specifically for Apps and for use in the App Store that excludes other products like music, in order to improve performance.
http://itunes.apple.com/search?term=SEARCHTERM&country=us&entity=software&limit=100
So, you could do the following in order to get only software for iPhone, iPod touch, and Universal apps with a search term of 'Gameloft'.
http://itunes.apple.com/search?term=Gameloft&country=us&entity=software&limit=100
To include iPad apps in the search, use:
http://itunes.apple.com/search?term=Gameloft&country=us&entity=software,iPadSoftware&limit=100
Check out Apple's documentation for more options.
You can try out a working example I put together of the iTunes search API here. Example Search Tool

Hacks to access iOS APIs through Flex?

I am building a Flex iPhone application that in an ideal world would need to open up the iPhone SMS interface to send texts, make calls, access phone information (such as phone number) and access contact lists... I realise there isn't much in the way of accessing phone specific API's through flex at the moment, does anyone know if or when this is coming?
My main question: I seen this interesting article on extending AIR to access android APIs and was wondering if there was anything similar for accessing iOS APIs? What are people doing at the moment if you need to access iOS APIs? Is everyone waiting for an update to Flex/AIR?
I'd prefer to not splash out on a Mac!
Thanks
Phil
You can use a URL Syntax from a Flex App to open the 'native' controls for sending / receiving text messages. You can do somthing like this:
navigateToURL(new URLRequest("sms:6175551212"))
It's not perfect, and still does not give you access to the address book, though. To add message text, you can use the body attribute as a URL variable:
navigateToURL(new URLRequest("sms:6175551212?body=hello%20there"))
(Source for body url variable)
I realise there isn't much in the way of accessing phone specific
API's through flex at the moment, does anyone know if or when this is
coming?
AIR 2.5 for TV has something called ActionScript extensions, which allows you to write native code that can then be used from Adobe AIR.
This Blog Post mentions "the Sony Tablet S2 you will use the upcoming Native Extension feature in AIR 3".
So, I perceive that Air 3 will support the same ActionScript Extensions on a wider range of devices.
I believe most people who have immediate / important access to AIR APIs are building Native Apps and not using Adobe AIR.
My update 1/18/2011; AIR 3 has been released and it does indeed support Native Extensions on iOS, Android, OSX, and Windows PCs.

Android, Iphone app with JS and HTML

I have read some post about apps programming for Iphone and Android, but I have one question. Is it posible when there is a mobile website optimized for mobile phones, that I can create apps for Iphone, Android, Win 7 and Blackberry, that only statrts the browser as instance and display the mobile website? What do you think, is this ok? Do you have any ideas or examples for that kind of apps? I mean this is not an app, that should be has access to the hardware of the phone, only web app.
Thanks
Nik
This would work.
You could create an app that consists merely of a webview into which you load your content. The content could be loaded over the mobile network or be stored locally.
However most users (including yours truly) strongly dislike apps that merely present a single website to the user, because of the long delays if the content is loaded over the mobile network every time and because the UI is, in many cases, very different to what the he or she is used to from native apps.
Most users fail to see the need for a specialized app just to visit a website which they could as well keep as a favorite in their mobile browser. On the iPhone, you may even add favorite websites as icons on your homescreen, so there is no need for apps presenting a single website at all.
It's not only possible, such things are already done. One example I know of is cookd, a restaurant guide for Vienna. But there are some constraints; for example, cookd requires GPS data for the "Nearby" option; on my Android phone (HTC Legend), this is possible when I open the web page directly in the browser (the browser asks if I want to allow cookd.com to get this info); but the same webpage, running in an application that does nothing more than display the browser component, cannot do that. To fix that, they would have to build GPS reception into the app and forward this info to the browser component.
O'reilly has a fantastic article about this:
http://building-iphone-apps.labs.oreilly.com/
This is a little bit directed to iPhone only, but will give you a good overview about the topic and possibilities.

iPhone app that access the Core Location framework over web

I was wondering if I could access the iPhones Core Location framework over a website?
My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/family so we could locate each other. I can have them manually enter lng/lat but its not the easiest thing to find. If the iPhone could display or upload this automatically it would be great.
I don't own a Mac yet (waiting for the new Mac Book Pro) but would like something a little more automatic right now. Once I have the mac I could download the SDK and build a better version later. For now a webapp version would be great if possible. Thanks.
Why not simply use W3C GeoLocation API available in mobile Safari? This will work on ipod touch as well (suburb precision).
It's literally 10 lines of code and the javascript will work without change on Firefox 3.5. Far easier than scrape some third party website.
http://www.instamapper.com/iphone
iPhone App store
While this may not directly answer your question, there are quite a few iPhone apps that already do this kind of thing with GPS. Instamapper is the first one I pulled up from the app store, but I'm sure you could find something to fit your needs.
I'm pretty sure you can't do what you want directly.
The best idea I can come up with is to "reuse" an iPhone app that records location and makes it accessible on the web. Take Twitter for example. If I'm not mistaken, Tapulous' app Twinkle will grab your location and post it to your Twitter.com user profile. Here's an example of what that looks like:
From your webapp, you could then scrape the user page for each person whose location you're interested in. It's a pain in the butt, but like I said, this is the best I could come up with.
Again, if you don't want to mess with Twitter, there may be other apps out there that do this as well, but I don't personally know of any. Good luck.
We built a really thin iphone client app that simply calls a predefined .js file on our site. Works like a charm.
See arisgames.org for the project.