Thursday, 29 January 2015

Managing programmers and the programming mother******* mentality

I came across the following great site on Stumbleupon today - programming-motherfucker.com - and as a developer had a great laugh before realising that in my day job I'm really the guy the site is having a swipe at!

The site aims it's gun firmly at the door of managers, whether they practice agile, XP, Scrum, waterfall etc and pokes fun at the agile manifesto:

Screenshot of the alternative manifesto from http://programming-motherfucker.com/ 
Whilst the site may be a bit tongue in cheek (obviously taking inspiration from Pulp Fiction), a huge challenge of managing developers can be the fact they can see you as a roadblock in the way of them producing code. Ultimately you are responsible for the success or failure of a project and as a result you have probably applied a process to the team to help you ensure your team are progressing in the correct direction. So how, as a manager, can you break down this perception from members of your team who have this mentality?

Before I start, I'll confess when I started my first programming job I agree 100% with the sentiment of this site - I thought the people managing me had crazy processes which did nothing but slow me down. Over time and as I progressed through the ranks, I guess my mentality has changed - that or I've been broken by managers ;-)

Firstly put your cards on the table and explain why a certain process is in place. If you are transparent and can explain why you have a process - truthfully - then you will gain respect. If you use a tool like JIRA or Rally to manage workload, explaining that its really to help you manage people's workload and help plan releases and how their use of these tools allow you to do that will at least help them understand. The key here is to ensure that firstly the admin they are required to do is as little and efficient as possible, and secondly to get their input into the process and how they think it could change to make their work easier. At the end of the day a business and jobs survives because it makes money, if someone cannot accept that then you shouldn't employ them anyway.

The second thing which really really helps, is to be good technically in the first place. If you are not only a manager, but a good programmer (mother******) then they wont feel like you are bullshitting them. I talk about this in my post can someone from a non-technical background manage a team of programmers?

You have to accept that you can't force people to do something, if you want them to do it well. Unit tests are a great example; you can force people to do them but they'll end up writing rubbish tests. If the programmers are engaged in why the team wants unit tests, then they'll write good tests.

The last thing you should do, is look at the table above and work out where you currently sit - are you closer to the "They Claim to value" column or the "They Really Value" column. If you are to the right, you should look at what you can do to move to the left. Have you gone too far in trying to manage the team that you have actually moved away from the basic principles?

It's an interesting topic - how do you deal with programmers who have this attitude? If you are a programmer what do you think managers can do to be more effective?

Monday, 26 January 2015

Top 5 tips for when interviewing developers

Interviewing can be a stressful experience, not only for the interviewee! However, having a plan in place for how you want the interview to go and a set of good questions will take a lot of stress out of the experience.

1. Know what you are looking for before the interview.


You are hiring for a reason. You have a position to fill and probably a specific skills gap you are trying to fill. Write down the top 5 skills you need, what behaviours you expect from the person, what experience you expect etc. This should have been done at the CV sifting stage but it's still worth having clear in your head before the interview. 


2. Start the interview with technical questions on the top 5 skills you require.

They are in the interview as their CV has noted the key skills you are seeking - so start off (maybe after a welcome and explaining the process) with a few questions on these key skills. Make sure you know what answers you are expecting. A good candidate will answer these questions with ease, and more importantly will help them relax which helps with the rest of the interview. If the candidate doesn't know the answers, then you should try (within reason) to help get them to the answer you are looking for. If you can't - move on.

Note: at this stage, if a candidate has not answered well you may already know the outcome of the interview. It can be tempting to end the interview early, but you can leave yourself in a tricky situation legally as all candidates deserve the same opportunity in terms of questions. Law in different countries (especially around equality etc) can be a minefield so if in doubt seek advice from a member of the HR department. 

3. Get the candidate to solve a problem.

