4

How can I code a button to make a shortcut for mobile phone especially on iPhone and Android.

I'm using boilerplate as a framework so it would automatically be adding this on the head section <link rel="shortcut icon" href="img/l/apple-touch-icon.png">. I think this would be my default icon to be used.

now I have a button in my html that is setup like this

<a href="#"><img src="img/button-shortcut.jpg" /></a>

I'm not sure what to put in my href or should I implement it using javascript. I'm also not sure what is the proper term, I'm just guessing it's called as a "shortcut"

What' I'm trying to achieve is, I have a simple web app (plain html) and I have a button to add a shortcut/icon on their homescreen. That way it's easier for them to access my website/web app. My target devices are iphone and android primarily.

Can someone enlighten me?

Thanks!

enter image description here

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Pennf0lio
  • 3,888
  • 8
  • 46
  • 70

1 Answers1

2

You can't make a shortcut link for this functionality on iOS, and I'm not aware of a way on Android either. iOS users have to use the Safari toolbar to add something to the home screen.

Some sites use JavaScript to present the user with a little popup, like this:

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • 2
    I've stopped visiting the last site that showed me one of those. It was &^%$@ing irritating. – Quentin Apr 10 '12 at 16:01
  • 1
    Thanks for confirming. Do you think this is relevant? http://code.google.com/p/mobile-bookmark-bubble/ – Pennf0lio Apr 10 '12 at 16:03
  • Btw, the button isn't that obvious like what i put on my sample above. it will just be optional for user if they want to add it. So we're not forcing them to add the app – Pennf0lio Apr 10 '12 at 16:06
  • That code would appear to do what I've shown in the screenshot. – ceejayoz Apr 10 '12 at 16:06
  • I tryed to do that but i was not able to do it at least as far as i know is not posible. If there is a way it might be really recent. – PedroAGSantos Apr 10 '12 at 16:13
  • @subspider oh i see. Thanks again. But this is not what I'm trying to achieve. – Pennf0lio Apr 10 '12 at 16:23