This tutorial shows how to check whether your Android phone is currently connected to a network or not (e.g. Wi-Fi, 3G etc.).
A while back, I wrote a tutorial on how to dynamically monitor network connectivity in Android. However, sometimes all you want is to check if your phone has an active network connection at any given time (i.e. not to constantly monitor its status).
Resource files are one of the major strength in Android SDK that allows you to separate presentation from application logic. String resources in particular helps to effectively manage multi-lingual applications with ease.
In this tutorial, I will be showing how to use formatted string resources in Android. In addition to discussing the benefits of using formatted strings, the tutorial will show (a) how to define formatted string resources in xml, and (b) how to problematically use them when developing applications.
This is part 2 of an ongoing series of articles about my experiences with Liferay. In this article I will be providing step-by-step instructions on setting up an extensions environment with Liferay.
If you haven’t already set up a Liferay installation (with an application server), please refer to my previous blog post here.
Other articles of the Liferay series:
- Setting up Liferay with MySQL database
- Setting up Liferay Extensions environment
- Inter-portlet communication (both within a war and different wars)
- Step-by-step guide to creating a Liferay Hook
- Customizing Liferay login process
ActionBar is a user interface (UI) design pattern found in Android that allows users to quickly perform common actions within your application. ActionBar replaces the traditional title bar with a more featured and consistent UI. Popular applications that use this pattern include Facebook App and Twitter App. ActionBars help us to:
- Have a dedicated UI space for commonly used actions in your applications to increase user engagement (e.g. Search, Refresh, display status etc.)
- Have a consistent look and feel across all activities
- Allows the user to perform common/key actions quickly without having to use the menu
Though framework support for ActionBars has been added in Android 3.0+ (Honeycomb), developers are required to implement it from scratch for non-tablet versions of Android. The aims of this tutorial are two-fold; Firstly to demonstrate how to build an ActionBar widget from ground up, and secondly to illustrate how to use the ActionBar in your application.
Figure 1 shows an Activity with the ActionBar we are planning to implement in this tutorial.
Figure 1: Action Bar Example
Posted in Android, Development, Guides
Tagged ActionBar, Android, custom style, custom title, custom titlebar, custom widget, Development, Guides, quickaction, tutorial
This is a small guide demonstrating how we can use Android EditText controls to create multi line text inputs.
The simplest way to create a multi line text input is using the following xml snippet:
android:text="Default text" />
This will create a EditText view that displays the default text as shown in Figure 1 (a). When you enter new lines, the EditText will grow vertically (Figure 1 (b)). This might not be desirable in actual applications, as your layout becomes too fluid; potentially pushing important information out of user’s view.
Android devices have multiple network interfaces (e.g. WiFi and 3G/4G etc.) that allows them to go online and be connected to the outside world. At the same time, these network interfaces are prone to intermittent disconnection (for example, due to location, weather etc). Having knowledge of when the phone is connected (or disconnected) helps applications to act smartly when communicating over the internet. An example is automatically resuming pending downloads – without user intervention – when your network connection comes back online.
The following guide shows how you can monitor the network connectivity in Android, so your application can respond better when the network connectivity changes.
Often you might want to limit the number of characters a user can enter into your EditText control in Android. There are two ways to accomplish this:
- Using XML (e.g. layout or style)
- By code
- When developing Android applications, most of the time we need to share information (whether it be primitive data or complex objects) between different Activities. For example, we might want to pass in some data to initialise the views within a new Activity, or we might want to reuse a Database Helper across all our Activities to improve performance.
There are several different means of accomplishing this seemingly trivial task. However, picking the best option that suits your needs can be a daunting task for a novice Android developer! I aim to summarise few methods of sharing information between Activities and discuss when to use each one.
Zend Web Framework is one of the most popular PHP frameworks out there to ease the construction of web sites. Though, there are lots of online tutorials on how to set it up using Apache, details are bit sketchy on getting everything to work on Windows machines. I was following several online tutorials, including the official tutorial from the Zend website itself, but kept running into various problems associated with getting Apache and Zend to work properly.
I am sure I am not alone with these issues, and compiled a small guide to show how to get Zend framework working on your windows machine (tested on XP, Vista and Windows 7) using Apache web server.
According to the Android developer guide, border lines are not displayed for table layouts. However, often you will find the need to do things such as having vertical separators between table cells and borders around table rows. There are two different methods that I can think of to achieve this. Continue reading