Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть How to create your PDF reader Android App? - complete source code

  • Programmer World
  • 2019-07-28
  • 7868
How to create your PDF reader Android App? - complete source code
androidsmartphonephoneappapplicationreadvoiceapeakaudiosoundnoiseconvertextractpassagestory
  • ok logo

Скачать How to create your PDF reader Android App? - complete source code бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно How to create your PDF reader Android App? - complete source code или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку How to create your PDF reader Android App? - complete source code бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео 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'
}

/************************************************************/

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]