LibGDX Android Studio: Download and set up a new LibGDX Project

LibGDX android Setup

Hey fellow developers!

Welcome to the beginning of LibGDX for Android tutorials. In this tutorial, you will learn how to download, setup and create a new LibGDX project in Android Studio.

At the end of this tutorial, you will:

  1. Download LibGDX
  2. Setup LibGDX
  3. Create a new LibGDX project in Android Studio

So lets get Started!


Download LibGDX

First of all, lets download LibGDX. (I am assuming that you already have Android Studio.)

  1. Go to official LibGDX website.
  2. Go to Download
  3. Download (Duh!)
  4. And open the folder

This process is given here

 LibGDX Android Studio - Download

Now, we will setup LibGDX for our project.


Setup LibGDX

Now, we will setup the LibGDX project using the downloaded gdx-setup.java file.

  1. First of all, fill in the basic project information
    1. Run gdx-setup.java
    2. Provide your Project name.
    3. Provide package information according to your settings
    4. Game Class is the java class file name that you will eventually be working with.
    5. Destination is where you will work on your project.
    6. Android SDK is where your Android SDK is installed. Give its path.
  2. Sub-Projects is where you provide the platforms that you wish to support.
    1. Chose Android
      (Only because this is an android based tutorial. But you are not limited to that.)
  3. Extensions is where you tell the setup what extensions to load.
    1. For simplicity, just chose Box2d
      (you can learn more later)
  4. Press Generate
    1. Wait until the download completes.

Here is the screen shot of my completed setup.

This entire process is given below.

 LibGDX Android Studio - Setup

Now, we will open this project in Android Studio


Open in Android Studio

Follow these steps to load the LibGDX project in Android Studio

  1. Open Android Studio
  2. Click Import Project
    • Here is how
  3. Give path to the LibGDX download location (which you provided in setup) and press OK
    • Here is how
  4. Wait till the project is loaded in Android Studio

This entire process is given below:

LibGDX Android Studio - Load project in Android Studio

This is it. You have just loaded LibGDX in Android Studio. Now lets run it in Android Virtual Device 😀


Run LibGDX in Android Virtual Device

Follow these steps to run your new LibGDX project in AVD

  1. Launch your Android Virtual Device (AVD)
  2. Press the Run button in Android Studio
  3. Now, the app will run on your AVD. Done!

This process is given below:

LibGDX Android Studio -Launch app in AVD

This is it. You have just created and run a new LibGDX project in Android Studio.

Lets draw some shapes in the next tutorial.

Return to the LibGDX Tutorials

Use OpenCV to show camera on android App with correct orientation

Return to OpenCV 4 Android Tutorials List

In this series of tutorials, you are learning OpenCV for Android using Android Studio. So far, you have made a working OpenCV Android Studio Project containing OpenCV module.

In Here is the overview of what we are going to achieve:

  • Create an OpenCV for Android Project (As in previous tutorial in this series) (Here)
  • Show Camera on the Screen
    1. Edit Manifest
      1. Add permission to allow camera.
      2. Support various screen sizes and adaptability of camera.
      3. Use specific features of the camera.
    2. Add a custom Layout show_camera.xml to display camera in it.
    3. Edit MainActivity_show_camera.java 
      1. Import required android classes
      2.  Import OpenCV classes
      3. Connect to OpenCV manager
      4. Initiate LogCat to log events of out app
      5. SHOW CAMERA ON LAYOUT
      6. Corrected Orientation (portrait)

Trust me, it is very simple to do. Lets do it!


 

Manifest.xml

We need to edit the AndroidManifest.xml file like following:

  1. Allow permission to use camera
  2. Allow camera to optimize to the dimensions of the device in use
  3. Use Front camera and autofocus of camera :S

The Manifest.xml file in its entirety is given here

 

This entire process is given here:

Show camera on android App using OpenCV for Android - Edit Manifest

This is all you need to do in AndroidManifest.xml


Create a new layout (show_camera.xml )

Now in your project, do the following:

  1. Create a new layout called show_camera.xml
  2. Add the following code it to:

    Note that the JavaCameraView has the id of show_camera_activity_java_surface_view

