|By Mike Jacobs||
|March 17, 2011 03:00 PM EDT||
Which mobile device should I target for my application? That's one of the first questions you need to answer as a mobile developer. You might select the device based on personal preference or what looks cool today. The problem is that mobile technology choices are diverse and evolving quickly. The tools and languages used to develop native applications vary wildly and you probably cannot afford to learn them all. Chances are you want to find a way to replicate your application across multiple devices while minimizing your investment. How can that be done?
Hybrid Is More than a Green Decision
Figure 1 - This diagram depicts the major differences between mulitple native and hybrid application development
Sencha Touch Is My Cup of Tea
The Sencha company logo is a green leaf, presumably because sencha is a Japanese whole leaf green tea. I am an ardent coffee drinker but I really like this tea. Sencha is perhaps best known for their Ext JS and Ext GWT libraries. Sencha Touch is their latest library released late in 2010. There are several similar libraries in various stages of development, but Sencha was one of the first to market and I am working on commercial products that depend on released libraries. The first release includes support for Android and Apple iOS devices. Reading the tea leaves promises future support for Blackberry 6 and Blackberry Torch. The library is open source and supports a dual license approach making it appropriate for commercial use. The library includes:
- Robust data integration including access to AJAX, JSONP, or YQL and local storage
- Large library of user interface elements many of which automatically bind to the data objects
- Advanced native look-and-feel styling, animation and branding capabilities
- Model, View, Controller (MVC) support to put it all together
Figure 2 - Example Sencha Touch application running on Apple iPhones
My First Sips of Sencha
I started using Sench Touch in the Summer of 2010 while it was in beta. I had the typical beta experience of incomplete documentation, a few bugs and changing API. Over the frequent updates, the documentation improved and examples were updated to align with the latest API. Throughout the beta and after the production release, I worked on my application. My application successfully used local storage, tree and carousal navigation, animated transitions, custom search features and selective user updates to content. The plan is to deploy on Apple iOS devices first with the need for possibly many different branding themes.
I found it quite easy to define enities and storage objects with the data integration features. The storage objects were extensible enough to add custom search features. The user interface elements often took some experimentation and reverse engineering to fill in the gaps of light documentation. I had to become familiar with the inspection and debugging features of Chrome and Safari to ultimately answer many questions. There are still a few inconsistencies in how user interface element templates are used but overall, the library is quite complete. One of the most powerful user interface features is the branding support.
The branding support in Sencha uses Syntactically Awesome Stylesheets (SASS). SASS is a scripting language that describes how to generate cascading stylesheets. Need to change your corporate color across all user interface elements? Change it in one place and regenerate your native look-and-feel stylesheet. Sencha Touch ships with a full library of SASS scripts that you can easily extend to meet your branding needs. This approach also encodes images into the stylesheet to reduce the number of files to deploy. I was able to extend the SASS to specify branding color selections, omit unused user interface elements and specify the needed icons.
Figure 3 - You can also write applications for the Apple iPad
This is Only a Test
- Continuous integration
- Multiple browser testing
- Event testing
- Mock objects
- Organization of tests (e.g. suites)
- Code coverage reports
Figure 4 - A unit testing console for displaying progress and results
- Start the Selenium RC server
- Specify the regression test HTML files
- Specify the browsers to run the regression
- Run the tests
- Collect and report the success or failure of the tests
- Optionally create coverage reports
- Shutdown the Selenium RC server
PhoneGap also provides console integration with desktop debuggers, support for six platforms and integrated development environment (IDE) project templates. You must have your target platform SDK installed to use PhoneGap. Since my project is targeting Apple iOS, that means a Mac running the Xcode IDE and the iOS SDK. After downloading and installing the IDE, SDK and PhoneGap, a new project template was available. I created a new PhoneGap project and the template created all the native programs, build targets and default properties and images for me. I copied the application build results into the Xcode project, pressed Build and Run and the application was running in the phone simulator. It was that simple. No Objective-C to learn or write with less than a day from install to running.
Gaps with PhoneGap
Despite the trivial effort to get the application running on the simulator, there were three minor gaps to address:
- The default target is iPhones. This means the application would start up and run on an iPad with the dimensions of a phone (with the 2x option). Sencha Touch reported the platform as a phone even when running on the actual iPad device. Ideally, the default would be what Apple calls a Universal App that runs on all devices and adjusts itself when running. After some research, I found that the solution was few mouse clicks away within Xcode.
- Orientation changes did not work. A Sencha Touch application can change the way it looks based on the orientation of the device. PhoneGap always reported the device orientation as portrait (0 degrees) even though Sencha Touch correctly reported the current orientation. The solution was a minor hack to monitor for the window resize event and inform Sencha Touch to do the right thing.
- Certain text was rendered as a link. Clicking on the link offered to add or update a contact. What was that all about? It turns out the default web view component in the iOS SDK attempts to find phone number and e-mail addresses and automatically makes them links to the appropriate app like contacts. Pretty cool if you want that behavior but does 001-999.9 look like a phone number? The solution was to add one line of Objective-C code in the PhoneGap generated code to turn this behavior off.
Live Long and Provision
In order to get your application running on an actual device you must go through a complex process Apple calls provisioning. There is a nice step by step procedure to get you through it all available on the Apple developer site. Now that I have my Sencha Touch application running on an iPad I see that performance work is needed. Now that automated build and test process is going to pay off. It is clear to me that a robust development cycle with this technology is possible and practical.
There are bound to be changes in the available libraries and supported devices in the coming months. Sencha Touch and PhoneGap is a powerful and easy to use combination that is ready now.
- Opinions expressed in this article are those solely of the author and do not reflect those of my employer.
- iPhone image Courtesy of Apple
- Sencha Touch application images used with permission
- The Android logo is reproduced from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
- Sencha: http://www.sencha.com/
- SASS: http://sass-lang.com/
- YUI Test Standalone Library: http://yuilibrary.com/yuitest/
- Selenium Remote Control: http://seleniumhq.org/projects/remote-control/
- Apache Ant: http://ant.apache.org/
- LCOV: http://ltp.sourceforge.net/coverage/lcov.php
- PhoneGap: http://www.phonegap.com/
Internet of @ThingsExpo, taking place June 6-8, 2017 at the Javits Center in New York City, New York, is co-located with the 20th International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. @ThingsExpo New York Call for Papers is now open.
Jan. 19, 2017 07:30 AM EST Reads: 3,616
Smart Cities are here to stay, but for their promise to be delivered, the data they produce must not be put in new siloes. In his session at @ThingsExpo, Mathias Herberts, Co-founder and CTO of Cityzen Data, discussed the best practices that will ensure a successful smart city journey.
Jan. 19, 2017 07:00 AM EST Reads: 1,999
Every successful software product evolves from an idea to an enterprise system. Notably, the same way is passed by the product owner's company. In his session at 20th Cloud Expo, Oleg Lola, CEO of MobiDev, will provide a generalized overview of the evolution of a software product, the product owner, the needs that arise at various stages of this process, and the value brought by a software development partner to the product owner as a response to these needs.
Jan. 19, 2017 07:00 AM EST Reads: 1,200
@ThingsExpo has been named the ‘Top WebRTC Influencer' by iTrend. iTrend processes millions of conversations, tweets, interactions, news articles, press releases, blog posts - and extract meaning form them and analyzes mobile and desktop software platforms used to communicate, various metadata (such as geo location), and automation tools. In overall placement, @ThingsExpo ranked as the number one ‘WebRTC Influencer' followed by @DevOpsSummit at 55th.
Jan. 19, 2017 06:00 AM EST Reads: 4,753
In 2014, Amazon announced a new form of compute called Lambda. We didn't know it at the time, but this represented a fundamental shift in what we expect from cloud computing. Now, all of the major cloud computing vendors want to take part in this disruptive technology. In his session at 20th Cloud Expo, John Jelinek IV, a web developer at Linux Academy, will discuss why major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform are all trying to sidestep VMs and containers...
Jan. 19, 2017 06:00 AM EST Reads: 822
SYS-CON Events announced today that MobiDev, a client-oriented software development company, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MobiDev is a software company that develops and delivers turn-key mobile apps, websites, web services, and complex softw...
Jan. 19, 2017 05:30 AM EST Reads: 1,892
The cloud market growth today is largely in public clouds. While there is a lot of spend in IT departments in virtualization, these aren’t yet translating into a true “cloud” experience within the enterprise. What is stopping the growth of the “private cloud” market? In his general session at 18th Cloud Expo, Nara Rajagopalan, CEO of Accelerite, explored the challenges in deploying, managing, and getting adoption for a private cloud within an enterprise. What are the key differences between wh...
Jan. 19, 2017 01:15 AM EST Reads: 6,105
"Tintri was started in 2008 with the express purpose of building a storage appliance that is ideal for virtualized environments. We support a lot of different hypervisor platforms from VMware to OpenStack to Hyper-V," explained Dan Florea, Director of Product Management at Tintri, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Jan. 19, 2017 12:45 AM EST Reads: 4,713
The security needs of IoT environments require a strong, proven approach to maintain security, trust and privacy in their ecosystem. Assurance and protection of device identity, secure data encryption and authentication are the key security challenges organizations are trying to address when integrating IoT devices. This holds true for IoT applications in a wide range of industries, for example, healthcare, consumer devices, and manufacturing. In his session at @ThingsExpo, Lancen LaChance, vic...
Jan. 18, 2017 09:45 PM EST Reads: 6,523
WebRTC has had a real tough three or four years, and so have those working with it. Only a few short years ago, the development world were excited about WebRTC and proclaiming how awesome it was. You might have played with the technology a couple of years ago, only to find the extra infrastructure requirements were painful to implement and poorly documented. This probably left a bitter taste in your mouth, especially when things went wrong.
Jan. 18, 2017 09:30 PM EST Reads: 7,640
Big Data, cloud, analytics, contextual information, wearable tech, sensors, mobility, and WebRTC: together, these advances have created a perfect storm of technologies that are disrupting and transforming classic communications models and ecosystems. In his session at @ThingsExpo, Erik Perotti, Senior Manager of New Ventures on Plantronics’ Innovation team, provided an overview of this technological shift, including associated business and consumer communications impacts, and opportunities it m...
Jan. 18, 2017 09:30 PM EST Reads: 5,751
You have great SaaS business app ideas. You want to turn your idea quickly into a functional and engaging proof of concept. You need to be able to modify it to meet customers' needs, and you need to deliver a complete and secure SaaS application. How could you achieve all the above and yet avoid unforeseen IT requirements that add unnecessary cost and complexity? You also want your app to be responsive in any device at any time. In his session at 19th Cloud Expo, Mark Allen, General Manager of...
Jan. 18, 2017 07:30 PM EST Reads: 3,156
WebRTC is bringing significant change to the communications landscape that will bridge the worlds of web and telephony, making the Internet the new standard for communications. Cloud9 took the road less traveled and used WebRTC to create a downloadable enterprise-grade communications platform that is changing the communication dynamic in the financial sector. In his session at @ThingsExpo, Leo Papadopoulos, CTO of Cloud9, discussed the importance of WebRTC and how it enables companies to focus o...
Jan. 18, 2017 06:15 PM EST Reads: 4,208
Big Data engines are powering a lot of service businesses right now. Data is collected from users from wearable technologies, web behaviors, purchase behavior as well as several arbitrary data points we’d never think of. The demand for faster and bigger engines to crunch and serve up the data to services is growing exponentially. You see a LOT of correlation between “Cloud” and “Big Data” but on Big Data and “Hybrid,” where hybrid hosting is the sanest approach to the Big Data Infrastructure pro...
Jan. 18, 2017 05:30 PM EST Reads: 4,896
In his General Session at 16th Cloud Expo, David Shacochis, host of The Hybrid IT Files podcast and Vice President at CenturyLink, investigated three key trends of the “gigabit economy" though the story of a Fortune 500 communications company in transformation. Narrating how multi-modal hybrid IT, service automation, and agile delivery all intersect, he will cover the role of storytelling and empathy in achieving strategic alignment between the enterprise and its information technology.
Jan. 18, 2017 04:45 PM EST Reads: 4,613
Buzzword alert: Microservices and IoT at a DevOps conference? What could possibly go wrong? In this Power Panel at DevOps Summit, moderated by Jason Bloomberg, the leading expert on architecting agility for the enterprise and president of Intellyx, panelists peeled away the buzz and discuss the important architectural principles behind implementing IoT solutions for the enterprise. As remote IoT devices and sensors become increasingly intelligent, they become part of our distributed cloud enviro...
Jan. 18, 2017 04:30 PM EST Reads: 4,832
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place June 6-8, 2017, at the Javits Center in New York City, New York, is co-located with 20th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry p...
Jan. 18, 2017 03:30 PM EST Reads: 3,707
"LinearHub provides smart video conferencing, which is the Roundee service, and we archive all the video conferences and we also provide the transcript," stated Sunghyuk Kim, CEO of LinearHub, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
Jan. 18, 2017 02:45 PM EST Reads: 1,605
Things are changing so quickly in IoT that it would take a wizard to predict which ecosystem will gain the most traction. In order for IoT to reach its potential, smart devices must be able to work together. Today, there are a slew of interoperability standards being promoted by big names to make this happen: HomeKit, Brillo and Alljoyn. In his session at @ThingsExpo, Adam Justice, vice president and general manager of Grid Connect, will review what happens when smart devices don’t work togethe...
Jan. 18, 2017 02:00 PM EST Reads: 434
"There's a growing demand from users for things to be faster. When you think about all the transactions or interactions users will have with your product and everything that is between those transactions and interactions - what drives us at Catchpoint Systems is the idea to measure that and to analyze it," explained Leo Vasiliou, Director of Web Performance Engineering at Catchpoint Systems, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York Ci...
Jan. 18, 2017 01:00 PM EST Reads: 5,632