Android: ScotchApp – How to parse Excel data and display it using a ListView and Dialog.

Some time ago, I had come across some interesting data about Scotch Whiskey.  I soon, decided to parse it and display it in an android app.  The app can be downloaded for free at the Android Market https://market.android.com/details?id=Scotch.App

scotchapp

This Scotch data can be downloaded here below.

http://www.bio.umontreal.ca/casgrain/en/labo/scotch.html

This file being parsed : scotch.xls

To get this Excel Data into my android java application:  Using Microsoft Excel, I simply saved it as a *.csv, opened it using notepad, and copy and pasted it into a string variable (String scotchData).

For each row of different Scotch, parse the appropriate columns for their values.

I also added a tasty photograph taken by Kyle May.

[java]

//for each item in the array
//add logic to match the Excel file’s columns
//I populate a different output string for each category

String sColor = “Color : “;
for ( int i = 2; i < 16; i++)
{
if (indValues[i].equals(“1”))
{
switch(i)
{
case 2:
sColor += “wyne”;
break;
case 3:
sColor += “yellow”;
break;
case 4:
sColor += “v.pale”;
break;
case 5:
sColor += “pale”;
break;
case 6:
sColor += “p.gold”;
break;
case 7:
sColor += “gold”;
break;
case 8:
sColor += “o.gold”;
break;
case 9:
sColor += “f.gold”;
break;
case 10:
sColor += “bronze”;
break;
case 11:
sColor += “p.amber”;
break;
case 12:
sColor += “amber”;
break;
case 13:
sColor += “f.amber”;
break;
case 14:
sColor += “red”;
break;
case 15:
sColor += “sherry”;
break;
}
}
}
String sNose = “Nose : “;
for ( int i = 16; i < 28; i++)
{
if (indValues[i].equals(“1″))
{
switch(i)
{
case 16:
sNose += ” AROMA “;
break;
case 17:
sNose += ” PEAT “;
break;
case 18:
sNose += ” SWEET “;
break;
case 19:
sNose += ” LIGHT “;
break;
case 20:
sNose += ” FRESH “;
break;
case 21:
sNose += ” DRY “;
break;
case 22:
sNose += ” FRUIT “;
break;
case 23:
sNose += ” GRASS “;
break;
case 24:
sNose += ” SEA “;
break;
case 25:
sNose += ” SHERRY “;
break;
case 26:
sNose += ” SPICY “;
break;
case 27:
sNose += ” RICH “;
break;
}

}

}
String sBody = “Body :”;
for ( int i = 28; i < 36; i++)
{
if (indValues[i].equals(“1″))
{
switch(i)
{
case 28:
sBody += ” soft “;
break;
case 29:
sBody += ” med “;
break;
case 30:
sBody += ” full “;
break;
case 31:
sBody += ” round “;
break;
case 32:
sBody += ” smooth “;
break;
case 33:
sBody += ” light “;
break;
case 34:
sBody += ” firm “;
break;
case 35:
sBody += ” oily “;
break;
}
}
}
String sPal= “Palate :”;
for ( int i = 36; i < 51; i++)
{

if (indValues[i].equals(“1″))
{
switch(i)
{
case 36:
sPal += ” full “;
break;
case 37:
sPal += ” dry “;
break;
case 38:
sPal += ” sherry “;
break;
case 39:
sPal += ” big “;
break;
case 40:
sPal += ” light “;
break;
case 41:
sPal += ” smooth “;
break;
case 42:
sPal += ” clean “;
break;
case 43:
sPal += ” fruit “;
break;
case 44:
sPal += ” grass “;
break;
case 45:
sPal += ” smoke “;
break;
case 46:
sPal += ” sweet “;
break;
case 47:
sPal += ” spice “;
break;
case 48:
sPal += ” oil “;
break;
case 49:
sPal += ” salt “;
break;
case 50:
sPal += ” arome “;
break;
}
}
}
String sFin = “Finish :”;
for ( int i = 51; i < 70; i++)
{
if (indValues[i].equals(“1″))
{
switch(i)
{
case 51:
sFin += ” full “;
break;
case 52:
sFin += ” dry “;
break;
case 53:
sFin += ” warm “;
break;
case 54:
sFin += ” big “;
break;
case 55:
sFin += ” light “;
break;
case 56:
sFin += ” smooth “;
break;
case 57:
sFin += ” clean “;
break;
case 58:
sFin += ” fruit “;
break;
case 59:
sFin += ” grass “;
break;
case 60:
sFin += ” smoke “;
break;
case 61:
sFin += ” sweet “;
break;
case 62:
sFin += ” spice “;
break;
case 63:
sFin += ” oil “;
break;
case 64:
sFin += ” salt “;
break;
case 65:
sFin += ” arome “;
break;
case 66:
sFin += ” ling “;
break;
case 67:
sFin += ” long “;
break;
case 68:
sFin += ” very “;
break;
case 69:
sFin += ” quick “;
break;

}
}
}
String sScore = “Score : ” + indValues[72];
String sPer = “% : ” + indValues[73];
String sReg = “Region : ” + indValues[74];
String sDist= “District : ” + indValues[75];

