Android Open Source - Android102 Family Db






From Project

Back to project page Android102.

License

The source code is released under:

MIT License

If you think the Android project Android102 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.myfamily.db;
/*  w  w w.  j  a va  2 s. c  o m*/
import java.util.List;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import asia.sonix.android.orm.AbatisService;

import com.myfamily.R;

public class FamilyDb extends AbatisService {
  public FamilyDb(Context context) {
    super(context, "family", 1);
  }

  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    // do upgrades here
  }

  public List<FamilyMember> getFamilyMembers() {
    return executeForBeanList(R.string.getMembers, null, FamilyMember.class);
  }

  public long addFamilyMember(String name, long contactId) {
    ContentValues cv = new ContentValues();
    cv.put("contactId", contactId);
    cv.put("name", name);
    SQLiteDatabase database = getWritableDatabase();
    long ret = database.insert("family", "", cv);
    database.close();
    return ret;
  }
}




Java Source Code List

asia.sonix.android.orm.AbatisService.java
com.myfamily.PersonDetailActivity.java
com.myfamily.PersonDetailFragment.java
com.myfamily.PersonListActivity.java
com.myfamily.PersonListFragment.java
com.myfamily.db.FamilyDb.java
com.myfamily.db.FamilyMember.java
com.myfamily.dummy.DummyContent.java
com.myfamily.receivers.SmsReceiver.java
com.myfamily.services.LocationService.java