On December 12th, EMC and VMware announced a spin-off that will merge units from both VMware and their parent company into a single, focused organization named the Pivotal Initiative.
Wednesday, December 5, 2012
The "Pivotal Initiative" - VMware and EMC spin off a new organization to focus on big data in the coud
On December 12th, EMC and VMware announced a spin-off that will merge units from both VMware and their parent company into a single, focused organization named the Pivotal Initiative.
Thursday, November 15, 2012
Installing PhoneGap Plugins with pluginstall
Phonegap applications can be extended with plugins to add additional functionality. Historically, installing plugins meant copying a bunch of files into the correct places in your project.
Andrew Lunny wrote the Cordova Plugin Specification and pluginstall. Pluginstall is a tool that automates the installation of plugins which conform to the plugin specification.
In addition to demonstrating pluginstall, we’ll also use the PhoneGap create script to make a new project. The cordova build scripts will be used for compiling and installing the binary. Using these tools it’s possible to develop PhoneGap apps with a text editor, instead of an IDE.
Prerequisites
I’ll assume that you have Phonegap 2.2.0 and the Android SDK installed.
Pluginstall requires node.js and is installed through npm. If you’re on a mac and use homebrew, install node and npm with brew install node.
Setup
Install pluginstall
$ npm install -g pluginstall
Create a new Android project using the PhoneGap create script. Create takes the new project path, package name and activity name as arguments.
$ cd /usr/local/phonegap-2.2.0/lib/android
$ ./bin/create ~/foo com.example.foo Foo
The create script built a new PhoneGap project in directory ~/foo. Inside the project there is a cordova directory with some command line tools.
Let’s ensure the generated project works before we modify anything. Start the emulator.
$ cd ~/foo
$ corodova/emulate
Patiently wait for the emulator to start. Unlock the screen and keep the emulator running. Compile, build, install, and launch your app.
$ cordova/BOOM
The application should launch and say “Device is ready”.
Install the plugin
Get a local copy of the Child Browser Plugin.
$ cd /tmp
$ git clone git://github.com/alunny/ChildBrowser.git
Install the plugin using pluginstall. Pluginstall takes the platform, project directory and plugin directory as arguments.
$ pluginstall android ~/foo /tmp/ChildBrowser
The Child Browser plugin is now installed. Pluginstall used to the information in the plugin.xml manifest to update the project. It added an Activity to the Android manifest, listed the plugin in config.xml, added java source code, and added javascript code and images to our project.
Write some code to use the plugin
Edit ~/foo/assets/www/index.html
Include the javascript after cordova.js
<script type="text/javascript" src="cordova-2.2.0.js"></script> <script type="text/javascript" src="childbrowser.js"></script> <script type="text/javascript" src="js/index.js"></script>
Edit ~/foo/assets/www/js/index.js
In onDeviceReady, add a call that will open a web page in the Child Browser after 3 seconds
onDeviceReady: function() {
app.receivedEvent('deviceready');
setTimeout( function() {
window.plugins.childBrowser.showWebPage(
'http://phonegap.com', { showLocationBar: true }
);
}, 3000 );
},
Compile, build, install, and launch your app into the running emulator.
$ cordova/BOOM
The sample application should run and open http://phonegap.com in the Child Browser Plugin.
Monday, October 22, 2012
Top Questions To Ask When Choosing an Android Development Firm or Developer
You are ultimately responsible for the application - even if you go the outsourcing route. Things happen, disagreements happen, and turn over happens. The likelihood is high that you will need to maintain the application at some point in its lifecycle. The better the code, the easier the maintenance will be.
There is a wide range of abilities, experience, and knowledge out there. These questions are designed to help you make the best choice about how to invest your Android budget. You need to ensure that anybody you onboard to build the application will advance your organization's goals and not cause unnecessary rework.
Interview Questions
- What applications have you published in the market? Do you have references we can contact? Describe application features and your role in each application. Do they speak positively of their clients and applications? What do their references have to say? How high are the app ratings? Take note of positive and negative comments. If possible, download and try the application(s). This will give you some insight into the quality of the implementation and design.
- How do fragments fit into your development process? Any firm or developer you hire should be knowledgeable of fragments and should be using them. Otherwise, they are writing obsolete code. This technology is nearing two years old and is the way to write Android apps going forward. Frankly, if they haven't taken the time to learn them by now, how can you trust that they will help you innovate in your application?
- What strategies do you use to ensure the user interface will scale to the multitude of Android devices? There are many strategies and best practices for making interfaces that scale. Some of the things you’ll want to hear from the developer or firm are:
- Using fragments
- Using dimensions, styles, and qualifiers
- Using 9-patches
- Using images in different densities
- Wrapping elements and using relative layouts
- Not using fixed pixels
- How do you minimize battery life drain and bandwidth usage? If they don't have ideas around this, beware. This is one of user’s main complaints! There is typically a cap on data plans, so users want to limit bandwidth so they don’t get hit with overages. Battery is also a major concern for users. A major factor in battery life is the amount of data downloaded and processed on the device.
- Do you unit test your applications? Do you write integration or other automated tests? Test coverage is an important judge of quality for the end product. Although it seems like it's just more code to write, the investment up front will reduce bugs and rework. It may or may not speed time to market, but it will definitely increase the quality of your application.
- How often will we discuss and decide priorities? Priorities change - often quickly and without warning. You will encounter challenges even with the best thought out designs. Business requirements will change and it's essential to keep in close contact with your developers to make sure critical features are implemented according to the latest specifications.
- How will I access the code base? It's always a good idea to have access to the code. A good practice is to create an organization on github and invite the developer(s) to join your team. They create a repository for your application and save any changes in the cloud. This gives you access to the most updated code as well as the commit history. You can browse code commits to see what they are working on and get an idea of where the project stands.
- Will I get regular builds of the application? It's also possible to get frequent builds of the app - either manually or as part of an automatic process. Giving stakeholders access to regular builds is a good idea so that the business can ensure that the developers are creating the features as expected.
Do they use similar platform features to what you plan to use? For example, have they only written map applications when you want to create a music streaming application? Keep in mind there is a plethora of platform features, so unfamiliarity with a particular feature isn't a deal breaker. Great engineers can pick up any new feature very quickly. If something is business critical and you are uncomfortable with them learning this for your application, you may want to look for someone with experience with these features.
If they don't use them, you will need to completely renovate the application when you expand to the Android tablet market. On the other hand, if they write it with fragments from the start it will be much easier to transition to tablets.
There is a large base of Android developers who remain resistant to learning this new and more flexible way to build applications. I've gone on a conference crusade this year to help businesses and developers see the benefits of switching to fragments before it's too late.
Some techniques are using services to complete background work, using alarms to kick of background tasks, detecting when on WiFi and downloading large amounts of data, designing APIs that give incremental data, or detecting when plugged into the wall to do a large amount of processing.
Developers that don't use unit testing spend a lot of time building to devices or emulators. This uses significant amounts of time that could be use for writing tests to verify behavior. Plus they won't be able to find all the bugs by poking around in the application.
Although many Android developers eschew using testing frameworks like Robolectric, setting up new projects with Robolectric, IntelliJ, and maven (or maven + Eclipse) avoids the headaches that come from integrating later on in the project. There are many things you could test, but there are limits and tradeoffs. Check out my article about best practices for testing with Robolectric to help you structure your testing strategy.
Although unit testing in great, there are other types of testing. The more types of tests that are written, the bigger safety net you have when the architecture needs to change. It will help ensure that large changes don't break existing functionality and find subtle bugs before they get into the wild.
Although we always embark on new contracts with good will on both sides, disputes with an external firm or developer can happen. Make sure that you have access to and retain the rights of your application's code. You can't develop or maintain what you don't have!
Friday, September 28, 2012
iPhone 5 Quick Tip: How to add letterboxing back to your iOS 6 app
- Remove the Default-568h@2x.png launch image
- Run a "Clean Build Folder" (⌥⇧⌘K)
- Uninstall the app from your device/simulator
- Build and run the app
Wednesday, September 26, 2012
So You Want To Build An Android App?
Android ≠ iOS
This should be obvious, but too often business think "I have an iOS app, how different can it be?" The challenges on each platform are not the same and some factors make Android applications a bit trickier to develop and maintain.It is unrealistic to think that the exact time (or less) taken to build your iOS application can yield an Android app. The underlying assumption is that all the mobile problems were solved with the iOS effort and perfect conditions are now in place to start a new application. This thinking doesn't leave room to reevaluate infrastructure decisions that could impact the device or scale to new demands. It assumes that there are no developer or institutional knowledge gaps. Finally, it doesn't leave room evaluate the current set of features and how the design translates to the new platform.
Development & Testing
Android does not have a small subset of form factors and OS versions like the iOS ecosphere. There are a multitude of devices that officially (and unofficially) run the Android OS. The OS version distribution impacts both hardware and software features that you can leverage in your application. Also, there are many legacy phones still in use.This increases complexity of creating an application that looks great on all devices. However, the Android platform has many ways to mitigate these challenges. It's critical to hire engineers and designers that have a good grasp of the platform so that you can reach a wide audience while preserving your brand.
Your organization should define a strategy around which devices to support (preferably when an Android expert is in the room). Different approaches come into play here, but a common one is to pick a representative sampling of devices and make sure the application works well on them. Whichever way you go, the decision will impact the level of testing and development effort.
This may seem daunting, but your application will have a much further reach - on everything from phones to televisions!
Design
There is tremendous value in making your users happy by giving them an intuitive and optimal user experience. This drives adoption and makes your users much more likely to continue to engage with your app over time.You can’t simply take your current application’s look and feel and shoehorn it into an Android device. This is disrespectful to your users and makes it clear that you view Android as an afterthought. Navigation, user interactions, and widget standards are very different and should be respected on each platform.
It’s critical to evaluate your current features and determine how they will translate to the Android platform. The upside to this fresh perspective is that you will discover ways to leverage platform features that are unique to Android (e.g. rich notifications and widgets).
--
Bottom line: The design will be different, the code base will be different, and the challenges will be different. Make your users happy and follow Android design standards.
Are you building a team or an app?
Once an application is in the market, it will need care and feeding. There will be bug fixes and a growing list of new features to implement. The goal is to find an approach that fits into your mobile strategy and creates a sustainable process around the application. The main trade off is creating an organization in-house or using external firms. Let's look at both approaches in detail.External team
Outsourcing could provide many advantages for your organization. Although consulting has a higher up front cost, you won't be paying to train and maintain a team. You pay-as-you-go and build only business critical features. The downside is that you’ll continue to pay the firm for maintenance, bug fixes, and feature growth.Although it's tempting to think about this as something you can just hand off to another firm, you should be involved at all stages. Communication is key to making this approach successful because any external party won't understand your business as well as you do. Being involved in the design and feature prioritization process will ensure that the application created is what you envisioned. You don't want your app built in a vacuum and end up surprised by the end product!
There are several options, including hiring a contracting firm, a boutique firm, an independent contractor, or an overseas team. Contracting firms typically have several contractors that either create apps from scratch or embed with existing teams. Boutique shops have extensive experience with a particular platform and know how to best leverage its features. Independent contractors are typically self employed and work on several applications at once. Finally, you can hire an overseas team for cheaper than what you'd pay a local contractor.
Experience varies widely in the Android development realm. Make sure to ask the right technical questions (covered in detail in the next blog in the series) to ensure you are getting a high quality software product. Aggressively check references and contact past clients to gauge how happy they are with the end product. Install their published applications and check ratings and comments in the Google Play market. Finally, determine how maintainable and easy to extend the app will be (just in case you or someone else needs to update it).
In-house team
Creating a team internally makes sense for many businesses. It allows you to leverage your existing developers and have complete control over the roadmap. You won’t need to pay outside firms each time you want a new feature. Finally, you won’t have to manage the risk of having external developers create your app.The drawback of this approach is creating and maintaining a team. It's a massive commitment and fiscal investment to support this team. You need to recruit, train, and have enough work for developers to do over the long haul. Depending on the scope of your application and your business objectives, creating your own team can be overkill.
Do you have the right knowledge to select developers to help you with this effort? There is no shortage of developers interested in switching to mobile development because it's an exciting corner of technology. However, it can be challenging to find the talent with the right experience. One strategy is to recruit internal developers and retrain them as mobile developers. Skills like Java and front-end development translate well to Android because it's written in a mixture of XML and Java. This technique is especially effective when combined with hiring an architect to help build the team.
Organizations tend to face the same challenges when beginning a team and an experienced architect can help you avoid these pitfalls. Team augmentation, which is hiring one or more experts to mentor new developers and increase the team Android knowledge, is one way to make this an easier process. Hiring this expert can help you get the right architecture in place, recruit new members, implement best practices, set up continuous integration, mentor team members, and inform the organization about the challenges and constraints of mobile development. Team augmentation can help you make a sustainable team much earlier. Plus there is an endpoint - you decide when to remove the training wheels.
--
Stay tuned for more articles in the series that will focus on choosing the best developers, designers, and testers for your Android project.
Tuesday, August 14, 2012
Going mobile? The key to any successful project is asking tough questions before you write code
About half of U.S. businesses will be in the mobile market by the end of 2012, according to a recent survey by Robert Half Technology (“Mad for Mobile.” New Jersey TechNews, April 2012). Nearly a quarter of the CIOs surveyed said they planned to develop a mobile application for the first time this year. The mobile boom is in full swing. Developing mobile apps can be scary and exciting, especially for managers who must make difficult business decisions in a rapidly changing technology landscape. Asking tough questions before you begin mobile development can save a lot of headaches down the road.
Are you focused?
It’s a good strategy to kick off a project with some blue-sky brainstorming. Sometimes ignoring reality is the best way to get all the ideas on the table. But the hard part is taking your big ideas and breaking them down into much smaller ideas that you can actually execute.
Do you have a clear idea of what you’re going to build? There is a wide spectrum of possibilities. You could be building a mobile version of your website. You could be building a task-specific app for clients or customers. Perhaps you are building a set of tools to help your employees work smarter and more efficiently.
Make sure you are not trying to do too much. Often it’s a good idea to start with the minimum number of features you need to satisfy your users. You can always add features later.
Probably the biggest thing to keep in mind is this: it’s not an effective use of resources to go mobile just for the sake of it. The rush to mobile now feels a bit like the dot com boom in the late 90s—building websites just to build websites. Be thoughtful. Focus.
Have you considered your audience?
This might seem like an obvious one, but managers and developers often make assumptions without really understanding their users.
If you are building something for your customers, do you know what they want or need? What is you target market? Do you have any studies to back this up? What devices do your users have? Android and iPhone are the most popular, but you might also have to consider other devices, such as the Blackberry or Windows Phone.
It’s also important to be realistic about how much time your customers will spend using your app. Some product managers have this fantasy that they will hold a user’s attention for an hour and a half. Try five minutes.
If you are building tools for your employees, do you understand their workflow? Do you know what kind of hardware they are using? Does the tool need to work offline and online? You want to build something that your employees will easily (and willingly) adopt. It’s important to understand how these mobile tools will be integrated with other software and hardware systems in your company.
Also, don’t forget about the bigger picture for your users. How are you making their lives better or easier? In addition to solving problems and meeting needs, you might consider ways to bring a little fun into their mobile experience. Create something that delights them.
Is your team ready?
This is a tough question, in part because it may force you to consider longer-term business strategies. Is your mobile project a one-time endeavor or do you intend to make mobile development part of your company’s skillset? Is it better to hire someone to build the app for you? Or are you willing to spend time and money training your existing team?
If you have good software developers they can become mobile developers. A consultant can help you plan the project and get your team up to speed. This could be a good strategy if you have developers willing and excited to learn. If your developers aren’t willing and excited to learn new technologies, you have much bigger problems.
Which technologies will you use?
In some ways, choosing technologies is the easy part—easier, at least, than understanding your users and getting developers up to speed. It’s also easy to get into the trap of using shiny, new, cool tools without putting people first.
The first decision you’ll have to make is whether to develop a native app or a web app. With a native app—for instance, one developed specifically for the iPhone or Android platforms—you can easily access each phone’s built-in devices, like the camera, microphone, and file system.
If you are going to build native applications for multiple platforms, start with one platform first, instead of trying to develop on multiple platforms in parallel. Your applications won't launch at the same time, but you can take what you learned on the first platform and apply it to the others.
The mobile web allows you to build applications that are not platform specific and can run in the browser on any phone. But browser capabilities vary across devices. Geolocation support is good. Camera support exists in newer Android and Blackberry but is unavailable on the iPhone.
One solution is to use a framework like PhoneGap that will allow you to build cross-platform native apps using HTML5. PhoneGap provides access to device features (camera and file system) that are not yet available in all web browsers. PhoneGap applications are packaged like native apps and delivered to users through the app stores.
The good news is that the line between web apps and native apps is blurring, and a year from now this distinction might not be a sticking point.
How much are you willing to invest in the project?
Obviously, developer and designer time will be the most expensive resource. All of the plumbing around the project—planning, marketing, and managing—can also add up. Building custom software is expensive, and your first mobile project could be more expensive than you think, especially if you have to train your team. The scope of the project and your vision for your business will likely determine the cost of going mobile.
A consultant could set you on a good path, but only if you do your legwork first. Although there’s no silver bullet here, asking tough questions before you dive in could lead to a more successful mobile app, one that makes your users happy and won’t break the bank.
Bio: Don Coleman, director of consulting at Chariot Solutions, helps businesses put together clear roadmaps for mobile development. He loves equally solving interesting technical problems and making businesses work better.
Tuesday, August 7, 2012
Android Unit Testing With Robolectric
I've created two example apps for your reference. The first is a glorified Hello World and the other is a simple animation app. If you are unfamiliar with Robolectric, I'd start with my introductory blog that details how to integrate IntelliJ, Robolectric, and Maven into your project.
What To Test
You should focus your unit testing on business logic, basic view validation, and functionality. You can validate certain requirements very well with unit testing (e.g. "when I click this bell image, it whistles" or "all activities have a logo on the screen").- Ensure the activity and view elements are not null.
- Ensure expected view elements are visibile on the screen.
- Ensure that the proper resources are used for view elements.
- Ensure items are hidden when expected.
- Ensure that your intent starts the correct thing.
- Ensure that fragments are present.
What Not To Test
I don't recommend investing much time in verifying less important styling details and XML attributes. Your user interface is likely to change many times a week, but typically the basic view elements and their behavior remain the same. If you updated a test each time a button had new padding, that would get very tedious indeed!Example: The app logo is 250dp high with a proportional width, the file name is "main_logo.png", it has a 20dp left margin and 12dp right margin, has a content description of "Text," and is centered vertically on every screen.
You are likely able to test all of the attributes above (I haven't tried), but your time is best spent on items that are most important to the business. From this example, likely the most bang for your buck will come from testing that the proper image is used and making sure that it appears on all expected screens.
Returns start diminishing pretty quickly when you verify every possible XML attribute - unless that detail has an important business outcome for your app. Many of the attributes you don't test can be caught by designers, quality assurance, business, product, and/or the engineers. A better stategy is to sweep the app near deployment with a designer to make sure the app appears as expected on a wide range of devices.
Best Practices
- Simplify your architecture. As with most object oriented realms, attempt to simplify the architecture as much as possible. Do this by creating abstract or base objects or interfaces. This way you can test shared behavior in one place instead of several, which simplifies tests and reduces code duplication.
- Mock/stub functionality. Often we want to ensure that a certain action was performed but not actually run the code. To do this, you create a test class which extends the class under test and override/mock out/track that a particular function was called. For example, if you want a particular click to make an API call, there is no need to make the actual call (since this would be an integration level test). You can use this strategy to track that the function that invokes the call has been called, but avoid making the actual call. This is also helpful when an operation crashes the unit testing framework (e.g. specialty library that causes funky side effects), doesn't play nice, or is otherwise unnecessary to invoke directly.
- Create a custom test runner. Create a helper test runner to gives your entire unit test suite access to handy functionality. My simplest version includes string, drawable, and color resource fetching as well as view visibility helper functions. I also add a helper function to start fragments without a hosting activity. Finally, this is a good place to bind custom shadows you create and set up any external library configurations that you may need.
- Centralize test constants. Android strongly encourages the use of abstracting string resources into one place over using hard-coded string constants. Use a test constants class when you have lots of test data (e.g. When creating a user with lots of fields to mock out a JSON response).
- Have a robust testing strategy. Don't rely solely on unit tests to ensure the proper implementation of your app. These tests, though quite useful, only give you a small window into your app and it's behavior. At minimum, you should include integration level tests and have some level of manual QA in the process to ensure your app is everything that you want it to be.
Notes
- Unit testing Android apps is not as simple as with other platforms and Robolectric is still a work in progress. You will find things that you'd like to test that the library doesn't suport. It's up to your organization to determine how much they would like to invest to give back the the community by writing and fleshing out shadow classes.
- When running the sample tests you may notice a few warnings about binding map-related shadow classes (because the library is not available in the maven central repository). To solve this issue use the maven android SDK deployer.
Warning: an error occurred while binding shadow class: ShadowGeoPoint Warning: an error occurred while binding shadow class: ShadowItemizedOverlay Warning: an error occurred while binding shadow class: ShadowMapController Warning: an error occurred while binding shadow class: ShadowMapActivity Warning: an error occurred while binding shadow class: ShadowMapView Warning: an error occurred while binding shadow class: ShadowOverlayItem