Android MySQL Retrofit2 Multipart CRUD,Search,Pagination
4.3 (12 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
57 students enrolled

Android MySQL Retrofit2 Multipart CRUD,Search,Pagination

How to INSERT,SELECT,UPDATE,DELETE,SEARCH and PAGINATE Data, including images and text.
4.3 (12 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
57 students enrolled
Created by Clement Ochieng
Last updated 6/2020
English
English [Auto]
Current price: $12.99 Original price: $19.99 Discount: 35% off
13 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 11.5 hours on-demand video
  • 15 articles
  • 16 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • FULL CRUD : Performing INSERT SELECT UPDATE and DELETE against MySQL from Android
  • Retrofit2 MULTIPART : Upload/download/Update/Delete of images and text
  • PAGINATION : Server side pagination using 'Load more' technique.
  • SEARCHING: Performing server side Search, Render SearchView in ToolBar,Highlight Search Results
  • DESIGN : Splash Screen, Dashboard, Editing/CRUD screen, Lsting screen, Detail screen,CollapsingToolBar
  • DATA PASSING: Serialize Objects,Pass them to Activities and Deserialize them, Show them
  • SPLASH SCREEN: Use Animation class to load animations and apply them to widgets.
  • CUSTOM FONTS: Apply any downloaded Custom Fonts to an android application
  • PHP: Write Object Oriented PHP code that can perform all CRUD operations as well as search and page data
  • RECYCLERVIEW: With Letter Icons,Search capability, Scroll events,Images Text
  • Many more because we code in Realtime explaining line by line.
Course content
Expand all 184 lectures 11:38:58
+ FULL APPS CREATED SO FAR
7 lectures 00:37

Learn Full app Kotlin Android development involving several technologies.

CONCEPTS YOU WILL LEARN FROM THIS PROJECT

  1. Kotlin Programming Language

  2. Retrofit2(Latest version) - Multipart Uploads,Update,Downloads,Delete

  3. Object Oriented PHP + MySQL

  4. RedbeanPHP

  5. Memory and LRU Disk Caching

  6. Server side Pagination

  7. Capture images from camera,gallery,file picker and upload

  8. Several Page designs (Splash,Dashboard,CRUD,Listings,Detail)

  9. Swipeable Image slider - Carousel

  10. Runtime Permissions implemented

  11. Implement ClearText communication(Communication over non-secure http)

  12. Highly efficient app creation(We make single requests to server,cache data in both disk and memory,download data in small chunks)

Preview 00:03

This is the second app we create. In this part we will learn how to perform multipart uploads/update/delete/download. In short a full CRUD application but with images and text. User can pick images, type text then upload. Users can also view, edit and delete as well as search. This is a perfect template to use if you plan on using mysql with android especially as there aren't many online courses and tutorials that put it all together in an easy to follow manner.


FEATURES

  1. UPLOAD/DOWNLOAD/UPDATE/DELETE images and text to the server using Retrofit2

  2. Capture Photos directly from camera and upload.

  3. Replace existing images and text with new ones.

  4. Paginate data using load more technique. Control how many items you want per page.

  5. Beautiful UI with many activities already designed and working well.

  6. Show amazing image carousel/slider at the top of your recyclerview. The slider autoslides images. Images can also be swiped manually.

  7. Runtime permissions integrated.

  8. ClearText communication implemented. This implies it will support even non-https traffic.

  9. Updates almost every month. We keep on adding features and improving the app.

  10. Suggest us features you want integrated.

  11. More coming.




Preview 00:03

This is the first app we create. We do this in detail. It is perfect for absolute beginners. You will know how to create a full application that you can use to as a template in creating other apps. You can download the APK and test it. We are hosting a online test mysql database to start with.

Preview 00:04

This is a gift for you because you are dear to me. You've bought my courses so I have to give you some extras. This is an app that I have created and it's play store ready. Use it to learn the following:

  1. Kotlin Programming Language

  2. Clean Architecture

  3. Room

  4. LiveData

  5. ExpandableRecyclerView with images and text

  6. Single Page design


Preview 00:07

Am trying to say thank for purchasing my course by creating this project for you. This project is meant to teach you:

  1. Room Data Access Layer - Full CRUD

  2. Model View ViewModel

  3. LiveData

  4. How to import data from csv to room

  5. CarouselView

  6. Page creation and designs

It is basically a template. Be creative and turn it into your own idea app.

Preview 00:03
+ Introduction
1 lecture 08:54

Am showing you the preview of the app we will create in this course. In the process we will learn alot including but not limited to:

  1. How to use Retrofit to perform all the CRUD(Create Read Update Delete) operations against a mysql database. We do this by making HTTP POST and GET requests asynchronously. While performing this we show progressbar and handle response appropriately.

  2. How to perform a sever side search against our data and render the result in a recyclerview. I also teach you how to highlight search results. We render as searchview in the toolbar which the user can then use to search.

  3. How to perform a server side pagination using the load more technique. For this we will see how to listen to RecyclerView scroll events to assist us in pagination.

  4. How to create several re-usable screens using XML in android studio. These screens will include splash screen, dashboard screen, listing screen, details screen and editing screen. In the process we use several widgets like cardviews, datepickers, lovely dialogs etc.

  5. How to write quality Object Oriented PHP code that can listen, interpret our requests and return us a response which we can then process.

  6. How to use custom professional fonts in your android app. The fonts can be applied as per widget, per activity or to the whole application.

Preview 08:54
+ Setting UP XAMPP
3 lectures 06:09

This part is for you if you haven't used XAMPP before. I show you how to download XAMPP. XAMPP remember is our localhost server and will come packaged with Apache and MySQL.

How to Download XAMPP
02:19

This part is also for students who haven't used XAMPP before. Once you've downloaded and installed XAMPP, I show you how to start Apache and MySQL and explain what the two do for us.

How to Start XAMPP
00:55

This is part is for students who are not sure how to create a mysql database. We use a tool called PHPMyAdmin. This tool comes packaged with our XAMPP or WAMP server and allows us easily and visually create databases and tables. Am showing you how to do that in this lecture.

How to Create MySQL Database in PhpMyAdmin
02:55
+ PHP
10 lectures 27:28

In this class am showing you how to create an index.php file. It is onto these file that we will write all our PHP code. Am also showing you where to create the file. Am explaining and showing what htdocs folder is for XAMPP.

Create PHP File
01:37

We are starting serious business right in this lecture. Realtime coding. After this lecture you will know how to create a Constants class in PHP to hold database credentials.

Constants Class To Hold Database Credentials
01:36

In this class we are creating another class. This class will hold all our CRUD methods. After this lesson you will know how to create a re-usable method to establish a connection to MySQL database and return a mysqli instance. This method will be used by other methods to establish connection.

Connect to MySQL
01:48

Am teaching you how to insert data into mysqli database from PHP in an object oriented way. Am also showing you how to receive data sent via HTTP POST request from a client. Am teaching you also how to handle several responses based on the success/failure our insertion attempt.

INSERT into MySQL
03:35

After this class you will know how to:

  1. Receive data sent from a HTTP POST request by client.

  2. Write SQL statement for updating data.

  3. Encode an array into JSONObject that we then send to the client as a response for it's update request.

UPDATE Data in MySQL
02:37

In this class we delete data from mysql. After this class you will know how to:

  1. Receive the id of the row to be deleted.

  2. Write an SQL statement for deleting data, including that id.

  3. Execute our delete query.

  4. Send a response to the client based in success or failure.

DELETE from MySQL
02:06

Am teaching you how to select all data/rows from mysql table using PHP. After this class you will know how to:

  1. Write SQL select all statement and Execute it.

  2. Hold the result in an array and alongside a response code and message.

  3. JSON Encode that result into a JSON Object and print it out for the client.


SELECT from MySQL
02:55

In this class we write one method that will do for us both search and pagination in mysql. After this class you will be able to:

  1. Receive search Query and Pagination parameters from the client.

  2. Apply these into a SQL statement, against multiple columns as for the search.

  3. Return a response to the client based on his search and pagination requests.

SEARCH and PAGINATE in MySQL
05:02

We write a method to act as our controller. After this class you will be able to:

  1. Listen to incoming HTTP requests, categorize them and call the appropriate method.


Handle incoming HTTP Requests
04:53

In this class we perform a simple HTTP GET request test. By doing this we will be able to ascertain that atleast our database credentials are correct and we can move then to android.

Test MySQL Connection From PHP
01:19
+ Start Here
2 lectures 09:55

In this lesson we create an android studio project. After this class you will be able to:

  1. Create an empty android studio java project.

Create Android Studio Project
00:44

This lesson is all about gradle and our app's dependencies. I talk about all the libraries we will use and why. After this lesson you will be able to:

  1. Install dependencies into your project.

  2. Know about certain android libraries and why to use them.

Add Gradle Dependencies
09:11
+ Let's Prepare Resources
3 lectures 10:36

Here we basically add drawables/images into our drawables directory. These are the images and icons we will use   in our project.

Adding Drawables
00:51

In this class we create the menu items we will show in our toolbars. Then later on when those menu items are clicked/selected we will see how to handle those events and perform certain operations

Menu Resources
04:41

This class is all about our value resources. These resources include:

  1. Colors - many color definitions in their Hex format. We will use these in several places in our app like toolbars and backgrounds.

  2. Strings - The static strings like the app name.

  3. Styles - I tell you how to create custom styles by deriving from existing styles.

  4. Arrays - To hold our array of colors. We will use this array in our adapter to set random backgrounds to our material letter icon.

Value Resources
05:04
+ How to use Custom Fonts
3 lectures 07:08

The video tells you the objectives we will aim to achieve practically. That is am showing you the part of the app that this section will allow us create.

Preview 01:52

How to add custom fonts in the assets folder. Then we will load the font that we want to use globaly(default font) in our next class.

Adding Downloaded Fonts in the Assets Folder
01:56

In this lesson we cover the App class. This is a global class to our android app and is actually an android component. I show you how to initialize Calligraphy in this class.

Initializing Calligraphy in the Application Subclass
03:20
+ How to Create a Professional Splash Screen for our app
3 lectures 10:19

This is a preview of this section's Objectives, visually. Basically the splash screen we will be creating and how it works visually.

Preview 01:24

After this class you will learn:

  1. How to design a splash screen in XML.

How to Design the Splash screen in XML
02:05

After this class you will learn:

  1. Load animations using the static loadAnimation method of the Animation class.

  2. How to apply the top to bottom and fade animations to imageview and textview respectively.

  3. How to sleep a thread for a custom amount of time then open our dashboard page.

How to apply the animations in Java then Open another activity
06:50
+ Creating Our Model Classes and RESTApi interface,using them with Retrofit
3 lectures 26:32

I had told you that we will be performing CRUD operations. These operations I said are very fast and work smoothly. I said we are using Retrofit as our HTTP Client. This is a preview of how those operations work visually in this app before we sink into coding them.

Preview 06:29

We first need to define our model class. This is our data object or java bean if you like. Here I show you how to:

  1. Make a class/object serializeable using the Serializeable interface in the java.io package.

  2. I explain why we are making it serializeable.

  3. I show and explain the @SerializedName attribute, and why we decorate our model fields with it.

Scientist.java - Our model class
04:27

We code this interface to define methods that will act as our RestAPI methods. We use special Retrofit attributes to designate them HTTP request types. These method include:

  1. Method for retrieving data via HTTP GET request.

  2. Method for inserting data via HTTP POST request.

  3. Method for updating data via HTTP POST request.

  4. Method for deleting data via HTTP request.

  5. Method for searching and pagination data via HTTP POST request.

We pass them fields to be sent to the server, however they are abstract and we use special Retrofit attributes to empower them.

RestAPI.java - Our REST API interface
15:36
+ Let's Create Re-usable Utility Methods
9 lectures 36:43

Am spending these 9 minutes showing you visually some of the features our utility methods will perform for us. Those methods will be static will be re-usable throughout the application. This saves us time and from typing repetitive code.

Preview 09:32

Let's create our Utils class to hold those methods. Then am showing you how to obtain your computer's ip address and some of the addresses you can use as well depending on the emulator you are using for testing the app.

Utils.java - Constants, Getting our IP Address
04:56

In this class you learn:

  1. How to instantiate Retrofit and assign it a converter factory.

  2. What is a converter factory and why it.

How to instantiate Retrofit and add Converter Factory
02:18

In this class you learn:

  1. How to create a utility method to show us Toast messages throughout our app.

  2. How to validate edittexts throughout the whole app using one method.

How to Create a Toast, How to Validate EditTexts
05:14

In this class you learn how to open another activity.

How to Open another Activity
01:14

Am showing you in this class how to:

  1. Create a re-usable Materrial Dialog using the  LovelyDialogs library. This is an info dialog to show any information including errors throughout our app.

How to Create a Material Lovely Info Dialog
04:18

In this class you will learn:

  1. How to create a re-usable material single choice dialog. That dialog allows users to select one item from an arbitrary number of items in a list. Then the selected item gets automatically displayed in an edittext.

How to Create a Material Single Choice Dialog
02:29

Here am showing you how to:

  1. Convert a string into a date safely without crashing the app.

How to Convert a String to a Date safely
01:19

Here am creating two static re-usable methods showing you:

  1. How to send a serialized object to another activity.

  2. How to receive the serialized object and deserialize it.

How to send and receive serialized Objects across activities
05:23
Requirements
  • Be able to use android studio
Description

LATEST PROJECT - Retrofit CRUD Multipart Image Upload/Download

Making any type of Software is all about data manipulation, be it pixels, images, text. Being able to write to and read from a database is therefore of paramount importance if you desire to create any meaningful app. Unfortunately there are surprisingly not many android tutorials online that give you an all in one solution for this.

I have been making apps for several NGOs here in Nairobi,Kenya and mostly I use MySQL, sometimes Firebase. Hence I have decided to produce a course to make working with MySQL and performing HTTP requests as easy as possible yet robust enough to be used in production.

Main Things You Will Learn


This course aims to teach you the following:

  1. How to Perform all CRUD operations against MySQL: INSERT SELECT UPDATE DELETE.

  2. How to perform a fast server side search and pagination.

  3. How to use retrofit as all in one solution HTTP Client  to make HTTP Requests in the background thread.

  4. How to write Object Oriented quality PHP code to perform CRUD, search and pagination for students coming from Java background who find most PHP code in the web weird and dirty looking.

  5. How to design and incorporate splash screen, dashboard, detail pages, data entry pages and listing pages into a an app.

  6. How to Create a reusable real world app template that can be modified by inexperienced programmers.

  7. The process of coding a full app in realtime.

My Style of Teaching

I have done many tutorials in YouTube in Java,Android and C# mainly, so am able to take students through a full course, covering everything, emphasizing important part yet moving at an amazing peace.

My courses assume no experience at all in app creation. Maybe my only assumption is that you can install android studio. Hence beginners can find this course very important. Intermediates can also benefit from this course as we cover several intermediate topics like Making HTTP requests and achieving pagination and search highlighting.

We code line by line and at the same time narrate and explain. We explain method by method.


What Can I create after this course?

Any app that involves CRUD. Your imagination is your limit.

For example recently I have used this template to create for a client an app. I will also be using this as a template to create other mysql apps as well as Firebase. Hence if you follow this course keenly, you will be able to create any type of app that involves CRUD.

Your app will be able to perform reliably in production. Your app won't crush as we have handled exceptions reliably. For example if there is no connection or user enters wrong data. A beautiful dialog gets shown to the user informing of him of the error.

The app will be very fast, no matter how many hundreds of thousands or millions of rows you have. This is because the app doesn't download all data at once. Instead short HTTP requests are made as the user scrolls through the recyclerview. The pagination takes place at the database engine level which is heavily optimized. The client downloads just a small chunk of data weighing a few bytes.

Your users will be able to take advantage of a search feature that doesn't slow your app. This because the search also occurs at the database level.  This is a multi-column search, hence you can add as many columns in as you want. I have used two columns as an example in this app.


What if I don't know PHP? How will I maintain the app?

Well you are in luck. The PHP code is the easiest to understand code you will ever find especially if you are a Java/C#/Python developer. It's completely Object Oriented and is written in a single file. That file has only two classes. One class where you add the database credentials and the other class performs all the CRUD operations. All you will need to do is replace the table name and database name.


What Technologies does this course teach and Why?

The technologies that we use to create this simple app. And we cover them in a practical manner by coding.


1. Retrofit

We use it as our HTTP Client. It takes advantage of GSON as a dependency, using it to map our JSON data to our model classes. Thus this saves us from having to use JSONArray and JSONObjects to parse our JSON data.

Moreover Retrofit allows us uniquely map our HTTP requests using an interface. This gives us a higher level of abstraction and makes our code maintenable and clean.

We use it's enqueue method to queue and asynchronously send our HTTP requests. Thus we are liberated from having to deal with AsyncTasks here and there.

Retrofit also allows us abstract our response from the server easily in a response model class. Moreover handling of Failure is abstracted away for us, thus we only have to log or show the exception message. No more try--catch blocks.

2. RecyclerView

It's the most powerful adapterview in android. It's more powerful and flexible than ListView. We rely on it's onScroll events to do our pagination.

We will use it almost all our upcoming courses.

3. CollapsingToolbarLayout

It's great and beautiful. It allows us show an image on top. It gives our app material design feel.


4. LovelyDialogs

Rather than showing exceptions and warnings in toasts, we use the lovely dialogs. I will use this library in many of my upcoming courses. It's beautiful and is easy to wrap in a utility method that can then be invoked from anywhere.

Moreover it gives almost 4 dialog options: info,single-choice,multi-choice and input. It allows us easily align the dialog contents, control number of buttons shown, assign custom dialog images and handle onclick events.

5. Calligraphy

For your app to dominate play store you need the app to feel and taste nice. Fonts will make massively help with that. However not old fonts like sans serif and Times New Roman. We need custom fonts. Those you can download from the web.

Calligraphy is the best custom font library. I show you how to use it to load any font throughout your app or in individual widgets.


Do you provide support?

Obviously. I come from a YouTube background so am used to providing support to my students. I also welcome suggestions to improve myself as I enjoy learning, sharing and growing.

Who this course is for:
  • Beginner and Intermediate Android students
  • Students who want a reusable template to create full app