This is given below:

 


MainActivity_show_camera.java

Import the following Android Classes in your MainActivity_show_camera:

Import the following OpenCV classes in your MainActivity_show_camera:

Now, lets work with the MainActivity_show_camera Class 🙂 (Code in the end). I will explain every line of OpenCV code in detail.

  • Implement the OpenCV class CvCameraViewListener2 to allow OpenCV to communicate with android camera functionalities.

  • Declare the following items in the class
  • Now, lets call OpenCV manager to help our app communicate with android phone to make OpenCV work

    • CameraBridgeViewBase mOpenCvCameraView
      This variable acts as a bridge between camera and OpenCV library.
    • BaseLoaderCallback mLoaderCallback = …..
      Well, once OpenCV library is loaded, you may want to perform some actions. For example, displaying a success or failure message.
  • Initiate the LogCat
  • Now, when the activity is created, display the OpenCV camera in the layout. show_camera.xml.
  •  The following three functions handle the events when the app is Paused, Resumed and Closed/Destroyed
  • Now, we will do two main things:
    • Receive Image Data when the camera preview starts on your screen 😀
    • Destroy image data when you stop camera preview on your phone screen
    • Now, this one is interesting! OpenCV orients the camera to left by 90 degrees. So if the app is in portrait more, camera will be in -90 or 270 degrees orientation. We fix that in the next and the most important function. There you go!

The entire code is given below:

The entire process of editing MainActivity_show_camera.java is shown here:

Show camera on android App using OpenCV for Android - MainActivity_show_camera


Note: The camera disorientation problem is a bitch an issue not to be takien lightheartedly. Thanks for noting.

This concludes this tutorial, now that you have created a camera app, it is now time to continue this and perform more Computer Vision! In the next tutorial, I will draw a simple object on the screen. Be sure to check out the list of OpenCV for Android tutorials for latest tutorials.

Thanks for reading, and please share and comment if this helped and to share your ideas and opinions.

Return to OpenCV 4 Android Tutorials List

Creating a new OpenCV project in Android Studio

Return to OpenCV for Android Tutorials List

In this tutorial, we will create a new OpenCV project in Android Studio. Since you have everything downloaded already, we are ready to move on. By the end of this tutorial, you will have a new project set up, which you can use to build your projects upon. So lets do some CV!

Note: This tutorial has been tested on Android Studio 1.5 and 2.0

In short, the steps are, (2) Create simple project. (3) Import OpenCV SDK as a Module in Android Studio. (4) Set OpenCV Version. in Project (5) Fix Library association in project. (6) Done! Now actual OpenCV code can be written in future. The longer and detailed guided tutorial is given below.

  1. I beg you to open Android studio.
  2. Create a new project
    • I named it “OpenCV_Test”. (It could be different in the following GIF)
    • Minimum SDK is “API 19: Android 4.4 (KitKat).
    • Default Activity is “Basic Activity” (easily changeable later on)
    • Activity name is “MainActivity” (i.e. default settings)
    • I have shown the entire process in this GIF.
      Android-Studio-Create-New-Project
    • After pressing Finish, Gradle will perform some processes and eventually, you will be presented with your Android project.
    • Now, we can start importing OpenCV into the project.
  3. Import the OpenCV for Android SDK module in Android Studio.
    • To import the OpenCV SDK as a module in your project, go to File>New>Import Module.
    • Then Give path to your OpenCV as ..\OpenCV-android-sdk\sdk\java
    • You can chose to modify your module’s name.
    • Press Next and Finish the Dialogue.
    • The entire process is given here:
      OpenCV-Android-Import-Module-Android-Studio
    • Note that in the end, there are some errors in the code as well as the console. This is because you need to fix the Version number and link the libraries with your own project. This is shown in the next two steps.
  4. In this step, we will fix the Android Project SDK information in the OpenCV build.gradle file.
    • In project explorer, switch to Project view.
    • Go to OpenCVLibrary300 > build.gradle file and open it.
      • I have updated the contents of the file with the following code
      • Note that the android project’s SDK information can be obtained from the project’s own build.gradle file.
    • Once the Android SDK settings are updated, press “Try Again” button.
    • This entire process is given below:
      OpenCV-Android-Update-DefaultProject-SDK-Information
    • Now. we need to fix library association.
  5. Looking good so far! We now need to make sure that the OpenCV for Android libraries are associated with our Android Studio project. Currently, Android Studio will not recognize the OpenCV code that we type in our files. We fix this as follows.
    • Go to File>Project Structure.
    • When window opens, under Modules, select app.
    • Click Dependencies.
    • Click +.
    • Select Module Dependencies.
    • (In my case) Select :openCVLibrary300.
    • Press Ok and Ok.
    • After a few seconds, the libraries will be associated with your Android project.
    • This entire process is shown here:
      OpenCV-SDK-library-association
    • You can now write more OpenCV code in future in the same project.
  6. We did it! Project is ready for future OpenCV development.