//I clump all my output strings together here
alertDialog.setMessage( sColor+”\n”+sNose+”\n”+sBody+”\n”+sPal+”\n”+
sFin+”\n”+sScore+”\n”+sPer+”%\n”+sReg+”\n”+sDist );

//close button
alertDialog.setButton(“Close”, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
} });
alertDialog.show();
}
}
});
}

//event for initial Image click
private OnClickListener iniPicClickListener = new OnClickListener()
{
public void onClick(View v)
{
//hide greeting hide image and show scotchList
greetTxt.setVisibility(8);
iniPic.setVisibility(8);
titleList.setVisibility(1);
}
};
}

[/java]
main.xml
[xml]

android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”>
android:id=”@+id/greetingText”
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”Welcome To Scotch App”
android:gravity=”center”
/>
android:layout_height=”wrap_content”
android:layout_width=”wrap_content”
android:src=”@drawable/kylemayscotchphoto”
android:layout_gravity=”center”
android:background=”#FFF”
>
android:id=”@+id/listTitle”
android:layout_width=”fill_parent”>

[/xml]

Full Code:
[java]
package Scotch.App;

import java.util.ArrayList;
import java.util.Hashtable;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class Drink extends Activity
{
//Raw Scotch Data
public static String scotchData = “Aberfeldy,Aberfeldy,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,-9,2,69,40,HIGH,MIDLAND,0,1,0,0,0,0,0,0,0 \n”
+ ”    Aberlour,Aberlour,0,0,0,0,0,0,0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ore,Tormore,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,10,3,76,43,HIGH,SPEY,0,0,1,0,0,0,0,0,0\n”
+ ”    Tullibardine,Tullibardi,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,1,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,10,3,76,40,HIGH,MIDLAND,0,1,0,0,0,0,0,0,0\n”;

//Globalize controls
ImageButton iniPic;
TextView greetTxt;
ListView titleList;

//global srraylist for title string or “name” title of each list element
public ArrayList<String> sTitle = new ArrayList<String>();

//hash table Key: index Value: data row
public Hashtable<Integer,String> dataHash = new  Hashtable();

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Greetings TextView
greetTxt = (TextView) findViewById(R.id.greetingText);
//initial Picture by Kyle May Button
iniPic = (ImageButton) findViewById(R.id.iniPic);
//Image onClickListener set
iniPic.setOnClickListener(iniPicClickListener);
//break up the string by to line breaks (“\n”)
String [] row = scotchData.split(“\\n”);
//for each row element
for ( int i =0; i < row.length; i++)
{
//break up line into array by commas
String [] element = row[i].split(“,”);
//add first element of each row to sTitle arrayList
sTitle.add(element[0].trim());
//increment the key and add the row as
dataHash.put(i, row[i]);
}

//shamelessly promote yourself
sTitle.add(“www.mantascode.com”);
//get TitleList
titleList = (ListView) findViewById(R.id.listTitle);
//set titleList to invisible/gone
titleList.setVisibility(8);
//populate titleList with sTitle ArrayList
titleList.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, sTitle));

