Google IO - What's new in Android

1 comment
At Google IO 2015 some exciting new announcements were made about new features in the Android operating system for developers.

Developers can now build apps for Android M by downloading the developer preview (API 22) and latest SDK. There will be a couple of versions of previews which will be improved before the final version is released.


In Android M run-time permissions have been introduced. What this means is that the user won't have to accept a wall of permissions when they first install and application, instead they'll be asked to grant permission to that app to access a specific feature only when it's needed, and of course it'll remember the users  choice so they'll only have to do it once for each permission for each app.
The user can also go into settings and view and adjust app permissions for all installed applications sorted both by app and also by a particular permission too which is handy. Basically everything users have ever wanted with permissions delivered. This will only be available for apps developed for Android M though. Legacy apps will remain the same, by asking all permissions up front on install, but they can still be adjusted from the phone settings. This means that your app must be tested in M to check all permissions work.

Voice Interaction

VoiceInteractor allows you to interact with the voice input system - there was already the capability for the user to launch an intent and use voice, but now with the voice category intent filter, so creating voice interaction request is really easy

Finger Printing

There is a new finger print manager in the API which allows for really easy integration of finger print authentication. Your app will still contain all the UI, and the API does all the work on the backend alternativley you can use the existing keyguard manager to show the lock screen to authenticate the user with their pin, code or whatever they set up.


In Android M by default all app data will be backed up to the users Google account. The user can opt out of this, as can the developer don't use the <full-backup> tags. Everything else related to user data was already backed up in previous versions of Android and will continue to be.

Google Play Services

Version 7,5 is out, one of the most exciting features of this is GCM network manager - this is every cool way of making sure that your network requests are going to be much more optimal for the device, even for older versions (unlike in L where the app had to have this explicitly written in). There's also a few more new features, like maps available for Android wear devices.


Another focus on M is to improve battery life. A new feature called Doze has been implemented which uses the devices accelarometer to detect if the device has not been moved for a long period of time (like hours to days) and exponentially decreases the number of network requests and scheduled app processes until the device is moved. If there are real-time alarms or high priority tasks the device will be woken and they will have priority. As soon as the device is plugged in or moved Doze will turn off. Same will happen with apps you don't use (for a few days or weeks), less resources will be allocated to their background processes.

Data Binding

This idea obviously has been around on other platforms for a while but it's now being integrated with Android. Data binding is the ability to connect the data model to some of the UI elements in the application. Data binding is cool.

UI Features

The Android design support library has been updated with the new material design, with emmbed better practices. And a f-a-b button so developers don't have to create their own circles with a shadow anymore. Updates to recycler view and web view.


Now notifications can contain a resource id for their icon, this is cool because for the first time you can use a bitmap, you no longer need a million  assets for each possible condition, they can now be generated on the go, like downloading an asset from your web back-end.


Better text selection, (use ActionMode.TYPE_FLOATING in your code) for a floating pallet of icons, that'll be easier for users.  The improved ability to process text. Also better formatted text, finally.

App Links

In Android M will now be able to distinguish between app and web links made by the same developer securely. Very simple to set up in manifest and on server with auto verify certificates and app links, so links to those urls will open in your app. As with everything else in M the user can take controll and modify this in settings. 

Direct Share

Allowing the user to share more easily. Provide information with intent filter, with a certain intent return list of possible targets

Better Stylus Support

Stylus support has been around for a while, but it has been greatly improved in M. You can create a datastream to receive preasure and button data over BLE protocol Android can fuse this with touch data on the glass, what this means is you can build a bluetooth stylus that then records as a stylus on any app on M that supports stylus - no special hardware, no app modifications, no nothing complicated, so interrogating stylus data = very easy.
There will also be some motion events added in M to help deal with stylus'es like ACTION_BUTTON_RELEASE , BUTTON_STYLUS_SECONDRY.

Graphics and Media