This concludes this tutorial. You are now ready to start making your own Android Studio Project that consists of OpenCV SDK features limited only by your imagination. In the next tutorial, I will SHOW CAMERA on android app screen using OpenCV. Make sure that you read it. Do not forget to SHARE this post and write your opinions, ideas and views  in the  COMMENT  section below.

Thanks for reading :). Please like my Facebook page and follow my Twitter for more tutorials.

Return to OpenCV for Android Tutorials List

OpenCV SDK for Android File Structure

OpenCV for Android SDK file structure

Return to OpenCV for Android Tutorials List

In this tutorial, you will learn about the file structure of OpenCV SDK for Android. The information here is very short and lacks details. My purpose here is to provide just enough information to get going with the rest of the tutorials. I highly recommend reading more about the folders, algorithms, libraries and classes on your own.

OpenCV-for-Android-filestructure

So you have downloaded SDK but you may be curious what the SDK files do. Lets see to that now. You can skip this tutorial if you are interested in going directly to the development.

When you extract the “OpenCV-3.0.0-android-sdk-1.zip” from the precious tutorial, you will get a folder /OpenCV-android-sdk/.

Inside the /OpenCV-android-sdk/ folder, you will see:

  • /apk/
  • /samples/
  • /sdk/
  • LICENSE
  • README.android

Lets look at these in detail.

OpenCV for Android SDK file structure
OpenCV for Android SDK file structure
S.No
Name
Description

1

/apk/ This folder contains OpenCV manager API for different android device architectures. Chose the .apk file which is supported by your android device. Or simply download one from Google Play Store because that way, you will be downloading the apk file that is supported by your device/

2

/samples/ This folder contains sample android apps that you can install into your android device to test features of OpenCV. Also note that the source code of each sample is included in the /samples/ folder. It is a good place to start.

3

/sdk/ THE BRAINS OF OpenCV is here. I will explain about this folder below.

4

LICENSE Well, it can’t be said more precisely than what is written there as “By downloading, copying, installing or using the software you agree to this license.If you do not agree to this license, do not download, install,

copy or use the software.”

5

README.android Contains a link to online documentation, resources and feedback. Quiet handy!

http://opencv.org/platforms/android.html

Now that the root file structure of OpenCV is out of the way, we can now take a look at the SDK folder contents to give you the idea of what exactly what it and its contents do.

The /sdk/ folder contains the OpenCV API and libraries that will be used in your android project. You need these to perform all the functionalities that OpenCV offers in order to help you perform your Computer Vision related job.

Inside the SDK folder, in my case, there are three folders:

  1. /sdk/etc/
  2. /sdk/java/
  3. /sdk/native/

Lets look at the contents of SDK folder here:

S.No Name Description
1 /sdk/etc/ This folder contains the “memory” of OpenCV. Memory being like the brain-memory :D. See, as the time passed, the geniuses who made OpenCV for us to feast upon collected data and fine-tuned it for algorithms to use. That data is kept here.

For example, face detection requires some data which is compared with the picture snapped by your x-megapixel camera. That data is kept inside this folder.

2 /sdk/etc/haarcascades HAAR or HAAR-like-features is a folder where you put post-OpenCV-training data.

 

