У нас вы можете посмотреть бесплатно How to create your PDF reader Android App? - complete source code или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
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: programmerworld1990@gmail.com 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' } /************************************************************/