| Author |  | 
      
        | traviskleckner Senior Member
 
  
  
 Joined: February 26 2007
 Location: United States
 Online Status: Offline
 Posts: 118
 | 
          Hello all!
           | Posted: October 06 2009 at 11:11 | IP Logged |   |  
           | 
 |  
 I just thought I would share the iPhone light control
 pages I've been working on.  These all run on the
 internal PowerHome web server.
 
 
 Home Page
 
 
 Master Suite
 
 
 Nursery
 
 
 Adjust Level
 This is the screen you get when clicking any of the
 device names.
 
 So far it works pretty well.  I've found that it's very
 fast on a desktop browser, but disappointingly slow on my
 actual phone (even WIFI) there is a second or 2 delay
 after each click as the page reloads.
 
 Which has led me to phase 2 of this project...
 
 IIS
 Sample
 
 This page runs all on IIS.  It's uses a version of the VB
 PH socket interface that I posted here a while back.  The
 nice thing about this page is that it's all one page,
 that is clicking the room buttons just reconfigures
 existing controls on the page.
 
 And it's all running AJAX, so clicking one light doesn't
 force a postback and reload the page. (of course the
 downside is that it doesn't automatically reflect changes
 that were made outside the app.  I'm working on a timer
 to update in the background though.)
 
 For what it's worth, the security on my IIS pages is
 basically that you need to be accessing it from an iPhone
 (or a browser that's fairly convincingly calling itself
 an iPhone.)  That said, I *think* there must be a way to
 get the ID or phone number of a incoming browser, since
 my bank app made me enter the mobile # that's authorized.
 If anyone knows how I can snag that info that would be
 great.  I'd love to force a redirect to a login screen
 from any device that's not *my* iPhone.
 
 Also, while I haven't tested this yet, word is there is a
 metatag you can add to a page that when you bookmark the
 page on iPhone, it then runs the page full screen and
 *NOT* in Safari's memory space.  It basically runs the
 page as an application (as long as you don't link off the
 page, which would then open in Safari.)  That's my goal
 once it's a little closer to working.
 
 Anywho, it's all very much a work in progress, but I
 thought I would share.
 
 -Travis
 
 Edited by traviskleckner - October 06 2009 at 11:19
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | raven77 Groupie
 
  
  
 Joined: January 02 2007
 Location: United States
 Online Status: Offline
 Posts: 44
 | 
          No code??
           | Posted: October 07 2009 at 08:51 | IP Logged |   |  
           | 
 |  
   PS here's the meta tag your looking for...
 <meta name="apple-mobile-web-app-capable" content="yes" />
 works great!
 
 Edited by raven77 - October 07 2009 at 08:54
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | traviskleckner Senior Member
 
  
  
 Joined: February 26 2007
 Location: United States
 Online Status: Offline
 Posts: 118
 | 
          Thanks for the meta tag.  I had that info but haven't yet
           | Posted: October 07 2009 at 10:14 | IP Logged |   |  
           | 
 |  tried it.  The IIS application version still very, very
 rough.  I'm currently working on the timing of the
 updates...I'm trying a version that polls PH to look for
 the update after you press a button so that the status
 indicator is consistently updated (something that's a
 significant issue with the PH version.)
 
 Do you want the code for the PH version or the IIS
 version?  The IIS version is still very rough, but I'm
 happy to share.
 
 The PH version is a little more polished, but as a web
 developer I am more than a little embarrassed about the
 crap mess state that the formatting and CSS are in.
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | onhiatus Senior Member
 
  
  
 Joined: May 12 2004
 Location: United States
 Online Status: Offline
 Posts: 279
 | 
          Note: The full page meta tag only works if you "save" the link to your home screen.
           | Posted: October 07 2009 at 14:59 | IP Logged |   |  
           | 
 |  
 Also, I had issues with the delay that's built into the iphone / touch safari - it seems that this was added to allow the app to interpret gestures and results in a minumum of about 300ms delay before a click is even registered. The good news is that you can add an event hook and get desktop browser like performance. I do this with all my iphone web apps.
 
 See this article for the details: Remove onClick delay on webkit for iPhone
 
 Also look around the site while you are htere - he has some great demos for spoofing native controls (spinners and indexed lists) in html
 
 Have fun! Tony
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | raven77 Groupie
 
  
  
 Joined: January 02 2007
 Location: United States
 Online Status: Offline
 Posts: 44
 | 
          
           | Posted: October 10 2009 at 20:08 | IP Logged |   |  
           | 
 |  
| traviskleckner wrote: 
 
    
    | 
      
       | Thanks for the meta tag.  I had that info but haven't yet tried it.  The IIS application version still very, very
 rough.  I'm currently working on the timing of the
 updates...I'm trying a version that polls PH to look for
 the update after you press a button so that the status
 indicator is consistently updated (something that's a
 significant issue with the PH version.)
 
 Do you want the code for the PH version or the IIS
 version?  The IIS version is still very rough, but I'm
 happy to share.
 
 The PH version is a little more polished, but as a web
 developer I am more than a little embarrassed about the
 crap mess state that the formatting and CSS are in.
 |  |  |  I wouldn't mind checking them both out...
   I have a few versions of an iphone webapp that I work on from time to time.  I am not using the onclick delay script but on wifi my buttons react pretty instant.
 I don't notice a delay at all!
 That's with an .html file served from PowerHome.  I was working a little on getting an IIS version up so I could use Ajax, but then I start playing around with the HTML5 .manifest that allows you to cache everything locally to the iPhone.  It's a neat idea but I can't get it to work with the powerhome webserver.  Another reason I wanna go IIS!
 I am not a web designer at all, I just learn as I go.  So some of my code is pretty darn messy too!
 FYI here is another cool thing recently added to iPhone 3.1 (I think)
 I'm sure you know about this one...
 <link rel="apple-touch-icon" href="/icon.png"/>
 That lets you supply your own icon when you save your webapp to the homescreen.
 But this is new I think...
 <link rel="apple-touch-startup-image" href="/startup.png"/>
 This will show any image you want while the page is loading.  I think it works out pretty nice!
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | kev21986 Senior Member
 
  
  
 Joined: April 04 2007
 Location: United States
 Online Status: Offline
 Posts: 199
 | 
          
           | Posted: October 20 2009 at 16:39 | IP Logged |   |  
           | 
 |  
| traviskleckner wrote: 
 
    
    | 
      
       | Hello all! So far it works pretty well.  I've found that it's very
 fast on a desktop browser, but disappointingly slow on my
 actual phone (even WIFI) there is a second or 2 delay
 after each click as the page reloads.
 
 |  |  |  
 I found the same thing about a year ago when I started playing with this.
 
 
 
| traviskleckner wrote: 
 
    
    | 
      
       | And it's all running AJAX, so clicking one light doesn't
 force a postback and reload the page. (of course the
 downside is that it doesn't automatically reflect changes
 that were made outside the app.  I'm working on a timer
 to update in the background though.)
 
 |  |  |  
 The AJAX approach works a lot better than full page reloads. The timer is a good idea and should help. I do the same thing with my iPhone App. It builds a list of devices that it needs to check and then checks the status of those devices every 10 seconds. There is no reason this couldn't be done in AJAX.
 
 I didn't make it that far before switching to native iPhone app development. It takes a lot longer to write, but you get a lot more control and much faster response. My app should be available soon.
 
 __________________
 Kevin Smith
 @respectTheCode
 | 
       
        | Back to Top |       | 
       
       
        |  |