In this folder, you can find data files which contain data generated by training OpenCV in order to detect face, eyes, nose etc detection.

 

You too can create such data files if you wish to detect something such as legs, airplane, cracks on wall (edge detection), pacman, ****, *******, *******888*88* detection 😛

 

Lets say you wish to train OpenCV to detect face of a “sick” person. So you take pictures of a (e.g.) 1000 sick people (positive images) and then resize those picture to a same small size that is easy to process in bulk :D. Now you will also need pictures of people who are NOT sick.  Now, you will train OpenCV on that load of 1000 pictures plus the people who are not sick. This data is put in this folder to be used.

 

HAAR algorithm is very accurate but is slower as compared to LBP.

3 /sdk/etc/lbpcascades LBP stands for local binary pattern. This method is unique in a way that instead of using generated data to detect features (as was the case of HAAR), the LBP takes a pixel and finds the intensity of its neighbor pixels.

 

So lets say there is a pixel. Practically, each pixel has eight neighbor pixels, so our pixel also has eight surrounding pixels. Now, for each pixel, a binary value is obtained. The value of binary number depends on the comparison between the center pixel and its test-neighbor pixel.

 

If pixel intensity is greater than center pixel, then value is 1.

If pixel intensity is lesser than center pixel, then value is 0.

 

LBP algorithm is very fast, but least accurate.

4 /java/ When creating a new Android project, you can import the OpenCV Java Api from this folder.
5 /java/.settings Contains settings that are implemented when importing the OpenCV for android Java API.
6 /java/gen Contains generated files. For example, R.java, when generated is put here.
7 /java/javadoc This folder contains the documentation of OpenCV for Android. In my case, it is the documentation for the version 3.0.0

All the classes of OpenCV for Android are explained here. So if you ever find yourself in trouble, or wish to learn more, visit this folder.

8 /java/res Standard Android project folder that contains resources to be used in an android project. The resource file that came in my case contains camera information.
9 /java/src The /etc/ folder was the memory of OpenCV. But this folder is the actual brain of OpenCV. This folder contains the classes that perform all the functionalities of OpenCV in Android. Classes are written in Java.

 

Root files are self explainatory. If not, then what on Earth are you doing on this post? You should learn Android and then come here.

10 /java/src/org/opencv Exactly this folder contains the classes. Core, mathematical operation algorithm, training and all the shit that OpenCV gets done for you, is actually here. Every improvement in OpenCV is included here. Please respect the contents of this folder if you use OpenCV.
11 /native/ This folder contains C++ .h (header) files and native libraries for multiple android architectures.

This is it for this tutorial. I have explained to you the structure of the OpenCV for Android SDK file structure. In the next tutorial, I will explin to you about the classes available in OpenCV for Android SDK which you can use.

Return to OpenCV for Android Tutorials List

OpenCV for Android: Download Required Software

OpenCV for Android Download-Required Software

Return to OpenCV for Android Tutorials List

In this tutorial, you will learn which tools to download for creating your OpenCV project in Android Studio if you follow this tutorial series 🙂

  1. Download and install Android Studio from HERE. Make sure that it is working.
  2. Download  OpenCV for Android SDK from HERE.
    • Demonstration of SDK download.

      OpenCV for Android Download-Required Software
      OpenCV for Android Download-Required Software
  3. Basically, after downloading the SDK, simply extract it on a folder and it will be ready for usage.
  4. That’s it! You have downloaded the OpenCV for Android SDK.

In the next tutorial, you will make a new project and set it up so that your application is ready to OpenCV!

Return to OpenCV for Android Tutorials List

Android OpenCV Pre-requisites

Return to OpenCV for Android Tutorials List

Welcome to the beginning of the OpenCV for Android (OpenCV4Android) tutorial series. Before we start, you must know that this series expects you to know:

  • Basics of Java
  • XML
  • Computer Vision
  • Object Orient Programming concepts
  • Know how to use Android Studio
  • Know how to make and install an APK file in a real Android device.

