{"id":172777,"date":"2013-03-14T16:22:03","date_gmt":"2013-03-14T12:22:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=172777"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=172777","title":{"rendered":"<span class=\"post_title\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Berkeley DB \u0432 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 \u00abHello World\u00bb \u043f\u043e\u0434 Android, \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 Android, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435. \u0418 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c c SQL. \u041f\u0440\u0438\u0432\u044b\u043a \u043a\u0430\u043a-\u0442\u043e \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u041f\u043e-\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0440\u044b\u0441\u043a\u0430\u0432 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0445 \u0441 Android \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0430\u0448\u0451\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u2014 Berkeley DB, \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0411\u0414.<br \/>  \u041f\u0440\u0438\u0447\u0451\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043e\u0442 Oracle \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 SQlite.\u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0434\u0430\u043b\u044c\u0448\u0435 \u043c\u043e\u0435\u0433\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043e\u043d\u043e \u0442\u0430\u043a \u0438 \u043d\u0435 \u0443\u0448\u043b\u043e) \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u044d\u0442\u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  \u041a\u043b\u0430\u0441\u0441 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u044f\u0434\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0441\u0434\u0435\u043b\u0430\u043d \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 Singleton, \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"java\">public class DatabaseConfig {     private static DatabaseConfig ourInstance;      private Environment envmnt;     private EntityStore store;      public static DatabaseConfig getInstance() {         if (ourInstance == null)             throw new IllegalArgumentException(&quot;You need initialize database config previously!&quot;);         return ourInstance;     }      public static void init(File envDir) {         ourInstance = new DatabaseConfig(envDir);     }      private DatabaseConfig(File envDir) {         EnvironmentConfig envConfig = new EnvironmentConfig();         StoreConfig storeConfig = new StoreConfig();          envConfig.setTransactional(true);         envConfig.setAllowCreate(true);         storeConfig.setAllowCreate(true);         storeConfig.setTransactional(true);         envmnt = new Environment(envDir, envConfig);         try {             store = new EntityStore(envmnt, &quot;autocalc&quot;, storeConfig);         } catch (IncompatibleClassException e) {             \/\/todo: \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.         }     }      public static void shutdown() {         if (ourInstance != null) {             ourInstance.close();         }     }      private void close() {         store.close();         envmnt.close();      }      public EntityStore getStore() {         return store;     }      public Transaction startTransaction() {         return envmnt.beginTransaction(null, null);     }  }<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0437\u0430\u0438\u0447\u043d\u044b, \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0435\u0451 \u043d\u0430\u0434\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u044b\u0442\u044c. \u041f\u043b\u044e\u0441, \u0432\u044b\u0441\u043a\u043e\u0447\u0438\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\/\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435, \u0430 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0441\u0430\u043c\u044b\u043c \u043b\u0443\u0447\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041f\u043e\u043a\u0430 \u044d\u0442\u0443 \u00ab\u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u044c\u00bb \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u00ab\u043a\u0440\u0430\u0441\u0438\u0432\u043e\u00bb \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u0440\u0438\u0432\u043e \u044d\u0442\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u0432 \u0441\u0432\u0435\u0442\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u041d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0431\u044b\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c DataAccess.<\/p>\n<pre><code class=\"java\">public class FuelItemDA {      private PrimaryIndex&lt;Long, FuelItem&gt; prIndex;     private SecondaryIndex&lt;Long, Long, FuelItem&gt; odometerIndex;     private SecondaryIndex&lt;Date, Long, FuelItem&gt; dateIndex;      private DatabaseConfig dbConfig;      public FuelItemDA() {         dbConfig = DatabaseConfig.getInstance();          prIndex = dbConfig.getStore().getPrimaryIndex(                 Long.class, FuelItem.class);          odometerIndex = dbConfig.getStore().getSecondaryIndex(                 prIndex, Long.class, &quot;odometer&quot;);         dateIndex = dbConfig.getStore().getSecondaryIndex(                 prIndex, Date.class, &quot;operationDate&quot;);      }      public void save(FuelItem item) {         Transaction tx = dbConfig.startTransaction();         try {             if (item.getId() == 0) {                 long id = dbConfig.getStore().getSequence(&quot;SPENT_ID&quot;).get(tx, 1);                 item.setId(id);             }             prIndex.put(tx, item);             tx.commit();         } catch (Exception e) {             e.printStackTrace();             if (tx != null) {                 tx.abort();                 tx = null;             }         }     }      public FuelItem load(long id) {         return prIndex.get(id);     }      public List&lt;FuelItem&gt; getItemsInDates(Date bDate, Date eDate) {         List&lt;FuelItem&gt; result = new LinkedList&lt;FuelItem&gt;();         EntityCursor&lt;FuelItem&gt; cursor = dateIndex.entities(bDate, true, eDate, true);         for (Iterator&lt;FuelItem&gt; iterator = cursor.iterator(); iterator.hasNext(); ) {             FuelItem spentItem = iterator.next();             result.add(spentItem);         }         cursor.close();         return result;     }       public void removeFuelItem(long id) {         try {             prIndex.delete(id);         } catch (DatabaseException e) {             e.printStackTrace();             prIndex.delete(id);         }     } } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0434\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0442\u043e\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f. \u0422.\u0435. \u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043a\u0430\u0442\u044c \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u043f\u043e\u043b\u0435\u0439, \u0442\u043e \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441.<\/p>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Berkley DB \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c Berkley DB \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<pre><code class=\"java\">@Persistent(version = 1) public class SpentItem implements Item{      @PrimaryKey(sequence=&quot;SPENT_ID&quot;)     private long id;     @SecondaryKey(relate= Relationship.MANY_TO_ONE)     private long odometer;     @SecondaryKey(relate= Relationship.MANY_TO_ONE)     private Date operationDate;     private double sum;      public long getId() {         return id;     }      public void setId(long id) {         this.id = id;     }      public long getOdometer() {         return odometer;     }      public void setOdometer(long odometer) {         this.odometer = odometer;     }      public Date getOperationDate() {         return operationDate;     }      public void setOperationDate(Date operationDate) {         this.operationDate = operationDate;     }      public double getSum() {         return sum;     }      public void setSum(double sum) {         this.sum = sum;     } }  @Entity(version = 1) public class FuelItem extends SpentItem {      private double count;     private double price;     private boolean full;      public double getCount() {         return count;     }      public void setCount(double count) {         this.count = count;     }      public boolean isFull() {         return full;     }      public void setFull(boolean full) {         this.full = full;     }      public double getPrice() {         return price;     }      public void setPrice(double price) {         this.price = price;     } } <\/code><\/pre>\n<p>  \u0412 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0435\u0440\u0435\u0437 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f:  <\/p>\n<ul>\n<li> \u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0411\u0414. \u0415\u0441\u043b\u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0442\u043e \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e. \u042f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 try\/catch \u0431\u043b\u043e\u043a \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 FuelItemDA.<\/li>\n<li> Primary \u0438 Secondory \u043a\u043b\u044e\u0447\u0430\u0445, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0442\u043e\u043c \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u043c\u0435\u043d\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 DataAccess<\/li>\n<\/ul>\n<p>  \u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f. \u0422.\u043a. \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0411\u0414, \u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0412 \u043f\u043b\u044e\u0441\u044b \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 SQlite \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u0432\u0438\u0434\u0435 SQL.<br \/>  \u0412 \u043f\u043b\u044e\u0441\u044b \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Berkley Db \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043f\u0440\u044f\u043c\u044b\u0435 CRUD \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0447\u0442\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0438\u043c\u0435\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0432\u0435\u0441, \u043d\u0435\u0436\u0435\u043b\u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u044b\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/172777\/\"> http:\/\/habrahabr.ru\/post\/172777\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430 \u00abHello World\u00bb \u043f\u043e\u0434 Android, \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 Android, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435. \u0418 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c c SQL. \u041f\u0440\u0438\u0432\u044b\u043a \u043a\u0430\u043a-\u0442\u043e \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438. \u041f\u043e-\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0440\u044b\u0441\u043a\u0430\u0432 \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0445 \u0441 Android \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0430\u0448\u0451\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u2014 Berkeley DB, \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0411\u0414.<br \/>  \u041f\u0440\u0438\u0447\u0451\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043e\u0442 Oracle \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 SQlite.\u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0434\u0430\u043b\u044c\u0448\u0435 \u043c\u043e\u0435\u0433\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043e\u043d\u043e \u0442\u0430\u043a \u0438 \u043d\u0435 \u0443\u0448\u043b\u043e) \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u044d\u0442\u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  \u041a\u043b\u0430\u0441\u0441 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u044f\u0434\u0440\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0441\u0434\u0435\u043b\u0430\u043d \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443 Singleton, \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-172777","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/172777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172777"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/172777\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}