Tag

mobile development

Gradle: Google’s New Android Build System

By | Android, Mobile | No Comments

If you talk to a typical Android developer about their choice in build tools, chances are you’ll overwhelming hear Maven. But there’s a new kid on the block looking to change that. android_gradleAccording to RebelLab’s recent global survey of 2164 Java professionals, Gradle ranked as the highest technology that developers are most interested in learning with 58%. Let’s take a look at what Gradle can do.

Google introduced Gradle as an advanced build system to create custom build logic through plugins. Google selected Gradle as the foundation of the Android SDK build system because it provides flexibility and imparts a common standard for the build system. With a declarative Domain Specific Language (DSL), Gradle developers have access to a single, authoritative build bath that powers both Android IDE and builds from the command-line.

The main functions behind Gradle is to:

  • Make it easy to reuse code and resources
  • Enhance the ability to make several versions of an application
  • Improve configuration
  • Good IDE integration

Features and Benefits of Using Gradle

  • Integration with Android Studio: Android Studio is tightly integrated with the Gradle build system.
  • Simple, Declarative, Domain-specific Language: Gradleware and Google works together to make simple, declarative DSL for Android builds.
  • A Single Build System: Gradle is the authoritative build across the IDE and command-line.
  • Product Flavours, Build Variants and Build Type: Provides an easy way to create keystore and signing configuration across different build type.
  • Dependency Management: Gradle offers a flexible dependency management that can use the existing Maven repositories or reference local JARs.
  • Multi-Project Support: Supports mutile project from both IDE and command-line.
  • Binary Bundles for Libraries (.aar): Gradle supports the new .aar binary bundle format for library projects.
  • Full Incremental Builds: Incremental Builds means your waiting time for build process will be reduced.
  • A Focus on Testing: With Gradle you can run unit and integration tests without creating subprojects. Gradle supports several scenarios for integration testing on build servers.
  • Test Server API supported Hosted Testing: Integration with Jenkins-based build servers and services from AppThwackTestDroid, and Manymo means that your build can support complex, massively-parallel integration testing scenarios.

Incorporating Gradle in Android Studio

Make sure you download the Android Support Repository under Extras using the SDK Manage

Gradle 1

The gradle.build provides some instruction on what you have to do.

Gradle 2

Gradle 3

Despite Maven dominating among Android build tools, fast-growing Gradle appears to be gaining in popularity among Android developers. Have you had the chance to experiment with Gradle? What are your thoughts on Gradle gaining momentum on Maven? Comment below!

 

3rd Party Technologies Every iOS Developer Should Use – Part 1- Appledoc

By | iOS, Mobile | 2 Comments

As part of a new series, we’re going to be looking at various tools that our App Experts have encountered during our mobile app experience that we feel no iOS developer should be without. To get the ball rolling, we have the solution to every developers most dreaded task, documentation. So what is this remarkable tool? The answer is Appledoc.

What is it?

Appledoc is a tool for building and maintaining documentation for your apps/libraries. After a quick setup, it compiles together your code-comments into a fully Apple-styled docset that can be kept up-to-date with a simple press of a button. For hassle free documentation on the fly, it’s the best option around for iOS developers.

Setup

Appledoc has a quick and easy installation process. First things first, you’ll need to download it:

You can download it manually from the developers’ github or just run this simple command in the terminal:

git clone git://github.com/tomaz/appledoc.git

Next up, install. To install appledoc use the following command:

sudo sh install-appledoc.sh

Add the build script to your project:

Once Appledoc is installed, you’ll need to add it into your project (note: you’ll need to repeat this step for every new project you start if you want to use Appledoc with it).

Select your project in the Project Navigator and select the plus icon at the bottom left of the view window to add a new target. We’re going to add our script as an ‘Aggregate’ target, which can be found in the ‘Other’ tab. For this new target, go to the ‘Build Phases’ tab and add a new ‘Run Script Build Phase’ by selecting the plus sign in the top left of the view window. Paste the following script into this new phase’s script window:

#appledoc Xcode script
 # Start constants
 company="YOURCOMPANYHERE";
 companyID="com.YOURCOMPANYHERE";
 companyURL="http://YOURCOMPANYHERE.com";
 target="iphoneos";
 outputPath="~/help";
 # End constants
 /usr/local/bin/appledoc \
 --project-name "${PROJECT_NAME}" \
 --project-company "${company}" \
 --company-id "${companyID}" \
 --docset-atom-filename "${company}.atom" \
 --docset-feed-url "${companyURL}/${company}/%DOCSETATOMFILENAME" \
 --docset-package-url "${companyURL}/${company}/%DOCSETPACKAGEFILENAME" \
 --docset-fallback-url "${companyURL}/${company}" \
 --output "${outputPath}" \
 --publish-docset \
 --docset-platform-family "${target}" \
 --logformat xcode \
 --keep-intermediate-files \
 --no-repeat-first-par \
 --no-warn-invalid-crossref \
 --exit-threshold 2 \
 "${PROJECT_DIR}"

