Home » Tag Archives: core

Tag Archives: core

HTTP Camera live preview example

With this example we are going to demonstrate how to create Live Camera preview in Android. The Android SDK includes a Camera class that is used to set image capture settings, start/stop preview, snap pictures, and retrieve frames for encoding for video. It is a handy abstraction of the real hardware device What we are essentially going to do is setup a web ...

Read More »

Google Maps example

With this example we are going to demonstrate how to use Google maps on Android. Note that in order to use Google Maps, the Google APIs have to be present in your SDK. In case they are not already installed, you will have to manually install them. This is accomplished by using the Android SDK and AVD Manager. So, in ...

Read More »

Animations examples

In this example we shall show you how to programmatically set animations to a layout . To achieve this one should perform the following steps: Create an XML file and place it in a new folder inside the “res” folder of the Android Project Use an  AccelerateInterpolator that dictates the way the animation changes its state Use  the AnimationUtils to load the animation ...

Read More »

JSON parsing with Gson

This is an example of JSON parsing on Android with Gson. Google Gson is a Java library that can be used to convert Java Objects into their JSON representation. In order to parse JSON with Gson, follow these steps: Create a class that extends Activity (here called JsonParsingActivity) Create an instance of the Gson class Use the DefaultHttpClient to retrieve ...

Read More »

Prefernces and PreferenceActivity example

In this example we shall show you how to use Preferences with Android. This functionality is used for storing user’s preferences and using them for example when the application starts. For using the Preferences framework the following steps must be followed: Create a class that extends PreferenceActivity (here called QuickPrefsActivity) Use the addPreferencesFromResource method in order to read the config ...

Read More »

Gallery View without pictures

This is an example of Galery view on Android without any pictures. Gallery View is one of Android’s widgets. It provides a list of scrollables elements, much like the normal ListView or even a HorizontalScrollView. In order to use Gallery View with custom elements follow these steps: Create a Layout xml file with describing the layout of the Gallery elements Add a Gallery ...

Read More »

Creating an AppWidget for the home screen

In this tutorial we are going to see how can you create an AppWidget of your Android Application for the home screen of the device. Since version 1.5, the Android SDK includes the AppWidget framework, a framework that allows developers to write “widgets” that people can drop onto their home screen and interact with. The use of widgets is very ...

Read More »

Customized dialog

In this tutorial we are going to see how can we use Customized dialogs for user interaction in Android. The easiest way to do that is to use the Dialog class. The basic steps to create a Customized dialog are: Create a new xml Layout file that describes the content of the Dialog box and how it will be rendered use ...

Read More »

Using options menus

In this example we shall show you how to create and display option menus in your Android Application. It is very important to use option menus because they enhance the user experience and improve user interaction. To create Option Menus in Android one should perform the following steps: Override the onCreateOptionsMenu(Menu menu) method of the Activity class menu.add method to ...

Read More »

Customized list view

This is an example of how to create a Customized ListView on on Android. The normal ListView component of Android is very useful. But we have the ability to further customize it which makes it more flexible. In order to create your own, customized ListView, follow these steps: Create a new XML  file that describes the layout of each row Create ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns