ANDROID

How to Create PDF Reader App in Android Studio

How to Create PDF Reader App in Android Studio

Hello guys, in this post I came up with an easy solution for creating PDF reader application for Android device using Android Studio. PDF Reader is used to reading PDF documents, the extension (file format) for PDF documents is .pdf and 70% documents are developed as PDF document this increases the use of PDF reader App. So developing Android Application for PDF files will be beneficial for those developers who like to get more downloads for their App in Google Play Store.

Actually, I too added PDF reader feature in one of my Android App, you can download that app from play store BuzzMyCode and see how in real time the App works with PDF feature. The reason why I embedded functionality to read (Display) PDF within Buzzmycode App is to increase engagement of user significantly. In this tutorial you will learn how to make simple PDF Reader application in Android, this can be improved by adding more controls.

Step.1# Create a new Android Project in Android Studio with name BuzzMyCodePDFreader or you can assign any name to Project.

Configure Android Project

Configure Android Project

Step.2# Select Minimum SDK in Phone and Tablet as API 19: Android 4.4 (KitKat) as the lower version is used by few people and the main reason is that if we create App for lower version then it become more complicated with coding. So for basic app use API 19 and if you like to develop for lower version then please contact me.

Select Target Android Devices

Select Target Android Devices

Step.3# Now select the Empty activity, you can select any other activity if you know how to use it in coding.

Select Android Activity For Project

Select Android Activity For Project

Now you to edit two files one is present in Java folder and another one is Xml file which is in res folder (resource) if you are not able to locate this files then follow the path:

For Java file- ../app/Java/<your package name>/MainActivity.java

For Xml file- ../app/res/layout/activty_main.xml

Android Project File

Android Project File

Make sure you have a pdf file and copy that pdf file in assets folder, which can be created under res folder.

Step.4# Now edit MainActivity.java with the following code:

Step.5# And in activity_main.xml file add the following the code

Step.6# Finally in AndroidManifest.xml file which can be easily located in the manifest folder under app root folder, add the following line of code above opening application tag.

Here we had completed with our PDF Reader app, for detailed information regarding this tutorial you can ask in comment box. Keep sharing our tutorial with Android Developers.

5 Comments

5 Comments

  1. surbhi jain

    June 22, 2016 at 10:48 am

    I am not able to understand what it will do ..becoz when i am running this code it’s not showing anything

    • ALICIA LAUFER

      June 22, 2016 at 11:28 am

      Hi, just copy whole code and i think u forget to add PDF in libraries and the PDF path in CODE om line No 58
      File file = new File(“/sdcard/downloads/Example.pdf”);

  2. Vikki Asati

    March 3, 2017 at 12:28 am

    i did everything copy and attach pdf file in folder but when i run it it shows error that is Error:(32) Error parsing XML: not well-formed (invalid token)

  3. koklek

    April 7, 2017 at 12:23 pm

    Hi i would like to Create PDF Reader App with API 16(Jelly Bean). Can you guild me?

  4. Harshit Singh

    August 18, 2017 at 7:49 pm

    hey… is this pdf reader gonna support every pdf file or a specified one which is uploaded?

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

Buzzing your life from assorted Coding,tips and general life opinion. Made your life Buzz by BuzzMyCode articles, share with world.

What is Buzzmycode, we had started this website to give tech savy the new way of life by reading our fresh organic content on every technology and applications.

Copyright © 2017 SyncSaS. Theme by SyncSaS Themes, powered by BuzzMyCode.

To Top