Android Open Source - radioExpresWidget My Activity






From Project

Back to project page radioExpresWidget.

License

The source code is released under:

GNU General Public License

If you think the Android project radioExpresWidget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hustaty.radioexpres.widget;
/*from w  w w. j  a  va  2s . c om*/
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import android.widget.TextView;
import com.hustaty.radioexpres.widget.exception.RadioExpresException;
import com.hustaty.radioexpres.widget.http.MyHttpClient;
import com.hustaty.radioexpres.widget.model.Kml;
import com.hustaty.radioexpres.widget.model.Placemark;
import com.hustaty.radioexpres.widget.receiver.AlarmManagerBroadcastReceiver;
import com.hustaty.radioexpres.widget.util.LogUtil;

import java.io.IOException;

public class MyActivity extends Activity
{
  // logger entry
  private final static String LOG_TAG = MyActivity.class.getName();

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    MyHttpClient myHttpClient = new MyHttpClient(this);

    try {
      Kml kml = myHttpClient.getTrafficInformation(true);
      TextView t = (TextView)findViewById(R.id.textView);
      t.setText(kml.getDocument().getPlacemarkList().toString());
//      Placemark placemark = kml.getDocument().getPlacemarkList().get(0);
    } catch (IOException e) {
      Log.e(LOG_TAG, "#onReceive(): " + e.getMessage());
    } catch (RadioExpresException e) {
      Log.e(LOG_TAG, "#onReceive(): " + e.getMessage());
    }

    try {
      AlarmManagerBroadcastReceiver alarmManagerBroadcastReceiver = new AlarmManagerBroadcastReceiver();
      alarmManagerBroadcastReceiver.cancelAlarm(this);
      alarmManagerBroadcastReceiver.setAlarm(this);
      Log.d(LOG_TAG, "#onCreate(): cancelling and setting Alarms");
      LogUtil.appendLog(LOG_TAG + "#onCreate():  cancelling and setting Alarms");
    } catch (Exception e) {
      Log.e(LOG_TAG, e.getMessage());
      LogUtil.appendLog(LOG_TAG + "#onCreate(): " + e.getMessage());
    }

  }
}




Java Source Code List

com.hustaty.radioexpres.widget.MyActivity.java
com.hustaty.radioexpres.widget.exception.RadioExpresException.java
com.hustaty.radioexpres.widget.http.MyHttpClient.java
com.hustaty.radioexpres.widget.model.Document.java
com.hustaty.radioexpres.widget.model.IconStyle.java
com.hustaty.radioexpres.widget.model.Icon.java
com.hustaty.radioexpres.widget.model.Kml.java
com.hustaty.radioexpres.widget.model.Placemark.java
com.hustaty.radioexpres.widget.model.Point.java
com.hustaty.radioexpres.widget.model.Style.java
com.hustaty.radioexpres.widget.receiver.AlarmManagerBroadcastReceiver.java
com.hustaty.radioexpres.widget.service.LocationService.java
com.hustaty.radioexpres.widget.util.Constants.java
com.hustaty.radioexpres.widget.util.LogUtil.java
com.hustaty.radioexpres.widget.util.Serializer.java