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!
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!
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:
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:
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.
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:
In order to use GreenDemy effectively (Phone authentication service),
you need to connect GreenDemy to Firebase. First go to
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:
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:
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
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!
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
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!
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