There is nothing better than seeing someone in action to help you make a judgement call, so challenge them to do something. Some people ask the candidate to sit a practical programming test which is great, but can put a lot of potential candidates off. I find asking them to design on a whiteboard how they would tackle a problem is a far better and quicker option which allows you real insight into their problem solving skills.

When asking them to design something, how about a simplified version of the product you are working on? How would they architect it? Do they dive into the problem at a very low level or do they think about the high level problem and drill down? How do they react to you challenging their design? Can they accept criticism and adapt their design, or can they defend their design and convince you they are right? Offer to work with them after a while and see how they collaborate and interact with you. This simple exercise (only needs to take 10-15 minutes) is in my opinion the best way to separate the good candidates from the bad. You may also learn something yourself from it! If you don't want to ask them to design your current product, why not try something everyone knows, like a board game such as checkers, chess or monopoly.

Asking candidates to design a board game can give you a great insight into how they work and approach problems.


4. Hire better than what you already have, and different to what you already have.

This one is simple, but it's amazing how many people (bad managers) fall into this trap. You need to hire better people than you have/you are if the company is going to grow and your projects are going to be successful. Bad managers are scared that they will be outshone by the people they are hiring; the opposite is true - your projects will be more successful and your own reputation will grow. Soon you will be heading up more recruitment as you have a proven track record. Additionally, you will get to know most new starts who will have instant respect for you due to the fact you interviewed them. James Caan goes into detail on this here.

Diversity is also key; just because someone works or thinks differently to your or your current staff doesn't mean they are doing it wrong. Different approaches and views are always good and can help to provide the best solutions, so long as the person can collaborate and defend their decisions; but you will know that from point 3 above!

5. Ask how they keep their skills up to date.

Last but not least, good developers keep their skill sets up to date. Ask them how they do this? Do they read textbooks or blogs or both? Do they attend conferences or take part in hackathons? Don't expect everyone to do all of these, just one will do. However, someone who doesn't do one of these is a big warning sign for me that they lack the drive to keep improving and learning. Would you want someone not up to date in the latest technology and trends to be designing your next product?

This again can be a great opportunity to learn about new blogs or books that you should check out. For senior hires, ask what they would recommend to a junior hire straight from University? Again, questions like this will give you an insight into how they may mentor junior members of the team.

That is my recipe for interviews and has worked for me pretty well, but there are always new techniques to learn so if you have any experiences you would like to share please leave a comment below.

Thursday, 22 January 2015

Real time Google Analytics on the go

As I mention in most of my blog posts analytics is a key part of product development with Google Analytics being the key player in the market. When doing an A/B test knowing who your users are, where they are, when and how they interact with your app, website or blog will help you make informed decisions.

Checking these stats is important so when should you do it? I try to check my stats on the train to work in the morning with using Googles own app.



Take 5 minutes and try and learn from the data in front of you. I frequently can identify mobile devices for example which my apps don't run properly on, as it causes very low duration times and high drop off rates. Maximising what you have is really important!

Saturday, 17 January 2015

[Book Review] - Technical Blogging by Antonio Cangiano

Title: Technical Blogging
Author: Antonio Cangiano
Publisher: Pragmatic Bookshelf
Publish Date: March 1, 2012

As part of my new years resolution to more blog more regularly I started reading this book on the train into work on my iPad, finishing it within a week. As I mentioned in my post last week this book is great and has been a real motivator for me to take my blogging more seriously.

Book cover - image taken from the Pragmatic Bookshelf

I highly recommend this book to anyone who is a keen blogger or even someone who has a website or app who wants to increase their exposure to their product as the tips given in the book are transferrable. Antonio Cangiano is the author of many blogs - most famously Zen and the art of Programming and Math-Blog so he know's what he's talking about.

The book covers the following key topics:
  • Determining what kind of blog you are running (personal, company, general, niche etc)
  • The technicalities on how to create a blog
  • Creating content and maintaining your pace of blogging
  • Promoting your blog
  • Making money from your blog
