title: Localizing SQL in Android
body: <p>I'm preparing database definition class for my application. Let me abbreviate it a little:</p>
  
  <pre><code>public class DatabaseDefinition {
  
       public static class Table {
  
           public static final String TABLE_NAME = "MyTable";
  
           public static final int ID_FIELD = "ID";
           public static final String DATA_FIELD = "Data";
  
           public static final String CREATE_SQL = "CREATE TABLE " + TABLE_NAME + "(" +
               ID_FIELD + " INTEGER PRIMARY KEY," +
               DATA_FIELD + " TEXT)";
  
           public static String getCreateSql() {
  
               return CREATE_SQL;
           }
       }
  }
  </code></pre>
  
  <p>I'd like to add some data to this table when the database is being created (very few, like max. 10 entries). The problem is, that this data must be localized. I may store appropriate entries in resources, but I'm not aware of any way of accessing resources without context and I have none in <code>onCreate</code> event of my <code>DatabaseHelper</code>:</p>
  
  <pre><code>@Override
  public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {
  
      database.execSQL(DatabaseDefinition.GetCreateSql());
  }
  </code></pre>
  
  <p>How can I access resources from here? Or how else should I solve this problem?</p>