Quick Start Guide

Last updated: 10th September, 2020, by Emenike Samuel

Introduction

GreenDemy is a learning app/platform that allows tutors and students to connect and learn via online videos or articles provided in the app.
GreenDemy supports videos of three kinds: YouTube, Vimeo and Server videos.
GreenDemy is subscription based app that allows tutors/admins to collect payment from learners.
GreenDemy supports in-app quiz/exam for students to test their knowledge of what they have learnt so far.
One good feature about GreenDemy is that it is Passwordless! This means your users/learners don't have to memorize or remember passowrds. GreenDemy eliminates the painstakingly typing of email and passwords in learning platforms; and most of all, GreenDemy is extremely very easy to use!

Features

  • Passwordless learning app
  • Video & Content based lessons
  • Multiple courses & course contents
  • Subscription based
  • Four payment gateways integrated (Paystack, PayUmoney, PayPal & Flutterwave)
  • Complete app with admin & student dashboards respectively
  • Online Exam/Quiz for learners
  • Block & Unblock users
  • Award free subscription to users
  • PHPMailer integrated. Server setup and Sendgrid setup included and explained!
  • Easy install
  • Beautiful interface
  • Well documented
  • Help included
  • Clean coded
  • ... and lots more! Check the app preview to see the rest of the cool features included; the demo app says it all!

Server Requirements

  • PHP 7.X +
  • CuRL support
  • PDO support
  • MySQL support

Backend Customization

Uploading Files, Creating & Connecting To Database

