HomeStoreForumsWikiiPhone Native AppsiPhone Apps modmyifone Downloadsmodmyifone Links








Cell Phone Reception

Go Back   iPhone Forums at ModMyiFone.com - iPhone | iPod Touch, news, apps, themes. > 3rd Party Apps For iPhone | iPod Touch > 3rd Party Apps Requests
Register FAQ Members List READ THIS Today's Posts Mark Forums Read

3rd Party Apps Requests Request iPhone apps here.


MMi Super Contest | 30 winners! Over $1500 in Prizes! Enter Today!

Discuss AppStore Apps! | MMi Cydia Repo Download Stats

Get more out of ModMyiFone by joining our free community. By registering you get privileges to download files from our downloads section and you may also post your questions in our forums! It's fast, free, and easy!

2.0 Unlock|Jailbreak OS X / Windows | iPhone 3G Detailed Review w/Pics! | Developers - Port Your Apps to 2.0
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-08-2007, 03:24 PM
iPhoneaholic
 
Join Date: Oct 2007
Location: BOOTLOADER
Posts: 454
Thanks: 6
Thanked 515 Times in 107 Posts
iPhone Web Development Tips and Official Documentation Released

iPhone Web Development Tips and Official Documentation Released

As soon as the iPhone was in developers hands on Friday they were hacking around. This involved doing a "for (var key in document)" and the like to see what was available.

In an ideal world, Apple would have released a beautiful set of documentation for the community, but they were probably too busy getting the phone out of the door (maybe can't blame them huh).

The community has begun to document things:

Getting rid of the toolbar

You can scroll down a little, enough to get rid of the toolbar via:
Code:
javascript:
   1.
   2.
      window.onload = function() {
   3.
        setTimeout(function(){window.scrollTo(0, 1);}, 100);
   4.
      }
   5.
but what about handling the rotation of the phone?

Updating the Layout when the user rotates

Joe Hewitt built a liquid layout that watches the the change from portrait to landscape mode.
Code:
javascript:
   1.
   2.
      addEventListener("load", function()
   3.
      {
   4.
          setTimeout(updateLayout, 0);
   5.
      }, false);
   6.
   7.
      var currentWidth = 0;
   8.
   9.
      function updateLayout()
  10.
      {
  11.
          if (window.innerWidth != currentWidth)
  12.
          {
  13.
              currentWidth = window.innerWidth;
  14.
  15.
              var orient = currentWidth == 320 ? "profile" : "landscape";
  16.
              document.body.setAttribute("orient", orient);
  17.
              setTimeout(function()
  18.
              {
  19.
                  window.scrollTo(0, 1);
  20.
              }, 100);           
  21.
          }
  22.
      }
  23.
  24.
      setInterval(updateLayout, 400);
  25.
Notice that there isn't a nice event for "hey I just changed mode". Instead, we have to poll and check the current width.

meta viewport

There is also a lot of chat about the viewport tag, and people are experimenting with getting a nice outcome when jumping between the various modes. E.g.
Code:
HTML:
   1.
   2.
      <meta name="viewport" content="width=480; initial-scale=0.6666; maximum-scale=1.0; minimum-scale=0.6666" />
   3.
View Source

To do a lot of testing, it would help to be able to do a view source on other cool iPhone applications. this work, based on Abe's let's you.

Drag and drop

Everyone has been a bit frustrated with the lack of events, but between Tahoma Toelkes and Joe Hewitt, we have a drag demo that works when you do a two-finger vertical dragging motion on the phone, but only for certain elements such as textareas.

Then comes the official docs

After all of this tinkering, we finally get the official docs from Apple. They are a little sparse, and don't seem to have much new, but at least they are out there, and they are official.

It is here that you can learn:

* How Apple thinks you should specify an iPhone only set of style (mixed reviews on how IE handles this). The iPhone ignores the handheld profile as it thinks of itself as a desktop browser instead.
Code:
      HTML:
         1.
         2.
            <link media="only screen and (max-device-width: 480px)" href="iPhone.css" type="text/css" rel="stylesheet" />
         3.
* The various meta data for viewport:
o width The default is 980. The range is [200, 10,000].
o height The default is calculated based on the width and aspect ratio. The range is [223, 10,000].
o initial-scale is the scale to render the page when it first loads. The default fits the page to the screen. The range is [minimum-scale, maximum-scale]. Keep in mind that the user can change the scale, either through the pinch gesture or by a double tap.
o user-scalable determines whether or not the user can scale the page. The default is yes.
o minimum-scale is the lower bound for scaling. The default is 0.25; the range is [>0, 10].
o maximum-scale is the upper bound for scaling. The default is 1.6; the range is [>0, 10].
* How to interact with the apps from JavaScript
o Phone call: <a href="tel:1-408-555-5555">1-408-555-5555</a>
o Mail: <a href="mailto:frank@wwdcdemo.example.com">John Frank</a>
o Google Maps: <a href="http://maps.google.com/maps?q=cupertino">Cupertino</a>
* How to embed a movie in a page (making sure to setup a preview image)
* Making sure your text is readable
* And much more.

The documentation states that Safari for iPhone is your good old Safari, however there seem to be a LOT of differences in practice, and it has been said that the codebase was forked some time ago.

More information on iPhone Development

I recommend hanging out on the iPhoneWebDev group, and we are excited to have Joe Hewitt himself speak at The Ajax Experience in a few weeks, all about his experience with the iPhone, and what he has learnt.
__________________
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
The Following 2 Users Say Thank You to ReVan For This Useful Post:
blue_wind (10-09-2007), Happylinks (09-02-2008)
Reply

  iPhone Forums at ModMyiFone.com - iPhone | iPod Touch, news, apps, themes. > 3rd Party Apps For iPhone | iPod Touch > 3rd Party Apps Requests

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

ModMyMoto.com - ModMyGPhone.com - ModMyiFone.com - Dedicated Server Hosting by SingleHop - iPhone Wallpapers - iPhone forums | iPod touch forums, news, themes, apps, games, unlock, jailbreak community - ModMyiFone.com RSS Feeds - Contact Us - Link to us - Archive - Privacy Statement - - Top
Copyright © 2007-08 by ModMy, LLC. All rights reserved. You may not copy anything on this site unless you link to the original.
All times are GMT -6. The time now is 10:31 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
ModMyiFone.com is an independent publication and has not been authorized, sponsored, or otherwise approved by Apple, Inc or Cisco Systems, Inc. The information contained on this site is for educational purposes only.
Forum skin by poetic_folly