Friday, July 29, 2016

#SocialMedia #code #webdev #webdevelopment Low cost SEO services that help you rank higher on Google! Find out mo… https://t.co/OqQ0Dm49wU


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 40+ Awesome Tips That Will Help You Do #Twitter Like a Boss: … https://t.co/cKNOavPpnE


from Twitter https://twitter.com/webimprovenew4u

#webdesign 6 Best Landing Page Conversion Trends of 2016 So Far https://t.co/kUe5Jbos7k


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 6 Essential Components of a Successful Online #Marketing Strategy: … https://t.co/tYaskXYq8B


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Got No #SEO Budget? Here's 20+ Tips to Increase Google Traffic for FREE… https://t.co/Fd4IiFFM1J


from Twitter https://twitter.com/webimprovenew4u

#webdesign Dio: Lightweight virtual DOM framework https://t.co/FyrDtP497C


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 36 Rules of Social Media EVERY #Business Should Live By: … https://t.co/oylsCQsWXu


from Twitter https://twitter.com/webimprovenew4u

#webdesign In conversation with architects: 9 video interviews from the Venice Architecture Biennale https://t.co/3Pk3cWALPb


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 6 Steps to Building a Loyal Online Audience: https://t.co/7swD95vqF2 … https://t.co/HzO4UiZmuR


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Conversion Rate Optimisation: How to Test and Improve Your Website: … https://t.co/Fksa5n1ZOi


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Just for Fun: 20 of the Craziest Questions People Ask Google: … https://t.co/00tgovIvg5


from Twitter https://twitter.com/webimprovenew4u

#webdesign Marimekko illustrator Aino-Maija Metsola creates covers for six Virginia Woolf books https://t.co/Uhh4sInaPf via itsnicethat


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 8 Really Easy Ways to Keep Visitors on Your Website for Longer: … https://t.co/jcyMMyt6to


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 4 Mistakes That Will Lead To The FAILURE Of Your #Marketing Strategy: … https://t.co/zMJjgYUCea


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Low cost Ecommerce website design for small business. Find out more - … https://t.co/zmSpFAlDDY


from Twitter https://twitter.com/webimprovenew4u

#webdesign The Complete iOS 9 Developer Course (6 weeks) - https://t.co/joNHPhgri9 #deal


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 10 Ways Infographics Can Help You BOSS Your #Marketing Strategy: … https://t.co/3SGUvBSv4K


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment SEO Basics: How to Structure a Perfectly Optimised Web Page: … https://t.co/SStFYFzUOc


from Twitter https://twitter.com/webimprovenew4u

#webdesign Creative industries booming across the UK, according to new report https://t.co/I6owu9F4cl via Dezeen


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 15+ Shocking Stats That Will Make You Start Using #Instagram TODAY: … https://t.co/sjkXI5PATU


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Cold Calling is for AMATEURS! This Is What You Should Do Instead: … https://t.co/KJtMRyaJrN


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Social Media Hashtags: How Many You Should Use on Each Network: … https://t.co/bdat161SaL


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Create a #Marketing Strategy That STANDS OUT With These 9 Design Trends… https://t.co/cdabKLylsB


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Just for Fun: 20 of the Craziest Questions People Ask Google: … https://t.co/tQe2y77SwS


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment SEO Tips: 7 Rules for Creating Content That Generates LOADS of Links: … https://t.co/qelaqfvHcF


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Does Your #SEO Suck? Here's 9 Reasons Why You Don't Show Up On Google: … https://t.co/1xKvHSdiyc


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Simple and affordable websites that help your business grow! Find out … https://t.co/jeNeTpsiKy


from Twitter https://twitter.com/webimprovenew4u

#webdesign nadiacosta we were using Polar polls, sadly they went out of business. We’re now using a custom script based on their original s…


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Email #Marketing: 15 Creative Ideas to MASSIVELY Increase Subscribers: … https://t.co/GHwY1npCt3


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment How To Be AWESOME at Social Media #Marketing Without Even Trying: … https://t.co/7wOVCGefTu


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment SEO FAQ: What is Google Panda & Penguin and How Does It Affect My Site?… https://t.co/ADT5lbeLK0


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment Got Bloggers Block? Here's How To Break Out Of A Creative Rut: … https://t.co/FkaGHkDFeU


from Twitter https://twitter.com/webimprovenew4u

How to Create a Fluffy, Feathery Ugly Duckling Text Effect in Adobe Photoshop

