Day 2: What Can I Get for a Buck?

Or, Building a Conversion Interface

We’ve got a solid foundation in place for getting data to and from the API. Now let’s get into building an interface for the app.

Building an Interface

To allow the user to be able to do the conversion of one currency to another, we’ll need an interface. Android’s interface definition is done mostly in XML, with sensible layout language and a very powerful system for dealing with device differences. Let’s start by building a form for the user to specify two currencies and convert an amount in one to an amount in the other.

Creating a Linear Layout

The activity_convert.xml layout is the view that ConvertActivity manages. Here’s the first line of input fields for currencies. ...

Get Seven Mobile Apps in Seven Weeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.