Employee Directory for "AIR for Android" Updated

I updated my Employee Directory on AIR for Android sample application to work with the latest AIR for Android build (8/26/2010). To make it easier to find the latest version of the application, I also created a project page for the application where you will always be able to download the lastest build. That way you won’t have to skim through blog posts to make sure you found the latest one.

Both the apk file and the source code are available for download on the project page.

  • giuseppe mazzi

    Great tutorial, I have found solutions to my problems.
    I would like to know how to insert a new action: Gmap.
    So if I have an address in the db I could find the position in the map.

    You can see a new class below
    public class AbicabDetails extends ListActivity {

    protected TextView abicabBANCA;
    protected TextView abicabABICAB;
    protected TextView abicabIndirizzo;
    protected int abicabId;
    protected int managerId;

    protected List actions;
    protected abicabActionAdapter adapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.abicab_details);

    abicabId = getIntent().getIntExtra("ABICAB_ID", 0);
    SQLiteDatabase db = (new DatabaseHelper(this)).getWritableDatabase();
    Cursor cursor = db.rawQuery("SELECT emp._id, emp.ABI, emp.CAB, emp.BANCA, emp.City, emp.Indirizzo, emp.CAP, emp.Prov, emp.managerId, mgr.BANCA managerFirstBANCA, mgr.City managerLastCity FROM abicab emp LEFT OUTER JOIN abicab mgr ON emp.managerId = mgr._id WHERE emp._id = ?",
    new String[]{""+abicabId});

    if (cursor.getCount() == 1)
    {
    cursor.moveToFirst();

    abicabBANCA = (TextView) findViewById(R.id.abicabBANCA);
    abicabBANCA.setText(cursor.getString(cursor.getColumnIndex("BANCA")) + " " + cursor.getString(cursor.getColumnIndex("City")));

    abicabABICAB = (TextView) findViewById(R.id.abicabABICAB);
    abicabABICAB.setText(cursor.getString(cursor.getColumnIndex("ABI")) + " " + cursor.getString(cursor.getColumnIndex("CAB")));

    abicabIndirizzo = (TextView) findViewById(R.id.abicabIndirizzo);
    abicabIndirizzo.setText(cursor.getString(cursor.getColumnIndex("City")) + " " + cursor.getString(cursor.getColumnIndex("Indirizzo")));

    actions = new ArrayList();

    // String abicabAddress = (cursor.getString(cursor.getColumnIndex("City")) + "," + cursor.getString(cursor.getColumnIndex("Indirizzo")));
    String abicabAddress = cursor.getString(cursor.getColumnIndex("City"));
    if (abicabAddress != null) {
    actions.add(new abicabAction("Vedi in Maps", abicabAddress, abicabAction.ACTION_VIEW));
    }
    managerId = cursor.getInt(cursor.getColumnIndex("managerId"));
    if (managerId>0) {
    actions.add(new abicabAction("View manager", cursor.getString(cursor.getColumnIndex("managerFirstBANCA")) + " " + cursor.getString(cursor.getColumnIndex("managerLastCity")), abicabAction.ACTION_VIEW));
    }
    adapter = new abicabActionAdapter();
    setListAdapter(adapter);
    }
    }

    public void onListItemClick(ListView parent, View view, int position, long id) {

    abicabAction action = actions.get(position);

    Intent intent;
    switch (action.getType()) {

    case abicabAction.ACTION_VIEW:
    Uri mapUri = Uri.parse("geo:0,0?q=" + action.getData());
    intent = new Intent(this, AbicabDetails.class);
    intent.putExtra("ABICAB_ID", managerId);
    startActivity(intent);
    break;
    }
    }
    class abicabActionAdapter extends ArrayAdapter {

    abicabActionAdapter() {
    super(AbicabDetails.this, R.layout.action_list_item, actions);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    abicabAction action = actions.get(position);
    LayoutInflater inflater = getLayoutInflater();
    View view = inflater.inflate(R.layout.action_list_item, parent, false);
    TextView label = (TextView) view.findViewById(R.id.label);
    label.setText(action.getLabel());
    TextView data = (TextView) view.findViewById(R.id.data);
    data.setText(action.getData());
    return view;
    }

    }

    }

    But it does’nt work.
    Any suggestion?
    Thanks in advance

  • mrkim

    hi~
    Thanks for the good information about flex air.

    a frank question.

    ** android SDK ===> READ_PHONE_STATE

    * java source
    TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    String myNumber = mTelephonyMgr.getLine1Number();

    ** flex air?
    I don’t know what to do.

    <![CDATA[

    ]]>

    • PapaDeBeau

      Yes, I too would like to know how to set this up. Did you get it to work yet?

  • mrkim
  • hi,

    i want to listing persons in database file (employee.xml) under categories city, department etc.

    for example i want to list all cities in db
    and when clicked the city name, listing a that city persons.

    how can i do it?

    thanks

  • качество, массового производства и справедливые цены.http://jonsunsport.com/spor-coraplari.html

  • I have tried to install with differnt installer but no luck.

  • Mobile projects are pretty interesting but ideally the platform needs

css.php