20 Useful Video Plugins Available on CodeCanyon

Designing, Wireframing & Prototyping an Android App: Part 1

Designing, Wireframing & Prototyping an Android App: Part 1

If you dream of creating the next big thing in Android apps, then I'm not going to lie: you’ve got your work cut out for you!

You only need to take a quick peek at the Google Play store to see that pretty much every app you can think of has already been created—usually, multiple times and with varying degrees of success.

In such a competitive market, your app has to offer the full package—simply having a great set of features isn’t going to cut it! Your app also has to be responsive, easy to use, completely free of bugs, and (as shallow as it may seem) it has to look nice, too.

So when you jolt awake in the middle of the night with a brilliant idea for an Android app, resist the temptation to leap out of bed, boot up Android Studio and start bringing your vision to life. If you’re going to do your idea justice, then you need to put some thought into your application’s design.

In this two-part series, I’m going to show you how to turn a great idea into a great app. You’ll learn how to plan, test and perfect every part of your app’s design, and how to iron out as many issues as possible before you even write a single line of code.

In this first installment, we’re going to look at how to answer all of those big, burning questions every developer has to tackle whenever they start a new Android project. Then, we’ll create a list of all the screens we need to build, plus a screen map that shows exactly how all these screens fit together.

In part 2, you’ll master some powerful, designed-minded techniques, including wireframing and prototyping. By the end of part 2 you’ll have created a digital prototype that you can install and test on your Android smartphone, tablet, or emulator.

To help you see exactly how you’d take an idea from ‘spark of inspiration’ to working digital prototype, I’m going to imagine I’ve come up with an idea for an Android app that I want to create, and then develop this idea throughout the series.

Since we're (supposedly) heading into summer, I’m going to design an app that’ll help people plan and book the ultimate summer holiday with all their friends.

So we have our idea—what’s the first thing we need to do?

1. Write a Product Statement

Your typical app has lots of nice-to-have added extras, but it also has a clearly defined primary task. For example, our finished travel app might include social media functionality so users can share a snap of that awesome cocktail they had on the beach, or the cat they petted outside their hotel, but these features aren’t the app’s primary task.

A good trick for getting to the core of what your app is really about is to write a product statement. This is a single sentence that communicates what your app is, what it does, and why it’s imperative that the user boots up Google Play and downloads your app right now. It might help to imagine you’re pitching your app to a potential user, and you only have a single sentence to get your message across.  

After much deliberation, I’ve decided on the following product statement:

An app that takes the stress out of planning and booking the ultimate summer vacation.

It’s crucial that you never lose sight of this product statement, so you may want to scribble it on a post-it note and stick it above your desk.

You may want to scribble your product statement on a post it note

2. Identify Your Target Audience

The next big question you need to tackle is: who exactly am I building this thing for?

Hopefully you already have a rough idea of the kind of person who might want to use your app, but for the best results you need to design your app with a very specific target audience in mind. The old saying is true: try to please everyone, and you’ll end up pleasing no one.

Who you’re trying to appeal to should influence every part of your app—from the features you include to the look and feel of your UI, right through to the tone of your application’s text. That’s why it’s crucial you identify your target audience as early in the design process as possible.

I already have a rough idea of who I’m targeting: young adults aged 18-25 who are either on summer break from college or university, taking a full-blown gap year, or are planning one final adventure before it’s time to start looking for that first full-time job. This is a good start, but we can get more specific than that!

One simple but effective trick for zeroing in on your audience is to create a user persona.

A user persona is a single user who epitomizes the kind of person you’re targeting. What characteristics would this person have? Although the exact characteristics will vary depending on the kind of app you have in mind, you can start by answering the following questions:

  • How old is your user persona? This could be an exact age or an age bracket such as people over 60, or young adults.  
  • Where do they live? This might be a specific country or city, or a type of place such as by the sea or in the big city.
  • Do they have any children?
  • What are their hobbies?
  • Do they have a job? And if so, what is it?
  • Are they currently in education?
  • What is their favourite type of application?
  • What is their least favourite type of application?
  • What factors motivate them to download an app?
  • Do they ever pay for mobile apps?
  • How experienced are they with mobile apps? Are they a power user, or a beginner?  
  • How experienced are they with technology in general?

