How to create your PDF reader Android App? - complete source code
This video shows simple steps to create your own PDF Reader Android App. You can create your own PDF reader App which will read out the text in any PDF file. This App uses TextToSpeech method to convert the text to speech and speak out in the locale language you have set in your App. To watch and understand the TextToSpeech command please watch my Youtube video at: • How to convert Text to Speech in your Andr... To read the PDF it uses PdfReader and PdfTextExtractor which are a part of itextpdf package. So, please ensure to have the following line of code in your gradle and sync the gradle to have the package available for your in your App code. implementation 'com.itextpdf:itextg:5.5.10' To get the steps to create a PDF file from your App, please refer to the below video: • How to create PDF file in your Android App... We will be glad to hear from you regarding any query, suggestions or appreciations at: [email protected] https://programmerworld.co/android/ho... The complete source code is being pasted below: //****************MainActivity.java ************** package com.example.mypdfreader; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import android.Manifest; import android.content.pm.PackageManager; import android.os.Bundle; import android.speech.tts.TextToSpeech; import android.view.View; import android.widget.TextView; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.parser.PdfTextExtractor; import java.io.File; import java.io.IOException; import java.util.Locale; public class MainActivity extends AppCompatActivity { private TextView textView; private TextToSpeech textToSpeech; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = findViewById(R.id.textView); textToSpeech = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() { @Override public void onInit(int i) { textToSpeech.setLanguage(Locale.US); } }); ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, PackageManager.PERMISSION_GRANTED); } public void readButtonOnClick(View view){ File file = new File("/sdcard/myPDFFile.pdf"); String stringParser; try { PdfReader pdfReader = new PdfReader(file.getPath()); stringParser = PdfTextExtractor.getTextFromPage(pdfReader, 1).trim(); pdfReader.close(); textView.setText(stringParser); textToSpeech.speak(stringParser, TextToSpeech.QUEUE_FLUSH,null, null); } catch (IOException e) { e.printStackTrace(); } } } /***************** Gradle (App) file *************************/ apply plugin: 'com.android.application' android { compileSdkVersion 29 defaultConfig { applicationId "com.example.mypdfreader" minSdkVersion 26 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' implementation 'com.itextpdf:itextg:5.5.10' } /************************************************************/

How to convert JPG image file into PDF file in your Android App? - complete source code.

Unbelievable Smart Worker & Hilarious Fails | Construction Compilation #7 #adamrose #smartworkers

How to create or generate QR (Quick Response) Code in your Android App? - complete source code

Unbelievable Workers | Working with Talented Engineers #46 #fail #adamrose #smartworkers

Backend web development - a complete overview

How to share file or text on gmail, whatsapp, sms, Bluetooth from your Android App (share button)?

How to create background process in your Android App?

God Says:"I JUST CONFIRMED — ONLY YOU CAN SEE THIS LETTER"/God Message Now/God Message

If This Video Appears In Your Life, The Entire Blessings Of The Universe Will Come To You - 963Hz

3 Hours of Creepy Minecraft Theories to Fall Asleep to

How to create your Optical Character Recognition (OCR) Android App and convert the text into speech?

Android PDF Reader App - Part 1/2 | Load all PDF Files in Recycler View

How to adjust the volume of your Android Phone programmatically from your App? - Source code

How to implement fingerprint biometric authentication in your Android App? - complete source code

How to create your own Compass Android App using Magnetic Field and Accelerometer Sensors?

Turn Off This Parasite on Every Phone! Developers Don’t Want You to Know This

How to fetch data from SQLite database and put that in a PDF File in your Android App? - source code

Creating PDF Reader App - Mastering Android Course #39

How to download files from Firebase Storage to Android device | Simple and easy tutorial

