This post is bit of a follow up to my last post on how to build an app for multiple environments and local development using build types and product flavors. We will focus on how to install multiple of the resulting APKs on a single device.
Tag Archives: android
Different build types in android can be used to build the same application with different configurations. This can be predefined config values like 'debuggable', but you can also define your own config values that will be accessible in your application. This post will show you some ways in which you can use this functionality to easily build your app for different environments of remote services and for better local development.
In my previous post, I showed you the basic setup for android with maven using the android-maven-plugin. Now I'll show you how to configure it to make releases with maven, and how to configure the plugins to save you some work.
Configuring the keystore data
If you have used the release archetype like in the previous post, most of the work is already done. The necessary plugins are configured and only need some additional data, like the data for your release keystore.
Building and managing Android projects with maven is not as easy as it could be. So in this blog, I'll show you how we managed to get it work nicely.
In this example, we'll create a parent project with an app module and a separate instrumentation tests module.
We had a case in an internal app, where on Phones only the Portrait mode should be possible and on Tablets only the Landscape mode. So I googled a bit and tried out some things, and here is the solution I found for this problem.
First, in each Activiy in the AndroidManifest (or each Activity that should have this behaviour, but I prefer a consistent behaviour for the whole app), declare the following:
Within the scope of some Android R&D I took a look at Google's Cloud Message Service, GCM.
Well, the starter guide at http://developer.android.com/google/gcm/gs.html is almost all you need to get started, so I'll explain my setup and some further instructions for a small test case.
In case you already decided to setup GCM for yourself: make sure to do the guide above until you reach the 'Writing the Android Application' part.
In today's tutorial I'd like to show you how to implement a ListView, that only displays a limited number of entries. With a button at the end of the list, the user can load more entries.
To achieve this goal, we first need to implement a basic Adapter that provides our ListView with the entries:
Dieses Jahr hatte unsere Mobile Developer Reisegruppe das Glück die MDC 2012 quasi vor der Haustüre, nämlich in Stuttgart, vorzufinden. Das machte den Besuch natürlich noch viel reizvoller. Darüber hinaus kündigte sich mit Robert Virkus, dem Gründer eines unserer Partnerunternehmens, Enough Software aus Bremen, ein spannender Talk über das , meiner Meinung nach derzeit heißeste Thema im Mobile Bereich, an. Doch dazu später mehr.
In a recent project I encountered a problem with SQLite on android 2.1. On later versions, my code worked perfectly, but on 2.1 it crashed every time when trying to get a column from a cursor.
Here's the simplified code:
In my last project I needed to implement a ListView with rounded corners, because the app had to be supplied for Android and iPhone and they needed to look somewhat alike.
In this blogpost, I want to show you how I've implemented it and hopefully help some people who also want to use ListViews with rounded corners:
First off, we need the drawables for the backgrounds of the Lists entries: