Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/AudioPlayerView.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/AudioPlayerView.java	(revision 24270)
+++ 	(revision )
@@ -1,621 +1,0 @@
-package org.greenstone.android.tipple;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import android.content.Context;
-import android.media.MediaPlayer;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-public class AudioPlayerView extends LinearLayout 
-{
-	TextView text_view_;
-	
-	protected Button buttonPlayPause_;
-	protected Button buttonNext_;
-	protected Button buttonShowHideText_;
-	
-	protected String stopLabel_;
-	
-	protected boolean hasCompletionHandler_;
-	
-	protected TippleActivity.TextAudioModeEnum current_text_audio_mode_;
-	
-	protected List<MediaPlayer> audioPlayerQueue_;
-	protected List<String>		idPlayerQueue_;
-	protected List<String>      textPlayerQueue_;
-	protected List<Boolean>     visitedPlayerQueue_;
-	protected int absolute_head_pos_;
-	protected int absolute_tail_pos_;
-	
-	  
-	AudioPlayerView(Context context, TextView text_view)
-	{
-		super(context);
-		
-		text_view_ = text_view;
-		
-		audioPlayerQueue_    = new LinkedList<MediaPlayer>();
-		idPlayerQueue_     = new LinkedList<String>();
-		textPlayerQueue_     = new LinkedList<String>();
-		visitedPlayerQueue_  = new LinkedList<Boolean>();
-		
-		absolute_head_pos_ = 0;
-		absolute_tail_pos_ = -1;
-		
-	    // media buttons - play/pause, and next song/audio as horizontal layout, 50% each
-		
-		stopLabel_ = "Stop";
-		
-		LayoutParams layout_params 
-	    	= new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
-	    									ViewGroup.LayoutParams.MATCH_PARENT,1);
-		
-	    buttonPlayPause_ = new Button(context);
-	    buttonPlayPause_.setLayoutParams(layout_params);
-	    buttonPlayPause_.setText("Play");
-	    buttonPlayPause_.setEnabled(false);
-	    
-	    buttonNext_ = new Button(context);
-	    buttonNext_.setLayoutParams(layout_params);
-	    buttonNext_.setText(stopLabel_);
-	    buttonNext_.setEnabled(false);
-	
-	    hasCompletionHandler_ = false;
-	    
-	    
-	    buttonPlayPause_.setOnClickListener(new View.OnClickListener() {
-	        public void onClick(View v) {
-	        	
-	        	if (isPlaying()) {
-	        		// Change to pause
-	        		
-	        		TippleActivity.log.optMessage("Manual Pause Audio", textPlayerQueue_.get(0));
-	    			
-	        		pauseAudio();
-	        	}
-	        	else {
-	        		// Must be paused => resume playing
-	        		TippleActivity.log.optMessage("Manual Play/Resume Audio", textPlayerQueue_.get(0));
-	    			
-	        		playResumeAudio();
-	        	}
-	        }
-	    });
-	    
-	    buttonNext_.setOnClickListener(new View.OnClickListener() {
-			@Override
-			public void onClick(View v) {
-				TippleActivity.log.optMessage("Manual Next Audio Location");
-				nextAudioLocation();
-			}
-		});
-	    
-	    // Optional show text button
-	    
-	    buttonShowHideText_ = new Button(context);
- 	    buttonShowHideText_.setLayoutParams(layout_params);
- 	    buttonShowHideText_.setText("Show Text");
- 	    buttonShowHideText_.setEnabled(false);
- 	    
- 	    buttonShowHideText_.setOnClickListener(new View.OnClickListener() {
- 	        public void onClick(View v) {
- 	        	TippleActivity.log.optMessage("Manual Show/Hide Text");
- 	        	
- 	        	if (text_view_.getVisibility()==View.INVISIBLE) {
- 	        		TippleActivity.log.optMessage("Manual Show Text");
-	        		text_view_.setVisibility(View.VISIBLE);
-	        		buttonShowHideText_.setText("Hide Text");
-	        	}
-	        	else {
-	        		TippleActivity.log.optMessage("Manual Hide Text");
-	        		text_view_.setVisibility(View.INVISIBLE);
-	        		buttonShowHideText_.setText("Show Text");
-	        	}
- 	        }
- 	    });
-    
-	    	
-	  
-	    
-	    // Horozontal layout is:
-	    // Play | OptText | Next
-	    
-	    addView(buttonPlayPause_);
-	    
-	    /*
-	    current_text_audio_mode_ = TippleActivity.textAudioMode;
-	    if (current_text_audio_mode_ == TippleActivity.TextAudioModeEnum.AUDIO_PLUS_TEXT) {
-	    	addView(buttonShowHideText_);
-	    }
-	  */
-	    addView(buttonShowHideText_);
-	    
-	    addView(buttonNext_);
-	}
-	
-	protected boolean audioViewIsActive()
-	{
-		return ((current_text_audio_mode_==TippleActivity.TextAudioModeEnum.AUDIO_ONLY)
-				|| (current_text_audio_mode_==TippleActivity.TextAudioModeEnum.AUDIO_PLUS_TEXT)
-				|| (current_text_audio_mode_==TippleActivity.TextAudioModeEnum.TEXT_PLUS_AUDIO));
-		
-	}
-	
-	protected boolean textViewIsActive()
-	{
-		return ((current_text_audio_mode_==TippleActivity.TextAudioModeEnum.TEXT_ONLY)
-				|| (current_text_audio_mode_==TippleActivity.TextAudioModeEnum.TEXT_PLUS_AUDIO)
-				|| (current_text_audio_mode_==TippleActivity.TextAudioModeEnum.AUDIO_PLUS_TEXT));
-		
-	}
-	
-	public void refreshView() 
-	{
-		if (current_text_audio_mode_ != TippleActivity.textAudioMode) {
-			// There has been a mode change
-			
-			 if (TippleActivity.textAudioMode == TippleActivity.TextAudioModeEnum.AUDIO_PLUS_TEXT) {
-				 // ensure both play/pause and show/hide removed, then add in order needed
-				 
-				 if (this.indexOfChild(buttonPlayPause_)>=0) {
-					 this.removeView(buttonPlayPause_);
-				 }
-				 if (this.indexOfChild(buttonShowHideText_)>=0) {
-					 this.removeView(buttonShowHideText_);
-				 }
-				 this.addView(buttonPlayPause_,0);
-				 this.addView(buttonShowHideText_,1);
-				 
-				 stopLabel_ = "Stop";
-			 }
-			 
-			 else if (TippleActivity.textAudioMode == TippleActivity.TextAudioModeEnum.AUDIO_ONLY) {
-				 // ensure show/hide is gone, and only add play/pause if needed
-				 if (this.indexOfChild(buttonShowHideText_)>=0) {
-					 // Don't want to see a show/hide text button
-					 this.removeView(buttonShowHideText_);
-				 }
-				 if (this.indexOfChild(buttonPlayPause_)<0) {
-					 this.addView(buttonPlayPause_);
-				 }
-				 stopLabel_ = "Stop";
-			 }
-			 
-			 else if (TippleActivity.textAudioMode == TippleActivity.TextAudioModeEnum.TEXT_PLUS_AUDIO) {
-				 // ensure both play/pause and show/hide removed, then add in order needed
-				 if (this.indexOfChild(buttonPlayPause_)>=0) {
-					 this.removeView(buttonPlayPause_);
-				 }
-				 if (this.indexOfChild(buttonShowHideText_)>=0) {
-					 this.removeView(buttonShowHideText_);
-				 }
-				 
-				 this.addView(buttonShowHideText_,0);
-				 this.addView(buttonPlayPause_,1);
-				 
-				 stopLabel_ = "Stop";
-			 }
-			 
-			 else if (TippleActivity.textAudioMode == TippleActivity.TextAudioModeEnum.TEXT_ONLY) {
-				 // ensure play/pause is gone, and only add show/hide if needed
-				 
-				 if (this.indexOfChild(buttonPlayPause_)>=0) {
-					 // Don't want to see a play button
-					 this.removeView(buttonPlayPause_);
-				 }
-				 
-				 if (this.indexOfChild(buttonShowHideText_)<0) {
-					 this.addView(buttonShowHideText_,0);
-				 }
-				 stopLabel_ = "End";
-			 }
-			 
-			 current_text_audio_mode_ = TippleActivity.textAudioMode;
-		}
-	
-	}
-	synchronized public boolean audioQueueEmpty()
-	{
-		return (audioPlayerQueue_.size()==0);
-	}
-	
-	synchronized public boolean outstandingAudioPending()
-	{
-		return (audioPlayerQueue_.size()>1);
-	}
-	
-	synchronized public int audioQueueLength()
-	{
-		return audioPlayerQueue_.size();
-	}
-	
-	synchronized public boolean addAudio(String new_id) 
-	{
-		// Assume audio should be added, unless an existing match is found
-		boolean add_audio = true;
-		
-		int rev_pos = audioPlayerQueue_.size()-1;
-		for (int i=0; i<3; i++) {
-			if (rev_pos<0) {
-				break;
-			}
-			
-			String id = idPlayerQueue_.get(rev_pos);
-			
-			if (new_id.equals(id)) {
-				add_audio=false;
-			}
-			
-			rev_pos--;
-		}
-		
-		return add_audio;
-	}
-	synchronized public void queueAudio(String audio_filename, String id, String text, 
-										boolean previously_visited)
-	{
-		MediaPlayer mp = new MediaPlayer();
-		try {
-			
-			mp.setDataSource(audio_filename);
-			mp.prepare();
-			audioPlayerQueue_.add(mp);
-			idPlayerQueue_.add(id);
-			textPlayerQueue_.add(text);
-			visitedPlayerQueue_.add(previously_visited);
-			
-			absolute_tail_pos_++;
-			
-			int audio_queue_len = audioPlayerQueue_.size();
-			int mod_head_pos = absolute_head_pos_ % 3;
-			
-			if (audio_queue_len==1) {
-				// Nothing to do, not enough data to allow the user to play anything
-				return;
-			}
-			else if (audio_queue_len==2) {
-				
-				// mod_head_pos==0 => title followed by text => ready to play
-				// mod_head_pos==1 => text followed by beep => "stop"
-				// mod_head_pos==2 => beep followed title => "skip to next"
-				
-				if (mod_head_pos==0) {
-					// just queued up a title and text (at the head of the queue) 
-					// => make play active if not already so 
-					if (!buttonPlayPause_.isEnabled()) {
-						//buttonPlayPause_.setText("Play");
-						buttonPlayPause_.setEnabled(true);
-					}
-					if (!buttonShowHideText_.isEnabled()) {
-						buttonShowHideText_.setEnabled(true);
-						
-					}
-					buttonNext_.setText(stopLabel_);
-					buttonNext_.setEnabled(true);
-				}
-				else if (mod_head_pos==1) {
-					
-					buttonNext_.setText(stopLabel_);
-					buttonNext_.setEnabled(true);
-				}
-				else {
-					// mod_head_pos==2
-					buttonNext_.setText("Skip to Next (1)");
-					buttonNext_.setEnabled(true);	
-				}
-			}
-			else {
-				// length >= 3
-				
-				// mod_head_pos==0 => title at head, spans loc if len >3
-				// mod_head_pos==1 => text at head, guaranteed to span loc => "skip to next"
-				// mod_head_pos==2 => beep at head, guaranteed to span loc => "skip to next"
-				
-				if ((mod_head_pos==0) && (audio_queue_len==3)) {
-					// stop 
-					buttonNext_.setText(stopLabel_);
-					buttonNext_.setEnabled(true);
-				}
-				else {
-					// for everything else, the queue spans to another location
-			
-					
-					int relative_adjustment_pos = mod_head_pos -1;
-					int num_remaining_locations = (audio_queue_len+relative_adjustment_pos)/3;
-
-					buttonNext_.setText("Skip to Next (" + num_remaining_locations + ")");
-					buttonNext_.setEnabled(true);					
-				}
-			}
-		}
-		catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-	
-	synchronized public void queueAudio(String audio_filename, String id, String text)
-	{
-		queueAudio(audio_filename,id,text,false);
-	}
-	
-	synchronized public void removeAudioTrack()
-	{
-		if (audioPlayerQueue_.size()>0) {
-			
-			TippleActivity.log.optMessage("Remove Audio Track","Queue size was: " + audioPlayerQueue_.size());
-			
-			MediaPlayer mp = audioPlayerQueue_.remove(0);
-			idPlayerQueue_.remove(0);
-			textPlayerQueue_.remove(0);
-			visitedPlayerQueue_.remove(0);
-			
-			absolute_head_pos_++;
-			mp.stop();
-			mp.release();				
-			
-			hasCompletionHandler_ = false;
-		}
-		else {
-			System.err.println("Error: No audio in queue to remove");
-		}
-	}
-	
-	synchronized public void removeAudioLocation()
-	{
-		int audio_queue_len = audioPlayerQueue_.size();
-		
-		if (audio_queue_len>0) {
-	
-			TippleActivity.log.optMessage("Remove Audio Location","Queue size was: " + audioPlayerQueue_.size());
-			
-			int mod_head_pos = absolute_head_pos_%3;
-			int need_to_skip = 3-mod_head_pos;
-				
-			// remove up to the next absolute multiple of 3
-			for (int i=0; i<need_to_skip; i++) {
-				MediaPlayer mp = audioPlayerQueue_.remove(0);
-				idPlayerQueue_.remove(0);
-				textPlayerQueue_.remove(0);
-				visitedPlayerQueue_.remove(0);
-				absolute_head_pos_++;
-				
-				mp.stop();
-				mp.release();
-				if (audioPlayerQueue_.size()==0) {
-					// happens if there is no beep on the last location
-					break;
-				}
-			}
-			
-			hasCompletionHandler_ = false;
-		}
-		else {
-			System.err.println("Error: No audio in queue to remove");
-		}
-	}
-	
-	
-	synchronized public void onAudioCompletion(MediaPlayer mp)
-	{
-		mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
-			
-			@Override
-			public void onCompletion(MediaPlayer mp) {
-				nextAudioTrack();	
-			}
-		});
-	}
-
-	synchronized public void onVisitedAudioCompletion(MediaPlayer mp)
-	{
-		mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
-			
-			@Override
-			public void onCompletion(MediaPlayer mp) {
-				playResumeAudioInternal();
-			}
-		});
-	}
-
-	public boolean updateTextViewIfHeadIsNewLocation() 
-	{
-		boolean updated = false;
-		
-		if ((absolute_head_pos_%3)==0) {
-			// start of a new location
-			String text_desc = textPlayerQueue_.get(0);
-			if (visitedPlayerQueue_.get(0)) {
-				text_desc += "\n(Previously Visited)";
-			}
-			text_desc += "\n------";
-			
-			if (textPlayerQueue_.size()>1) {
-				text_desc += "\n" + textPlayerQueue_.get(1);
-			}
-			
-			text_view_.setText(text_desc);
-			updated = true;
-		}
-		
-		return updated;
-	}
-	
-	
-	synchronized public void playResumeAudio()
-	{
-		if (audioPlayerQueue_.size()>0) {
-			
-			if ((audioViewIsActive()) && (visitedPlayerQueue_.get(0))) {
-				// Play (synchronously) the "previously visited" message before moving on to
-				// describing the location itself
-				MediaPlayer mp = new MediaPlayer();
-				
-				try {
-					mp.setDataSource(TipLocationManager.prevVisitedFilename);
-					mp.prepare();
-					onVisitedAudioCompletion(mp);
-					mp.start();
-				}
-				catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-			else {
-				// go straight on and play the queued audio
-				playResumeAudioInternal();
-			}
-		}
-		else {
-			System.err.println("Error: No audio in queue to start playing");
-		
-		}
-		
-	}
-	
-	
-	synchronized public void playResumeAudioInternal()
-	{
-		if (audioPlayerQueue_.size()>0) {
-			TippleActivity.log.optMessage("Play/Resume Audio","Queue size was: " + audioPlayerQueue_.size());
-			
-			MediaPlayer mp = audioPlayerQueue_.get(0);
-
-			if (!hasCompletionHandler_) {
-				
-				updateTextViewIfHeadIsNewLocation();
-				
-				onAudioCompletion(mp);
-				hasCompletionHandler_ = true;
-			}
-			
-			if (audioViewIsActive() || ((absolute_head_pos_%3)==2)) {
-				// allow it to play a "ding" even in text only mode
-				mp.start();
-			}
-			buttonPlayPause_.setText("Pause");      // next operation 
-		}
-		else {
-			System.err.println("Error: No audio in queue to start playing");
-		}
-		
-	}
-	
-	synchronized public void pauseAudio()
-	{
-		if (audioPlayerQueue_.size()>0) {
-			MediaPlayer mp = audioPlayerQueue_.get(0);
-			mp.pause();
-			buttonPlayPause_.setText("Play/Resume");      // next operation 
-		}
-		else {
-			System.err.println("Error: No audio in queue to pause");
-		}
-	}
-	
-	synchronized public void nextAudioLocation()
-	{
-		removeAudioLocation(); // stops it if currently playing
-
-		int remaining_audio_len = audioQueueLength();				
-		if (remaining_audio_len>0) {
-			playResumeAudio();
-			
-			int mod_head_pos = absolute_head_pos_ % 3;
-			/*
-			int relative_adjustment_pos = 1 - mod_head_pos;
-			int num_remaining_locations = (remaining_audio_len+relative_adjustment_pos)/3;
-			
-			if (num_remaining_locations>=1) {
-				
-				buttonNext_.setText("Skip to Next (" + num_remaining_locations + ")");
-				buttonNext_.setEnabled(true);
-			}
-			*/
-			
-			int num_remaining_locations = (remaining_audio_len+mod_head_pos)/3;
-			
-			if (num_remaining_locations>1) {
-				
-				buttonNext_.setText("Skip to Next (" + (num_remaining_locations-1) + ")");
-				buttonNext_.setEnabled(true);
-			}
-			
-			else {
-				buttonNext_.setText(stopLabel_);
-				buttonNext_.setEnabled(true);
-				buttonPlayPause_.setText("Play");
-				buttonPlayPause_.setEnabled(true);
-				buttonShowHideText_.setText("Show Text");
-				buttonShowHideText_.setEnabled(true);
-			}
-		}
-		else {
-			buttonNext_.setText(stopLabel_);
-			buttonNext_.setEnabled(false);
-			buttonPlayPause_.setText("Play");
-			buttonPlayPause_.setEnabled(false);
-			
-			if (text_view_.getVisibility() == View.VISIBLE) {
-				TippleActivity.log.optMessage("Audio Hide Text");
-				text_view_.setVisibility(View.INVISIBLE);
-			}
-			buttonShowHideText_.setText("Show Text");
-    		buttonShowHideText_.setEnabled(false);
-		}
-	} 
-	
-	synchronized public void nextAudioTrack()
-	{
-		removeAudioTrack(); // stops it if currently playing
-
-		int remaining_audio_len = audioQueueLength();				
-		if (remaining_audio_len>0) {
-			playResumeAudio();
-			
-			int num_remaining_locations = ((remaining_audio_len-1)/3);
-			
-			if (num_remaining_locations>=1) {
-				
-				buttonNext_.setText("Skip to Next (" + num_remaining_locations + ")");
-				buttonNext_.setEnabled(true);
-			}
-			else {
-				buttonNext_.setText(stopLabel_);
-				buttonNext_.setEnabled(true);
-				//buttonPlayPause_.setText("Play");
-				buttonPlayPause_.setEnabled(true);
-				buttonShowHideText_.setEnabled(true);
-			}
-		}
-		else {
-			buttonNext_.setText(stopLabel_);
-			buttonNext_.setEnabled(false);
-			buttonPlayPause_.setText("Play");
-			buttonPlayPause_.setEnabled(false);
-			
-			if (text_view_.getVisibility() == View.VISIBLE) {
-				TippleActivity.log.optMessage("Audio Hide Text");
-				text_view_.setVisibility(View.INVISIBLE);
-			}
-    		buttonShowHideText_.setText("Show Text");
-    		buttonShowHideText_.setEnabled(false);
-    		
-    		
-		}
-	} 
-	
-	
-	synchronized public boolean isPlaying()
-	{
-		boolean is_playing = false;
-		if (audioPlayerQueue_.size()>0) {
-			is_playing = audioPlayerQueue_.get(0).isPlaying();
-		}
-		return is_playing;
-	}
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/EditPreferences.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/EditPreferences.java	(revision 24270)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/*
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- * Based on file of the same name from mapsforge.org
- * 
- */
-package org.greenstone.android.tipple;
-
-import android.os.Bundle;
-import android.preference.PreferenceActivity;
-
-/**
- * Activity to edit the application preferences.
- */
-public class EditPreferences extends PreferenceActivity 
-{
-	@Override
-	protected void onCreate(Bundle savedInstanceState) 
-	{
-		System.err.println("*** EditPreferences::onCreate()");
-		super.onCreate(savedInstanceState);
-		addPreferencesFromResource(R.xml.preferences);
-	}
-
-	@Override
-	protected void onResume() 
-	{
-		System.err.println("*** EditPreferences::onResume()");
-		super.onResume();
-	}
-	
-	@Override
-	protected void onStop() 
-	{
-		System.err.println("*** EditPreferences::onStop()");
-		super.onResume();
-	}
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/InfoView.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/InfoView.java	(revision 24270)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- * Based on file of the same name from mapsforge.org
- */
-package org.greenstone.android.tipple;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.webkit.WebView;
-
-/**
- * Simple activity to display the info web page from the assets folder.
- */
-public class InfoView extends Activity 
-{
-	@Override
-	protected void onCreate(Bundle savedInstanceState) 
-	{
-		super.onCreate(savedInstanceState);
-		WebView webView = new WebView(this);
-		webView.loadUrl("file:///android_asset/info.xml");
-		setContentView(webView);
-	}
-
-	@Override
-	protected void onResume() 
-	{
-		super.onResume();
-	}
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TipLocation.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TipLocation.java	(revision 24270)
+++ 	(revision )
@@ -1,99 +1,0 @@
-package org.greenstone.android.tipple;
-
-import java.util.List;
-import java.util.HashMap;
-//import java.util.ArrayList;
-
-public class TipLocation 
-{
-	
-	// Text and/or Audio associated with (Latitude,Longitude) location with radius
-	
-	private double latitude_;
-	private double longitude_;
-	
-	private double radiusInKM_;
-	//private double avgRadLatLong_;
-	
-	private String title_;
-	private String text_;
-	private String tts_text_;
-	
-	
-	private String audioFilename_;
-	private List<String> audioPaths_;
-	
-	protected String id_;
-	
-	public TipLocation(HashMap<String,String> hashmap)
-	{
-		latitude_  = Double.parseDouble(hashmap.get("latitude"));
-		longitude_ = Double.parseDouble(hashmap.get("longitude"));
-		radiusInKM_ = Double.parseDouble(hashmap.get("radius"));
-		
-		title_ = hashmap.get("title");
-		text_  = hashmap.get("text");
-		tts_text_ = (hashmap.containsKey("tts")) ? hashmap.get("tts") : null;
-		
-		audioFilename_ = hashmap.get("audio");
-		
-		// Consolidate whitespace
-		title_ = title_.replaceAll("^\\s+", "");
-		title_ = title_.replaceAll("\\s+$", "");
-		title_ = title_.replaceAll("\\s+", " ");
-
-		if (text_ != null) {
-			text_ = text_.replaceAll("^\\s+", "");
-			text_ = text_.replaceAll("\\s+$", "");
-			text_ = text_.replaceAll("\\s+", " ");
-		}
-		
-		id_ = title_.replaceAll("/\\s+/", "-");
-	}
-	
-	
-	public double getLatitude() 
-	{
-		return latitude_;
-	}
-	
-	public double getLongitude() 
-	{
-		return longitude_;
-	}
-	
-	public double getRadiusKM() 
-	{
-		return radiusInKM_;
-	}
-
-	public String getText() 
-	{
-		return text_;
-	}
-	
-	public String getTTSText()
-	{
-		return (tts_text_ != null) ? tts_text_ : text_;
-	}
-	public String getTitle() 
-	{
-		return title_;
-	}
-	
-	public String getID()
-	{
-		return id_;
-	}
-	
-	public List<String> getAudio() 
-	{
-		return audioPaths_;
-	}
-	
-	public String getAudioFilename()
-	{
-		return audioFilename_;
-	}
-	
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TipLocationManager.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TipLocationManager.java	(revision 24270)
+++ 	(revision )
@@ -1,444 +1,0 @@
-package org.greenstone.android.tipple;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.greenstone.android.tipple.R;
-import org.mapsforge.android.maps.ArrayItemizedTextAudioOverlay;
-import org.mapsforge.android.maps.CirclesOverlay;
-import org.mapsforge.android.maps.GeoPoint;
-import org.mapsforge.android.maps.MapView;
-import org.mapsforge.android.maps.Overlay;
-import org.mapsforge.android.maps.OverlayItem;
-import org.mapsforge.android.maps.OverlayTextAudioItem;
-import org.mapsforge.android.maps.RouteOverlayResetable;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-import android.app.Activity;
-import android.graphics.Color;
-import android.graphics.DashPathEffect;
-import android.graphics.Paint;
-import android.graphics.drawable.Drawable;
-import android.speech.tts.TextToSpeech;
-import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener;
-import android.util.Log;
-
-public class TipLocationManager 
-{
-	Activity activity_;
-	AudioPlayerView audio_player_view_;
-	TextToSpeech tts_;
-	
-	public static CirclesOverlay circlesOverlay=null; 
-	public static ArrayItemizedTextAudioOverlay itemizedMarkerOverlay;
-	public static ArrayList<OverlayItem> itemizedMarkerOverlayArrayList;
-	public static ArrayList<GeoPoint> circlesOverlayGeoPoints;
-	public static ArrayList<Integer> circlesOverlayRadii;
-	
-	public static RouteOverlayResetable routeOverlay=null;
-	public static ArrayItemizedTextAudioOverlay routeMarkerOverlay;
-	public static GeoPoint[] routeOverlayArray;
-	
-	public static ArrayList<OverlayItem> routeMarkerOverlayArrayList;
-	
-	public static String prevVisitedFilename;
-	
-	TipLocationManager(Activity activity, AudioPlayerView audio_player_view, 
-						 TextToSpeech tts)
-	{
-		activity_ = activity;
-		audio_player_view_ = audio_player_view;
-		tts_ = tts;
-	
-	
-		
-	}
-	
-	protected void createLogRouteLocationsOverlay(MapView mapView,ArrayList<TipLocation> locations)
-	{
-		Paint fillPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		fillPaint.setStyle(Paint.Style.STROKE);
-		fillPaint.setColor(Color.BLUE);
-		fillPaint.setAlpha(160);
-		fillPaint.setStrokeWidth(7);
-		fillPaint.setStrokeCap(Paint.Cap.BUTT);
-		fillPaint.setStrokeJoin(Paint.Join.ROUND);
-		fillPaint.setPathEffect(new DashPathEffect(new float[] { 20, 20 }, 0));
-
-		Paint outlinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		outlinePaint.setStyle(Paint.Style.STROKE);
-		outlinePaint.setColor(Color.BLUE);
-		outlinePaint.setAlpha(96);
-		outlinePaint.setStrokeWidth(7);
-		outlinePaint.setStrokeCap(Paint.Cap.BUTT);
-		outlinePaint.setStrokeJoin(Paint.Join.ROUND);
-	
-		Drawable defaultMarker = activity_.getResources().getDrawable(R.drawable.routemarker);
-		
-		if (routeOverlay==null) {
-			routeOverlay = new RouteOverlayResetable(fillPaint, outlinePaint);
-			routeMarkerOverlay = new ArrayItemizedTextAudioOverlay(defaultMarker,activity_,tts_);
-			routeMarkerOverlayArrayList = new ArrayList<OverlayItem>();
-		
-		}
-		// This one needs to be done again, incase it is of a different size
-		routeOverlayArray = new GeoPoint[locations.size()];
-		
-		for (int i=0;  i<locations.size(); i++) {
-			TipLocation location = locations.get(i);
-			double latitude  = location.getLatitude();
-			double longitude = location.getLongitude();
-			String title     = location.getTitle();
-			String text      = location.getText();
-			String tts_text  = location.getTTSText();
-			GeoPoint geoPoint = new GeoPoint(latitude,longitude);
-				
-			routeOverlayArray[i] = geoPoint;
-			
-			if (title.startsWith("Manual")) {
-				// ItemizedOverlay => display marker with text for info pop-up window
-				OverlayTextAudioItem overlayItem = new OverlayTextAudioItem(geoPoint, title, text, tts_text);
-				
-				//routeMarkerOverlay.addOverlay(overlayItem);
-				routeMarkerOverlayArrayList.add(overlayItem);
-			}
-		}
-		
-		//routeOverlay.setRouteData(routeOverlayArray);
-		
-		// Only add in if not already present
-		List<Overlay> overlays = mapView.getOverlays();
-		if (!overlays.contains(routeOverlay)) {
-			overlays.add(routeOverlay);
-		}
-		if (!overlays.contains(routeMarkerOverlay)) {
-			overlays.add(routeMarkerOverlay);
-		}
-	}
-	
-	protected void addLogRouteLocations(MapView mapView)
-	{	
-		for (int i=0; i<routeMarkerOverlayArrayList.size(); i++) {
-			
-			OverlayItem overlay_item = routeMarkerOverlayArrayList.get(i);
-			routeMarkerOverlay.addOverlay(overlay_item);
-		}
-	
-		routeOverlay.setRouteData(routeOverlayArray);
-		
-		mapView.invalidate();
-		
-	}
-	
-	protected void removeLogRouteLocations(MapView mapView)
-	{		
-		for (int i=0; i<routeMarkerOverlayArrayList.size(); i++) {
-			
-			OverlayItem overlay_item = routeMarkerOverlayArrayList.get(i);
-			routeMarkerOverlay.removeOverlay(overlay_item);
-			
-		}
-		
-		routeOverlay.reset();
-		
-		mapView.invalidate();
-	}
-	
-	protected void createTourLocationsOverlay(MapView mapView, ArrayList<TipLocation> locations)
-	{
-		Paint circleFillPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		circleFillPaint.setStyle(Paint.Style.FILL);
-		circleFillPaint.setColor(Color.BLUE);
-		circleFillPaint.setAlpha(64);
-
-		Paint circleOutlinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		circleOutlinePaint.setStyle(Paint.Style.STROKE);
-		circleOutlinePaint.setColor(Color.BLUE);
-		circleOutlinePaint.setAlpha(128);
-		circleOutlinePaint.setStrokeWidth(3);
-	
-		Drawable defaultMarker = activity_.getResources().getDrawable(R.drawable.marker);
-		
-		if (circlesOverlay==null) {
-			circlesOverlay          = new CirclesOverlay(circleFillPaint, circleOutlinePaint);
-			circlesOverlayGeoPoints = new ArrayList<GeoPoint>();
-			circlesOverlayRadii     = new ArrayList<Integer>();
-		
-			itemizedMarkerOverlay = new ArrayItemizedTextAudioOverlay(defaultMarker,activity_,tts_);
-			itemizedMarkerOverlayArrayList = new ArrayList<OverlayItem>();
-		}
-		
-		for (int i=0;  i<locations.size(); i++) {
-			TipLocation location = locations.get(i);
-			double latitude  = location.getLatitude();
-			double longitude = location.getLongitude();
-			int radius       = (int)Math.round(1000.0 * location.getRadiusKM());
-			String title     = location.getTitle();
-			String text      = location.getText();
-			String tts_text  = location.getTTSText();
-			GeoPoint geoPoint = new GeoPoint(latitude,longitude);
-				
-			// CirclesOverlay => Highlight location with a circle showing catchment radius
-			//circlesOverlay.addCircleData(geoPoint, radius);
-			circlesOverlayGeoPoints.add(geoPoint);
-			circlesOverlayRadii.add(radius);
-			
-			// ItemizedOverlay => display marker with text for info pop-up window
-			OverlayTextAudioItem overlayItem = new OverlayTextAudioItem(geoPoint, title, text, tts_text);
-			 
-			//itemizedMarkerOverlay.addOverlay(overlayItem);
-			itemizedMarkerOverlayArrayList.add(overlayItem);
-		}
-		
-		// Only add in if not already present
-		List<Overlay> overlays = mapView.getOverlays();
-		if (!overlays.contains(itemizedMarkerOverlay)) {
-			overlays.add(itemizedMarkerOverlay);
-		}
-		if (!overlays.contains(circlesOverlay)) {
-			overlays.add(circlesOverlay);
-		}
-	}
-	
-	
-	protected void addTourLocations(MapView mapView)
-	{
-		for (int i=0; i<itemizedMarkerOverlayArrayList.size(); i++) {
-			
-			OverlayItem overlay_item = itemizedMarkerOverlayArrayList.get(i);
-			itemizedMarkerOverlay.addOverlay(overlay_item);
-			
-			GeoPoint geo_point = circlesOverlayGeoPoints.get(i);
-			int radius = circlesOverlayRadii.get(i);
-			circlesOverlay.addCircleData(geo_point, radius);
-		}
-
-		mapView.invalidate();
-	}
-	
-	protected void removeTourLocations(MapView mapView)
-	{	
-		for (int i=0; i<itemizedMarkerOverlayArrayList.size(); i++) {
-			
-			OverlayItem overlay_item = itemizedMarkerOverlayArrayList.get(i);
-			itemizedMarkerOverlay.removeOverlay(overlay_item);
-		}
-		
-		circlesOverlay.reset();
-		
-		mapView.invalidate();
-		
-	}
-	
-	protected ArrayList<HashMap<String,String>> parseXMLToHashMapArrayList(String xml_filename,String lock_on_element)
-	{
-		ArrayList<HashMap<String,String>> hashmap_list = null;
-		
-		try {
-			
-			// set up XML parser
-			SAXParserFactory spf = SAXParserFactory.newInstance();
-			SAXParser sp = spf.newSAXParser();
-			XMLReader xr = sp.getXMLReader();
-
-			// Create handler that maps XML Tags within <Location> to a hashmap 
-			XMLToHashmapHandler xmlTourHandler = new XMLToHashmapHandler(lock_on_element);
-			xr.setContentHandler(xmlTourHandler);
-			
-			File tour_file = new File(xml_filename);
-			FileInputStream fis = new FileInputStream(tour_file);
-			
-			InputSource is = new InputSource(fis);
-			xr.parse(is);
-			
-			// get the HashMap List that results from parsing the file
-			hashmap_list = xmlTourHandler.getHashmapList();
-			
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		
-		return hashmap_list;
-	}
-	public ArrayList<TipLocation> loadTour(String tour_filename)
-	{
-		ArrayList<HashMap<String,String>> location_hashmap_list 
-			= parseXMLToHashMapArrayList(tour_filename,"Location");
-
-		if (location_hashmap_list != null) {
-			Log.d("TippleActivity::loadTour()", "XML Tour File Parsed");
-		}
-		
-		ArrayList<TipLocation> locations = new ArrayList<TipLocation>();
-		
-		for (int i=0;  i<location_hashmap_list.size(); i++) {
-			HashMap<String,String> location_hashmap = location_hashmap_list.get(i);
-			
-			TipLocation location = new TipLocation(location_hashmap);
-			locations.add(location);
-		}
-		
-		return locations;
-	}
-	
-	protected ArrayList<TipLocation> loadUserTrail(String log_filename)
-	{
-		ArrayList<HashMap<String,String>> logentry_hashmap_list 
-			= parseXMLToHashMapArrayList(log_filename,"LogEntry");
-
-		ArrayList<TipLocation> locations = new ArrayList<TipLocation>();
-		
-		if (logentry_hashmap_list != null) {
-			Log.d("TippleActivity::loadUserTrail()", "XML User Activity Log File Parsed");
-			
-
-			for (int i=0;  i<logentry_hashmap_list.size(); i++) {
-				HashMap<String,String> logentry_hashmap = logentry_hashmap_list.get(i);
-				
-				HashMap<String,String> location_hashmap = new HashMap<String,String>();
-				location_hashmap.put("longitude",logentry_hashmap.get("longitude"));
-				location_hashmap.put("latitude",logentry_hashmap.get("latitude"));
-				location_hashmap.put("radius",logentry_hashmap.get("accuracy"));
-				location_hashmap.put("title",logentry_hashmap.get("action"));
-				location_hashmap.put("text",logentry_hashmap.get("message"));
-				
-				TipLocation location = new TipLocation(location_hashmap);
-				locations.add(location);
-			}
-		}
-		
-		return locations;
-	}
-	
-	
-	protected String SyncSynthesizeToFile(String text, String id, String root_utterance)
-	{
-		String audio_dir = TippleActivity.audioDirectory;
-		File tts_file = new File(audio_dir, id+"-"+root_utterance+"-TTS.wav");
-    	String tts_filename = tts_file.getAbsolutePath(); 	
-    	
-    	if (tts_file.exists()) {
-    		// already synthesized this
-    		return tts_filename;
-    	}
-    	
-		// Rendering the supplied text of the id+utterance derived WAV file
-    	HashMap<String, String> hashRender = new HashMap<String, String>();
-    	hashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, text);
-    	
-    	String UTTERANCE = root_utterance+"-utterance";
-    	
-    	hashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, UTTERANCE);
-    	UtteranceWaitListener listener = new UtteranceWaitListener(UTTERANCE);
-    	tts_.setOnUtteranceCompletedListener(listener);
-    	
-    	 tts_.synthesizeToFile(text, hashRender, tts_filename);
-    	 
-    	try {
-    		listener.waitForComplete();
-    	} 
-    	catch (Exception e) {
-    		e.printStackTrace();
-    		return null;
-    	}
-    	
-    	return tts_filename;
-	}
-	
-	boolean genPrevVisited = true;
-	
-	public boolean textToSpeechToLocation(TipLocation tip_location, boolean visited_previously) 
-	{
-		if (genPrevVisited) {
-			prevVisitedFilename = SyncSynthesizeToFile("Previously visited.","Previously-visited","cue");
-			System.err.println("** Prev visisted file = " + prevVisitedFilename);
-			genPrevVisited = false;
-		}
-		
-		String title = tip_location.getTitle();
-		String text = tip_location.getText();
-		String id = tip_location.getID();
-		
-		String title_filename = SyncSynthesizeToFile(title,id,"title");
-		String text_filename = SyncSynthesizeToFile(text,id,"text");
-	 
-		if ((title_filename!=null) && (text_filename!=null)) {
-			String audio_dir = TippleActivity.audioDirectory;
-			File ding_file = new File(audio_dir, "DingExtended.wav");
-			String ding_filename = ding_file.getAbsolutePath();
-			
-			if (audio_player_view_.addAudio(id)) {
-				TippleActivity.log.optMessage("Queue Audio",title);
-				audio_player_view_.queueAudio(title_filename,id,title,visited_previously);
-				audio_player_view_.queueAudio(text_filename,id,text);
-				audio_player_view_.queueAudio(ding_filename,id,"[Audio Bing]");
-				
-				audio_player_view_.updateTextViewIfHeadIsNewLocation();
-			}
-		}
-    	
-    	return true;
-	}
-	
-	
-	public static void stopOverlayThreads()
-	{
-	   	 if (circlesOverlay!=null) { 
-	        	circlesOverlay.stop();
-	        	circlesOverlay = null;
-	        }
-	       
-	        if (itemizedMarkerOverlay!=null) {
-	       	 itemizedMarkerOverlay.stop();
-	        	itemizedMarkerOverlay = null;
-	        }
-
-	        if (routeOverlay!=null) {
-	       	 routeOverlay.stop();
-	        	routeOverlay = null;
-	        }
-
-	        if (routeMarkerOverlay!=null) {
-	       	 routeMarkerOverlay.stop();
-	        	routeMarkerOverlay = null;
-	        }
-	}
-    private static class UtteranceWaitListener implements OnUtteranceCompletedListener {
-        private boolean mIsComplete = false;
-        private final String mExpectedUtterance;
-
-        public UtteranceWaitListener(String expectedUtteranceId) {
-            mExpectedUtterance = expectedUtteranceId;
-        }
-
-        public void onUtteranceCompleted(String utteranceId) {
-            if (mExpectedUtterance.equals(utteranceId)) {
-                synchronized(this) {
-                    mIsComplete = true;	
-                    notify();
-                }
-            }
-        }
-        
-        public boolean waitForComplete() throws InterruptedException {
-            if (mIsComplete) {	
-                return true;
-            }
-
-            synchronized (this) {
-                int TTS_SPEECH_MAX_WAIT_TIME = 5* 1000;
-            	wait(TTS_SPEECH_MAX_WAIT_TIME);
-                return mIsComplete;
-            }
-        }
-        
-    }    
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLocationListener.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLocationListener.java	(revision 24270)
+++ 	(revision )
@@ -1,296 +1,0 @@
-package org.greenstone.android.tipple;
-
-import java.io.File;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.greenstone.android.tipple.TipLocation;
-
-import org.mapsforge.android.maps.ArrayItemizedMarkerOverlay;
-import org.mapsforge.android.maps.CircleOverlay;
-import org.mapsforge.android.maps.GeoPoint;
-import org.mapsforge.android.maps.MapController;
-import org.mapsforge.android.maps.MapView;
-import org.mapsforge.android.maps.OverlayMarkerItem;
-import org.mapsforge.android.maps.OverlayTextAudioItem;
-import org.mapsforge.android.maps.Projection;
-
-import android.app.Activity;
-import android.content.Context;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Point;
-import android.graphics.drawable.Drawable;
-import android.location.Location;
-import android.location.LocationListener;
-import android.media.MediaPlayer;
-import android.os.Bundle;
-import android.os.Vibrator;
-
-import android.widget.TextView;
-
-public class TippleLocationListener implements LocationListener 
-{
-	public static Location lastKnownLocation = null;
-	
-	protected ArrayList<TipLocation> locations_;
-	
-	protected Activity activity_;
-	protected MapView map_view_;
-	protected TextView text_view_;
-	protected TipLocationManager tip_location_manager_;
-	
-	protected MapController map_controller_;
-	protected CircleOverlay here_overlay_;
-	protected ArrayItemizedMarkerOverlay highlight_marker_overlay_;
-	
-	protected Vibrator vibrator_;
-
-	protected Set<TipLocation> curr_locations_;
-	protected Set<TipLocation> prev_locations_;
-	HashMap<Integer,OverlayMarkerItem> highlight_marker_hash_;
-	
-
-	public TippleLocationListener(Activity activity, MapView map_view,TextView text_view,
-			TipLocationManager place_location_manager,
-			ArrayList<TipLocation> locations) 
-	{
-		activity_ = activity;
-		map_view_ = map_view;
-		text_view_ = text_view;
-		
-		tip_location_manager_ = place_location_manager;
-		locations_ = locations;
-		
-		// location aware
-		Paint circleFillPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		circleFillPaint.setStyle(Paint.Style.FILL);
-		circleFillPaint.setColor(Color.GREEN);
-		circleFillPaint.setAlpha(64);
-
-		Paint circleOutlinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		circleOutlinePaint.setStyle(Paint.Style.STROKE);
-		circleOutlinePaint.setColor(Color.GREEN);
-		circleOutlinePaint.setAlpha(128);
-		circleOutlinePaint.setStrokeWidth(3);
-		here_overlay_ = new CircleOverlay(circleFillPaint, circleOutlinePaint);
-		map_view_.getOverlays().add(here_overlay_);
-
-		Drawable highlightMarker = activity_.getResources().getDrawable(R.drawable.markerhighlight);
-		highlight_marker_overlay_ = new ArrayItemizedMarkerOverlay(highlightMarker,activity);
-		map_view_.getOverlays().add(highlight_marker_overlay_);
-		
-		vibrator_ = (Vibrator) activity
-				.getSystemService(Context.VIBRATOR_SERVICE);
-		
-		curr_locations_ = new HashSet<TipLocation>();
-		prev_locations_ = new HashSet<TipLocation>();
-		highlight_marker_hash_ = new HashMap<Integer,OverlayMarkerItem>();
-		
-	}
-
-	boolean checking_location_ = false;
-	
-	synchronized protected boolean getLock()
-	{
-		if (!checking_location_) {
-			checking_location_ = true;
-		}
-		
-		return checking_location_;
-	}
-	
-	synchronized protected void freeLock()
-	{
-		checking_location_ = false;
-	}
-	
-	protected double pointDistance(Point place_point, Point here_point)
-	{
-		double delta_x = place_point.x - here_point.x;
-		double delta_y = place_point.y - here_point.y;
-		double pixel_distance = Math.sqrt((delta_x * delta_x) + (delta_y * delta_y));
-
-		return pixel_distance;
-	}
-	
-	Point lastLoggedPoint_ = null;
-	
-	protected void updateActiveLocations(Location loc)
-	{
-		// Find out if the current GPS location lies within the boundaries
-		// of any of the tour locations
-		Projection projection = map_view_.getProjection();
-		byte zoom_level = map_view_.getZoomLevel();
-		// byte zoom_level = 10; // work at a reasonable level of scale
-
-		float in_out_gap_meters = 3.0f;
-		float in_out_gap_pixels 
-			= projection.metersToPixels(in_out_gap_meters, zoom_level);
-
-		double here_latitude = loc.getLatitude();
-		double here_longitude = loc.getLongitude();
-		GeoPoint here_geopoint = new GeoPoint(here_latitude, here_longitude);
-		Point here_point = projection.toPoint(here_geopoint, null,zoom_level);
-		
-		if (lastLoggedPoint_==null) {
-			lastLoggedPoint_ = here_point;
-			TippleActivity.log.optMessage("GPS Location Reading");
-		}
-		else {
-			float far_enough_meters = 3.0f; // 3 meters
-			float far_enough_pixels = projection.metersToPixels(far_enough_meters, zoom_level);
-			if (pointDistance(here_point,lastLoggedPoint_)>far_enough_pixels) {
-				TippleActivity.log.optMessage("GPS Location Reading");
-			}
-		}
-		
-		for (int i=0; i<locations_.size(); i++) {
-
-			TipLocation place = locations_.get(i);
-			
-			double place_latitude = place.getLatitude();
-			double place_longitude = place.getLongitude();
-			double radius_meters = place.getRadiusKM() * 1000.0;
-
-			GeoPoint place_geopoint = new GeoPoint(place_latitude,place_longitude);
-			Point place_point = projection.toPoint(place_geopoint, null,zoom_level);
-
-			float radius_pixel_distance = projection.metersToPixels((float) radius_meters, zoom_level);
-
-			double delta_x = place_point.x - here_point.x;
-			double delta_y = place_point.y - here_point.y;
-			double pixel_distance = Math.sqrt((delta_x * delta_x) + (delta_y * delta_y));
-
-			double outside_pixel_distance = radius_pixel_distance + in_out_gap_pixels;
-			double inside_pixel_distance  = radius_pixel_distance;
-
-			if (pixel_distance <= inside_pixel_distance) {
-
-				if (!curr_locations_.contains(place)) {
-					// User has entered new location on tour
-					
-					curr_locations_.add(place);
-					vibrator_.vibrate(1000);
-					Bundle bundle = new Bundle();
-					bundle.putString("placeName", place.getTitle());
-
-					boolean visited_previously = prev_locations_.contains(place);
-					tip_location_manager_.textToSpeechToLocation(place,visited_previously);
-					
-					OverlayTextAudioItem here_marker_item 
-						= (OverlayTextAudioItem) TipLocationManager.itemizedMarkerOverlayArrayList.get(i);
-					
-					GeoPoint dm_geopoint = here_marker_item.getPoint();
-					String title = here_marker_item.getTitle();
-					
-					//itemized_overlay.onTap(i);
-					
-					OverlayMarkerItem highlight_marker_item = new OverlayMarkerItem(dm_geopoint,title);
-					highlight_marker_hash_.put(i,highlight_marker_item);
-					highlight_marker_overlay_.addOverlay(highlight_marker_item);
-					
-					
-					try {
-						// Cue up audio alert
-						String audio_dir = TippleActivity.audioDirectory;
-						File alert_file = new File(audio_dir, "BeepMorseSonar.wav");
-						String alert_filename = alert_file.getAbsolutePath();
-					
-						MediaPlayer mp = new MediaPlayer();
-						mp.setDataSource(alert_filename);
-						mp.prepare();
-						mp.start();
-					} 
-					catch (Exception e) {
-						System.err.println("Failed to play audio alert for active GPS location");
-						e.printStackTrace();
-					}
-					
-					// Now record the fact we've been here
-					prev_locations_.add(place);
-						
-				}
-
-			}
-
-			else if (pixel_distance >= outside_pixel_distance) {
-				
-				if (curr_locations_.contains(place)) {
-					curr_locations_.remove(place);
-					
-					// TipLocationManager.itemizedMarkerOverlay.unTap();
-					
-					OverlayMarkerItem highlight_marker_item = highlight_marker_hash_.remove(i);
-					highlight_marker_overlay_.removeOverlay(highlight_marker_item);
-				}
-			}
-		}
-	}
-	@Override
-	public void onLocationChanged(Location loc) 
-	{
-		if (loc != null) {
-
-			//System.err.println("TipLocationListener::onLocationChaged -- start");
-			lastKnownLocation = loc;
-			
-			if (getLock()) {
-				updateActiveLocations(loc);
-				freeLock();
-			}
-
-			DecimalFormat truncPlaces = new DecimalFormat("0.0000000000");
-			double longitude = loc.getLongitude();
-			double latitude = loc.getLatitude();
-			
-			String trunc_long = truncPlaces.format(longitude);
-			String trunc_lat  = truncPlaces.format(latitude);
-			
-			String text_mess = "(Long,Lat): (" +  trunc_long + "," + trunc_lat + ")";
-			text_view_.setText(text_mess);
-
-			// location aware
-			GeoPoint point = new GeoPoint(latitude, longitude);
-			here_overlay_.setCircleData(point, loc.getAccuracy());
-			
-			// Use the following line if you want to map to auto center on the GPS location
-			 boolean centre_on_gps_loc = TippleActivity.sharedPreferences.getBoolean("centreOnGPSLoc", false);
-			 if (centre_on_gps_loc) {
-				 MapController map_controller = map_view_.getController();
-				 if (map_controller != null) {
-					 	map_controller.setCenter(point);
-				 }
-			 }
-			 
-			//System.err.println("TipLocationListener::onLocationChaged -- finished");
-		}
-	}
-
-	@Override
-	public void onProviderDisabled(String provider) 
-	{
-		// TODO Auto-generated method stub
-		System.err.println("TipLocationListener::onProviderDisabled()");
-	}
-
-	@Override
-	public void onProviderEnabled(String provider)
-	{
-		// TODO Auto-generated method stub
-		System.err.println("TipLocationListener::onProviderEnabled()");
-
-	}
-
-	@Override
-	public void onStatusChanged(String provider, int status, Bundle extras) 
-	{
-		// TODO Auto-generated method stub
-		System.err.println("TipLocationListener::onStatusChanged()");
-
-	}
-
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLog.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLog.java	(revision 24270)
+++ 	(revision )
@@ -1,189 +1,0 @@
-package org.greenstone.android.tipple;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.text.DecimalFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.location.Location;
-
-public class TippleLog 
-{
-	protected Activity activity_;
-	protected String log_directory_;
-	
-	public PrintStream TIPLOG = null;
-	protected boolean logging_enabled_ = false;
-	protected File    logging_file_;
-	protected String  logging_filename_final_;
-
-	
-	public TippleLog(Activity activity, String logDirectory) 
-	{
-		activity_ = activity;
-		log_directory_ = logDirectory;
-		
-		//boolean logfile_ok = initLogging();
-	    //alertLogging(logfile_ok);
-	}
-	
-	protected void optStartLog()
-	{
-	    if (TIPLOG!=null) {
-	    	   TIPLOG.println("<Log>");
-	    }
-	}
-	
-	protected void optStopLog()
-	{
-	    if (TIPLOG != null) {
-	    	   TIPLOG.println("</Log>");
-	    	   
-	    	   TIPLOG.close();
-	    	   
-	    	   
-	    	   File logging_file_final = new File(logging_filename_final_);
-	    	   logging_file_.renameTo(logging_file_final);
-	    	   
-	    	  
-	    }
-	}
-	
-	public void optMessage(String action, String message_line)
-	{
-		if (logging_enabled_) {
-			
-			TIPLOG.println("  <LogEntry>");
-			
-			final long timestamp = System.currentTimeMillis();
-			final Calendar cal = Calendar.getInstance();
-			cal.setTimeInMillis(timestamp);
-			Date date = cal.getTime();
-			int hour = date.getHours();
-			int minute = date.getMinutes();
-			int seconds = date.getSeconds();
-			
-			TIPLOG.println("    <Timestamp>"+timestamp+"</Timestamp>");
-			TIPLOG.println("    <Time>" + hour + ":" + minute + ":" + seconds + "</Time>");
-			
-			Location loc = TippleLocationListener.lastKnownLocation;
-			if (loc!=null) {
-				double longitude = loc.getLongitude();
-				double latitude  = loc.getLatitude();
-				double accuracy  = loc.getAccuracy();
-				TIPLOG.println("    <Longitude>"+longitude+"</Longitude>");
-				TIPLOG.println("    <Latitude>"+latitude+"</Latitude>");
-				TIPLOG.println("    <Accuracy>"+accuracy+"</Accuracy>");
-			}
-			TIPLOG.println("    <Action>"+action+"</Action>");
-			if (message_line != "") {
-				TIPLOG.println("    <Message>"+message_line+"</Message>");
-			}
-			TIPLOG.println("  </LogEntry>");
-		}
-	}
-	
-	public void optMessage(String action)
-	{
-		optMessage(action,"");
-	}
-	
-
-	 DialogInterface.OnClickListener contEnableCallback = new DialogInterface.OnClickListener() {
-    	public void onClick(DialogInterface dialog, int which) {
-    		logging_enabled_ = true;
-    		dialog.cancel();
-    		//dialog.notifyAll();
-    	}
-    };
-    
-    DialogInterface.OnClickListener contDisableCallback = new DialogInterface.OnClickListener() {
-     	public void onClick(DialogInterface dialog, int which) {
-     		
-     		// Delete logging file, then allow application to proceed 
-     		logging_file_.delete();
-     		logging_file_ = null;
-     		TIPLOG = null;
-     		
-     		logging_enabled_ = false;
-     		
-     		//SharedPreferences.Editor editor = activity_.sharedPreferences.edit();
-     		//editor.putBoolean("showUserTrail", false);
-     		//editor.commit();
-     		
-     		dialog.cancel();
-     	}
-     };
-     
-    DialogInterface.OnClickListener stopCallback = new DialogInterface.OnClickListener() {
-		public void onClick(DialogInterface dialog, int which) {
-			
-			// Delete logging file, then finish application
-			
-     		logging_file_.delete();
-     		logging_file_ = null;
-     		TIPLOG = null;
-     		
-			logging_enabled_ = false;
-			
-			activity_.finish();
-		}
-	};
-	
-	protected boolean initLogging()
-	{
-		 boolean logfile_ok = false;
-        
-        try {
-        	
-        	for (int i=1; i<1000; i++) {
-        		
-        		DecimalFormat zeroFill = new DecimalFormat("000");
-        		String formatted_i = zeroFill.format(i);
-        		
-        		File potential_log_file = new File(log_directory_,"UserInteract-" + formatted_i + ".log");
-        		
-        		if (potential_log_file.exists()) { continue; }
-        		
-        		logging_file_ = new File(log_directory_,"UserInteract-" + formatted_i);
-        		logging_filename_final_ = logging_file_.getAbsolutePath() + ".log";
-        		
-        		TIPLOG = new PrintStream(logging_file_);
-        		if (TIPLOG != null) {
-        			logfile_ok = true;
-        			break;
-        		}
-        	}
-        }
-        catch (Exception e) {
-       	 logging_file_ = null;
-        	 e.printStackTrace();      
-        }
-        
-        return logfile_ok;
-	}
-	
-	protected void alertLogging(boolean logfile_ok)
-	{   		
-	    	AlertDialog.Builder confirm_log_alert = new AlertDialog.Builder(activity_);
-	    	
-	    	if (logfile_ok) {
-	    		confirm_log_alert.setTitle("Logging Activity");
-		        confirm_log_alert.setMessage("Tipple can log your user interaction.  Do you want this activated?");
-		        confirm_log_alert.setPositiveButton(R.string.logging_ok_enable,contEnableCallback);
-		        confirm_log_alert.setNegativeButton(R.string.logging_ok_disable,contDisableCallback);	
-	    	}
-	    	else {
-	    		confirm_log_alert.setTitle("Error");
-		        confirm_log_alert.setMessage("Failed to initialize user activity log file");
-		        confirm_log_alert.setPositiveButton(R.string.logging_error_continue,contDisableCallback);
-		        confirm_log_alert.setNegativeButton(R.string.logging_error_stop,stopCallback);		
-	    	}
-	    	
-	    	confirm_log_alert.show();
-	}
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLogFileBrowser.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLogFileBrowser.java	(revision 24270)
+++ 	(revision )
@@ -1,207 +1,0 @@
-/*
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- * Based on FileBrowser.java from mapsforge.org
- * 
- */
-
-package org.greenstone.android.tipple;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.util.Arrays;
-import java.util.Comparator;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.WindowManager;
-import android.widget.AdapterView;
-import android.widget.GridView;
-
-/**
- * Simple file browser activity to select a log file from the file system.
- */
-public class TippleLogFileBrowser extends Activity implements AdapterView.OnItemClickListener 
-{
-	private static final String DEFAULT_DIRECTORY = "/";
-	private static final int DIALOG_LOG_FILE_INVALID = 0;
-	private static final int DIALOG_LOG_FILE_SELECT = 1;
-	private static final String PREFERENCES_FILE = "FileBrowser";
-	private File currentDirectory;
-	private TippleLogFileBrowserIconAdapter fileBrowserIconAdapter;
-	private Comparator<File> fileComparator;
-	private FileFilter fileFilter;
-	private File[] files;
-	private File[] filesWithParentFolder;
-	private GridView gridView;
-	private File selectedFile;
-
-	@Override
-	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long id) {
-		this.selectedFile = this.files[(int) id];
-		if (this.selectedFile.isDirectory()) {
-			this.currentDirectory = this.selectedFile;
-			browseToCurrentDirectory();
-		} else if (this.selectedFile.getAbsolutePath().endsWith(".log")) {
-			String log_filename = selectedFile.getAbsolutePath();
-			Intent ok_intent = new Intent();
-			ok_intent.putExtra("logFile", log_filename);
-					
-			setResult(RESULT_OK, ok_intent);
-			finish();
-		} else {
-			showDialog(DIALOG_LOG_FILE_INVALID);
-		}
-	}
-
-	@Override
-	public boolean onKeyDown(int keyCode, KeyEvent event) {
-		if (keyCode == KeyEvent.KEYCODE_BACK) {
-			// quit the application
-			setResult(RESULT_CANCELED);
-			finish();
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Browse to the current directory.
-	 */
-	private void browseToCurrentDirectory() {
-		setTitle(this.currentDirectory.getAbsolutePath());
-
-		// read and filter files and subfolders in the current folder
-		this.files = this.currentDirectory.listFiles(this.fileFilter);
-
-		// order all files by type and alphabetically by name
-		Arrays.sort(this.files, this.fileComparator);
-
-		// if a parent directory exists, add it at the first position
-		if (this.currentDirectory.getParentFile() != null) {
-			this.filesWithParentFolder = new File[this.files.length + 1];
-			this.filesWithParentFolder[0] = this.currentDirectory.getParentFile();
-			System.arraycopy(this.files, 0, this.filesWithParentFolder, 1, this.files.length);
-			this.files = this.filesWithParentFolder;
-			this.fileBrowserIconAdapter.updateFiles(this.files, true);
-		} else {
-			this.fileBrowserIconAdapter.updateFiles(this.files, false);
-		}
-		this.fileBrowserIconAdapter.notifyDataSetChanged();
-	}
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.filebrowser);
-		this.fileBrowserIconAdapter = new TippleLogFileBrowserIconAdapter(this);
-		this.gridView = (GridView) findViewById(R.id.fileBrowserView);
-		this.gridView.setOnItemClickListener(this);
-		this.gridView.setAdapter(this.fileBrowserIconAdapter);
-
-		this.fileFilter = new FileFilter() {
-			@Override
-			public boolean accept(File pathname) {
-				if (pathname.isDirectory()) {
-					// accept all readable folders
-					return pathname.canRead();
-				}
-				// accept all readable files with the correct extension
-				return pathname.canRead() && pathname.getName().endsWith(".log");
-			}
-		};
-
-		this.fileComparator = new Comparator<File>() {
-			@Override
-			public int compare(File o1, File o2) {
-				if (o1.isDirectory() && !o2.isDirectory()) {
-					return -1;
-				} else if (!o1.isDirectory() && o2.isDirectory()) {
-					return 1;
-				} else {
-					return o1.getName().compareToIgnoreCase(o2.getName());
-				}
-			}
-		};
-
-		/*
-		if (savedInstanceState == null) {
-			// first start of this instance
-			showDialog(DIALOG_LOG_FILE_SELECT);
-		}
-		 
-		 */
-	}
-
-	@Override
-	protected Dialog onCreateDialog(int id) {
-		AlertDialog.Builder builder = new AlertDialog.Builder(this);
-		switch (id) {
-			case DIALOG_LOG_FILE_INVALID:
-				builder.setMessage(getString(R.string.log_file_invalid)).setTitle(
-						getString(R.string.error)).setPositiveButton(getString(R.string.ok),
-						null);
-				return builder.create();
-			case DIALOG_LOG_FILE_SELECT:
-				builder.setMessage(getString(R.string.log_file_select)).setPositiveButton(
-						getString(R.string.ok), null);
-				return builder.create();
-			default:
-				return null;
-		}
-	}
-
-	@Override
-	protected void onPause() {
-		super.onPause();
-		// save the current directory
-		Editor editor = getSharedPreferences(PREFERENCES_FILE, MODE_PRIVATE).edit();
-		editor.clear();
-		if (this.currentDirectory != null) {
-			editor.putString("currentDirectory", this.currentDirectory.getAbsolutePath());
-		}
-		editor.commit();
-	}
-
-	@Override
-	protected void onResume() {
-		super.onResume();
-		// check if the full screen mode should be activated
-		if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("fullscreen", false)) {
-			getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
-			getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
-		} else {
-			getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
-			getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
-		}
-
-		// restore the current directory
-		SharedPreferences preferences = getSharedPreferences(PREFERENCES_FILE, MODE_PRIVATE);
-		this.currentDirectory = new File(preferences.getString("currentDirectory",
-				DEFAULT_DIRECTORY));
-		if (!this.currentDirectory.exists() || !this.currentDirectory.canRead()) {
-			this.currentDirectory = new File(DEFAULT_DIRECTORY);
-		}
-		browseToCurrentDirectory();
-	}
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLogFileBrowserIconAdapter.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/TippleLogFileBrowserIconAdapter.java	(revision 24270)
+++ 	(revision )
@@ -1,113 +1,0 @@
-/*
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- * Based on FileBrowserIconAdapter.java from mapsforge.org
- * 
- */
-package org.greenstone.android.tipple;
-
-import java.io.File;
-
-import android.content.Context;
-import android.view.Gravity;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.TextView;
-
-/**
- * An adapter for the FileBrowser GridView.
- */
-class TippleLogFileBrowserIconAdapter extends BaseAdapter 
-{
-	private Context context;
-	private File currentFile;
-	private File[] files;
-	private boolean hasParentFolder;
-	private TextView textView;
-
-	/**
-	 * Create a new FileBrowserIconAdapter with the given context.
-	 * 
-	 * @param context
-	 *            the context of this adapter, through which new Views can be created.
-	 */
-	TippleLogFileBrowserIconAdapter(Context context) {
-		this.context = context;
-	}
-
-	@Override
-	public int getCount() {
-		if (this.files == null) {
-			return 0;
-		}
-		return this.files.length;
-	}
-
-	@Override
-	public Object getItem(int index) {
-		return this.files[index];
-	}
-
-	@Override
-	public long getItemId(int index) {
-		return index;
-	}
-
-	@Override
-	public View getView(int index, View convertView, ViewGroup parent) {
-		if (convertView instanceof TextView) {
-			// recycle the old view
-			this.textView = (TextView) convertView;
-		} else {
-			// create a new view object
-			this.textView = new TextView(this.context);
-			this.textView.setLines(2);
-			this.textView.setGravity(Gravity.CENTER_HORIZONTAL);
-			this.textView.setPadding(5, 10, 5, 10);
-		}
-
-		if (index == 0 && this.hasParentFolder) {
-			// the parent directory of the current folder
-			this.textView.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_menu_back,
-					0, 0);
-			this.textView.setText("..");
-		} else {
-			this.currentFile = this.files[index];
-			if (this.currentFile.isDirectory()) {
-				this.textView.setCompoundDrawablesWithIntrinsicBounds(0,
-						R.drawable.ic_menu_archive, 0, 0);
-			} else {
-				this.textView.setCompoundDrawablesWithIntrinsicBounds(0,
-						R.drawable.ic_menu_mapmode, 0, 0);
-			}
-			this.textView.setText(this.currentFile.getName());
-		}
-		return this.textView;
-	}
-
-	/**
-	 * Call this method to change the data of the adapter.
-	 * 
-	 * @param newFiles
-	 *            the new files for this adapter.
-	 * @param newHasParentFolder
-	 *            true if the files array has a parent folder at index 0, false otherwise.
-	 */
-	void updateFiles(File[] newFiles, boolean newHasParentFolder) {
-		this.files = newFiles;
-		this.hasParentFolder = newHasParentFolder;
-	}
-}
Index: other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/XMLToHashmapHandler.java
===================================================================
--- other-projects/tipple-android/trunk-restructured/workspace/tipple-standalone-hpg/src/org/greenstone/android/tipple/XMLToHashmapHandler.java	(revision 24270)
+++ 	(revision )
@@ -1,79 +1,0 @@
-package org.greenstone.android.tipple;
-
-import java.util.HashMap;
-import java.util.ArrayList;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class XMLToHashmapHandler extends DefaultHandler 
-{
-	String lockon_element_;
-	Boolean locked_on_;
-	ArrayList<HashMap<String,String>> lockon_list_; 
-	
-	HashMap<String,String> hashmap_;
-	String active_element_;
-	StringBuffer inner_text_;
-	
-	public XMLToHashmapHandler(String lockon_element)
-	{
-		// initial settings to parse a file	
-		lockon_element_ = lockon_element;
-		lockon_list_ = new ArrayList<HashMap<String,String>>();
-		locked_on_ = false;
-	}
-	
-	public ArrayList<HashMap<String,String>> getHashmapList() 
-	{
-		return lockon_list_;
-	}
-
-	@Override
-	public void startElement(String uri, String localName, String qName, Attributes attributes) 
-		throws SAXException 
-	{
-		if (localName.equalsIgnoreCase(lockon_element_)) {
-			hashmap_ = new HashMap<String,String>();
-			locked_on_ = true; // => covert each child element inside this to a hashmap key
-		}
-		else if (locked_on_) {
-			active_element_ = localName.toLowerCase();
-			inner_text_ = new StringBuffer();
-		}
-		// else ignore element as outside area of interest
-	}
-
-	@Override
-	public void endElement(String uri, String localName, String qName) 
-		throws SAXException 
-	{
-		if (localName.equalsIgnoreCase(lockon_element_)) {
-			// push hashmap onto arraylist
-			lockon_list_.add(hashmap_);
-			hashmap_ = null;
-			
-			locked_on_ = false;
-		}
-		else if (localName.equalsIgnoreCase(active_element_))
-		{
-			// add 'inner_text_' into hashmap under the key 'active_element_';
-			hashmap_.put(active_element_,inner_text_.toString());
-			//Log.d("***", "Saving: " + active_element_+ " = " + inner_text_.toString() + "\n");
-			active_element_ = null;
-			inner_text_ = null;
-		}
-	}
-
-	@Override
-	public void characters(char[] ch, int start, int length)
-		throws SAXException 
-	{
-		if ((locked_on_) && (active_element_ != null)) {
-			String text = new String(ch,start,length);
-			inner_text_.append(text);
-		}
-	}
-
-}