Let’s create a user persona for our travel app. For the best results, it helps to think of your persona as a real person. You might even want to give your user persona a name, which is exactly what I'm going to do: meet Sasha!

  • She’s 20.
  • She’s a university student on summer break.
  • She’s living with her parents over the summer, but will be returning to student halls at the start of the academic year.
  • She’s single, with no children.
  • She doesn’t have a job, so her student loan is her sole source of income.
  • As someone who has grown up with social media, her favourite apps are anything and everything that lets her share photos and status updates with her friends, family, and the World Wide Web in general.
  • She’s a pro with technology, especially mobile apps.

Since my app is all about organising a holiday, I also need to define Sasha’s experiences surrounding travel. Is my “typical” user likely to be well-travelled? Have they been responsible for planning their own holidays before, or is this all new to them?

I’m going to add the following characteristics to my user persona:

  • Sasha has been abroad several times, but only ever with her family.
  • This is the first time she’s planned her own holiday.
  • Sasha can be fairly organised when she wants to be, but since this is the first time she’s been involved in planning and booking a holiday, she'd definitely appreciate a helping hand!

Use Cases

So now we have the who, but what about the when? Under what circumstances might Sasha feel compelled to whip out her phone and boot up our app?

Here are a few that spring to my mind:

  • Sasha is hanging out with university pals, and inevitability the conversation turns to how much fun they're going to have over the summer. Everyone gets over-excited, and before you know it Sasha has opened our app, and she and her friends are eagerly planning what is sure to be the trip of a lifetime.
  • Sasha has just popped into the group chat she and her friends leave running in their favourite instant messaging app, and she sees that—finally!—everyone has agreed on a destination. Excited, Sasha boots up our app and starts researching fun things to do in that area.
  • Sasha is feeling frustrated. She and her friends seem to spend hours talking about how great their trip is going to be, but never actually get around to booking anything. Someone needs to take charge, and it looks like that person is going to have to be her. The only problem is she’s never arranged anything like this before. What she needs is some kind of app that can take the stress out of planning and booking the perfect summer vacation….

3. Create a Features List

It’s time to have some fun: let your imagination run wild and write down every feature you would include in your app if you had infinite time, money and a whole army of developers ready and raring to help you out. For now, don’t worry about whether these features are practical—think of this as your ultimate features list.

If you're struggling for inspiration, then head over to the Google Play store and download a few examples of Android applications that cover similar content, or have the same target audience as your application.


Spend some time exploring these apps and make a note of what the app does well, and any areas you feel you could improve upon. 

Here are a few of the features I’ve jotted down:

  • The ability to book everything the user could ever need for their trip, from plane, train and bus tickets, to hotel reservations, and even miscellaneous things like reserving a table at that local restaurant that has particularly great reviews on TripAdvisor.
  • Read reviews left by other users, and post your own reviews.
  • The user defines their budget in advance, and the app subsequently filters all its suggestions based on this budget.
  • Be spontaneous! Planning a holiday is supposed to be fun, so why not leave everything up to fate by sticking a virtual pin in a virtual map?  
  • Okay, so planning a holiday is supposed to be fun, but it can also be hard work—especially if this is the first trip you’ve ever booked. Our app should provide a checklist of everything the user needs to book and arrange, in order to plan the perfect vacation. 
  • Social media functionality, so users can make all their friends and family jealous by posting photos and status updates about how much fun they’re having on holiday.
  • A travel journal for those users who want to share more than simple photos and status updates.
  • Since my target audience is young adults, this may be the first time many of them have been responsible for booking their own holiday. They might appreciate some general advice aimed at the first-time traveller, such as how to apply for a passport, or the kind of things you can and can’t carry in your hand luggage.
  • A countdown, so users can track the weeks, day, hours and minutes until it’s holiday o’clock.

Now it’s time for a reality check: there’s no way anyone can cram all their ideas into a single app. Even if all your ideas are sensible, well thought out and would appeal to your target audience, throwing everything but the kitchen sink into an app would be a nightmare for you as a developer, and would likely lead to a terrible user experience.

Imagine launching an app for the first time and instantly being confronted by a huge, complicated menu packed with a tonne of options. Choice is a good thing, but too much choice just becomes confusing! Since the last thing you want to do is confuse your users, we need to whittle our ultimate features list down to the bare essentials.

So how do we decide which features live, and which features die?

For the initial release, you should concentrate on features that are essential for delivering your app’s core functionality. And remember that just because a feature doesn’t make it into Version 1.0, doesn’t mean it won’t find its way into a subsequent update. If you come across a feature in your list that has potential, but isn’t essential for fulfilling your app’s primary task, then make a note of it as something that’s worth revisiting once you’ve got your app’s fundamentals down.

