Android Open Source - habhub-chase-car-tracker About






From Project

Back to project page habhub-chase-car-tracker.

License

The source code is released under:

Copyright (c) 2012, Priyesh Patel All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1...

If you think the Android project habhub-chase-car-tracker 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.pexat.habhub.chasecartracker;
// w  w w. j a  v a  2  s .c  om
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class About extends ListActivity {

  String data[][];

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    data = new String[][]{
        {"Author", "Priyesh Patel"},
        {"Version", AppInfo.getApplicationVersion(getApplicationContext())},
        {"Device Information", AppInfo.getDevice()},
        {"Device Software", AppInfo.getDeviceSoftware()}
    };

    setListAdapter(new TwoLineArrayAdapter(this, data));
  }

  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    switch (position) {
      case 0 :
        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.author_url)));
        startActivity(i);
        break;
    }
    super.onListItemClick(l, v, position, id);
  }

  public class TwoLineArrayAdapter extends ArrayAdapter<String[]> {
    private int mListItemLayoutResId;

    public TwoLineArrayAdapter(Context context, String[][] ts) {
      this(context, android.R.layout.two_line_list_item, ts);
    }

    public TwoLineArrayAdapter(Context context, int listItemLayoutResourceId, String[][] ts) {
      super(context, listItemLayoutResourceId, ts);
      mListItemLayoutResId = listItemLayoutResourceId;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
      LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

      View listItemView = convertView;
      if (null == convertView) {
        listItemView = inflater.inflate(mListItemLayoutResId, parent, false);
      }

      listItemView.setPadding(20, 20, 20, 20);

      TextView lineOneView = (TextView) listItemView.findViewById(android.R.id.text1);
      TextView lineTwoView = (TextView) listItemView.findViewById(android.R.id.text2);

      String[] t = (String[]) getItem(position);
      lineOneView.setText(lineOneText(t));
      lineTwoView.setText(lineTwoText(t));

      return listItemView;
    }

    public String lineOneText(String[] t) {
      return t[0];
    }

    public String lineTwoText(String[] t) {
      return t[1];
    }
  }
}




Java Source Code List

com.pexat.habhub.chasecartracker.About.java
com.pexat.habhub.chasecartracker.AppInfo.java
com.pexat.habhub.chasecartracker.HabitatInterface.java
com.pexat.habhub.chasecartracker.ListenerTelemetry.java
com.pexat.habhub.chasecartracker.Main.java
com.pexat.habhub.chasecartracker.TrackerService.java
com.pexat.net.SimpleHttp.java