Android S7E4 : PHP MySQL - PDF Viewer with GridView

preview_player
Показать описание

In this tutorial we will see how to select PDF documents from mysql database, list them with images and text also from mysql database and render the PDF Document in a new activity for reading.

We will store PDF documents, PDF images, PDF name, description and author in mysql database. Then these will be downloaded and shown in a custom GridView with images and text. When the user clicks a single PDF document, we will render it internally with the android pdf viewer library.

As we download PDFs from our mysql we will be showing a progressbar. The PDF documents get downloaded from php mysql server in a background thread so our app will remain responsive throughout.

What is a PDF ?
PDF stands for Portable Document Format and is basically a file format for rendering documents including text formatting and images.

That file format can then read independent of application software, hardware and even operating systems. It's portable.

What is GridView?
A view that shows items in two-dimensional scrolling grid. The items in the grid come from the ListAdapter associated with this view.

What is a Database?
A database, generally speaking, refers to any organized collection of data

What is MySQL ?
MySQL is an open source, multithreaded, relational database management system created by Michael “Monty” Widenius in 1995.

Many businesses these days develop and maintain custom software with MySQL. Additionally, majority of the most popular websites(e.g Wikipedia) and software use MySQL for their database.

MySQLi
PHP has mysqli extension which allows us to access the functionality provided by MySQL 4.1 and above.

As an extension, mysqli exposes APIs to the PHP programmer, to allow us work with MySQL database programmatically.

Insert PDFs to MySQL
Well we now need to insert our pdf details into mysql database. For this app, we'll assume that this is done at the server level, maybe via some web interface. We are not uploading PDF documents from the device to the PHP server then downloading them again.

What is PHP?
PHP is a server-side programming language used for creating dynamic websites and interactive web applications.

The acronym PHP originally stood for Personal Home Page, but as its functionality grew this was changed to PHP: Hypertext Preprocessor.

WHAT WE LEARN IN THIS TUTORIAL:
1. Select PDF Documents from PHP MySQL database and show them in gridview.
2. Save PDF documents in mysql database.
3. Android PHP MySQL tutorial.
4. Android PHP MySQL GridView tutorial.
5. Android PDF Viewer example.
7. Fast Networking Library mysql.

Let's start.
Рекомендации по теме
Комментарии
Автор

GET RE-USABLE FULL APP TEMPLATE - Create any CRUD app you like.

Oclemy here guys. I have just released a much needed course for performing all CRUD operations, search and pagination using Retrofit against MySQL. I have designed this to be a full working app that you can use as a template.

TARGET STUDENTS:
1. Beginners/Intermediates who want to create their first full app.
2. Programmers who want a practical guide to master Retrofit.
3. Students who have a looming assignment/project and want a quick easy to understand project they can modify.
4. Anybody who wants to create a full CRUD app based on any idea.

WHERE IS IT?

I have just released it in udemy course. It's a 70 lecture practical step by step guide, realtime coding from scratch as we explain. It's the only Android MySQL CRUD course on udemy.

WHY GET IT NOW?

2. Next week am releasing a version for Firebase with Images/Text Full CRUD with pagination and search, You will get source code for that for free before I upload it to udemy.



ProgrammingWizards
Автор

Awesome bro 🥰
But your source code link not working .
How can I get the source code ?

manjilapp
Автор

Why do I have to download the pdfs Everytime i run the app, can it be possible to just download it once? How can i do that? Thanks.

tangxi
Автор

thanks bro... with this app if i change the pdf files in database the other users of the app will see the changes??i mean new pdf ???

ttmans
Автор

can the user also download the pdf to store it in the external storage (phone), or we need to add another library or codes?

techwithjovi
Автор

can you use Firebase instead of mysql?

musicalharmonics
Автор

Will an admin be able to add new pdfs or delete some old pdfs for the users and can it be shown to the users on the app accordingly?

ArunKumar-pqyj
Автор

Hello brother, can you help me, I want to ask you some questions

ahmedmuntaser
Автор

Excellent tutorial!!! How can I download different pdf from different buttons, from another activity?. For Example, when pressing a button from activity 1, this download from the server the PDFs in another activity, but when pressing another button from activity 1, download from server others PDFs. Thx.

williamsdazarola
Автор

final String path declare in ("PATH"); ?


.fromDirectory("My_PDFs", FileLoader.DIR_INTERNAL).... "My_PDFs"...?...plz help

rakeshkhandare
Автор

bro thanks wonderful and helpful tutorial bro can i use other fields like power point or Word Document automatically or we need other trig to fetch those data thanks for your support and for your quick reply .

mohamudosmanhamud
Автор

What is the approximate size of the app does it get large as we have downloaded many books..?

ArunKumar-pqyj
Автор

fromDirectory("My_PDFs", FileLoader.DIR_INTERNAL).... "My_PDFs"...?..what is this directory and where can I put it ?pleases help me I need answer

fatimahalyami
Автор

E/PDFView: load pdf error
java.io.IOException: cannot create document: File not in PDF format or corrupted.

hhegpsc
Автор

Please make a video how to print pdf through printer ...

RavindraSingh-fwdy
Автор

URL does not work. even PHP script is not available

sashashamsia
Автор

How can I perform the sql statement using a where, leaving something like this:

static $ SQL_SELECT_ALL = "SELECT * FROM pdfTB where name = '?' ";

and calling a variable $ author = $ _GET ["name"]

gerardoalainloredomoyeda
Автор

Hi, I’ stuck with this 3 errors:

error: missing method body, or declare abstract
error: method does not override or implement a method from a supertype
error: cannot find symbol method onCreate(Bundle)

wanahmadshailfulddeenbinwa
Автор

How to replace local host for run application on mobile phone

sanjeevkumarsingh
Автор

Unsuccessful error how to debug that error. Please dubug that error.

sanjeevkumarsingh
join shbcf.ru