Moreover, it is assumed by this series that you have:

  • Downloaded Android Studio.
  • Installed Android Studio.
  • Download Android SDK
  • Installed Android SDK

It may look like too much to ask for, but in reality, a seasoned programmer may already have satisfied the above requirements.

If there is a problem, then let me know, I will sort it out for ya 😉

Return to OpenCV for Android Tutorials List

Tutorial 2 – CodeIgniter 3.0.1 Understanding application folder structure

Back to CodeIgniter Tutorials

In the previous tutorial, you learn how CodeIgniter is downloaded, installed, and viewed the welcome screen to make sure that it worked.

In this tutorial. you understand how the the purpose and working of \application folder in your CodeIgniter project. This tutorial is meant to be simple to understand so that new users of CodeIgniter get a general idea of how to organize the project in CodeIgniter.

You can skip this tutorial if you already understand the structure of \application\ folder’s contents.

First of all, go to the CodeIgniter folder and open the application folder as shown below.

 

Inside the \application\ folder, you will see the following directory structure.

 

 

Now I will try to make it simple for you to understand the purpose of these folders. Chose the folder name you are interested in learning about from this list below. Enjoy!

Cache

Generally, cache stores data that is to be used in future. So, lets say if your application uses data that is used a 100 times in a minute, it would be preferable to “cache your data” so that time and processing power is saved by reducing the “loading” process.

In CodeIgniter, you can perform Caching too. Once your page is loaded, subsequent loads will trigger your application to load from the cache. This will improve your web application’s performance.

In order to perform caching, all you need to do add the following code (replace n with value) in the controller on which you wish to perform caching.

Where, n is the number of minutes that you wish your page/controller to be cached. So if is set 100, the controller will remain cached for 100 minutes. Afterwards, the page will be cached again.

In order to stop caching, simply remove the above code and caching will stop and pages will be loaded every time.

Config

The config folder contains configuration files that allow you to configure your CodeIgniter application. For example, the “database.php” configuration file allows you to setup one or more databases to be used in your application. The “autoload.php” config file will load up libraries, helpers or even your custom defined config files so you don’t have to call them again and again in your project. This feature should be used on a need-basis.

Speaking of custom config files, it is also possible to define your own config files in this folder and call them up in your controller. This will allow you to make your web application more flexible. Many 3rd party tools would require you to put their config files in this folder.

Please note that you might put critical information in this folder so it is important to have security as your top priority when hosting your projects.

Controllers

The flow of the web application is controlled by the “controller”. If the user presses a button, the controller handles its server side functionalities. If database request is made, it is moderated by the controller. If a web page is to be loaded, (i.e. a view) the controller does it. Roughly, we can say that controller is the brains of the CodeIgniter web application. If the controller does not work, nothing else associalted with it will!

The controller can pass parameters to the view, such as a username of a logged in user is retrieved from the database table of users. First the controller will use a model to retrieve username on the basis of logged in user’s authentication and identification. Afterwards, the controller will pass that username parameter to the view and view will be able to use it to show it on the browser.

As of CodeIgniter 3.0, the name of the Controller class file must start with an uppercase letter. So for instance, I would name my class as Calculator.php. The name “calculator.php” is incorrect. My next tutorials will cover Controllers.

Core

CodeIgniter has core classes in \system\ folder (outside the application folder). These core classes make up the CodeIgniter framework of PHP. In most cases, you won’t need to make any changes to the core classes of CodeIgniter.

But, if you actually need to modify the core classes of CodeIgniter, all you need to do is to create a class in “\application\core\” folder that has the same name as the core class file name in “\system\” folder. CodeIgniter will use your defined class instead of the native CodeIgniter class.

Again, it is not something that one does every day. But it is good to know that a wonderful feature such as this one does exist.

Helpers

Need help in doing a task? Use a Helper!

A helper either a native one, or a custom defined helps you in tasks. Take a few examples:

  • FORM HELPER: Used to create a form that works perfectly with CodeIgniter and hosts a lot of added features.Call it using the following line in Controller.
  • DATE HELPER: This won’t get you on a date, but you will definitely get date features in your web applications. Date, time, time zones, it has so much to offer.

