RSS
 

Posts Tagged ‘Scanean’

Understand and optimize Android’s ListView usage

25 Oct

1 – Introduction

The Android ListView object is meant to build scrollable items lists; is one of the most used user interfaces in the mobile applications. An Android ListView corresponds to an iPhone TableView.

Bare in mind that the code examples I will use in this post refear to the Android SDK 1.5; at the time I am writing the latest SDK version is the 2.2 and some methods/classes could be now deprecated. Moreover, all the import statements are omitted for semplicity.

This post will try to clarify how to setup a ListView in your Android v1.5 application; I spent time to understand it and now I personally feel that it could be improved cause the steps you need to take in order to build a ListView, even if few, need to be repeated for all the ListView objects you have in your application.

In the following paragraphs we will see how to setup these objects and later we will see a solution I’ve found during the development of Scanean to reduce this steps and use the same ListView object to implement different ListViews.

2 – Create a ListView

A ListView is a set of scrollable items; these items are a set of graphic objects (Images, TextViews…) disposed in a particular way that is described by an xml file stored in the /res/layout folder.
According with the explanation above, in order to setup a ListView we have to perform te following steps:

  • Create an xml layout template for the single ListView item (e.g. tpl_menu_item.xml)
  • Create an xml layout template for the page that will host our ListView component (e.g. menu.xml)
  • Create a bean that describes the single item (e.g. MenuItem.java); basically it’s a set of setter/getter methods used to assign a proper values to the item subcomponent (e.g. TextView content is “Products” and the related image is “Product.gif”)
  • Create a wrapper java class that populate the single item template with the right values (e.g. MenuItemWrapper.java).
  • Create an adapter JAVA class that will populate the ListView template (e.g. MenuItemAdapter.java)
  • Create the activity class associated to the ListView (e.g. A_MENU.java)

Total number of object to create in order to setup a single ListView: 6

Read the rest of this entry »

 
 

Scanean: an Android application prototype

20 Oct

1 – Introduction

With this post I want to introduce an Android application prototype that was presented in the 2009′s SeedRocket edition.

SeedRocket (www.seedrocket.com) is an initiative founded by a group of entrepreneurs, experienced business and venture capitalists across Europe.
It gives from € 20,000 to € 100,000 to the winners and assigned a mentor to assist entrepreneurs in the start phase.

2 – Story

The prototype development was started in June 2009 by a group of 3 people:

Josè Diaz
Giovanni Mangani
Javier Rincòn

The proposed application ElMejorPrecio (Scanean, later), based on PHP/MySql + Android/Zxing technologies, reached the 3rd position in the final selection (not bad for a one month development!).

Read the rest of this entry »