Your user persona and use cases should also play a role in determining what features you include in Version 1.0 (and in subsequent releases). What features are most likely to appeal to Sasha?

After re-reading the user persona, use cases and product statement, I’ve settled on the following features:

  • Booking travel and accommodation. This is an absolute must—if Sasha doesn’t at least arrange transport and a place to sleep, then she’s going nowhere.
  • Setting a budget. Sasha is funding the entire trip on the dregs of her student loan, so setting a budget is a top priority for our money-conscious student.
  • Sticking a virtual pin in a virtual map. Sasha is a young student looking to book a summer adventure with all her friends, so the thought of doing something a bit crazy and spontaneous might appeal to her. Also, remember our use case where Sasha is hanging out with her friends and they’re all egging each other on about how much fun they’re going to have this summer? This is the perfect opportunity for Sasha to really get the ball rolling by booting up our app and sticking a virtual pin in a virtual map.
  • A checklist. Since this is the first time Sasha has been involved in planning her own holiday, having a clear checklist to work through would make the whole thing much less intimidating.

Our list contains other features that would appeal to Sasha, such as being able to post photos from her trip, as we already know that Sasha is a fan of all things social media. However, for this initial release I’m going to keep things simple and remain focused on the app’s primary goal. Once you’ve delivered your app’s core functionality and fulfilled your product statement, you can turn your attention to all those nice-to-have added extras.

4. Sketch Out the High-Level Flow

You next task is to start thinking about the screens that you’ll need to create, in order to deliver this list of features, so grab a piece of paper and a pen or pencil. Sketch some rough flowcharts of the routes your users might take through your app, in order to accomplish core tasks.

For my travel app, the core tasks are:

  1. Booking a trip.
  2. Reviewing details about any trips the user has already planned.

You’ll typically represent screens with shapes, and express navigation using lines or arrows.

Example of a quick flowchart

This exercise is mainly intended to get you thinking about the different screens you’ll need to create, in order to deliver the features you cherry-picked from your ultimate features list. Don’t spend too much time on your flowchart, as you’ll refine this flow when you come to create your screen map.  

5. Create a Screen List

Next, come up with a list of all the screens you’ll need to create, based on your flowchart.

Here’s my screen list, plus a brief overview of what I plan to include in each screen:

  • Homescreen. This screen contains a menu of any trips the user has already planned via our app. The user can tap any item in this menu, to view the checklist for that particular trip. Alternatively, they can give the ‘Plan A New Adventure!’ link a tap.
  • Map. This screen contains a map and a virtual pin. The user can tap a section of the map, or if they’re feeling spontaneous they can grab the virtual pin, close their eyes and leave it all up to fate.
  • Select a city. Once the user has selected the country they want to visit, this screen suggests some cities where they might want to stay. This screen also contains a slider where the user can let the app know what kind of budget they’re working with. 
  • Checklist. This screen contains a checklist for the user to work through. Tapping any item in this list launches a screen where the user can complete this task, including:
  • Book transport.
  • Book a hotel.

6. Create a Screen Map

Now it’s time to combine our flowchart and screen list into a screen map that expresses the navigational relationship between all of these screens.

Start with the first screen the user sees when they launch your app, and work outwards.

A screen map of our travel app

It’s never too early to start looking for ways to improve the user experience, so once you’ve created your screen map, take a moment to look at it with a critical eye. One factor that has a huge impact on the user experience is the number of screens the user needs to navigate in order to complete the app’s core tasks.

Generally speaking, the fewer steps, the better the user experience. This map is the perfect opportunity to identify places where you can reduce the number of screens the user needs to navigate. This may involve removing screens, combining screens, reordering screens, or identifying places where it would make sense to add a navigational ‘shortcut’ so the user can jump straight from screen A to screen E.

Conclusion

So far, we've made some big decisions about the app we’re going to create, including who our target audience is, and what features we’re going to include in Version 1.0 (with some features left over for subsequent releases). We’ve also made a list of all the screens we need to design, and sketched out how these screens are going to be arranged in our finished app.

At this point we have our app all planned out, albeit at a very high level. In part 2 I’m going to dig deeper and design the individual screens that make up this screen map, before putting these screens to the test by building a digital prototype.


New Coffee Break Course: Build a Custom Colour Toning Action

How to Create a House Icon in Adobe Illustrator

New Course: Build a Credit Card Form Using JavaScript

Thursday, July 28, 2016

