iPhone Directory App

Discussion in 'iOS Programming' started by mmzplanet, Apr 28, 2010.

  1. mmzplanet macrumors regular


    Nov 4, 2004
    Six months or so ago, I picked up learning VB.NET and created a fairly large application for my organization. So I have some decent VB knowledge and very mild C programming knowledge. (I can read and interpret C, but writing good syntax consistently is another story, still lots of trial and error)

    Because I am one of the only Mac users in the department, and have some programming ability...my organization has asked if it is possible for me to create an internal iPhone application that will allow the physicians to have access to a medical staff directory (other physicians).

    The main staff system (Visual Cactus) stores all of its data into a MS SQL Database. I know that creating an app that can communicate with SQL is something a newbie to Cocoa and XCode is probably not going to have success with. A Mac Application.. maybe, an iPhone app is another story.

    My Plan:
    Have the DB export the needed data (Name/Phone/etc) to an XML file daily/weekly. This file can then be accessed online or downloaded by the iPhone application. Perhaps cache the last xml and grab the new one only if available. (not sure on all the iPhone app limitations)

    From what I understand, it is way more palatable for a newbie to XCode to create an app to read from XML.

    Any thoughts or opinions on this? I know I should know all this before going after it, but I find it way easier to learn something like this when you have a mission behind it. Also, any good resources to introduce someone to XCode who is coming from Visual Studio 2008? (There are ways to develop for both, but I'd prefer to tackle this one natively in Cocoa, I have to learn sometime)
  2. mmzplanet thread starter macrumors regular


    Nov 4, 2004
    Also, if anyone sees a better way. By all means tell me. :D

    I forgot to mention, the app (at version 1) should be able to list the directory and perhaps dial a listed number. Thats my initial goal anyway.
  3. flyingturtle macrumors regular

    Apr 7, 2010
    I'd do it via a web service. iPhone apps can consume online data via a web service. Build a web service that tied is to your MySQL database, and then the iPhone can make requests for data to it via a URL and then the web service will output the data back to the iPhone in either XML or JSON (depending on how you build it). JSON is more compact and my preference, but you can certainly use XML. The iPhone app will then receive the data, and if it's XML, you can use parse the XML.

    Buy the excellent "iPhone Programming: The Big Nerd Ranch Guide" book by Aaron Hillegass & Joe Conway. It has a great chapter on web services, chapter 21, and shows you how to consume a XML-based web service via NSURLConnection. BTW, if you ever do Mac Programming, the "Cocoa Programming for MAC OS X" also by Hillegass is excellent too. I have several iPhone and Mac programming books and Hillegass is my favorite author.

    You'll also need a book on Objective-C. The one by Stephen Kochan is highly recommended here. I like it too.

    Aside from the iPhone application itself, you'll obviously need to know how to make a web service. Since you know VB.NET, you could code a web service pretty easily with ASP.NET (you can code ASP.NET with VB, C#, IronPython, etc). I've made a web service in ASP.NET several times (I code in C#) and it was surprisingly easy. The only catch, in case, is that you have to know how to connect to a MySQL database rather than default MS SQL, but that isn't hard but you do have to configure something in Visual Studio and download a MySQL plugin in order to use MySQL as a datasource. I just googled and found tips about using MySQL instead of MS SQL as a database for ASP.NET. BTW, a good site for Visual Basic ASP.NET programmers is http://www.4guysfromrolla.com/.

    I just did a google search for "webservice VB.NET" and came up with a lot of articles and also with "mysql and vb.net". So you should have plenty to read if you go that route.

    There are non-Microsoft options for buliding web services, like using Apache web server and creating the web service in PHP or Python, too. I imagine there is a lot of pre-built scripts for that too. But it depends on your server environment (Windows, Linux, using IIS web server or Apache web server, etc).

    Anyway, get that iPhone book and you'll should get an idea of what you'll need to do and also research building web services with VB.NET/ASP.NET , also how to use MySQL with ASP.NET, and then you are set.

    You've got a list of things to tackle. 1) learn Objective-C 2) learn Cocoa Touch framework 3) learn how to read and parse XML and display it with an iPhone app 4) build a web service 5) associated skills with building a web service (may include VB.NET with ASP.NET tied to a MySQL database).

    As far as dialing a number, although I haven't tried it, you can use NSUrl to dial a number, too, in addition to opening URLs, etc.
  4. guptroh macrumors newbie

    Oct 3, 2010
    Can Iphone/Ipad Apps access Webservice that is internal to Enterprise Network?

    How can we make this APP and the Webservice Secure? are there any security threats that needs to be considered in this scenario?

Share This Page