Subversion Repositories Projects

Rev

Rev 212 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
212 ligi 1
 
2
package org.ligi.android;
3
 
4
import android.app.ListActivity;
5
import android.content.Intent;
6
import android.content.pm.PackageManager;
7
import android.content.pm.ResolveInfo;
8
import android.os.Bundle;
9
import android.view.View;
10
import android.widget.ListView;
11
import android.widget.SimpleAdapter;
12
 
13
 
14
import android.util.Log;
15
 
16
import android.app.Activity;
17
import android.os.Bundle;
18
 
19
 
20
import android.view.View;
21
import android.widget.ListView;
22
import android.widget.SimpleAdapter;
23
 
24
import java.text.Collator;
25
import java.util.ArrayList;
26
import java.util.Collections;
27
import java.util.Comparator;
28
import java.util.HashMap;
29
import java.util.List;
30
import java.util.Map;
31
import android.net.Uri;
32
 
33
import java.net.URISyntaxException;
34
import android.widget.*;
35
import android.content.DialogInterface;
36
import android.content.Context.*;
37
import android.widget.EditText;
38
import android.text.method.NumberKeyListener;
39
 
40
 
41
import com.google.android.maps.MapView;
42
 
43
import          android.app.AlertDialog.*;
44
import          android.app.AlertDialog;
45
 
46
import android.content.SharedPreferences;
47
 
48
 
49
import android.view.*;
50
import android.content.*;
51
import android.view.ViewGroup.*;
52
 
53
import org.ligi.ufo.*;
54
 
55
public class RCDataActivity extends Activity
56
    implements DUBwiseDefinitions,Runnable
57
{
58
 
59
 
60
 
61
    AndroidMKCommunicator mk;
62
 
63
    ProgressBar[] bars;
64
    @Override
65
        public void onCreate(Bundle savedInstanceState) {
66
        super.onCreate(savedInstanceState);
67
 
68
 
69
 
70
        bars=new ProgressBar[10];
71
 
72
        mk= new AndroidMKCommunicator(this);
73
        mk.user_intent=USER_INTENT_RCDATA;
74
        setContentView(R.layout.rcdata);
75
 
76
        bars[0]=        (ProgressBar)findViewById( R.id.stick_progress_0);
77
        bars[1]=        (ProgressBar)findViewById( R.id.stick_progress_1);
78
        bars[2]=        (ProgressBar)findViewById( R.id.stick_progress_2);
79
        bars[3]=        (ProgressBar)findViewById( R.id.stick_progress_3);
80
        bars[4]=        (ProgressBar)findViewById( R.id.stick_progress_4);
81
        bars[5]=        (ProgressBar)findViewById( R.id.stick_progress_5);
82
        bars[6]=        (ProgressBar)findViewById( R.id.stick_progress_6);
83
        bars[7]=        (ProgressBar)findViewById( R.id.stick_progress_7);
84
        bars[8]=        (ProgressBar)findViewById( R.id.stick_progress_8);
85
        bars[9]=        (ProgressBar)findViewById( R.id.stick_progress_9);
86
 
87
        new Thread( this ).start(); // fire up main Thread      
88
    }
89
 
90
    public void run()
91
    {
92
        while(true)
93
            {
94
                try{
95
                Thread.sleep(50);
96
                for (int i=0;i<10;i++)
97
                    bars[i].setProgress(mk.stick_data.stick[i]+127);           
98
                }
99
                catch(Exception e)
100
                    {
101
 
102
                        mk.log(e.toString());
103
                    }
104
 
105
    }
106
 
107
 
108
 
109
    }
110
   @Override
111
    protected void onDestroy()
112
    {
113
        mk.close_connections(true);
114
        mk=null;
115
        super.onDestroy();
116
 
117
    }
118
 
119
 
120
}