How to Create LUTs in Adobe After Effects and Premiere Pro

How to Create a Queen of Hearts Photo Manipulation With Adobe Photoshop

Ways of Getting Active Notifications to a Mac—Application

Alternatives to Amazon's Cloud Services (AWS)

New Course on the Twig Template Engine for PHP

Starbursting: How to Use Brainstorming Questions to Evaluate Ideas

How to Create Cinderella’s Pumpkin Carriage in Affinity Designer

Traveling Light: How to Film on Your Own

Atom in 60 Seconds: 3 Beautiful Themes

Wednesday, July 27, 2016

What Are WordPress Plugins?

How to Create a Little Red Riding Hood Inspired Fairytale Illustration in Paint Tool SAI

How to Start Your Own Online Store (Beginner Guide)

Invisible Forces: Alignment, Direction, and Focus

Create a Custom Plugin in OpenCart 2.1.x.x: Part One

Building a REST API With AWS SimpleDB and Node.js

An Introduction to Loopj

An Introduction to Loopj

Loopj is an Android library for making asynchronous HTTP requests. I like it for its ease of use and simplicity. Created by James Smith, it's also known as "Android Asynchronous HTTP Client", and it's used by companies like Instagram, Pinterest, and many others. It's a good entry point to the world of HTTP libraries, and will help you understand important concepts very easily.

To learn to use this library, we are going to create MovieTrivia, a simple app that connects to a web service to retrieve information about movies or TV shows and displays this information to the user.

1. Setup

To start, create a new Android Studio project, with an empty activity. To include Loopj, copy the dependency from the official website. You can find the dependency under the "Installation and basic usage" section of the website (or just copy the string below). 

The message "Sync Now" will pop up in the upper right-hand corner. Click it so Gradle will download the library and make it available to your project.

Because the app will connect to the internet, we must declare the appropriate permission for the user to authorise. Open your AndroidManifest.xml file and, just before the application tag, write:

Now you are ready to start using Loopj in your app.

2. Implementation

We are going to create the simplest possible user interface: just a TextField to enter a search term, a Button to do the search, and a TextView to show the results. Open activity_mail.xml and add the required UI components as shown below.

Now, as usual, wire up these components in your MainActivity.java.

To keep your code clean and organized, create a separate java class, MyLoopjTask.java, to contain all the Loopj-specific code and operations. You will need two instance variables, one of type RequestParams to build the search details into the URL, and another of type AsyncHttpClient to actually make the HTTP requests. Before going further, check that Android Studio added these necessary imports.

Also create a method that takes the user query as an argument—this is where the actual work will be done.

As you see, you can add all the necessary API request parameters keys with the RequestParams instance (in this case, just the query entered by the user). This version of the get() method returns a JSON object to onSuccess, but there are other variations available to fit your needs. (Use Ctrl+O to see the other versions of this method.)

This is all you need to do to implement a Loopj client to make HTTP calls to a web service. In our case, we want to send our request when the user clicks the "Search" button. So, back in MainActivity, create an instance of MyLoopjTask and inside onClick call  executeLoopjCall with the term entered by the user. MainActivity will look as follows.

Now, if you run the app, you should see the results of your request in the log window.

3. Publish Results to the UI

Separating asynchronous operations into dedicated classes helps keep our code clean, but it means we don't have access to UI elements directly. To show the results of these requests, I recommend creating a listener interface. This is a common strategy, discussed for example in this Stack Overflow question. It has three easy steps.

Create an Interface

First, create an interface with a single method that will be called when the results of the HTTP request are obtained from Loopj.

Update the Asynchronous Task Handler

In MyLoopjTask, modify the constructor so it takes a Context and an OnLoopjCompleted instance as parameters. 

Now, when the request results are available in MyLoopjTask, pass them to the listener interface's method.

Update the Activity

Finally, make the activity you want to update—in this case MainActivity—implement OnLoopjCompleted. Update the initialization of myLoopjTask to myLoopjTask = new MyLoopjTask(this, this);.

Since your activity now implements OnLoopjCompleted, Android Studio will force you to implement the method taskCompleted. There, you can update the UI with the new data.

4. Conclusion

There you have it. When you run the app, all the data from your asynchronous HTTP request will be displayed to the user. Naturally, you will want to parse the received JSON data to extract just the parts you need. For example, you could display the movie poster by passing the poster image URL to Picasso.