The book focusses mainly on the Wordpress platform, but most of it is transferrable to other platforms (e.g. I use Blogger). 

The big takeaway I took from the book which I could instantly put into action were tips on how to ensure your blog more regularly (e.g. have blog entries in reserve in case you suffer writers block) and how to make your blog reach more readers. It's amazing what can happen if you just publish your best content onto reddit for example.

Has the book made any measurable difference to my blog? YES! 
  1. My number of posts has increased dramatically. More importantly I have a backlog of potential blog posts ready to get out there.
  2. Previously my record number of page views in a day was 54. This week I had 2500 in one day! 
  3. I've started to contribute back to the programming community which feels really good. Reading and commenting on other people's contents helps broaden my knowledge and get me more enthused in the industry.
Well worth picking up for the motivation alone.

Thursday, 15 January 2015

Privacy Policy

This Privacy Policy governs the manner in which MacKenzie Software collects, uses, maintains and discloses information collected from users (each, a "User") of the http://www.mackenziesoftware.com/ website ("Site"). This privacy policy applies to the Site and all products and services offered by MacKenzie Software.

Personal identification information

We may collect personal identification information from Users in a variety of ways, including, but not limited to, when Users visit our site, subscribe to the newsletter, and in connection with other activities, services, features or resources we make available on our Site. Users may be asked for, as appropriate, email address. Users may, however, visit our Site anonymously. We will collect personal identification information from Users only if they voluntarily submit such information to us. Users can always refuse to supply personally identification information, except that it may prevent them from engaging in certain Site related activities.

Non-personal identification information

We may collect non-personal identification information about Users whenever they interact with our Site. Non-personal identification information may include the browser name, the type of computer and technical information about Users means of connection to our Site, such as the operating system and the Internet service providers utilized and other similar information.

Web browser cookies

Our Site may use "cookies" to enhance User experience. User's web browser places cookies on their hard drive for record-keeping purposes and sometimes to track information about them. User may choose to set their web browser to refuse cookies, or to alert you when cookies are being sent. If they do so, note that some parts of the Site may not function properly.

How we use collected information

MacKenzie Software may collect and use Users personal information for the following purposes:
  • - To improve customer service
    Information you provide helps us respond to your customer service requests and support needs more efficiently.
  • - To personalize user experience
    We may use information in the aggregate to understand how our Users as a group use the services and resources provided on our Site.
  • - To improve our Site
    We may use feedback you provide to improve our products and services.
  • - To send periodic emails
    If User decides to opt-in to our mailing list, they will receive emails that may include company news, updates, related product or service information, etc. If at any time the User would like to unsubscribe from receiving future emails, we include detailed unsubscribe instructions at the bottom of each email or User may contact us via our Site.
How we protect your information

We adopt appropriate data collection, storage and processing practices and security measures to protect against unauthorized access, alteration, disclosure or destruction of your personal information, username, password, transaction information and data stored on our Site.

Sharing your personal information

We do not sell, trade, or rent Users personal identification information to others. We may share generic aggregated demographic information not linked to any personal identification information regarding visitors and users with our business partners, trusted affiliates and advertisers for the purposes outlined above.We may use third party service providers to help us operate our business and the Site or administer activities on our behalf, such as sending out newsletters or surveys. We may share your information with these third parties for those limited purposes provided that you have given us your permission.

Third party websites

Users may find advertising or other content on our Site that link to the sites and services of our partners, suppliers, advertisers, sponsors, licensors and other third parties. We do not control the content or links that appear on these sites and are not responsible for the practices employed by websites linked to or from our Site. In addition, these sites or services, including their content and links, may be constantly changing. These sites and services may have their own privacy policies and customer service policies. Browsing and interaction on any other website, including websites which have a link to our Site, is subject to that website's own terms and policies.

Advertising

