Android Open Source - Test-SimpleTwitterClient App Database






From Project

Back to project page Test-SimpleTwitterClient.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project Test-SimpleTwitterClient 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.example.Twitter_Android.Logic;
/*from  w  w  w . j  a va 2  s  .c o m*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

public class AppDatabase extends SQLiteOpenHelper {
  public static final int DATABASE_VERSION = 1;
  public static final String DATABASE_NAME = "ThisAppDatabase.db";
  private static final String TEXT_TYPE = " TEXT";
  private static final String COMMA_SEP = ",";
  private static final String SQL_CREATE_ENTRIES = "CREATE TABLE IF NOT EXISTS " + FieldEntry.TABLE_NAME + " (" +
      BaseColumns._ID + " INTEGER PRIMARY KEY" + COMMA_SEP
      + FieldEntry.COLUMN_NAME_USER_ID + " LONG" + COMMA_SEP
      + FieldEntry.COLUMN_NAME_USER_NAME + TEXT_TYPE + COMMA_SEP
      + FieldEntry.COLUMN_NAME_USER_SCREEN_NAME + TEXT_TYPE + COMMA_SEP
      + FieldEntry.COLUMN_NAME_USER_LOCATION + TEXT_TYPE + COMMA_SEP
      + FieldEntry.COLUMN_NAME_USER_DESCRIPTION + TEXT_TYPE + COMMA_SEP
      + FieldEntry.COLUMN_NAME_USER_PROFILE_IMAGE + TEXT_TYPE + ")";

  public static class FieldEntry {
    public static final String COLUMN_NAME_USER_ID = "user_id";
    public static final String COLUMN_NAME_USER_NAME = "user_name";
    public static final String COLUMN_NAME_USER_SCREEN_NAME = "user_screen_name";
    public static final String COLUMN_NAME_USER_PROFILE_IMAGE = "user_profile_image";
    public static final String COLUMN_NAME_USER_DESCRIPTION = "user_description";
    public static final String COLUMN_NAME_USER_LOCATION = "user_location";
    public static final String TABLE_NAME = "persons";
  }


  public AppDatabase(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
  }

  @Override
  public void onCreate(SQLiteDatabase db) {
    System.out.println("Database onCreate");
    db.execSQL(SQL_CREATE_ENTRIES);
  }

  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

  }

}




Java Source Code List

com.example.Twitter_Android.AppActivity.ConcreteUserTimelineActivity.java
com.example.Twitter_Android.AppActivity.MainActivity.java
com.example.Twitter_Android.AppActivity.MessagesActivity.java
com.example.Twitter_Android.AppActivity.SearchableActivity.java
com.example.Twitter_Android.AppActivity.SettingsActivity.java
com.example.Twitter_Android.AsynkTasks.ImageDownloader.java
com.example.Twitter_Android.AsynkTasks.TaskDeleteTweet.java
com.example.Twitter_Android.AsynkTasks.TaskFollow.java
com.example.Twitter_Android.AsynkTasks.TaskPostTweet.java
com.example.Twitter_Android.AsynkTasks.TaskReply.java
com.example.Twitter_Android.AsynkTasks.TaskRetweet.java
com.example.Twitter_Android.AsynkTasks.TaskSendMessage.java
com.example.Twitter_Android.AsynkTasks.TaskUnfollow.java
com.example.Twitter_Android.Fragments.ConcreteUserTimelineFragment.java
com.example.Twitter_Android.Fragments.ConnectedUserTimelineFragment.java
com.example.Twitter_Android.Fragments.FollowersFragment.java
com.example.Twitter_Android.Fragments.FollowingsFragment.java
com.example.Twitter_Android.Fragments.HomeTimelineFragment.java
com.example.Twitter_Android.Fragments.TimelineFragment.java
com.example.Twitter_Android.Fragments.UserInfoFragment.java
com.example.Twitter_Android.Fragments.Adapters.ConcreteUserTimelineAdapter.java
com.example.Twitter_Android.Fragments.Adapters.FollowingsListAdapter.java
com.example.Twitter_Android.Fragments.Adapters.MessagesAdapter.java
com.example.Twitter_Android.Fragments.Adapters.TimelineAdapter.java
com.example.Twitter_Android.Fragments.Adapters.TweetAdapter.java
com.example.Twitter_Android.Fragments.Dialogs.DeleteTweetDialog.java
com.example.Twitter_Android.Fragments.Dialogs.DirectMessageDialog.java
com.example.Twitter_Android.Fragments.Dialogs.ErrorDialog.java
com.example.Twitter_Android.Fragments.Dialogs.PostTweetDialog.java
com.example.Twitter_Android.Fragments.Dialogs.ReplyDialog.java
com.example.Twitter_Android.Fragments.Dialogs.RetweetDialog.java
com.example.Twitter_Android.Fragments.Dialogs.ShowImageDialog.java
com.example.Twitter_Android.Fragments.Dialogs.UserInfoDialog.java
com.example.Twitter_Android.Fragments.Preferences.SettingsFragment.java
com.example.Twitter_Android.Loaders.AsyncUserInfoLoader.java
com.example.Twitter_Android.Loaders.FollowersLoader.java
com.example.Twitter_Android.Loaders.FollowingsLoader.java
com.example.Twitter_Android.Loaders.HomeTimelineLoader.java
com.example.Twitter_Android.Loaders.MessageLoader.java
com.example.Twitter_Android.Loaders.Task_LoadSearchedTweets.java
com.example.Twitter_Android.Loaders.Task_LoadSearchedUsers.java
com.example.Twitter_Android.Loaders.TweetLoader.java
com.example.Twitter_Android.Loaders.UserTimelineLoader.java
com.example.Twitter_Android.Logic.AppDatabase.java
com.example.Twitter_Android.Logic.Constants.java
com.example.Twitter_Android.Logic.DataCache.java
com.example.Twitter_Android.Logic.FileWorker.java
com.example.Twitter_Android.Logic.Person.java
com.example.Twitter_Android.Logic.Tweet.java
com.example.Twitter_Android.Net.Connector.java
com.example.Twitter_Android.Net.Parser.java
com.mass.cmassive.CMassive.java