Posts

Showing posts from 2013

How to take screenshots of your android app

Image
In this post I will explain how to take the screenshots you need to publish your app on google play shop. I know that searching around the web you can find a lot of other posts on the same argument, but I wrote this as my reminder. Prerequisites This article suppose you have already installed the Android SDK and that you know how to setup you device to use the debugging mode. I will write other articles on those topics in future posts. Take a screenshot Taking a screenshot is a very easy operation to do. If you follow the steps below you will get it in few seconds (well few if you match the prerequisites :-) ). Ok, stop talking and let's take the shots: 1. Connect your device in debug mode to the pc 2. Start your Eclipse with the Android SDK configured 3. Switch to the DDMS perspective 4. On the left panel you should see the devices you connected to the pc in debug mode. Select the one from which you want to take screenshots  5. Click on the small camera

JSF2 View Scope with Spring Core

Working with Spring and JSF2 I encountered the need to use something like a ViewScope bean. The Spring Framework support the following scopes bean scopes : singleton prototype request session globalSession Adding a new scope is quite simple using Spring. To add the View Scope in the Spring IoC container it is necessary to create a custom scope which implements the org.springframework.beans.factory.config.Scope interface and register it with the Spring Custom Scope Configurer. ViewScope implementation package eu.ac.tutorial.spring.scope; import java.util.Map; import javax.faces.context.FacesContext; import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.config.Scope; public class ViewScope implements Scope {     @Override     public Object get(String name, ObjectFactory<?> objectFactory) {         if (FacesContext.getCurrentInstance().getViewRoot() != null) {             Map<String, Object> viewMap = FacesContext.getC