Ads appearing on our site may be delivered to Users by advertising partners, who may set cookies. These cookies allow the ad server to recognize your computer each time they send you an online advertisement to compile non personal identification information about you or others who use your computer. This information allows ad networks to, among other things, deliver targeted advertisements that they believe will be of most interest to you. This privacy policy does not cover the use of cookies by any advertisers.

Google Adsense

Some of the ads may be served by Google. Google's use of the DART cookie enables it to serve ads to Users based on their visit to our Site and other sites on the Internet. DART uses "non personally identifiable information" and does NOT track personal information about you, such as your name, email address, physical address, etc. You may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at http://www.google.com/privacy_ads.html

Views Expressed in Blog
The views expressed in this blog are of MacKenzie Software only, and not that of anybody else including any current employers. MacKenzie Software is not responsible for views added to comments on this site, but will proactively monitor comments and remove any which are not acceptable.

Changes to this privacy policy

MacKenzie Software has the discretion to update this privacy policy at any time. When we do, we will post a notification on the main page of our Site, revise the updated date at the bottom of this page. We encourage Users to frequently check this page for any changes to stay informed about how we are helping to protect the personal information we collect. You acknowledge and agree that it is your responsibility to review this privacy policy periodically and become aware of modifications.

Your acceptance of these terms

By using this Site, you signify your acceptance of this policy. If you do not agree to this policy, please do not use our Site. Your continued use of the Site following the posting of changes to this policy will be deemed your acceptance of those changes.

Contacting us

If you have any questions about this Privacy Policy, the practices of this site, or your dealings with this site, please contact us at:
MacKenzie Software
http://www.mackenziesoftware.com/

This document was last updated on January 15, 2015

Privacy policy created by Generate Privacy Policy

Can someone from a non-programming background successfully manage or lead a team of programmers?

This is a question I have asked myself a few times over the last few years, and it can be a bit controversial:

Can someone from a non-programming background successfully manage or lead a team of programmers?

It's a good question. Of course, ultimately if you go up a few layers in an organization, the person at the top is invariably not from a programming background. I'm talking about direct leaders of the development team; the technical lead, the development manager, the scrum-master.

Over the years I've been managed by various different people from different backgrounds with varying success. I've also managed or led various development teams. Here's my general views on this:

Projects tend to fail, over-run or be massively underestimated in occasions when someone from a non-programming background leads a project. The following issues commonly arise:

    • The development team aren't involved in the work estimation and so it is hugely under-estimated. 
    • Requirements are not communicated effectively. Typically the initial requirement is paraphrased to the development team with key points which may hugely affect design omitted. This leads to rework or worse starting again. 
    • The lead may try to impose a bad design onto the development team, and due to their position the development team have to persevere with it.
Great example of bad design from Donald Norman's book - a great book for UI design. (Image from Amazon)

Some of the points above can be counter-acted with a strong development team - a team who are not scared to question decisions coming from the top. Additionally, agile teams can fair better where the development team are getting far more exposure to the end customer and the end requirements. 

Another thing which can commonly come up is that if the person leading the team does not have a good technical background, the development team can run over the top of them as they always delegate decisions to the team. I find good teams have strong leaders who will have a good technical vision but who will delegate some (or a lot) of decisions to the team. However, ultimately they have a vision and can quickly determine if the project is going off track. 

In conclusion, I think that having a development team led by someone not from a programming background is extremely dangerous, and from experience very rarely works. Adopting agile methodologies can help with mitigating some of the problems above, and strong minded development teams can overcome hurdles and ensure projects stay on track. 

I appreciate this is a generalisation, a bit controversial and every case is different so I'd like to hear your experiences - if you want to share please add a comment.

Monday, 12 January 2015

Android - Check for internet connectivity.

It's common to check for connectivity to the Internet within your Android app before you try and perform an operation. For example, if you were about to call an external REST call, you may want to check internet connectivity before performing the operation.

To perform the check I use the following utility method:

private boolean isNetworkAvailable() {
           ConnectivityManager connectivityManager
                 = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
           NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
           return activeNetworkInfo != null;

}