I will cover more on the helpers more in the coming tutorials.

Hooks

While “\core\” folder hosts class files that completely replace native CodeIgniter files, the Hooks feature allows you to hook into the flow of CodeIgniter application and meddle with it. Here are some simpler features for you to know about what hooks can do:

  • You can use hooks to performs actions before even system files are loaded.
  • You can do something before the first controller is called (check routes.php in \application\config\ folder).
  • You can perform an action between calling a controller’s constructor and calling its methods. Twisted, eh?
  • Do something after a controller is completed its functions.

There are more features for you to learn and utilize if you are interested, check out the official documentation Here.

Language

This folder allows you to create and organize text in a specific language. You can create files and folders for your desired language into this folder and use them in your project. All you need to do use the language helper and libraries accordingly.

Libraries

The \application\library\ folder hosts your custom libraries. Lets say you are tired of implementing the “date” features over and over in your projects. Reinventing the wheel in other words. All you need to do is simply create a library and simply carry it throughout the projects.

The libraries can call models too. Roughly, libraries are similar to controllers.

Logs

Your application can be configured to store status messages such as errors, exception handling messages or your custom log messages. These get stored in this folder. This is a very helpful feature. If you have an error that is hard to understand, take a look at the logs here in this folder. The logs need to be turned on by modifying the “www.yourapp.com\index.php” file. Note that there are different levels of logging available for you to set.

Models

Simply put, “Models” allow you to perform database queries. The controller requests the model to perform database queries, upon completion, the model (if programmed) will send the response data back to the controller and the controller may use it however we desire it.

Third Party

Many times, if you download some third party plugin for usage with CodeIgniter, its core files will be put in this folder. It is well known that CodeIgniter is flexible enough for almost every 3rd party plugin to be set up in its environment without a hassle.

Views

All your web design elements come here. You can keep the assets out of here, but the html code goes in here as “.php” files. The controller can call views. For example, a chat bubble can be made using a view and called on demand by the controller to be shown/overlaid in a different view. Moreover, It is possible to create a control panel separately and its sub pages separately in different views. This helps us in minimizing code drastically, thanks to CodeIgniter.


In the next tutorials, I will get started with teaching you how to program in CodeIgniter 3. Let me know in comments if you need a better explanation of a folder. Don’t forget to share :D. Thanks for reading. I hope it helped.

Back to CodeIgniter Tutorials

Review and Tutorial: Mobirise! A FREE WYSIWYG Responsive website editor is out!

Mobirise - A WYSIWYG web designign tool

Designing a website requires an artist to be able to program in multiple languages. That person has to learn multiple languages and frameworks to be able to design like a boss!

Such nonsense! This is 2015 and all you need is the Mobirise software on your desktop and you will be ready to go! Now I should get back to what I do best! I mean writing a tutorial on how to make a webpage using Mobirise.

What this tool does is that it SAVES YOUR TIME by doing the hard work by itself. All you need to do is that after you are done, simply edit the HTML file as per your liking to fine tune it according to your need.

Follow this tutorial and you will get the following benefits:

  1. An HTML file.
  2. Properly written code.
  3. CSS Code.
  4. Plugins required in a seperate folder.
  5. Assets you used in their own respective folder.
  6. RESPONSIVEness
  7. A sweet web page.
  8. You will share 🙂

This is UPDATED for version 2.6 Now lets get started!


Download Mobirise From Here

Mobirise-installation

 

Now, install it and run.

 

You will see this.

Mobirise-Default-start-screen

Click the + button and see the sidebar like below.

885

As teh Catz has pointed out, when  you click the + button, a sidebar will EXPAND. Now, we add a MENU.

Mobirise - A WYSIWYG web designign tool

And the added menu will look like this.

Mobirise-menu-added-on-top

Now, lets add some more components, a header, and a footer.

Mobirise-header-footer-added

Now do the following.

  1. In MENU. click icon and then select ANY image. I will be updated in the interface.
  2. In HEADER, click image and change it the same way.
  3. In MENU, click any text, and its options will become visible, like font, size, color and HYPERLINK. you can delete and rename the text as you like.
  4. In Header, click text or BUTTONS and they will be editable.
  5. In footer, everything is editable as stated above.
  6. More components can be added to have a parallax effect. Let me know if I should tell you how to make a parallax effect in Mobirise 1.8.1.

