Android Tutorial: Photo app – Save bitmap to SD card or Share via Intent

In this tutorial I will show you how you can make a simple photo app. First the app allow you to take a picture with the embedded photo camera app. Second, the app will place this picture in an ImageView and allows you to apply a Colorfilter. Similar, but not completely, like Instagram.

When the user has applied a color filter the user can either save the picture to the SD card or share the photo via an Intent to for example Twitter or Facebook. In case of sharing, the picture will not be saved to the internal SD card (unless the user clicks the save button as well).

The following concepts will be discussed:
- Use MediaStore to take and grab a photo.
- Use onActivityOnResult to set the photo to your ImageView
- Save the picture either in the cache or save it to a new folder on your SD card
- Use SeekBar and Colorfilter to apply a filter to the Photo.

Continue reading

Android: Create a Custom Dialog Window with Dialog.builder

In the previous tutorial I showed you how you can inflate an activity based on a item selection within a ListView. The content was stored in Arrays and thus it saved you a lot of time by not creating numerous of different activities (for each item in your ListView). In that tutorial we also used a dialog window to show the location of the Dutch provinces. I was not completely satisfied how we implemented it. Therefore in this tutorial we will create a custom Dialog window based on the Android Dialog.Builder. In case you missed the previous tutorial click here.

Continue reading

Populate activities based on ListView selection

In this tutorial I show you how you can populate your activity based on a previous selection in your Listview. This way you don’t need to create tons of different activities for each item selected in your ListView. This is a nice tutorial when your working on a recipe or tourist kind of app where you need to populate your activity only with different content but in the same activity layout.

Continue reading

Android Tutorial: local storage an app example

In this tutorial we will use the local storage database of the Android device. I will try to explain this by making a small app using local storage of Android devices. Personally I never plan my shopping. I run into a stores to buy a sweater or something else, but this is almost never really planned. A common problem for myself is that I never know my clothing size, which is sometimes a bit problematic when your goal is fly in- and out of the store :). Therefore we will make in this tutorial a small app in which you can set your sizes of different clothing items. When you open the app at a later moment, the previous selected sizes are still remembered and retrieved by the local storage of Android.
Continue reading

Android Tutorial: Create a Custom Toasts

android custom toast


The Android SDK has some default or standard toasts. In this Android tutorial I show you how you can make your own personal customized pop-up. Part of this example is creating a customized shape of the toast including an image in the toast (ImageView).

- We first create the shape of the toast through the XML.
- Then we create the layout XML of the toast.
- Finally we make the references and initiation via the Java.
Continue reading

Android Tutorial: Overlay with User Instructions

In this tutorial I show how you can make an overlay or second activity which overlays your main activity with a transparent overlay which you can use to show an instruction in the screen. This is often used to show the user key features of your app when they use your app the first time.

Note that this tutorial is part of a set of tutorials to develop an app to store locally your clothing sizes. Yeah Yeah, pretty useful ;)

If your wondering how to make the background gradient or the used action bar please see the following two tutorials.

Tutorial Gradient Background
Tutorial Actionbar

Continue reading

Android: create gradient background via XML

In the previous post we have created a blue actionbar header. The header was blue, but the body of the app was still white. In this short tutorial I show you how you can change the background of your app using color-codes and adding a gradient in the color. The screenshot displays the background color we will make with this turoial. In case, your wondering where the actionbar comes from see my previous tutorial.
Continue reading

ActionBar header Tutorial

Nowadays many Android apps use a solid header or actionbar. These headers are not just nice but are often used to expose the brand of the app or provide quick access to common functionalities of the app, hence the name actionbar. Some examples of Android apps applying these headers are Twitter and Instagram. In this tutorial I will show how you can make these “glossy” coloured header bars. The picture below is what we will make in this tutorial. I used as title “Size Matters”, as I am currently working on an app with this as title (more in a future post).


Continue reading