Tag

mobile apps

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!

 

How to Develop Hello World Google Glass Android App 

By | Android, Mobile | No Comments

Google Glass is an augmented reality wearable computer with a head-mounted display (HMD) that is being developed by Google in the Project Glass. It’s looking to reinvent the mobile device scene by providing hands-free Internet/computer access for users on the go. Despite this technology remaining in it’s infancy stage, our early adopter Google Glass App Experts have begun experimenting with the Glass Development Kit (GDK) so we’re thrilled by the potential this game changer has to offer. Below are some simple guidelines to follow to develop your first Google Glass app to leverage this emerging technology and familiarise yourself with the coding.

Developing A Google Glass App

If  you’re comfortable with Android, here’s all you need to know to get started:

  • Get the Android 4.4.2 (API 19) SDK and Glass Development Kit Preview add-on from the Android SDK Manager.
  • On Glass, turn on USB debugging (Settings > Device Info > Turn on debug).
  • Import some GDK samples with the File > New Project > Android Sample Project menu.
  • When you’re ready to create a project for your own Glassware, use these settings:
    • Minimum and Target SDK Versions: 19 (There is only one Glass version, so minimum and target SDK are the same)
    • Compile with: Glass Development Kit Developer Preview
    • Theme: None (ADT and Android Studio usually assign a theme automatically, even if you specify no theme, so remove the Android:theme property from your manifest after creating a project)
  • Don’t know where to start? Read these pattern and developer guides for additional information and helpful process tips.

Developing Hello World Immersion for Google Glass

This section describes how to create a simple hello world application for Google Glass using the GDK. There are two options for how the Glassware should show up on the device: as a live card that is part of the timeline or as an immersion that is displayed outside of the context of the timeline. We are focusing on how to write an immersion.

You might be wondering what is an immersion ? An immersion is basically an Android activity. The name immersion implies that it is not part of the normal Glass timeline. Instead, it takes full control of the device – except for the back gesture (Swipe down). To go back to the timeline you need to leave the immersion.

Google Glass 1

Project Set Up:

Create a normal Android project with the following settings:

  • Set minSDKversion and targetSDKversion to 15 (Android 4.0.3)
  • Set compileSDKversion to “Google Inc.:Glass Development Kit Sneak Peek:15”
  • Do not assign a theme to your application or derive your own theme from Theme.DeviceDefault.

Creating the Immersion:

Let’s create a simple activity. The Card class helps us to create a layout that looks like a timeline card.

Google Glass 2

Launching the Glassware Voice Commands:

After creating the activity, we need a way to start our Glassware. A common way to launch Glassware is to use a voice trigger. Let’s add a simple voice trigger to start our hello world activity.

First we need to declare a string resource for our voice command.

Google Glass 3

The next step is to create an XML resource file for the voice trigger using the previously created string value.

Google Glass 4

Now we can add an intent filter for the VOICE_TRIGGER action to our activity. A meta-data tag links it to the XML file we wrote above.

Google Glass 5

The developer guide requires you to add an icon for the touch menu to the activity (white in color on transparent background, 50×50 pixels)

An App Experts tip: the Glass Asset Studio is a helpful tool to generate these icons.

Google Glass 6

The Final Glassware

Now we can start our Glassware by saying “ok glass show hello world”:

Google Glass 7

Another option to start our Glassware is to use the touch menu and scroll to the “show hello world” command:

Google Glass 8

That’s it, you’re all set! We hope this tutorial has helped Android enthusiasts in developing their first Google Glass App. We look forward to seeing this new wearable experience takeoff. Stay posted for additional blogs on how to build great Glassware.

Have you had the chance to experiment with Google Glass? What are some of the major challenges you’ve experienced? Feel free to give us a shout below!

Android vs iPhone: Is marketing influencing mobile loyalty?

By | Android, iOS, Mobile | No Comments

Android or Apple? This debate is something that developers have been talking about for years and countless articles have argued the merits of one over the other. Our App Experts were discussing the two competitors recently, and an intriguing question came up to try and explain Apple’s success:  Can a good marketing strategy beat a cheaper product that’s similar in nature?

Apple completely changed the mobile world when they released the first iPhone. It was a remarkable moment. Blackberry was already in existence by that time, but Apple showed us that smartphones could be more than just a tool for work. They managed to expand from a phone previously used only for calling and texting to the preeminent key to unlocking the web on the go. Someone had to follow.

Android – The New Kids On The Block

When Android first appeared on the market, it was seen as a cheap alternative to having an iPhone. But Android grew in popularity thanks to having an open source policy which allowed developers to code freely. Today, Android captures the spirit of individuality and nonconformity. If you compare Apple’s iOS 7 with Android 4.4 (Kit Kat), you can see huge differences among them, but many functionalities mirror one another. So one has to wonder, if there’s such a massive gap in pricing, surely iPhones must deliver additional features? The answer is a resounding no. 

In fact, Apple is copying some things from Android. The new Apple iOS recently added some features that were around in Android for a long time, like disabling WiFi from the notification screen or the new task manager which is just an Apple version of the existing one in Android. 

Additionally, iOS 7 becomes problematic when you are using an old iPhone, like iPhone 4. Battery life lasts for a shorter time and some features are not available because the hardware is not ready for them. Some would argue this is a way to force people to buy a new phone every two years in order to be able to use the latest features.

So what about Android? They’ve added some interesting features like the new interface with a design that’s very clean and simple. They’ve incorporated some components from the flat iOS design, but it shows the elements in a clear way — not to mention the colour palette is appropriate for a device that the user is going to be looking at for a long period of time.

The question Android fans are puzzled with is why anyone would pay £500 for an iPhone when they can have a Samsung or a Motorola phone which provides the exact same functions for less than half the price of an iPhone? Sure, Apple products are beautiful and easy to use. But at the end of the day, Android gives more freedom to the user with customization capabilities. We’re going to suggest one possible answer for many Apple aficionados is in a genius marketing strategy. 

Power of Brand Awareness

The cult-like following of Apple’s products may be attributed to the hype Apple is able to generate for its consumers year after year. Nobody is able to build buzz and speculation on upcoming products and announcements like Apple. Their brand following is built on creating the ultimate user experience — from the packaging, design, to the products themselves, Apple has capitalized on fans looking to have the latest in gadgets. Just one look at the massive queues outside an Apple store during a new product launch summarizes the incredible demand these products generate.

Having all of this in mind, one must wonder the powerful effects of successful marketing efforts.  If most people aren’t moved by features or specifications, some other channels must be contributing to user preferences. Sometimes, a name seals the deal and you can see that every day in the tube or on the bus.

In a city like London, iPhones and iPads are more widely seen than Android devices. Why? That answer will vary user to user, but there’s no denying Apple’s global brand awareness and more importantly, loyalty. After all, Apple’s cool and sleek designs outsells a product that works on par and is significantly cheaper, so there is a sense of established value with the Apple community. Wherever your personal preferences lay, the war between Apple and Android continues…

We want to know: which operating system do you prefer and why? Comment below and join the debate.

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!

Improve Android Emulator Performance

By | Android, Mobile | No Comments

Testing is a critical aspect when building an app because it allows you to see how users interact with your app. Android developers need to be especially careful with fragmentation concerns due to multiple OS variations. The Android Emulator is a great tool to test Android applications in a development environment.

android

While using Android virtual emulator for testing, Android developers can configure the emulator to virtually every possible device type available on the market. Developers should focus on testing some of the more popular devices to ensure the app matches to each device’s screen resolution.

DISADVANTAGES

Despite the fact that Android emulator provides tremendous options for developers to make adjustments to configuring, many developers avoid testing Android applications on emulator because of its slow loading and response time. All too often, the emulator won’t load at all to run an app.

If a developer is building an application on a low configuration machine (4 GB RAM or lower and Intel i3 or lower), then development and testing may become dreadful. Developers may witness no sign of the emulator loading and even if it gets loaded, it seemingly takes forever to launch and load the app. So what’s a developer to do?

THE ANSWER

Our Android App Experts have resisted using emulator in the past, but they’ve found an option to maximize the response time of Android virtual emulator. Here are the steps to increase the RAM size of emulator beyond the configuration limit of virtual emulator.

Note*: The steps below are configured on Windows 7 machine

Locate below folder location on your machine:
C:\Users\<username>\.android\avd\<YOUR EMULATOR>\
Open config.ini (Configuration file)
Update below attribute to 1024MB
hw.ramSize=1024MB

Have you seen an improvement in Android emulator launch time and app response time while testing app on emulator? Tell us your experiences in Android app testing in the comment 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.