Tag Archives: Android

Using Robotium with a Play APK

This tutorial will look at how we can use Robotium to run tests on Android applications where we don’t have the source code, only the APK from Google Play. It’s not meant as an extensive review of what Robotium is or how is compares to other testing frameworks, just the basics that are required to get started in a slightly less verbose fashion than the informative ‘official’ documentation. Robotium can be downloaded here and if you want to head straight to the Robotium documentation for this task, it’s here. Continue reading

Embedding a Cordova WebView in a Native Android app

Sept 2013 – Updated to use cordova 2.9 – see github repo

A few months ago I wrote a tutorial on Hybrid apps and accessing native functions from an Android WebView. I made a comment that while Apache’s Cordova can do this fine, you wouldn’t use Cordova from within an app. Then I discovered you could embed a Cordova WebView within a native app. If you’re not familiar with Cordova, this means you can create an Activity within your native app which uses HTML5 and JavaScript to create the UI and access native functions and features via the Cordova API.

Continue reading

Accessing Twitter API 1.1 on Android

This tutorial covers the basics of using the Twitter API to access your own tweets, most likely with a view to displaying them in an app. Updated on Friday 13th September 2013, source code available on Github

Twitter API v1.0

On the 5th March, 2013, v1 of the Twitter API will be no longer be accessible. Currently, you can get access to Twitter REST API using unauthenticated HTTP requests. Continue reading

Android JavaScript Interface

This tutorial will show you how to access native features from a WebView, and how to pass data back to a WebView from native code. The former part, invoking native code from a WebView, is achieved through adding a JavaScript interface and is documented in the Android API guide here. The example in the guide causes an Android Toast to be triggered from the WebView. All very well, but what about having an app or part of an app that runs in a WebView, gets data from the Android OS and, rather than simply calling a native function like Toast, returns the data to the WebView UI? Read full article

Customising an Android Button

The stock android button can look a little dull and basic, so today I’m going to look at making a custom button.
Start with a generic android project (my target is 16, min version 7 – this will cause Eclipse to include the android-support-v4.jar which is needed for some of the xml statements in this tutorial) and navigate to your res/layout/yourlayout.xml layout xml. Read full article