RenderScript Compute: 
BLAS intrinsics (... really big matrix'es) 
Allocationless launches (size of kernal seperate from data)
ScriptGroup (more dependancy types, better compiler optimisations)

Also imporovements to camera API, even better flash light no longer linked to camera

Alpha Optimisation

MIDI package has been introduced. You could already do MIDI, if you did it manualy. Now this new package will give the developer the bytestring that will be able to send and receive the not information.

Higher Res Audio

Now single precision float (rather the 16-bit sample of before) Multil chanel UB digital audio

Android Studio 1.3

Integrated testing support, tooling, new language support, more support for vector drawables, Android ndk development. Also Systray has been cleaned up.

1 comment :

Post a Comment

Introduction to react.js

React is a JavaScript framework built at Facebook, it was built to answer the question "How should we structure JavaScript applications".
There are a lot of JavaScript frameworks that try to answer this question, most of them are MVC based (or MVVM or MVW) - basically they're all based around models - which are just observable objects that have some events api that allows you to subscribe to some changes on that object. So developers set up bi-directional data-binding that allow you to subscribe to changes on you r model, so whenever something changes you can mutate and update your view.

React is a JavaScript library for building user interfaces, you get all the good parts of a complete render, but without the downsides such as performance and loss of data.

At the heart of react is, declarative components - describing what components look at at any point in time

Initial Render

There is no explicit data binding, in react we just define one render function, and the purpose of this render function is to describe what your view looks like in any point in time. It returns a representation of your view. We recursive call render to build up this hierarchy. When we want to generate the mark-up of this representation for the first time, we take the representation and iterate over it generate a string and inject it into the document. This does something called two-pass rendering which is generating the string, then later, after the string is injected into the document we attach the event handlers at the top-level, which exposes some really interesting opportunities, since your generating your string somewhere separate from where your hooking up your events, you can render on the server.

Update Rendering

Instead of mutation for updating react uses a process called reconciliation, the purpose of this is to keep you UI up-to-date as your data changes, automatically updates your views and DOM. The render function that does the initial rendering and returns a string representation of what our components should look like at that point in time, and react compares that with the current DOM and finds all the differences, based on those differences creates some DOM representations of just the relevant parts and updates the view.

Building DOM Representations

Since the HTML is defined in JavaScript it would get a bit hard to understand for larger pages with a lot of nesting, there would be curly braces everywhere, so for that reason JSX syntax is used to define the elements. This is very similar to other templating engines and uses ordinary HTML-type syntax.

This post is based on information given by Tom Occhino from Facebook on his series about react.js


Post a Comment

How to create a web service to send emails for you Android, iOS or web application

No comments
Since it's a common task to have to send emails from your app, this post outlines the quickest way to get a mail service up and running  using server side JavaScript, Parse and Mandrill. No JavaScript or web coding experience is needed.

Set up Parse

1. Go to and create a cloud code app following the process
2. Download
3. Extract the zip
4. Run parse console
5. cd into your working directory
6. run the command parse new <name-of-project>
7. make changes to your code if you like
8. run the command parse deploy

Set up Mandrill

Mandrill is a is an email infrastructure service by MailChimp. It's free to use up to a limit of 12,000 emails per month (and 250 per hour) and it's easy to set up.
Head over to and sign up to get an API key.

The Code

Inside your new Parse project, there should be a folder called cloud, cd into that and create a file called main.js (if it doesn't already exist).
Paste the following code into cloud/main.js

Parse.Cloud.define("sendMail", function(request, response) {
    var Mandrill = require('mandrill');
        message: {
            text: request.params.text,
            subject: request.params.subject,
            from_email: request.params.fromEmail,
            from_name: request.params.fromName,
            to: [{
                email: request.params.toEmail,
                name: request.params.toName
        async: true
    }, {
        success: function(httpResponse) {
            response.success("Email sent!");
        error: function(httpResponse) {
            response.error("ERROR - mail failed to send");

And change the <api key> to your Mandrill API key (obviously withoiut the pointy brackets)
Once this id done, run parse deploy to push your work to parse.

Calling your service

Below is all the paramaters you'll need to send emails from your application.

URL Parameter Key
Raw JSON body:
   "toName":"jane doe",
   "fromName":"john smith",
   "text":"this is the email body for the main message",
   "subject":"this is the email subject"

You will probably want to test this out before you include it in your app. A good way to do this is to use the PostMan client availible free on the Chrome store (similar versions will be out there for Firefox and Safari). 

Fill in the form so that it looks like the image below, and you should see your new email service working :)

No comments :

Post a Comment

Vitality Run Hackney 2015 (21km)

No comments

A fast and flat half marathon through Hackney (East London), with 13,000 runners and a route including the Olympic park, Hackeny Empire and some of the green spaces of Hackeny marshes and Victoria park.

No comments :

Post a Comment

Digital Bucket - Charity Donation Collection App

1 comment
During the weekend of BattleHack I worked in a team developing a Digital Bucket Solution, a simple application that allows people to donate to charity bucket collectors even when they don't have any loose change, using their smart phone.

The backend was written in Node js and has an iOS client. It supports Apple Pay and all of BrainTree's services, it also uses iBeacons for detecting when you;v approached a charity collector.

Source Code for back-end

Web portal demo

1 comment :

Post a Comment

Built my first PC!

No comments

I have finished building my computer!!!!
Christopher's got the AMD FX-8350 8 core 4 GHz processor, 16 GB of DDR3 1866MHz RAM, 2TB HDD and 240GB SSD, 2GB graphics card ( the Asus AMD Radeon R7 250X) and the Asus M5A97 EVO R2.0 MB 
and LED lights because LED lights are COOL!!!

No comments :

Post a Comment

Learn HTML5 in 40 minutes tutorial

1 comment
Since EVERYTHING front-end related on the web is coded in HTML and HTML5 has a bunch of new features to make your web content more interactive and semantic, it is the language you need to know before you can do anything else web-related.

These videos should give you an overview of what HTML5 is and how you can use it to create web pages.

There are 6 videos in the series....

More resources relating to the videos above can be found at this URL:

Enjoy :)

1 comment :

Post a Comment

BattleHack London 2015 @ Tobacco Docks

No comments
My team 
BattleHack 2015 was the biggest London BattleHack so far, held at the Tobacco Docks.

Was a great weekend, my only disappointment was that I did not win an axe :(

The winners

No comments :

Post a Comment