source: other-projects/tipple-android/trunk-restructured/workspace/tipple-networked/src/org/greenstone/android/tipple/NetworkedTippleActivity.java@ 24283

Last change on this file since 24283 was 24283, checked in by davidb, 13 years ago

Changes that reflect shift to using Tipple Library

File size: 2.9 KB
Line 
1package org.greenstone.android.tipple;
2
3import java.io.DataOutputStream;
4import java.io.File;
5import java.io.FileOutputStream;
6import java.io.IOException;
7import java.io.InputStream;
8import java.util.ArrayList;
9import java.util.Locale;
10
11import android.location.LocationManager;
12import android.os.Bundle;
13import android.os.Environment;
14import android.preference.PreferenceManager;
15import android.speech.tts.TextToSpeech;
16import android.speech.tts.TextToSpeech.OnInitListener;
17import android.text.method.ScrollingMovementMethod;
18import android.util.Log;
19import android.view.Gravity;
20import android.view.Menu;
21import android.view.MenuItem;
22import android.view.View;
23import android.view.ViewGroup;
24import android.content.Context;
25import android.content.Intent;
26import android.content.SharedPreferences;
27import android.content.res.AssetManager;
28import android.location.LocationListener;
29import android.widget.FrameLayout;
30import android.widget.LinearLayout;
31import android.widget.LinearLayout.LayoutParams;
32import android.widget.TextView;
33
34import org.greenstone.android.tipple.base.TippleActivity;
35import org.greenstone.android.tipple.base.TippleLog;
36
37
38public class NetworkedTippleActivity extends TippleActivity
39{
40
41 @Override
42 protected void onCreate(Bundle savedInstanceState)
43 {
44 System.err.println("*** TippleActivity::onCreate()");
45 super.onCreate(savedInstanceState);
46
47 if (!initTippleStore()) {
48 System.err.println("Failed to initialize TippleStore on sdcard. Quiting");
49 onDestroy();
50 }
51
52 // Set up logging
53 log = new TippleLog(this,logDirectory);
54 log.optStartLog();
55
56 // "refresh" preferences here so views can be configured correctly
57 // and ensure showUserTrail is reset to off (as not log file has been selected yet)
58 refreshPreferences();
59 SharedPreferences.Editor editor = sharedPreferences.edit();
60 editor.putBoolean("showUserTrail",false);
61
62 // Set up Text to Speech
63 Intent checkIntent = new Intent();
64 checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
65 startActivityForResult(checkIntent, TTS_DATA_CHECK);
66
67 //startActivityForResult(new Intent(this, LogFileBrowser.class), SELECT_LOG_FILE);
68
69
70 // Screen dived into:
71 // Top: GPS location
72 // Bottom: Media player
73
74 LinearLayout linearLayout = new LinearLayout(this);
75 linearLayout.setOrientation(LinearLayout.VERTICAL);
76
77 longlat_view_ = createLongLatView();
78 map_view_ = createMapView("new-zealand.map");
79
80 text_view_ = createTextView();
81 text_map_composite_ = compositTextViewOnMapView(map_view_,text_view_);
82
83 audio_player_view_ = createAudioPlayerView();
84
85 linearLayout.addView(longlat_view_);
86 linearLayout.addView(text_map_composite_);
87 linearLayout.addView(audio_player_view_);
88
89 setContentView(linearLayout);
90 }
91
92
93}
Note: See TracBrowser for help on using the repository browser.