java

TabWidget demo project

Sorry it took little longer than expected, run in some issues with cupcake (SDK 1.5) I have attached a Demo project for all interested with  some screenshots and modified .project for TabWidget Project(fixes cupcake problem ref http://groups.google.com/group/android-developers/browse_thread/thread/5537ae10e4143240) if you use eclipse. 1. My env: Eclipse Version: 3.4.2 Android SDK 1.5 Windows 2.After you import the …

TabWidget demo project Read More »

Serving resources using Resource PhaseListener

PhaseListener designed to serve resources like css, javascript, images, pdf etc.. from jar file ResourcePhaseListener.java All required files can be downloaded here. package com.gregbugaj.jsfdump.console;   import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map;   import javax.activation.MimetypesFileTypeMap; import javax.faces.context.FacesContext; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse;   import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; …

Serving resources using Resource PhaseListener Read More »

Specifying java source and target version in Maven 2

While converting from Ant to Maven2 i have came across following error while trying to compile the project generics are not supported in -source 1.4 (try -source 1.5 to enable generics) private Map variables; To fix the problem we need to add the pluggin configuration to our pom.xml <project> … <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> …

Specifying java source and target version in Maven 2 Read More »

Detecting Network Speed and Type on Android (Edge,3G)

For better experience for users of my app I wanted to show them different UI based on their network speed, problem here is that there is no way to know what network we are currently on. My first instinct was to use android.net.ConnectivityManager getActiveNetworkInfo() which gives us current network information, but the only thing we …

Detecting Network Speed and Type on Android (Edge,3G) Read More »

Custom Android Tabs

Due to limitation of Android Tab component I created a custom TabWidget that I am using in couple different projects already. The widget allows us to  add custom background and use custom icons, tabs   can be Top/Bottom aligned. Currently tabs can launch new Activity and  Dialog , when starting new Activity we can use  “startActivityForResult” …

Custom Android Tabs Read More »