/[projects]/android/EKLLauncher/src/dk/thoerup/ekllauncher/EKLLauncherActivity.java
ViewVC logotype

Diff of /android/EKLLauncher/src/dk/thoerup/ekllauncher/EKLLauncherActivity.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1616 by torben, Thu Oct 20 18:39:19 2011 UTC revision 1617 by torben, Thu Oct 20 20:23:48 2011 UTC
# Line 3  package dk.thoerup.ekllauncher; Line 3  package dk.thoerup.ekllauncher;
3  import android.app.Activity;  import android.app.Activity;
4  import android.content.Context;  import android.content.Context;
5  import android.content.Intent;  import android.content.Intent;
6    import android.net.ConnectivityManager;
7  import android.os.Bundle;  import android.os.Bundle;
8  import android.os.Handler;  import android.os.Handler;
9  import android.os.Message;  import android.os.Message;
# Line 79  public class EKLLauncherActivity extends Line 80  public class EKLLauncherActivity extends
80                    
81          static final String URL = "http://omdeling.info/mobil/ekl/login.php";          static final String URL = "http://omdeling.info/mobil/ekl/login.php";
82                    
83            ConnectivityManager connMgr;
84          TelephonyManager telMgr;          TelephonyManager telMgr;
85          WebView web;          WebView web;
86          String device = "";          String device = "";
# Line 104  public class EKLLauncherActivity extends Line 106  public class EKLLauncherActivity extends
106                          intent.putExtra("state", false);                          intent.putExtra("state", false);
107                          sendBroadcast(intent);                          sendBroadcast(intent);
108                  }                  }
                 Log.d("EKL", "Airplane " +  airplane);  
109          } catch (Settings.SettingNotFoundException e) {          } catch (Settings.SettingNotFoundException e) {
110                  Log.d("EKL", "Exception " + e.getMessage() );                  Log.d("EKL", "Exception " + e.getMessage() );
111          }          }
# Line 113  public class EKLLauncherActivity extends Line 114  public class EKLLauncherActivity extends
114                    
115                    
116          telMgr = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);          telMgr = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
117            connMgr = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
118            
119          device = telMgr.getLine1Number();          device = telMgr.getLine1Number();
120          if (device == null || device.equals("")) {          if (device == null || device.equals("")) {
121                  device = telMgr.getDeviceId();                  device = telMgr.getDeviceId();
# Line 146  public class EKLLauncherActivity extends Line 149  public class EKLLauncherActivity extends
149          web.setWebChromeClient(new CustomChromeClient() );          web.setWebChromeClient(new CustomChromeClient() );
150          web.setWebViewClient( new DebugWebViewClient() );          web.setWebViewClient( new DebugWebViewClient() );
151                    
152          if (telMgr.getSimState() == TelephonyManager.SIM_STATE_READY && telMgr.getDataState() == TelephonyManager.DATA_CONNECTED) {          if ( (telMgr.getSimState() == TelephonyManager.SIM_STATE_READY && telMgr.getDataState() == TelephonyManager.DATA_CONNECTED) || connMgr.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI) {
153                  web.loadUrl( URL );                  web.loadUrl( URL );
154          } else {          } else {
155                  web.loadData("<html><body><h2>afventer netv&aelig;rksforbindelse</h2></body></html>", "text/html", "iso-8859-1");                  web.loadData("<html><body><h2>afventer netv&aelig;rksforbindelse</h2></body></html>", "text/html", "iso-8859-1");

Legend:
Removed from v.1616  
changed lines
  Added in v.1617

  ViewVC Help
Powered by ViewVC 1.1.20