Remember you need the following in your AndroidManifest.xml in order for your app to connect to the Internet:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Sunday, 11 January 2015

[FIX: Eclipse - Android layout file] - Incorrect line ending: found carriage return (\r) without corresponding newline (\n)

I hit this annoying issue today - I think due to copy and pasting code. Within my layout file in Android I'm getting the following error:

Incorrect line ending: found carriage return (\r) without corresponding newline (\n)



Closing the layout and deleting the problematic elements did not help. However, the fix is easy:


  1. Open your layout file. 
  2. Press Ctrl + Shift + F
  3. Save the layout file. 

Hope this saves someone time in the future!

Friday, 9 January 2015

The three key factors in an effective developer desk setup

Setting up your desk for efficient working is a vital step for any software developer, whether working from their home or in an office environment. In this post I set out a few tips on how to make your environment as effective as possible.

Note: This post is slightly different to my usual content, but I've been reading a book just now - Technical Blogging by Antonio Cangiano (responsible for Zen and the Art of Programming and Math-blog) - which stresses the importance of keeping up your pace of blogging when you start out. So while I've been too busy to blog as I've been building a new desk for my developer setup, I realised it formed a great subject for a blog post. I plan on writing a review post on the book (great so far) so look out in the future. 

To my knowledge there is no known ideal setup. There are three key factors you should consider when considering your setup:
  • Cost - what equipment can you buy
  • Space - how much space do you have (not to mention are you in a corner, open space, against a wall...)
  • Hardware requirements - some developers need one laptop, some need multiple machines, some need other devices attached such as mobile phones for app developers. 
As you can see in this post there is a huge development environment setup variety even in a workplace like Google. With that in mind you should focus on the three key factors above. 

When working with cost I recommend prioritising a good chair and desk. You will spend a lot of time (most likely multiple hours per day) so comfort is key. No matter what other equipment you buy, if you aren't comfortable you'll never sit at your desk and work. 

