Programming the Mobile Web

0
(0)

Programming the Mobile Web
 

  • Author:Maximiliano Firtman
  • Length: 512 pages
  • Edition: 1
  • Publisher: O’Reilly Media
  • Publication Date: 2010-07-30
  • ISBN-10: 0596807783
  • ISBN-13: 9780596807788
  • Sales Rank: #2865512 (See Top 100 Books)
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Today’s market for mobile apps goes beyond the iPhone to include BlackBerry, Nokia, Windows Phone, and smartphones powered by Android, webOS, and other platforms. If you’re an experienced web developer, this book shows you how to build a standard app core that you can extend to work with specific devices. You’ll learn the particulars and pitfalls of building mobile apps with HTML, CSS, and other standard web tools.
    You’ll also explore platform variations, finicky mobile browsers, Ajax design patterns for mobile, and much more. Before you know it, you’ll be able to create mashups using Web 2.0 APIs in apps for the App Store, App World, Ovi Store, Android Market, and other online retailers.

    • Learn how to use your existing web skills to move into mobile development
    • Discover key differences in mobile app design and navigation, including touch devices
    • Use HTML, CSS, JavaScript, and Ajax to create effective user interfaces in the mobile environment
    • Learn about technologies such as HTML5, XHTML MP, and WebKit extensions
    • Understand variations of platforms such as Symbian, BlackBerry, webOS, Bada, Android, and iOS for iPhone and iPad
    • Bypass the browser to create offline apps and widgets using web technologies

    (edited by author)

    Seven Myths of the Mobile Web
    by Maximiliano Firtman

    As the Web has moved onto mobile devices, developers have told themselves a lot of stories about what this means for their work. While some of those stories are true, others are misleading, confusing, or even dangerous.

    It’s not the mobile web; it’s just the Web!

    I’ve heard this quote many times in the last few years, and it’s true. It’s really the same Web. Think about your life. You don’t have another email account just for your mobile. (OK, I know some guys that do, but I believe that’s not typical!)

    You read about the last NBA game on your favorite site, like ESPN; you don’t have a desktop news source and a different mobile news source. You really don’t want another social network for your mobile; you want to use the same Facebook or Twitter account as the one you used on your desktop. It was painful enough creating your friends list on your desktop, you’ve already ignored many people…you don’t want to have to do all that work again on your mobile.

    For all of these purposes, the mobile web uses the same network protocols as the whole Internet: HTTP, HTTPS, POP3, Wireless LAN, and even TCP/IP. OK, you can say that GSM, CDMA, and UMTS are not protocols used in the desktop web environment, but they are communication protocols operating at lower layers. From our point of view, from a web application approach, we are using the same protocols.

    So, yes…it’s the same Web. However, when developing for the mobile web we are targeting very, very different devices. The most obvious difference is the screen size, and yes, that will be our first problem. But there are many other not-so-obvious differences. One issue is that the contexts in which we use our mobile devices are often extremely different from where and how we use our comfortable desktops or even our laptops and netbooks.

    Don’t get me wrong–this doesn’t mean that, as developers, we need to create two, three, or dozens of versions duplicating our work. In this book, we are going to analyze all the techniques available for this new world. Our objective will be to make only one product, and we’ll analyze the best way to do it.

    You don’t need to do anything special about your desktop website.

    Almost every smartphone on the market today–for example, the iPhone and Android-based devices–can read and display full desktop websites. Yes, this is true. Users want the same experience on the mobile web as they have on their desktops. Yes, this is also true. Some statistics even indicate that users tend to choose web versions over mobile versions when using a smartphone.

    However, is this because we really love zooming in and out, scrolling and crawling for the information we want, or is it because the mobile versions are really awful and don’t offer the right user experience? I’ve seen a lot of mobile sites consisting of nothing but a logo and a couple of text links. My smartphone wants more!

    One website should work for all devices (desktop, mobile, TV, etc.).

    As we will see, there are techniques that allow us to create only one file but still provide different experiences on a variety of devices, including desktops, mobiles, TVs, and game consoles. This vision is called “One Web.” This is to an extent possible today, but the vision won’t fully be realized for years to come. Today, there are a lot of mobile devices with very low connection speeds and limited resources–non–smartphones—that, in theory, can read and parse any file, but will not provide the best user experience and will have compatibility and performance problems if we deliver the same document as for desktop. Therefore, One Web remains a goal for the future. A little additional work is still required to provide the right user experience for each mobile device, but there are techniques that can be applied to reduce the work required and avoid code and data duplication.

    Mobile web is really easy; Just create a WML file.

    I’m really surprised how many mobile websites are still developed using a technology deprecated many years ago: WML (Wireless Markup Language). Even in emerging markets, there are almost no WML-only web-capable devices on the market today. The worst part of this story is that these developers think that this is the markup language for the mobile web. Wrong! WML development was called mobile web (or WAP) development a couple of years ago, when the first attempt at building a mobile web was made. There are still a small proportion of WML-only devices available in some markets, but WML is definitely not the mobile web today.

    Just create an HTML file with a width of 240 Pixels, and you have a mobile website.

    This is the other fast-food way to think about the mobile web. Today, there are more than 3,000 mobile devices on the market, with almost 30 different browsers (actually, more than 300 different browsers if we separate them by version number). Creating one HTML file as your mobile website will be a very unsuccessful project. In addition, doing so contributes to the belief that mobile web browsing is not useful.

    Native mobile applications will kill the mobile web.

    Every solution has advantages and disadvantages. The mobile web has much to offer native applications, as Chapter 12 of this book will demonstrate. The mobile web (and the new concept of mobile widgets) offers us a great multi-device application platform, including local applications that don’t require an always-connected Web with URLs and browsers.

    People are not using their mobile browsers.

    How many Internet connections are there in the world?

      1,802,330,457 (26% of the world’s population) at the beginning of 2010 (http://www.internetworldstats.com)

    How many people have mobile devices?

      4,600,000,000 (68% of the population) at the beginning of 2010 (U.N. Telecommunications Agency, http://www.itu.int)

    So, one of the reasons why people are not using their mobile browsers may be because of us, the web producers. We are not offering them what they need. There are other factors, but let’s talk about what we can do from our point of view.

    Opera Mini is a mobile browser for low- and mid-range devices. It is free and it has had more than 50 million downloads to date. This tells us that 50 million users wanted to have a better mobile web experience, so they went out and got Opera Mini. Do all the 4 billion plus worldwide mobile device users know about Opera Mini? Perhaps not, so it’s difficult to know how many would be interested in trying this different mobile web experience. However, 50 million downloads for only one browser that the user had to install actively is a big number for me. When Opera Mini appeared in Apple Inc.’s App Store, from which users can download and install applications for the iPhone, iPod, and iPad, 1 million users downloaded the browser on the first day. This is quite impressive.

    Today, less than 4% of total web browsing is done from mobile devices. This percentage is increasing month by month. Mobile browsing may never become as popular as desktop browsing, but it will increase a lot in the following years.

    In addition, user browsing on mobile devices will likely have a higher conversion rate. How many tabs do you usually have open at once in Internet Explorer or Firefox on your desktop or laptop? On a mobile device, when you browse you are more specific and more likely to act on what you find.

    中文:

    书名:对移动Web进行编程

    如今,中国的移动应用市场已经超越了iPhone,包括黑莓、诺基亚、Windows Phone,以及搭载Android、WebOS和其他平台的智能手机。如果你是一名经验丰富的Web开发人员,这本书将向你展示如何构建一个标准的应用核心,你可以将其扩展到与特定设备一起工作。您将了解使用HTML、CSS和其他标准Web工具构建移动应用程序的细节和陷阱。
    您还将探索平台变化、挑剔的移动浏览器、针对移动的AJAX设计模式等等。不知不觉中,你将能够在App Store、App World、Ovi Store、Android Market和其他在线零售商的应用程序中使用Web2.0API创建Mashup。

    • 了解如何利用现有的网络技能进入移动开发领域
    • 发现移动应用程序设计和导航方面的主要差异,包括触控设备
    • 使用HTML、CSS、JavaScript和AJAX在移动环境中创建有效的用户界面
    • Learn about technologies such as HTML5, XHTML MP, and WebKit extensions
    • 了解适用于iPhone和iPad的各种平台,如Symbian、BlackBerry、WebOS、Bada、Android和iOS
    • 绕过浏览器以使用Web技术创建离线应用程序和小部件

    (作者编辑)

    移动网络的七大误区
    马克西米利亚诺·菲尔特曼著

    随着网络转移到移动设备上,开发人员给自己讲了很多关于这对他们的工作意味着什么的故事。虽然这些故事中的一些是真的,但另一些故事是误导、令人困惑的,甚至是危险的。

    这不是移动网络,而是网络!

    在过去的几年里,我听过很多次这句话,这是真的。这真的是同一个网页。想想你的生活。你没有另一个专为你的手机准备的电子邮件账户。(好的,我知道有些人这样做,但我相信这不是典型的!)

    你在你最喜欢的网站上读到了上一场NBA比赛,比如ESPN;你没有一个桌面新闻来源和一个不同的移动新闻来源。你真的不想为你的手机使用另一个社交网络;你想要使用与你在桌面上使用的相同的Facebook或Twitter账户。在桌面上创建朋友列表已经够痛苦的了,你已经忽略了很多人…你不会想要再次在手机上做所有这些工作的。

    出于所有这些目的,移动网络使用与整个互联网相同的网络协议:HTTP、HTTPS、POP3、无线局域网,甚至是TCP/IP。好的,您可以说GSM、CDMA和UMTS不是桌面Web环境中使用的协议,但它们是在较低层运行的通信协议。从我们的观点来看,从Web应用程序的方法来看,我们使用的是相同的协议。

    所以,是的,…这是同一个网络。然而,在为移动网络开发时,我们的目标是非常不同的设备。最明显的区别是屏幕大小,是的,这将是我们的第一个问题。但还有许多其他不太明显的区别。一个问题是,我们使用移动设备的环境往往与我们使用舒适的台式机、甚至笔记本电脑和上网本的地点和方式截然不同。

    不要误解我的意思,这并不意味着作为开发人员,我们需要创建两个、三个或几十个版本来重复我们的工作。在这本书中,我们将分析适用于这个新世界的所有技术。我们的目标是只生产一种产品,我们将分析实现这一目标的最佳方式。

    你不需要对你的桌面网站做任何特别的事情。

    如今市场上几乎所有的智能手机,比如iPhone和基于Android的设备,都可以阅读和显示完整的桌面网站。是的,这是真的。用户希望在移动网络上获得与在桌面上相同的体验。是的,这也是真的。一些统计数据甚至表明,用户在使用智能手机时倾向于选择网络版本,而不是手机版本。

    然而,这是因为我们真的喜欢放大和缩小,滚动和爬行我们想要的信息,还是因为手机版本真的很糟糕,没有提供正确的用户体验?我见过很多手机网站,除了一个徽标和几个文本链接,什么都没有。我的智能手机想要更多!

    One website should work for all devices (desktop, mobile, TV, etc.).

    正如我们将看到的,有一些技术允许我们只创建一个文件,但仍然可以在各种设备上提供不同的体验,包括台式机、手机、电视和游戏机。这个愿景被称为“一张网”。今天这在一定程度上是可能的,但这一愿景在未来几年内不会完全实现。如今,有很多连接速度非常慢、资源有限的移动设备–非智能手机–理论上可以读取和解析任何文件,但不能提供最佳的用户体验,如果我们提供与台式机相同的文档,将会出现兼容性和性能问题。因此,One Web仍然是未来的目标。为每个移动设备提供正确的用户体验仍然需要一些额外的工作,但可以应用一些技术来减少所需的工作并避免代码和数据重复。

    移动网络非常简单,只需创建一个WML文件即可。

    我真的很惊讶,许多移动网站仍然使用一种多年前就不再使用的技术来开发:WML(无线标记语言)。即使是在新兴市场,如今市场上也几乎没有只支持WML的网络设备。这个故事最糟糕的部分是,这些开发人员认为这是移动网络的标记语言。不对!几年前,WML开发被称为移动网络(或WAP)开发,当时人们首次尝试构建移动网络。在一些市场上,仍然有一小部分仅支持WML的设备可用,但WML绝对不是今天的移动网络。

    只需创建一个宽度为240像素的HTML文件,您就拥有了一个移动网站。

    这是另一种考虑移动网络的快餐方式。今天,市场上有3000多台移动设备,有近30种不同的浏览器(如果我们按版本号分开,实际上有300多种不同的浏览器)。创建一个HTML文件作为您的移动网站将是一个非常不成功的项目。此外,这样做还会助长这样一种信念,即移动网络浏览没有用处。

    原生移动应用程序将扼杀移动网络。

    每种解决方案都有优缺点。正如本书第12章将演示的那样,移动网络有很多可以提供原生应用的东西。移动Web(以及移动窗口小部件的新概念)为我们提供了一个强大的多设备应用程序平台,包括不需要始终连接到URL和浏览器的Web的本地应用程序。

    People are not using their mobile browsers.

    世界上有多少互联网连接?

      2010年初1,802,330,457人(占世界人口的26%)(http://www.internetworldstats.com)

    有多少人拥有移动设备?

      2010年初46亿人(占人口的68%)(联合国电信署,http://www.itu.int)

    因此,人们不使用移动浏览器的原因之一可能是因为我们这些网络制作人。我们没有给他们提供他们需要的东西。还有其他因素,但让我们从我们的角度谈谈我们可以做些什么。

    Opera Mini是一款面向中低端设备的移动浏览器。它是免费的,到目前为止已经有超过5000万的下载量。这告诉我们,5000万用户想要更好的移动网络体验,所以他们出去买了Opera Mini。全球40多亿移动设备用户都知道Opera Mini吗?也许不是,所以很难知道有多少人会有兴趣尝试这种不同的移动网络体验。然而,用户必须主动安装的一个浏览器的5000万下载量对我来说是一个很大的数字。当Opera Mini出现在苹果公司的App Store上时,用户可以从App Store下载和安装iPhone、iPod和iPad的应用程序,第一天就有100万用户下载量。这真是令人印象深刻。

    如今,只有不到4%的网页浏览是通过移动设备完成的。这一比例正在逐月增加。移动浏览可能永远不会像桌面浏览那样流行,但在接下来的几年里,它会增加很多。

    此外,用户在移动设备上浏览可能会有更高的转换率。在你的台式机或笔记本电脑上,你通常一次在IE或Firefox中打开多少个标签?在移动设备上,当你浏览时,你会更具体,更有可能根据你找到的东西采取行动。

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册