# data[].attributes.body
Code mẫu GET, POST, DELETE api

# data[].attributes.body
Code mẫu SQLite

# data[].attributes.attachment_link.readable_text
﻿package com.phuonglt.sqlite;

import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class MainActivity extends AppCompatActivity {
    String DBNAME = "DbContact.sqlite";
    private static final String DB_PATH_SUFFIX = "/databases/";
    SQLiteDatabase database = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        xulySaoChepDB();
    }
//==copy database
    private void xulySaoChepDB() {
        layDuongDanLuuTru();
        File file = getDatabasePath(DBNAME);
        if(!file.exists()){
            try{
                copyDBFormAsset();
                Toast.makeText(MainActivity.this,"Sao chép thành công", Toast.LENGTH_LONG).show();
            }
            catch (Exception e){
                Log.e("Lỗi:",e.toString());
            }

        }
    }

    private void copyDBFormAsset() {
        try{
            InputStream myInput = getAssets().open(DBNAME);
            String outputFileName = layDuongDanLuuTru();
            File f = new File(getApplicationInfo().dataDir + DB_PATH_SUFFIX);
            if(!f.exists()){
                f.mkdir();
            }
            OutputStream myOutput = new FileOutputStream(outputFileName);
            byte[] buffer = new byte[1024];
            int length;
            while ((length=myInput.read(buffer))>0){
                myOutput.write(buffer,0,length);
            }
            myOutput.flush();
            myOutput.close();
            myInput.close();

        }
        catch (Exception e){
            Log.e("Lỗi sao chép:",e.toString());
        }
    }

    private String layDuongDanLuuTru() {
        return  getApplicationInfo().dataDir + DB_PATH_SUFFIX + DBNAME;
    }
}

# data[].attributes.attachment_link.description
2018-08-09 - We've just started testing a new download server cluster. If anything seems weird with our downloads, please report it here. 2018-06-08 - We've just created a Patreon account. Please become a Patron of DB Browser for SQLite! :) 2018-06-02 - Windows MSI installers are now available on our nightly build server!