Categories
Uncategorized

Learn how to build Shopify apps with “Shopify Application Development”, a book technically reviewed by Yours Truly

shopify application development

Michael Larkin has been helping people build online shops with Shopify for years in all sorts of ways. He’s helped people set up shops, he’s taken stock Shopify stores and hot-rodded them with all sorts of customizations, and he co-authored one of the first Shopify apps, FetchApp, which makes it possible to sell downloadable digital goods with Shopify. He recently wrote Packt Publishing’s Shopify Application Development, a quick read that’ll walk you through the process of building Shopify apps with Ruby on Rails, following good practices like test-driven design while you’re doing it. Among the things you’ll do by following the book’s exercises are:

  • Learn how to configure your Rails development environment for building Shopify apps, testing them with RSpec and FactoryGirl, and deploying them to Heroku
  • Connect an app to Shopify, and work with Shopify’s API and Webhooks
  • Build both private apps for use by a single store, and public apps, which any number of stores can use
  • Publish your app to the Shopify store so that you can sell it to vendors and make some money for your efforts

It has a number of technical reviewers, including one you might have heard of:

joey devilla tech reviewer

The book’s a mere 109 pages and should be a good starting-off point for your Shopify app development. You can order the ebook version directly from Packt for under $20; the paper book version (which comes with the ebook for free is about $30. It’s also available on Amazon, with the Kindle version priced at just under $10, and the paper book version under $30.

Categories
Swift Kick

A first look at Swift’s new access levels

privacy

swift kickC# and Java programmers are used to working with class member access level modifiers like public, private, and protected. With the latest version of Swift (which came with the latest version of Xcode), we got access level modifiers too. They’re just a little bit different.

Prior to Xcode beta 4, there was one and only one level of access in Swift. Now there are three:

  • private – accessible only from within the source file where it’s defined,
  • internal – accessible only from any file within the target where it’s defined, and
  • public – accessible from any file within the target where’s it’s defined, and from within any other context that imports the current target’s module.

In case you’re not clear on what’s meant by a target: it’s the end result of doing a build in Xcode. For most of us, this is likely an app, but it could also be a library, framework or unit test bundle.

These levels of access are file-based rather than class-based. To help make things clear, I’ve put together some illustrations.

The default access level: internal

The first level of access I’ll cover is internal

internal

An internal entity can be “seen” within the file where it’s defined, as well as from any other file in the same application or framework.

internal is the default level of access, and the only access level in versions of Swift prior to beta 4. If an entity — that is, a variable, constant, enum, struct, or class — doesn’t have a specified access level, its access level is internal.

The locked-down access level: private

The next level of access is private

private

private entity can be “seen” within the file where it’s defined, and only within that file. It’s invisible from outside that file.

If you’re used to the sort of access C# or Java programmer, you’re used to the idea of a private entity being one that can’t be “seen” outside the class. In Swift, access level is about files, not classes, meaning that a Swift private entity is one that can’t be seen outside its own file. Two Swift classes in the same file would be able to access each other’s private variables, methods, and so on. This approach will make it possible to encapsulate related classes in a single file, with “internal use only” classes marked as private. It also gets around having to use access kludges like C++’s friend functions and classes.

The “putting myself out there” access level: public

Just as private is a little bit different from what you might expect, so is public

public

public entity can be “seen” within the file where it’s defined, from any other file in the same application or framework, and by another file any other application or framework that imports the application or framework where the public entity was defined.

Once again, if you’re a C# or Java programmer, this may seem weird. Swift’s internal is closest in spirit to C#’s and Java’s public; Swift’s public exposes entities to outside code that imports our application or framework. This should come in particularly handy for those of you who are writing libraries: you can choose which classes and methods to expose to clients by marking them as public.

Trying out the new access levels

The following is a copy-and-paste from some code I wrote while taking these new access levels for a spin. I created a file called RelatedClasses.swift that contain classes named SomeClass, SomeOtherClass, and HiddenClass:

// RelatedClasses.swift

class SomeClass {
  
  internal func doSomethingInternal() -> () {
    println("SomeClass::doSomethingInternal() called.")
  }
  
  func doSomethingDefault() -> () {
    println("SomeClass::doSomethingDefault() called.")
  }
  
  private func doSomethingPrivate() -> () {
    println("SomeClass::doSomethingPrivate() called.")
  }
  
}

class SomeOtherClass {
  
  let someClassInstance = SomeClass()
  private let hiddenClassInstance = HiddenClass()
  
  func usePrivateMethodInSameFileDifferentClass() -> () {
    someClassInstance.doSomethingPrivate()
  }
  
}

private class HiddenClass {
  
}

Note that:

  • SomeClass has two internal methods: doSomethingInternal() and doSomethingDefault(). doSomethingInternal()‘s internal access level is explicit, and doSomethingDefault()‘s internal access level is explicit. Both these methods are callable from inside RelatedClasses.swift, or from any file inside the application or framework containing RelatedClasses.swift.
  • SomeClass also has a private method: doSomethingPrivate(). It’s accessible from within SomeClass, but also from anywhere else inside RelatedClasses.swift, including from within the other two classes. You can’t call this method from outside RelatedClasses.swift
  • SomeOtherClass contains an instance of SomeClass and HiddenClass. Note that because HiddenClass is private, any instance of HiddenClass must also be declared private.
  • SomeOtherClass has a method with the rather long name usePrivateMethodInSameFileDifferentClass(), and it lives up to its name. It can access SomeClass' doSomethingPrivate() method even though it’s private because it’s in the same file, and Swift’s access control is more file-based than class hierarchy-based.
  • HiddenClass is a private class. Since SomeClass and SomeOtherClass are in the same file, they can “see” it and create instances of it. Its definition is “invisible” outside the file, and thus you can’t create a HiddenClass instance outside of RelatedClasses.swift.

As you can see, Swift’s access control is different from C#’s and Java’s, which will lead to different coding patterns. We typically see the one-class-per-file approach in C# and Java, but Swift’s different kind of private access will likely give rise to larger-scale type of encapsulation, with related classes in the same file. public may change the way people write libraries and frameworks — I’m more of a library/framework user than a writer, so I’ll leave it to others to deliver more informed comment on that. It’ll be interesting to see the approaches that programmers come up with as they use Swift.

Recommended Reading

The online Swift documentation has been updated to cover the addition of access control in beta 4. There’s also some interesting discussion about Swift’s access levels in the Human Friendly’s blog, in an article titled Swift Access Controls are like C’s (and that isn’t necessarily a bad thing).

Categories
Uncategorized

Apple’s long shadow

apple casting a long shadow

Creative Commons photo by Rob Tiggelman. Click the photo to see the source.

After the release of the first-generation iPhone a little over seven years ago (June 29, 2007), the mobile industry would never be the same again. Sure, there were some naysayers who said it would never take off:

but in the end, the iPhone not only redefined what a smartphone was, but helped drive the convergence of mobile computing, wireless, and the internet, which in turn helped change the telecom industry’s business model from a voice-based one to a data-based one.

We’ve seen Apple’s long shadow in a couple of bits of recent news as well…

In the enterprise: The Apple/IBM partnership

ginni rometty and tim cook

IBM CEO Ginni Rometty and Apple CEO Tim Cook

We’ve covered this before, but it’s worth mentioning again, as it means that Apple’s iDevices — which have somewhere in the area of 90% penetration in the enterprise already — are getting paired up with IBM’s business services and big data expertise.

On the higher end: Samsung

If you wanted to get an idea of how fierce the competition between Samsung and Apple is, you need only to watch Screen Envy, Samsung’s latest ad:

Many of Samsung’s ads poke fun at Apple users and devices, but this one’s a little different. This time, the target of their fun-poking is the iPhone 6, which not only hasn’t been released, it hasn’t even been announced. There’s been word about Apple asking manufacturers to get ready for a record-breaking initial production run of iPhones in new sizes and the usual set of reports from reasonably reliable sources, but there’s still no confirmed list of features nor is there a release date.
That’s how competitive the mobile device industry is: you have to pre-emptively advertise against competitors’ products that don’t even yet exist.

On the lower end: Xiaomi

xiaomi logo and mascot

Xiaomi (pronounced “SHAO-mee”) may be a non-entity here in the U.S., but they’ve been called “The Apple of China”. The comparison is an apt one in many ways, not the least of which is that they’re a threat to Samsung — just from the lower end of the pricing spectrum. The underlying tech in their latest products can easily hold their own against Apple’s and Samsung’s flagship devices, and China alone can provide them with enough customers to make them a big player. Their devices are also cheaper than Samsung’s, which may be a threat as they expand beyond China and into the world market. As Business Insider’s Steve Kovach observed:

…that’s a big problem for Android manufacturers like Samsung. Apple has a great mobile ecosystem with iOS that you can only get on iPhones and iPads, but there isn’t a big difference between what a Samsung Android phone can do versus a Xiaomi Android phone. So, why spend twice as much when you can get a high-end gadget that does the same thing for half the price?

Here’s Xiaomi’s most recently-announced phone, the Mi4, which looks suspiciously like an iPhone, right down to the metal body and chamfers on the edges:

xiaomi mi4

And if that weren’t enough copycattery, here’s their tablet, the MiPad (yes, you read that right: MiPad). It does boast graphics chips on par with an Xbox 360 or PlayStation 3 under the hood, but that hood looks oh-so-familiar:

xiaomi mipad

The Apple-aping at Xiaomi doesn’t just stop at the products. Like Apple, their marketing points out their attention to design and detail. Their CEO, Lei Jun, is a bit of a Steve Jobs fan and according to Wikipedia “carefully cultivates a Steve Jobs image, including jeans and dark shirts, and Jobs’ style of product announcements.”

He’s even gone so far as to “borrow” this old “Stevenote” trick at a recent presentation:

xiaomi one more thing

Photo from Sascha Pallenberg’s Twitter account. Click the photo to see the source.

this article also appears in the GSG blog

Categories
Uncategorized

In spite of all the changes in the mobile industry, the carriers are managing to make even more money

It hasn’t even been a decade since the world of telecommunications got revolutionized by the convergence of the internet, mobile computing, and wireless. For the longest time, mobile carriers resisted the change, concerned that a world of smartphones and apps would disrupt their business models and networks. If you look at the numbers, they appear to have adapted quite handily.

pancake flip

A handful of years ago, mobile phones’ primary use was voice calls, and hence your voice minutes were the precious metered commodity and data (then largely used for texting) was unlimited. Smartphones — and more accurately, their apps — flipped that usage pattern, and mobile carriers flipped their billing model in response, offering unlimited voice calls and putting a meter on data.

As technology consultant Chetan Sharma observed in his US Mobile Market Update Q1 2014 report, data’s share of carrier ARPU (average revenue per user) has been climbing steadily and now accounts for more than half their revenue:

more than half is from data

Click the graph to see it at full size.

You may be surprised to note that the US was the seventh nation to hit the point where more than half of mobile carrier revenue comes from data. Japan, who’ve been using mobile phones for more than voice for far longer than we have, lead this category, with 70% of their carrier revenue generated from data.

Re/code’s Ina Fried points to a recent Consumer Intelligence Research Partners (CIRP) report that says that of the big US carriers, Verizon made the most of this transition, with the fewest customers on an unlimited data plan, and the largest share of customers paying more than $100 a month. She included a table of CIRP’s data showing the US mobile carriers’ average monthly bill; we took that data and turned it into two graphs. The first divides the bills into three price segments:

  • $50 and under/month
  • Between $50 and $100/month
  • Over $100/month

us carriers average monthly customer bills

Click the graph to see the data source.

The second graph is a little more granular, with the following price segments:

  • Under $25/month
  • $25 – 50/month
  • $51 – 100/month
  • $101 – 200/month
  • Over $200/month

us carriers average monthly customer bills 2

Click the graph to see the data source.

Some observations based on the data:

  • The smaller carriers live off the cheapest segment of the market, making over 80% of their mobile billing revenue from customers paying $50/month and less.
  • The big 4 carriers — AT&T, Verizon, Sprint, and T-Mobile — make about 40% of their mobile billing revenue from customers paying between in the $51 – $100 range.
  • The largest 3 carriers make most of their mobile billing revenue from customers who pay over $100/month.
  • Verizon is making money off the high-rollers, with 15% of their mobile billing revenue coming from people who pay over $200/month.

us mobile carrier revenues 2014b

Click the image to see the data source.

Chetan Sharma says that with US mobile services growing these ways in Q1 2014:

  • 4% quarter over quarter, and
  • 23% year over year,

…it’s expected that the US will become the first country to cross the $100 billion mark in mobile data service revenue, with continued growth expected as more businesses rely on mobile technology and services to generate revenue.

It’s good to be a mobile carrier.

Recommended reading

this article also appears in the GSG blog

Categories
Uncategorized

Telecom week in review, part 2: Scenes from the mobile market

galaxy s5 and iphone 5S

How goes the competition between Samsung, the biggest Android device vendor, and Apple? Well, in May, the iPhone 5S outsold the Galaxy S5 by 7 million units to Samsung’s 5 million. To counter Apple’s Beats offering (which Khoi Vinh suggests is about being able to offer well-made and fashionable audio accessories at scale), Samsung launched their “Level” family of high-end headphones and speakers. To counter Apple’s HomeKit and Google’s Nest, they’ve been talking to SmartThings about acquiring them.

android

After the announcements about the upcoming Android L (the next version of Android; the current one is K) and the Material design language, Google have been busy. They’ve spending several hundred million dollars in a big marketing push to sell Android One phones in India, adding support for Android Wear custom watch faces, designing fonts that look good and are readable on all manner of devices, and updating the Google Play Store with a beautiful new UI that’s a little closer to the specs in the Material design language.

In non-Samsung Android news, LG announced the G3 Beat, a mid-range version of its flagship G3 smartphone.

How about that Amazon Fire phone? It seems to be an Amazon shopping device that just happens to act like a smartphone, and its first ad seems to have confirmed many suspicions:

BlackBerry are saying “better late than never” with the announcement of their assistant technology for Blackberry 10.3: BlackBerry Assistant. Even Microsoft’s Cortana shouldn’t worry about this one.

And finally, on the general mobile accessories front, there’s GoTenna’s messaging gadget, which works even “in the middle of nowhere” where you can’t get a signal. In New York magazine, Kevin Roose asks an interesting question: Does anyone outside Silicon Valley even want a smartwatch? Keep in mind that once upon a time, mobile phones — never mind smartphones — seemed frivolous, not vital.

this article also appears in the GSG blog

Categories
Uncategorized

Telecom week in review, part 1: The Apple-IBM partnership

apple and ibm - 1983 and 2014

Bottom photo by @darth.

On Tuesday, Apple and IBM announced their partnership to “transform enterprise mobility through a new class of business apps”, combining Apple’s iOS ecosystem with IBM’s big data and analytics capabilities. According to Apple’s press release, the promised outcomes of this partnership are:

  • a new class of more than 100 industry-specific enterprise solutions including native apps, developed exclusively from the ground up, for iPhone and iPad;
  • unique IBM cloud services optimized for iOS, including device management, security, analytics and mobile integration;
  • new AppleCare® service and support offering tailored to the needs of the enterprise;  and
  • new packaged offerings from IBM for device activation, supply and management.

Horace Dediu, on his blog Asymco, made this observation about this partnership in light of both companies’ histories and transformations:

This dramatic turnaround–Apple moving to a device leadership position and IBM moving to a service leadership position–created the conditions for today’s announcement of a strategic partnership–an event which is astounding to those who witnessed the 1980s and 1990s. Were it not for the tenacious independence of Apple and the business model agility of IBM, neither company would be around today to leverage one another.

Over at ZDNet, Larry Dignan asks: In IBM and Apple’s wake, what will team Android do? He quotes a Forrester analyst: “Seek partnerships that offer a credible alternative” and suggests that Google and Samsung would team up and partner with Accenture and HP, both of whom would be reluctant to become an Android-only consultant given how deeply iOS has made its way into the enterprise already:

good - ios and android activations

He believes that SAP and Salesforce would prefer not to get involved with such an alliance, and that Oracle, who believe that Android ripped over Java in building their platform, would hope that Android fails in the enterprise.

In light of the announcement, BlackBerry shares fell by more than 10%. In its defense, Blackberry released an email statement saying that Apple and IBM’s partnership “only underscores the ongoing need for secure end-to-end enterprise mobility solutions like those BlackBerry has delivered for years,” and as the “clear leader” in the market, “enterprises should think twice about relying on any solution built on the foundation of a consumer technology that lacks the proven security benefits that BlackBerry has always delivered.”

Our reaction to that last statement:

rolling_eyes_neil_degrasse_tyson

this article also appears in the GSG blog

Categories
Uncategorized

Stephen Elop’s layoff email begins with a terribly inappropriate salutation

HELLo tHERE

It’s been noted how terrible Satya Nadella’s letter to Microsoft’s employees about the upcoming layoffs was. Stephen Elop — the guy who left Microsoft to run Nokia into the ground and then return to Microsoft triumphantly as the Executive VP of Devices and Services —  wrote a matching company-wide email that pertained specifically to the Devices and Services division, which would undergo “an estimated reduction of 12,500 factory direct and professional employees over the next year”.

It begins with this salutation:

Hello there,

Really? “Hello there?” “Hello there” is a suitable opener for an announcement such as “The restrooms on the 4th floor are out of commission today” or “The email servers will be down for an hour tomorrow”. It is completely inappropriate for a memo that essentially says “We’re firing 12,500 of you…and it could be up to a year before you find out if you’re one of them.”