In this tutorial, you've seen how to use Loopj, a library to perform asynchronous HTTP requests in Android. Loopj is easy to use with just a few lines of code. Now you don't have any excuse for not keeping your app up to date with content from your favourite web service!


How to Design a Retro Theatre Poster in Adobe Illustrator

3 Ways to Subtitle and Caption Your Videos Automatically Using Artificial Intelligence

How to Build Custom Photoshop Actions For Your Photography Workflow

Monday, July 25, 2016

How to Create Gingerbread and Candy Inspired Graphic Styles in Adobe Illustrator

How to Create a PowerPoint Presentation From a PPT Template

How to Share Your Python Packages

How to Reduce Busy Work as a Small Business Owner

Install and Uninstall Hooks in OpenCart

Install and Uninstall Hooks in OpenCart

As a module developer, more often than not you’ll need to create a custom schema in your day-to-day OpenCart custom module development. It’s already provisioned, as with the other frameworks, in the form of different hooks in the module architecture of OpenCart.

Before we go ahead and explore the aforementioned hooks, let’s explore the concept of extensions in OpenCart. Looking from the top, it’s an extension in OpenCart that allows you to enrich the core functionality of OpenCart. By installing it, you add features to the front-end store, be it a simple image gallery or some fancy-looking drag-and-drop functionality.

Further, the extensions, depending on the functionality they provide, are categorized into logical groups. As a quick example, the payment extension adds new payment methods in the front-end checkout, while it’s an anti-fraud extension that allows you to detect spam activities in your store. Head over to the back-end and have a look at the list under the Extensions menu that shows the different kinds of extensions supported in OpenCart.

You’ll be surprised to know that a module is also just an another kind of extension in OpenCart. Each extension is built around the common workflow of how things should work in the OpenCart ecosystem. And hooks allow you to perform certain actions based on specific events, whether it’s running an install hook during the module activation or cleaning up the garbage during uninstallation.

It’ll be those install and uninstall hooks that will be discussed throughout the course of this article. Although they’ll be discussed in the context of modules, I don’t see anything that stops you applying the same method to other kinds of extensions as well, so feel free to explore those files on your own.

It’s the latest version of OpenCart that provides the snippets spread over this tutorial. As of writing this, it’s the 2.1.0.2 stable version.

Walk Through the Install Hook

In this section, we’ll explore what exactly the install hook is used for. Go ahead and open admin/controller/extension/module.php in your favorite text editor, and find the install method. It should look something like this:

It’s the generic install hook for the module that will be called whenever you try to install any module from the back-end. Let’s go through the important parts of this method.

First, it loads the model files that are required for the subsequent activities. The $this->model_extension_extension->install method call makes sure that an entry is added to the database for this particular module.

Following that, there’s some ACL stuff, and it’s accomplished by calling the addPermission method. It makes sure that the current user, admin, should be able to access the module-specific settings and alter them.

Finally, it calls the install method of the module that’s being installed. Don’t get confused with the install method we’re already in—it’ll call the module specific install method if it exists.

For example, if you’re trying to install the Log In with PayPal module, it’ll call an install method defined in the file admin/controller/module/pp_login.php as shown below.

Since the introduction of OpenCart 2.x, there are a few exciting features included, and event-observer is one of them. It allows you to add module-specific events, and other modules could set up observers for this event so that they could run some arbitrary code when that particular event is fired. And that’s exactly what's demonstrated in the above install method, which adds the post.customer.logout custom event!

In the case of the Log In with PayPal module, it was pretty simple stuff, but sometimes you’ll need more should you wish to inject a custom schema or something similar. Let’s pull in our install method from the PayPal Express Checkout payment extension. Go ahead and open admin/controller/payment/pp_express.php.

First, it loads the corresponding model file, and using that it calls the install method of the model. As a rule of thumb, whenever you want to manipulate a schema, you should implement that code in the model's install method, rather than directly putting it in the controller's install method.

Now, let’s quickly pull in the install method defined in the model file admin/model/payment/pp_express.php.

Finally, there's something to cheer about! As you can see, a couple of custom MySQL tables are created using the database API of OpenCart. So, this is the way to apply database-related changes using the install method of the model.

So, that's it as far as the install hook is concerned. I hope it's not as complicated as it seems to be at first glance. Let's put it this way. The process is commenced by triggering an extension-specific install method that in turn calls the install method of the extension being installed if it exists. Finally, the install method of the model is called from the controller's install method in case any database manipulation is needed by that extension.

Walk Through the Uninstall Hook