Space is the one you can't really impact. However, a good desk can help you manage your space effectively. You want a clear working area but you want everything close. When worried about space, I find using TeamViewer to remote onto other machines can be a really good space saver. In my desk environment, I like to use only one monitor as I find additional screens distracting; however, I'm usually switching between my windows desktop, a windows laptop and a Macbook Pro (I'm looking at attempting iphone app development in addition to Android now...) so using TeamViewer to control the two laptops works great for me and keeps my desk clear. 


The problem with hardware is that it again impacts cost and space. Cluttering up your desk can lead to loss of comfort and distractions. I suggest where possible, you use remote desktop or something like TeamViewer and store the hardware elsewhere.

A few other things to consider if you are planning a new setup:
  • Remember you'll probably need multiple power sockets!
  • Some speakers are well worth it if you like to listen to music as you work.
  • Can you get rid of a desk phone and use services like Lync or Skype?
  • Can you go paperless, so you don't need space for a printer.
  • If you run your own business remember to keep receipts for all equipment (desk, mouse, keyboard, computers) so you can claim them off your tax submissions.
As always additional ideas are always welcome so please leave a comment below.

Sunday, 4 January 2015

Top 5 free tools to help publish a mobile app

You have created your app, tested it and are happy with your end product. That isn't you done though, you need to make sure you have the right icons, screenshots, feature graphics etc. This last hurdle can be a pain but here's a few free utilities I've found over the years which are a huge help.

GIMP - [FREE] Image creation and manipulation.

GIMP is a great free application for creating and touching up your images. Need to tweak your screenshots, create a feature graphic or an advertisement? GIMP is your tool. It's a great free alternative to Adobe Photoshop.



Syncfusion MetroStudio - [FREE] Icons for your app

Metro Studio comes with over 4000 pre-made icons which you can customize to meet your needs - change the colors, change the size and export them to any format you want. See my Syncfusion MetroStudio tutorial for help in getting started.




Paint - Simple image software

Paint is a great simple tool for quickly cropping images and tweaking screenshots.

Image Resizer for Windows - [FREE] Change the size of your images and icons

You'll notice each app store has different image sizes for feature graphics and screenshots which is another pain when uploading your app to the store. Image Resizer for windows however is a quick and easy tool for resizing your images - simply right click in windows and choose your new dimensions and the tool generates a copy of the file with the new dimensions.


Android Feature Graphic Generator - [FREE] Create quick feature graphics 

This great website allows you to simple enter the text you want in your feature graphic and it will generate a nice feature graphic for you. Tweak the colors, fonts and even add images. A really quick win if you want to get your app uploaded quickly and Google Play now requires you have a feature graphic. 



If you have any other tools you recommend please add a comment and I'll check them out. If you found this post useful subscribe via email using the link at the top of this site.

Integrating Google Analytics into existing Android app

Analytics are key to measuring the success of your project or application and are a great way of identifying your users trends and demographics. Have you released an app and wondered who your users actually are? Well with analytics you could find out where your users are situated, what ages they are etc. The leader in this field is Google Analytics - this can be embedded into your mobile application, website and even your blog.



After a few frustrating attempts at integrating Google Analytics into an existing app I thought I should post a guide on how to do this.

1. Download the Google play services library and add it to your project.

You can do this by right clicking on the project you want to add analytics to in eclipse, choosing properties and then the Android tab. In the Library section, select Add and choose google-play-services_lib and select Apply.

2. Add the required permissions to AndroidManifest.xml.

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

These are required so your app can send the analytics content.

3. Add Metadata to your application. This should be added under the application tab.

<meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
<meta-data
            android:name="com.google.android.gms.analytics.globalConfigResource"

            android:resource="@xml/global_tracker"/>

We'll add global_tracker later.

4. Create the analytics application helper class.

import com.google.android.gms.analytics.Logger;
import com.google.android.gms.analytics.Tracker;
import com.google.android.gms.analytics.GoogleAnalytics;

import android.app.Application;

import java.util.HashMap;

public class YourApplication extends Application {

    // The following line should be changed to include the correct property id.
    private static final String PROPERTY_ID = "YOUR_ANALYTICS_ID";

    public static int GENERAL_TRACKER = 0;

    public enum TrackerName {
        APP_TRACKER, // Tracker used only in this app.
        GLOBAL_TRACKER, // Tracker used by all the apps from a company. eg: roll-up tracking.
        ECOMMERCE_TRACKER, // Tracker used by all ecommerce transactions from a company.
    }

    HashMap<TrackerName, Tracker> mTrackers = new HashMap<TrackerName, Tracker>();

    public YourApplication () {
        super();
    }

    synchronized Tracker getTracker(TrackerName trackerId) {
        if (!mTrackers.containsKey(trackerId)) {

            GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
            Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                    : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(
                            R.xml.global_tracker)
                            : analytics.newTracker(R.xml.ecommerce_tracker);
            t.enableAdvertisingIdCollection(true);
            mTrackers.put(trackerId, t);
        }
        return mTrackers.get(trackerId);
    }

}

5. Update AndroidManfiest.xml to include your application, e.g.:

<application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:name=".YourApplication" >

6. Create the tracker xml files. 

Under the res section in your project create an xml folder. Create two xml files in this named ecommerce_tracker.xml and one called global_tracker.xml. Contents below - remember to substitute in your analytics tracking ids. These can be created following instructions here

ecommerce_tracker.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="ga_sessionTimeout">60</integer>
    <!--  The following value should be replaced with correct property id. -->
    <string name="ga_trackingId">**INSERT TRACKING CODE HERE**</string>
</resources>

global_tracker.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="ga_sessionTimeout">300</integer>
    <bool name="ga_autoActivityTracking">true</bool>
    <screenName name="**Path to Your Application e.g. com.company.YourApplication**">**YOUR NAME**</screenName>
    <!--  The following value should be replaced with correct property id. -->
    <string name="ga_trackingId">** INSERT TRACKING CODE HERE ** </string>
</resources>

Note the trackers are described as follows by Google 

APP_TRACKER, // Tracker used only in this app.
GLOBAL_TRACKER
, // Tracker used by all the apps from a company. eg: roll-up tracking.
ECOMMERCE_TRACKER
, // Tracker used by all ecommerce transactions from a company.

7. Send the screens

Add the following code to your onCreate method in your activity. This will send the screen views to Google Analytics.

// Get tracker.
Tracker t = ((YourApplication) getApplication()).getTracker(TrackerName.APP_TRACKER);

// Enable Display Features so you can see demographics in Google Analytics
t.enableAdvertisingIdCollection(true);

// Set screen name.
t.setScreenName("** YOUR SCREEN NAME  **");
       
// Send a screen view.
t.send(new HitBuilders.AppViewBuilder().build());

8. Update onStart and onStop

Add the following:

@Override
protected void onStart() {
super.onStart();
GoogleAnalytics.getInstance(this).reportActivityStart(this);
}

@Override
protected void onStop() {
super.onStop();
GoogleAnalytics.getInstance(this).reportActivityStop(this);
}

9. View results in Google Analytics.

You are now done and once users start using your app you should be able to see real time updates in Google Analytics. Note that the analytics aren't exactly real time - but it's good enough! 


Let me know if this helps you out or if you have any further questions and I'll try and help where I can.

EDIT: 11/01/2015 - updated section 7 to allow you to display demographics in Google Analytics.

Allow Android app to install on SD card

A common problem which can turn users off your app is not having the option to transfer the app to their SD card hence clogging up their phone. Chances are they'll uninstall as soon as they can. Users may have apps such as AppMgr III (App 2 SD) installed which will automatically try and move any installed apps to their SD card.

Luckily as a developer enabling this is incredibly simple - it's one line in the AndroidManfiest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.your.package.name"
    android:versionCode="1"
    android:versionName="1.0"

    android:installLocation="auto" >

The section highlighted in green is all you need to add. You have two options here:

  1. auto - this enables the app to be installed on the SD card, but you don't have a preference and you leave it up to the user. This is the option I always go for. Once installed the app can freely move between internal and external.
  2. preferExternal - this also enables the app to be installed on the SD card but you also try and install it there by default if there is available space. If there isn't it will default to internal phone storage. Once installed the app can freely move between internal and external.
That is all there is to it - a one line change which makes a massive difference to your user retention rates. The full documentation can be found here.

Friday, 2 January 2015

Update eclipse Android Development Toolkit to version 23.0.0

I hit the following irritating issue when I started eclipse up recently.

"This Android SDK requires Android Developer Toolkit version 23.0.0 or above. 

Current Version is 22.6.3.v201404151837-1123206. 

Please update ADT to the latest version." 



The really irritating thing was that clicking on Check for Updates found no updates! After a lot of different attempts, here's the steps I used to resolve this.

1. In Eclipse go to Help -> About Eclipse SDK


2. Click on "Installation Details".



3. Select Android Development Tools and click the uninstall button. You will need to restart once this is finished.


4. Now select Help-> Install new software.


5. Expand Developer Tools and select Android Development Tools and select next


6. Click next a few times and then finish.The installation will then begin. Accept any warnings about unsigned content. 

7. You'll be asked for another restart. Restart now.

  
Eclipse should now open with no errors. I hope this helps. I tried following others steps from stackoverflow  but had no success but these steps worked a treat. 

NOTE: At step 2 and 3 you can choose to uninstall all of these options and update all. In this article I focused on only the Android development tools.

Covid-19 impact on mobile applications - a quick case study

Amidst everything that's been going on over the last few months, checking on how my apps have been doing has been low down my priorities...