How to create pdf files in memory
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_pdftest);
    Button Btgerar = (Button) findViewById(R.id.gerarpdf);
    Btgerar.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            CriarPDF();
        }
    });
}
public void CriarPDF() {
    String FILE = Environment.getExternalStorageDirectory().toString() + "/PDF/" + "Ficha.pdf";
    EditText txt = (EditText) findViewById(R.id.editText);
    // Create New Blank Document
    Document document = new Document(PageSize.A4);

    // Create Directory in External Storage
    String root = Environment.getExternalStorageDirectory().toString();
    File myDir = new File(root + "/PDF");
    myDir.mkdirs();

    // Create Pdf Writer for Writting into New Created Document
    try {
        PdfWriter.getInstance(document, new FileOutputStream(FILE));

    // Open Document for Writting into document
        document.open();
        document.add(new Paragraph(txt.getText().toString()));


    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    }

    // Close Document after writting all content
    document.close();
    Toast.makeText(this, "PDF File is Created. Location : " + FILE,
            Toast.LENGTH_LONG).show();

    // Create new Page in PDF
    document.newPage();


}
}
</code></pre>

<p>I have declared in android manifest</p>

<p><code>uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE</code></p>

<p>and build gradle version is :</p>

<pre><code>compileSdkVersion 24
buildToolsVersion '24.0.0'
minSdkVersion 8
targetSdkVersion 24
</code></pre>

<p>The application can run normally, but can't create pdf file and I can't find.</p>