This section, the counterpart of the previous section, highlights the happenings in the uninstall hook. We'll proceed in the same way as we did for the install method in the previous section, so let's straight away grab the code of the uninstall hook from the file admin/controller/extension/module.php.

Again, it should look a bit familiar as most of it is the boilerplate code. The important snippet to start with is the call to the uninstall method that deletes the entry of the current extension being uninstalled from the extension MySQL table.

Next, it calls deleteModulesByCode, which deletes the modules associated with the extension. It's a special method that's only found in this module kind of extension—you won't find it in the other extensions like payment, shipping, fraud, etc.

The reason is that you could replicate every module to create multiple instances. For example, you could show different banner modules on different pages. On the other hand, it doesn't make any sense to replicate the other kind of extensions. Again as an example, there's only one instance required for the PayPal payment extension in the front-end.

Next, it deletes the configuration variables related to the module by calling the deleteSetting method. Finally, it calls the uninstall method of the module that’s being uninstalled.

Let's open admin/controller/module/pp_login.php to see how the uninstall method looks.

Pretty simple, huh? It's just undoing the stuff that was injected into the install method of the Log In with PayPal module. Recall that we created a new event post.customer.logout during the installation, so it's obvious that we need to delete it during uninstallation to make sure we don't leave any module-specific garbage.

Also, let's have a quick look at the uninstall method of the PayPal Express Checkout payment extension as we went through the install method of it in the earlier section. Grab the following snippet of admin/controller/payment/pp_express.php.

Fairly expected stuff—it loads the model and calls the uninstall method. That also gives us a strong reason to open the model file admin/model/payment/pp_express.php and explore the uninstall method as well.

We're just dropping the MySQL tables that were created earlier, as we don't want someone to ask us, "How could you leave this garbage?"

So, that was the story, hopefully nice, of install and uninstall hooks in OpenCart. The next and last section quickly wraps up the concepts learned so far in a simple, yet working, custom module, as that's something nice to have in your kitty post theory session.

Create/Drop a Custom Schema Using Install/Uninstall Hooks

In this section, we'll create an admin module demo that won't do much except to create a new schema during installation and drop it during uninstallation.

First, let's create a language file so that the module is picked up in the back-end. Go ahead and create a file admin/language/english/module/demo.php with the following contents.

Next, we need to create a model file that holds the actual and interesting code of our custom module. The model file should be placed at admin/model/module/demo.php. It creates a demo MySQL table in the install method and drops it in the uninstall method.

Finally, go ahead and create a controller file admin/controller/module/demo.php with the following contents.

It's straightforward, as it should be—it loads the model and calls the corresponding methods depending on the actions being performed.

Go ahead and give it a try. It should be listed as a Demo Module under Extensions > Modules. Install it and you should see the demo MySQL table created in the back-end, and of course don't forget to uninstall it to drop the table.

Conclusion

Today, we've discussed an important aspect of the OpenCart installation process, the install and uninstall hooks. We went through the details of those hooks, and in the later part of the article we built a simple module as a proof of concept.

Of course, queries and comments are always welcome!


How to Code a Scrolling “Alien Lander” Website

Sunday, July 24, 2016

#designs #HTML5 RT analyticbridge: RT KirkDBorne: 4 Skills You'll Need to Become a #DataScientist: … https://t.co/1v3YoaCEgZ


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT KirkDBorne: Human Capital #Analytics > Are Pre-hire Talent Assessments part of a Predictive Talent Ac…


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT KirkDBorne: #BigData #Analytics Certs >> Important Certifications in #DataSc… https://t.co/9DXLELIIlK


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT KirkDBorne: 1.#Python 2. R 3. SQL 4.#Hadoop 5. Java Top 5 Tools & Languages for #DataScience: …


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT KirkDBorne: #DataScience is greater than the sum of its parts: … https://t.co/3L8WO4ulSR


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT innova_scape: RT 12 #algorithms all #DataScientist Should Know … https://t.co/bTWvgldGt5


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: The "Island of Games" Data Puzzle https://t.co/GDFvn6vt2z


from Twitter https://twitter.com/ToolCSSDevelop

#softwareengine… Learn how to create a modern flat metro-style menu with flip effect using #CSS3 https://t.co/An5mC84l3F --- #CSS #webdev …


from Twitter https://twitter.com/DesignS0ftware

#softwareengine… 3 excellent programming tips to write faster, more efficient #code https://t.co/hLXO3iCH1X --- #dev #coding #development …