To get the backend script up and running you need to upload it to your cPanel (i.e your public_html folder or your domain's root folder).
To do this upload the GreenDemyBackend.zip file to your cPanel's public_html folder or your domain's root folder. After uploading and unzipping, you should see your files on your server as shown in the image below:



Next, create a database and upload the greendemy.sql file to your newly created database on your PHPMyAdmin dashboard



Next open the DB.php file in the classes folder in editor and change the following fields specified in the image below:


Our database has now been connected!

Setup Email Variables

In order for our app to send emails we need to configure the respective email variables needed to authenticate the sending of emails on our server.
How do we do this? Simply create an email on your cPanel or wherever and open the emailConfig.php file in the classes folder in an editor and change the variables specified in the comments in the image below:



Configure Payment Gateway Keys

The final thing we need to do to ensure our backend has been setup completely is to setup our keys for the payment gateways integrated in the project.


First we start with PayUmoney:
Open the PayUmoneyHash.php file and edit the file specified in the image below:
Next, we setup our Paystack Secrete Key in the PaystackPaymentVerifier.php file. This is shown below in the image:
Finally, for Flutterwave, we do same in the flutterwavePaymentVerifier.php file as shown in the image below:

We are now done with backend customization. But it is worthwhile to note/point one more thing out; our php.ini file!
Open your php.ini file and add the following configurations as shown in the image below and we are done:

App Customization

In this section we are going to see how we can setup the app project files, connect it to our backend files and to our Firebase account.

Importing project to Android studio

To import our project to Android Studio, first unzip the GreenDemyAndroid.zip to extract the app project folder. Now open Android Studio and click on the import option as shown below to import the unzipped project folder GreenDemy:


After successfully importing the project your workspace should be as shown below without any gradle/build errors:


Adding & Setting Up Firebase

In order to use GreenDemy effectively (Phone authentication service), you need to connect GreenDemy to Firebase. First go to https://firebase.google.com to open a Firebase account.
To add Firebase to your project, locate and click on the Firebase on the Tools option of your Android Studio. Check the image below for explanation:



This will open a window on the right side of your Android Studio workspace as shown below:



Locate the Analytics option and click on the Log an Analytics event. You should see a button that says Connect To Firebase, click on it and follow the resulting prompt/actions to connect your project to your Firebase account.
You can look up this blog post https://www.geeksforgeeks.org/adding-firebase-to-android-app/ how to import project to Android Studio for more guideline.

The last thing we need to do on Firebase is to add our app's Secure Hash Algorithms to our Firebase project settings. How can we achieve this?
First go to our Android Studio workspace and click on the Gradle option on the right; locate the signinReport report option and double click on it to run and generate our SHA-1 and SHA-256 fingerprints. Take note of these two fingerprints as we will use them on our Firebase console next. Descriptive images shown below:





Next we go to our Firebase console to add these records to our app settings.
Open your Firebase console/dashboard and navigate to Settings >> General and add the two fingerprints we've just generated above. Save your changes and we are done with Firebase setup. Image is shown below:



Changing Keys & Constants

In this section we are going to change some important keys in the app to your own keys. These includes payment gateway keys, constants, and database/server constants.
Navigate to Android Studio and open the Utils package. In here you can find and open the AppContants.java file which contains all the keys neccessary to run the app effectively.
In this file, the constants and keys to change have been commented so you can easily identify and change them with your own version of the keys and constants.
Skim through this file and change the respective constants and keys to your constants and keys. Image of the file is shown below:

Making App Country Specific (Optional)

By default there GreenDemy is available to anybody in any country. This means that people can signin into the app using their phone number via the internal format; i.e country phone code + phone number, for e.g +2349052554438 .
To restrict the app to only your country, simply set your country code in the AppContants.java file in the string COUNTRY_PHONE_CODE You must have done this above in constants and keys section.
Next open the Activities package and locate the Login.java file to edit this line (175 - 177) shown in the image below; the comment is very well descriptive:

This brings us to the end of making the app country-specific!

Renaming Package

It is required that every app on the Google app store have unique package names. This is what we are going to do in this section.

To do this, we first Un-compact the middle packages as shown in the image below:

Next, we have to change the havotek & greendemy package names. I'll demonstrate for havotek and you repeat the same process for the other greendemy package.
The image below explains the process; and when you are done, remember to Compact middle packages back again to in order to nest your middle packages (this is not really neccessary but, just that it makes your packages much redeable straightaway! )



Finally, we make our app level's build.gradle file to reference our new package name, otherwise we will encounter build errors!
Open your build.gradle file and change the previous applicationId to our new app package name. Image is shown below:



Now sync your project and run the app to your phone or emulator safely without any troubles!

How about generating a signed apk? Well, you can read up this blog post, https://medium.com/publishous/generate-a-signed-release-apk-file-in-android-studio-3ae4775beace to see how to do that!

This brings us to the end of our app customization!

Frequently Asked Questions

How do I notify users when a new version of my app is available on app stores?

Simply go to the Admin Settings section and update the Current app version field to your app's new version and you are done! All the users making use of the old versions would see a notification whenever they navigate to the Home screen on the bottom navigation.

Can I set payment option, currency and country code without touching any code?

Yes you can. Go to the About tab on the navigation. You should see a cog/wheel on the navigation bar; click on it to open the admin settings. The admin settings is where you configure most of the settings required to run the app effectively!

How do users know their plan is about to expire?

Users whose plan is about to expire are notified 7 days ahead of the expiration date so they would be aware and take neccessary actions on time!

Can users upgrade/renew their plan before expiration date?

Yes. Users can upgrade/renew their plan before the expiration date.

What happens when a user with N number of days upgrade/renew their plan?

Suppose a user/student has 5 days remaining and they upgrade/renew their plan to a plan of, 31 days validity say, their next plan expiration day would be 31+5 = 36 days added to the current day they upgraded their plan. That is their plan's leftovers are auto rolled over to the next plan!

Can users be blocked?

Yes. Users can be blocked and unblocked by the admin at any point in time. When a user has been blocked, they are automatically logged out of the app, and if they try to login again they would see a notification that their account has been blocked.

Support

Our team is working hard to answer all your questions and resolve all your issues through the envato comment system or via our direct Support Email