Now, after editing, I got this in like 3 minutes.

116

Now, we publish and look at the files for the designed page. Simply click the “Publish” button and save to a folder in your folder/

Mobirise-publish-project

Done!


Tips

  • The backup files of your Mobirise project are saved in
    C:\Users\USERNAME\AppData\Local\Mobirise.com\Mobirise\projects\project-2015-10-29_232053\assets\images
  • Do not completely rely on Mobirise to do the job for you. I highly recommend making the structure of the website using Mobirise and then fine-tuning the features using your favourite code editor or an IDE.
  • Mobirise seems to have issues with parallax videos. I suggest you watch out and test not only on your local machine, but also on a real server and multiple browsers. Stupid IE5! x(
  • Mobirise can’t do everything, but you can :).

 


That’s it! You have just created a web page without writing a single line of code. My suggestion is to use this tool to make a template, then grow upon the template. For example, once you have made this, you can use the HTML code and assets in a CodeIgniter project. CodeIgniter is a PHP framework that makes PHP programming very quick and easy.

 

CodeIgniter 3 Tutorials are [edsanimate animation=”tada” infinite_animation=”yes” animate_on=”” ]HERE[/edsanimate]

If you liked this tutorial and enjoyed it, then do like and share this page on Facebook, twitter and Reddit. Let me know if there are any problems. If you would like me to write a tutorial for you, then let me know about that. Take care and happy coding!

 

Codeigniter 2.20 – Sending E-mail using codeigniter

Back to CodeIgniter Tutorials

In CodeIgniter, sending e-mail is a simple process. First the library is loaded. Then the user provides e-mail related data. Finally, the E-mail is sent. Here is how E-mail is sent using a Controller in CodeIgniter

  1. Load the E-mail library of CodeIgniter
  2. Provide set of characters that are to be permitted in the E-mail address.
  3. Initialize the type of e-mail as html (options text or html)
  4. Provide Sender’s E-mail address
  5. Provide Receiver’s E-mail Address
  6. Provide BCC E-mail address
  7. Provide Subject of the E-mail
  8. Provide Body of the E-mail.
  9. Send the E-mail!

Following is the complete code of the above process.

Let me know in comments if there is something that you would like to know. And do like an share.

Back to CodeIgniter Tutorials

Laravel Tutorial 1 : Installation in XAMPP

Lets get it straight. “You want to install Laravel”. With this tutorial, I am starting a Laravel series. My tutorials are short and to the point. So lets get started without any fuss.

Prerequisites

  1. Download Composer or visit their official website.
    • Select “Install Shell Menus” in setup as shown.

      composerInstallation  install shell menu
      install shell menu
    • Press Next and point the setup to  the php.exe. For example, in my case, it is
      D:\xampp\php\php.exe
  2. Download Git
  3. Download Laravel Installaion Files from Github

Now that you have downloaded and installed Composer and Git, you can now start the Laravel installation process.

Installation of Laravel

  1. Extract Laravel to the xampp/htdocs folder. These are the installation files.
  2. Right click on the extracted folder and select Use Composer here. (this is why you installed shell menu with composer)
  3. A command prompt will open with composer settings. Also note that you will be at your extracted Laravel install
  4. Type the following command and press Enter. Downloading of Laravel assets will start.

 

Laravel is now installed. Now we will create a project.

Create a Project

  1. Go to Run and type cmd. 
  2. Lets assume that the project we are making is called “codeonion“.
  3. Type the following command in cmd to make out project:
  4. Wait for installation to finish.

A project named “codeonion” is made from Laravel installation. Lets test it.

Testing of new project

  1. Open your browser.
  2. Go to the following link
    localhost/codeonion/public/
  3. If you see the following then the installation went ok
    laravelinstallation

That is it! Laravel has been installed. In the coming tutorials, I will explain configuration of Laravel and then a project will be made.