from Twitter https://twitter.com/DesignS0ftware

#SocialMedia #code #webdev #webdevelopment 10 Rules for Creating a Cool, Effective and Viral #Infographic: … https://t.co/fwykiG66Rh


from Twitter https://twitter.com/webimprovenew4u

#designs #HTML5 RT techjunkiejh:#aspnet MVC 5 From Scratch : Create an https://t.co/zDXYcnQe3K MVC 5 Empty Projec… https://t.co/R7K7wN1Nfr


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT techjunkiejh:Art Spotlight: Fantasy Game Environments https://t.co/2r126SVw5n #gamedev #gaming https://t.co/SjMPEuYhFy


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT anitayorker: Google + open-source = TensorFlow - Data Science Central … https://t.co/WZVABaLXp1


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT autoDataSci: "Feature Engineering: Data scientist's Secret Sauce !" on Data … https://t.co/DHKIp1KL1J


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT DataScienceCtrl: Limitations of Deep Learning and strategic observations https://t.co/Zr1uS7roF0


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT simonlporter: How is Big Data Changing the World? – Data Science Central … https://t.co/cvQX9jQPlE


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT analyticbridge: Origin of Techniques used in Data Science https://t.co/4FoNJJDrHh


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: RT analyticbridge: Invitation to join Data Science Central … https://t.co/98RXxxPtyB


from Twitter https://twitter.com/ToolCSSDevelop

#designs #HTML5 RT analyticbridge: Storytelling in Social Media Analytics: Beyond the Bar Chart II https://t.co/4fRriX6pYr


from Twitter https://twitter.com/ToolCSSDevelop

#webdesign LIFETIME ACCESS: 500,000+ Stock Vectors, Illustrations and Icons https://t.co/10cgqmivKP #deal


from Twitter https://twitter.com/webimprovenew4u

#softwareengine… Prevent Delay on the Focus Event in #HTML5 #Apps for #Mobile Devices with #jQuery Mobile https://t.co/gF0i6k8sjh --- #UX …


from Twitter https://twitter.com/DesignS0ftware

#softwareengine… Perfect #CSS3 hexagons in any size using transform and calc() https://t.co/u3hlKNWVyo --- #webdev #CSS #webdesign #UX #UI…


from Twitter https://twitter.com/DesignS0ftware

#softwareengine… Making animated #CSS3 social buttons https://t.co/xqRg3x4D8x --- #UX #webdev #webdesign #UI


from Twitter https://twitter.com/DesignS0ftware

#SocialMedia #code #webdev #webdevelopment How Colour Can Impact the Kind of Customers Your #Business Attracts: … https://t.co/kFSIzJvLKs


from Twitter https://twitter.com/webimprovenew4u

#softwareengine… Make an animated image gallery percentage preloader with #CSS and #jQuery https://t.co/vGdtSy7u0a --- #webdev #UX #webdes…


from Twitter https://twitter.com/DesignS0ftware

#softwareengine… Creating a full-screen #responsive gallery with #CSS and the #Masonry #JavaScript library https://t.co/l3L8iYrsR7 --- #U…


from Twitter https://twitter.com/DesignS0ftware

#SocialMedia #code #webdev #webdevelopment 13 #Twitter Stats You Need to Know to Maximise the Effect of Your Tweet… https://t.co/hbjvlOhYgo


from Twitter https://twitter.com/webimprovenew4u

#softwareengine… Resizing, displaying and serving images on-the-fly with #Laravel https://t.co/RcQfmdqSbU --- #PHP #webdev


from Twitter https://twitter.com/DesignS0ftware

#softwareengine… How to use #AngularJS and #Laravel #Blade together https://t.co/p3A8SsIDjs --- #webdev #JavaScript #PHP


from Twitter https://twitter.com/DesignS0ftware

#SocialMedia #code #webdev #webdevelopment The 10 Most Effective Social Media Automation Tools for #Business: … https://t.co/Ye4ycYxj2v


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment How to Decide What Type of Logo is Right for Your #Business: … https://t.co/SzDtUN9fgg


from Twitter https://twitter.com/webimprovenew4u

#webdesign What’s new for designers, July 2016 https://t.co/HT0qi99bBH


from Twitter https://twitter.com/webimprovenew4u

#SocialMedia #code #webdev #webdevelopment 20 Rules Every Business Needs to Know Before Posting on #Instagram and … https://t.co/PfTyFZFK2Y


from Twitter https://twitter.com/webimprovenew4u