//onItemClickListener for titleList
titleList.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view,int position, long id)
{
//if the item that was clicked was my hardcoded promo
if( position ==  109)
{
Toast.makeText(getApplicationContext(),
“Documentation for Scotch App” ,Toast.LENGTH_LONG).show();
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(“http://www.mantascode.com”));
startActivity(i);
}
else//if position is in hashtable parse the Value of the HashTable
{
//Alert dialog window
AlertDialog alertDialog = new AlertDialog.Builder(Drink.this).create();
//set title to name of Scotch
alertDialog.setTitle(sTitle.get(position));
//split up the Hash set into an array
String [] indValues = dataHash.get(position).split(“,”);

//for each item in the array
//add logic to match the Excel file’s columns
//I populate a different output string for each category

String sColor = “Color    : “;
for ( int i = 2; i < 16; i++)
{
if (indValues[i].equals(“1”))
{
switch(i)
{
case 2:
sColor += “wyne”;
break;
case 3:
sColor += “yellow”;
break;
case 4:
sColor += “v.pale”;
break;
case 5:
sColor += “pale”;
break;
case 6:
sColor += “p.gold”;
break;
case 7:
sColor += “gold”;
break;
case 8:
sColor += “o.gold”;
break;
case 9:
sColor += “f.gold”;
break;
case 10:
sColor += “bronze”;
break;
case 11:
sColor += “p.amber”;
break;
case 12:
sColor += “amber”;
break;
case 13:
sColor += “f.amber”;
break;
case 14:
sColor += “red”;
break;
case 15:
sColor += “sherry”;
break;
}
}
}
String sNose = “Nose    : “;
for ( int i = 16; i < 28; i++)
{
if (indValues[i].equals(“1″))
{
switch(i)
{
case 16:
sNose += ” AROMA “;
break;
case 17:
sNose += ” PEAT “;
break;
case 18:
sNose += ” SWEET “;
break;
case 19:
sNose += ” LIGHT “;
break;
case 20:
sNose += ” FRESH “;
break;
case 21:
sNose += ” DRY “;
break;
case 22:
sNose += ” FRUIT “;
break;
case 23:
sNose += ” GRASS “;
break;
case 24:
sNose += ” SEA “;
break;
case 25:
sNose += ” SHERRY “;
break;
case 26:
sNose += ” SPICY “;
break;
case 27:
sNose += ” RICH “;
break;
}

}

}
String sBody = “Body    :”;
for ( int i = 28; i < 36; i++)
{
if (indValues[i].equals(“1″))
{
switch(i)
{
case 28:
sBody += ” soft “;
break;
case 29:
sBody += ” med “;
break;
case 30:
sBody += ” full “;
break;
case 31:
sBody += ” round “;
break;
case 32:
sBody += ” smooth “;
break;
case 33:
sBody += ” light “;
break;
case 34:
sBody += ” firm “;
break;
case 35:
sBody += ” oily “;
break;
}
}
}
String sPal= “Palate  :”;
for ( int i = 36; i < 51; i++)
{

if (indValues[i].equals(“1″))
{
switch(i)
{
case 36:
sPal += ” full “;
break;
case 37:
sPal += ” dry “;
break;
case 38:
sPal += ” sherry “;
break;
case 39:
sPal += ” big “;
break;
case 40:
sPal += ” light “;
break;
case 41:
sPal += ” smooth “;
break;
case 42:
sPal += ” clean “;
break;
case 43:
sPal += ” fruit “;
break;
case 44:
sPal += ” grass “;
break;
case 45:
sPal += ” smoke “;
break;
case 46:
sPal += ” sweet “;
break;
case 47:
sPal += ” spice “;
break;
case 48:
sPal += ” oil “;
break;
case 49:
sPal += ” salt “;
break;
case 50:
sPal += ” arome “;
break;
}
}
}
String sFin = “Finish  :”;
for ( int i = 51; i < 70; i++)
{
if (indValues[i].equals(“1″))
{
switch(i)
{
case 51:
sFin += ” full “;
break;
case 52:
sFin += ” dry “;
break;
case 53:
sFin += ” warm “;
break;
case 54:
sFin += ” big “;
break;
case 55:
sFin += ” light “;
break;
case 56:
sFin += ” smooth “;
break;
case 57:
sFin += ” clean “;
break;
case 58:
sFin += ” fruit “;
break;
case 59:
sFin += ” grass “;
break;
case 60:
sFin += ” smoke “;
break;
case 61:
sFin += ” sweet “;
break;
case 62:
sFin += ” spice “;
break;
case 63:
sFin += ” oil “;
break;
case 64:
sFin += ” salt “;
break;
case 65:
sFin += ” arome “;
break;
case 66:
sFin += ” ling “;
break;
case 67:
sFin += ” long “;
break;
case 68:
sFin += ” very “;
break;
case 69:
sFin += ” quick “;
break;

}
}
}
String sScore = “Score   : ” +  indValues[72];
String sPer =   “%         : ” +  indValues[73];
String sReg =   “Region : ” +  indValues[74];
String sDist=   “District : ” +  indValues[75];

//I clump all my output strings together here
alertDialog.setMessage( sColor+”\n”+sNose+”\n”+sBody+”\n”+sPal+”\n”+sFin+”\n”+sScore+”\n”
+sPer+”%\n”+sReg+”\n”+sDist );

//close button
alertDialog.setButton(“Close”, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
} });
alertDialog.show();
}
}
});
}

//event for initial Image click
private OnClickListener iniPicClickListener = new OnClickListener()
{
public void onClick(View v)
{
//hide greeting hide image and show scotchList
greetTxt.setVisibility(8);
iniPic.setVisibility(8);
titleList.setVisibility(1);
}
};

}
[/java]

Leave a Reply

Your email address will not be published.