Utilization

With all of that done, all that’s remaining is to build your new target and your Docset will be created.

Appledoc has it’s own commenting syntax to distinguish between code comments and documentation. So if we want to add a comment to our documentation, we’ll use either /// or /** as opposed to the usual // or /*.

When writing the documentation for class methods, we’re going to get prompted to provide documentation for any parameters and returned objects. We can do this using @param <parameterName> and @return. For example:

/**Provides functionality to do stuff with a string
@param input String value passed into our method to do stuff with
@return Returns the result of the stuff we did to our string */
-(NSString *)doStuffWithString:(NSString *)input

That’s the basics of Appledocs! There’s a lot more to the syntax — Part 1 of this series is meant to show developers enough to get started. If you’re looking for additional information,  you can find a comprehensive document here. What are some of the major challenges you’ve faced with documentation as an iOS mobile app developer? Give us a shout in the comments section below and be sure to check back for our next post in this series!

How I Learned to Stop Fighting and Love (well… like) the iPhone

By | Android, iOS, Mobile | No Comments

When I started as an iOS developer, it was largely by accident. I was looking for work as an Android developer and ended up in a situation that will be familiar to most mobile developers out there. I was called by a recruiter one day, and the conversation went like this:

 Recruiter: Hi, I have a mobile development role, I’ve read on your CV that you’re experienced with mobile development.

Me: Yessir, I have very strong skills in Android development.

Recruiter: Well I’ve sent you over a job spec, this sounds perfect for you.

Me: Ah, yeah, this job spec is for an iOS role, I’m an Android developer.

Recruiter: It’s fine, it’s just a boilerplate job spec, I assure you it’s 100% an Android role.

And so I ended up in my first iOS role…

Some background on me, up until this point I’d held a dislike for Apple so vocally and for so long that it had become ridiculous. It was a standing joke in my social circle, when forced to develop on Macs I’d wear gloves, when answering phone calls from iPhones, I’d cover my mouthpiece with a tissue to prevent contamination. I was the anti-Apple guy.iphone side

So I started working with the iOS SDK and, to my horror, it was great. Android at the time was a very messy SDK, everything you tried to do was an uphill struggle, but iOS was showing itself to be very straight-forward and simple. Because of Apple’s tight grip on what can be done with iOS and how, the SDK is a lot more comprehensive. Android’s buggy process of linking interface controls through an XML layer and then to the code was replaced with a single click-and-drag, the process of passing information to a new view through intent flags and intercepting it on the other end was replaced by the much easier process of creating a view with the information it needed and then just presenting it.

As I work more and more with iOS and its technologies I see more of what it is that makes it such a popular platform, elegant simplicity from interface to code. Back in my days of Android-fanaticism, I imagined iOS to be a claustrophobically restrictive platform, informed by horror stories of apples widget prohibition and restrictions on access to information on the device, but these restrictions have affected me probably twice in my career. In my day-to-day development it does everything I need in the simplest of ways.

How about you? Have you had your “come to Apple” moment, or have you always been keen to work with it? Love to hear from you in the comments section below.

The Ongoing Contest for Mobile Device Market Share Control

By | Android, iOS, Mobile | No Comments

Reports touting Apple mobile product features and functionalities seem to be everywhere these days, but it’s important to recognize that the iPad and iPhone are not the dominate devices out there in terms of market share.  That honor goes to Android.

Industry analysts at International Data Corporation report that Google’s Android now controls 80% of the market.  Also noteworthy, despite Apple’s sales volumes increasing and earning new records, iOS market share actually went down.

Equally important is the uptick with Windows Phone.  That platform saw impressive gains after the Nokia deal was announced in September. Nokia accounts for more than 90% of all the Windows Phone devices sold to date.

This isn’t to say that Apple is going the way of the dying Blackberry.  Some of the declining demand in 2013 Q3 can be attributed to the worst kept annual secret – that new iPhone and iPad devices tend to be released in the waning months of each year.  Likewise, while sales numbers are up, market share can decline due to the greater numbers of people that are adopting their first smart phone or tablet.

So how does a business best leverage mobile?  Our mobile app developers recommend developing a comprehensive mobile strategy that encompasses iOS, Android and Windows Mobile. The jury is still out on the possibility for a rebirth of RIM’s Blackberry.

Want to learn more about how your organization can benefit from mobile apps that span all of the major mobile platforms, contact the App Experts at 0208 591 9330.