filmov
tv
How to print RecyclerView content in a PDF file from your Android App? - Android 13 | API 33
![preview_player](https://i.ytimg.com/vi/DylqdqgvwSQ/maxresdefault.jpg)
Показать описание
In this video it shows steps to print the content of the recycler view content (images) in a PDF file page.
In this the Android App is developed in Android studio for Android 13 API 33 version.
It re-uses the recycler view part of code from my previously published video. The code is also available in the below link:
Complete source code and other details/ steps of this video are posted in the below link:
However, the main Java code is copied below also for reference:
public class MainActivity extends AppCompatActivity {
private RecyclerView recyclerView;
private RecyclerView.LayoutManager layoutManagerRecyclerView;
private RecyclerViewCustomAdapter recyclerViewCustomAdapter;
private File filePDFOutput;
@Override
protected void onCreate(Bundle savedInstanceState) {
new String[]{READ_MEDIA_IMAGES, WRITE_EXTERNAL_STORAGE},
PackageManager.PERMISSION_GRANTED);
// Liner Layout
// GRID Layout
StorageManager storageManager = (StorageManager) getSystemService(STORAGE_SERVICE);
Bitmap[] bitmaps = {bitmap, bitmap1};
recyclerViewCustomAdapter = new RecyclerViewCustomAdapter(bitmaps);
}
public void buttonPrint(View view) throws IOException {
PdfDocument pdfDocument = new PdfDocument();
1).create();
}
}
--
In this the Android App is developed in Android studio for Android 13 API 33 version.
It re-uses the recycler view part of code from my previously published video. The code is also available in the below link:
Complete source code and other details/ steps of this video are posted in the below link:
However, the main Java code is copied below also for reference:
public class MainActivity extends AppCompatActivity {
private RecyclerView recyclerView;
private RecyclerView.LayoutManager layoutManagerRecyclerView;
private RecyclerViewCustomAdapter recyclerViewCustomAdapter;
private File filePDFOutput;
@Override
protected void onCreate(Bundle savedInstanceState) {
new String[]{READ_MEDIA_IMAGES, WRITE_EXTERNAL_STORAGE},
PackageManager.PERMISSION_GRANTED);
// Liner Layout
// GRID Layout
StorageManager storageManager = (StorageManager) getSystemService(STORAGE_SERVICE);
Bitmap[] bitmaps = {bitmap, bitmap1};
recyclerViewCustomAdapter = new RecyclerViewCustomAdapter(bitmaps);
}
public void buttonPrint(View view) throws IOException {
PdfDocument pdfDocument = new PdfDocument();
1).create();
}
}
--
Комментарии