Saturday, October 15, 2016

Pinterest Expands Ad Retargeting: This Week in Social Media

gd-twism-10-15-16-600

Welcome to our weekly edition of what’s hot in social media news. To help you stay up to date with social media, here are some of the news items that caught our attention. What’s New This Week Pinterest Introduces More Targeting Options for Ad Campaigns: Pinterest’s enhanced ad targeting options make it “easier for you [...]

This post Pinterest Expands Ad Retargeting: This Week in Social Media first appeared on .
- Your Guide to the Social Media Jungle


by Grace Duffy via

Glitty

Premium wooden accessories for Apple Devices
by via Awwwards - Sites of the day

Friday, October 14, 2016

7 Reasons Why Marketers Should Use #Twitter (infographic)

Why Marketers Should Use Twitter (Infographic)

With all the newer, shinier image-driven social media sites like Snapchat and Instagram, many marketers have lost sight of the value of Twitter, preferring to chase after the latest “toy”. But if you’ve been ignoring Twitter it’s time you reexamine it.

As of June 2016, 313 million people are using the platform and posting 500 million tweets a day. That’s a lot of traffic and interest. With all that chatter going on, marketers may wonder if it’s worth the investment of time and resources. 65.8% of businesses are on Twitter and nearly half of the people who follow brands on the platform report that they are likely to visit the company website.

Are you still considering it? What are you waiting for?

by Guest Author via Digital Information World

Concurrency on Android with Service

In this tutorial we’ll explore the Service component and its superclass, the IntentService. You'll learn when and how to use this component to create great concurrency solutions for long-running background operations. We’ll also take quick look at IPC (Inter Process Communication), to learn how to communicate with services running on different processes.

To follow this tutorial you'll need some understanding of concurrency on Android. If you don’t know much about it, you might want to read some of our other articles about the topic first.

  • Android SDK
    Android From Scratch: Background Operations
    Paul Trebilcox-Ruiz
  • Android
    Understanding AsyncTask Values in 60 Seconds
    Paul Trebilcox-Ruiz
  • Android SDK
    Understanding Concurrency on Android Using HaMeR
    Tin Megali
  • Android SDK
    Practical Concurrency on Android With HaMeR
    Tin Megali

1. The Service Component

The Service component is a very important part of Android's concurrency framework. It fulfills the need to perform a long-running operation within an application, or it supplies some functionality for other applications. In this tutorial we’ll concentrate exclusively on Service’s long-running task capability, and how to use this power to improve concurrency.

What is a Service?

Service is a simple component that's instantiated by the system to do some long-running work that doesn't necessarily depend on user interaction. It can be independent from the activity life cycle and can also run on a complete different process.

Before diving into a discussion of what a Service represents, it's important to stress that even though services are commonly used for long-running background operations and to execute tasks on different processes, a Service doesn't represent a Thread or a process. It will only run in a background thread or on a different process if it's explicitly asked to do so.

A Service has two main features:

  • A facility for the application to tell the system about something it wants to be doing in the background.
  • A facility for an application to expose some of its functionality to other applications.

Services and Threads

There is a lot of confusion about services and threads. When a Service is declared, it doesn't contain a Thread. As a matter of fact, by default it runs directly on the main thread and any work done on it may potentially freeze an application. (Unless it's a IntentService, a Service subclass that already comes with a worker thread configured.)

So, how do services offer a concurrency solution? Well, a Service doesn't contain a thread by default, but it can be easily configured to work with its own thread or with a pool of threads. We'll see more about that below.

Disregarding the lack of a built-in thread, a Service is an excellent solution for concurrency problems in certain situations. The main reasons to choose a Service over other concurrency solutions like AsyncTask or the HaMeR framework are:

  • A Service can be independent of activity life cycles.
  • A Service is appropriate for running long operations.
  • Services don't depend on user interaction.
  • When running on different processes, Android can try to keep services alive even when the system is short on resources.
  • A Service can be restarted to resume its work.

Service Types

There are two types of Service, started and bound.

started service is launched via Context.startService(). Generally it performs only one operation and it will run indefinitely until the operation ends, then it shuts itself down. Typically, it doesn't return any result to the user interface.

The bound service is launched via Context.bindService(), and it allows a two-way communication between client and Service. It can also connect with multiple clients. It destroys itself when there isn't any client connected to it.

To choose between those two types, the  Service must implement some callbacks: onStartCommand() to run as a started service, and onBind() to run as a bound service. A Service may choose to implement only one of those types, but it can also adopt both at the same time without any problems. 

2. Service Implementation

To use a service, extend the Service class and override its callback methods, according to the type of Service . As mentioned before, for started services the onStartCommand() method must be implemented and for bound services, the onBind() method. Actually, the onBind() method must be declared for either service type, but it can return null for started services.

  • onStartCommand(): launched by Context.startService(). This is usually called from an activity. Once called, the service may run indefinitely and it's up to you to stop it, either calling stopSelf() or stopService().
  • onBind(): called when a component wants to connect to the service. Called on the system by Context.bindService(). It returns an IBinder that provides an interface to communicate with the client.

The service's life cycle is also important to take into consideration. The onCreate()  and onDestroy() methods should be implemented to initialize and shut down any resources or operations of the service.

Declaring a Service on Manifest

The Service component must be declared on the manifest with the <service> element. In this declaration it's also possible, but not obligatory, to set a different process for the Service to run in.

2.2. Working with Started Services

To initiate a started service you must call Context.startService() method. The Intent must be created with the Context and the Service class. Any relevant information or data should also be passed in this Intent.

In your Service class, the method that you should be concerned about is the onStartCommand(). It's on this method that you should call any operation that you want to execute on the started service. You'll process the Intent to capture information sent by the client. The startId represents an unique ID, automatically created for this specific request and the flags can also contain extra information about it.

The onStartCommand() returns a constant int that controls the behavior:

  • Service.START_STICKY: Service is restarted if it gets terminated.
  • Service.START_NOT_STICKY: Service is not restarted.
  • Service.START_REDELIVER_INTENT: The service is restarted after a crash and the intents then processing will be redelivered.

As mentioned before, a started service needs to be stopped, otherwise it will run indefinitely. This can be done either by the Service calling stopSelf() on itself or by a client calling stopService() on it.

Binding to Services

Components can create connections with services, establishing a two-way communication with them. The client must call Context.bindService(), passing an Intent, a ServiceConnection interface and a flag as parameters. A Service can be bound to multiple clients and it will be destroyed once it has no clients connected to it.

It's possible to send Message objects to services. To do it you'll need to create a Messenger on the client side in a ServiceConnection.onServiceConnected interface implementation and use it to send Message objects to the Service.

It's also possible to pass a response Messenger to the Service for the client to receive messages. Watch out though, because the client may not no longer be around to receive the service's message. You could also use BroadcastReceiver or any other broadcast solution.

It's important to unbind from the Service when the client is being destroyed.

On the Service side, you must implement the Service.onBind() method, providing an IBinder provided from a Messenger. This will relay a response Handler to handle the Message objects received from client.

3 Concurrency Using Services

Finally, it's time to talk about how to solve concurrency problems using services. As mentioned before, a standard Service doesn't contain any extra threads and it will run on the main Thread by default. To overcome this problem you must add an worker Thread, a pool of threads or execute the Service on a different process. You could also use a subclass of Service called IntentService that already contains a Thread.

Making a Service Run on a Worker Thread

To make the Service execute on a background Thread you could just create an extra Thread and run the job there. However Android offers us a better solution. One way to take the best advantage of the system is to implement the HaMeR framework inside the Service, for example by looping a Thread with a message queue that can process messages indefinitely.

It's important to understand that this implementation will process tasks sequentially. If you need to receive and process multiple tasks at the same time, you should use a pool of threads. Using thread pools is out of the scope of this tutorial and we won't talk about it today. 

To use HaMeR you must provide the Service with a Looper, a Handler and a HandlerThread.

If the HaMeR framework is unfamiliar to you, read our tutorials on HaMer for Android concurrency.

  • Android SDK
    Understanding Concurrency on Android Using HaMeR
    Tin Megali
  • Android SDK
    Practical Concurrency on Android With HaMeR
    Tin Megali

The IntentService

If there is no need for the Service to be kept alive for a long time, you could use IntentService, a Service subclass that's ready to run tasks on background threads. Internally, IntentService is a Service with a very similar implementation to the one proposed above. 

To use this class, all you have to do is extend it and implement the onHandleIntent(), a hook method that will be called every time a client calls startService() on this Service. It's important to keep in mind that the IntentService will stop as soon as its job is completed.

IPC (Inter Process Communication)

A Service can run on a completely different Process, independently from all tasks that are happening on the main process. A process has its own memory allocation, thread group, and processing priorities. This approach can be really useful when you need to work independently from the main process.

Communication between different processes is called IPC (Inter Process Communication). In a Service there are two main ways to do IPC: using a Messenger or implementing an AIDL interface. 

We've learned how to send and receive messages between services. All that you have to do is use create a Messenger using the IBinder instance received during the connection process and use it to send a reply Messenger back to the Service.

The AIDL interface is a very powerful solution that allows direct calls on Service methods running on different processes and it's appropriate to use when your Service is really complex. However, AIDL is complicated to implement and it's rarely used, so its use won't be discussed in this tutorial.

4. Conclusion

Services can be simple or complex. It depends on the needs of your application. I tried to cover as much ground as possible on this tutorial, however I've focused just on using services for concurrency purposes and there are more possibilities for this component. I you want to study more, take a look at the documentation and Android guides

See you soon!


by Tin Megali via Envato Tuts+ Code

Quick Tip: How to Add Coupons to a Magento eCommerce Store

Magento coupons

Say you want to run a promotional offer on your Magento eCommerce store; or to give promotional discounts to your users; or perhaps a buy 1 get 1 free offer.

Magento allows the admin to create coupon codes and set the terms and conditions. And the Magento 2 update makes it easier to create coupon codes for your campaign.

Coupon codes can be used with cart price rules to apply a discount that's pre-set with specific conditions. A coupon code can be generated for a particular group of customers, or for anyone who makes a purchase over a certain amount. The coupons can be emailed to customers, or Magento store owners can create in-store coupons for mobile users.

Adding Coupons from the Admin Panel

Let’s see how can we add coupons from the admin panel.

After logging into admin panel, navigate to Promotions > Shopping Cart Promotional Rules.

The new page shows you all of the shopping cart promotional price rules that have been added. To add a new rule, click on the Add New Rule button on the right-hand side.

This will load a new page through which you'll be able to add a new rule.

Adding a new rule

Following are the field details:

  • Rule Name: name to identify and describe it.
  • Description: details to specify its purpose.
  • Status: Active/Inactive to apply/not apply.
  • Customer Groups: select General and Not Logged in to cover visitors and registered users visiting front-end.
  • Coupon: select Specific Coupon from the drop down and add your unique coupon code in the field below it. You can also set Uses per Coupon and Uses per Customer to limit the usage of coupon by registered users.
  • From Date/To Date: if the rule is to be set for some specific period, dates can be selected.
  • Priority: priority matters when there's more than one rule applicable. It will work according to the rule's priority set from this field.

After adding basic details for the rule, now we need to add the conditions to the rule, if there are any to be added.

Continue reading %Quick Tip: How to Add Coupons to a Magento eCommerce Store%


by Binay Jha via SitePoint

5 Top Landing Page Mistakes

5 Top Landing Page Mistakes

This article is part of an SEO series from WooRank. Thank you for supporting the partners who make SitePoint possible.

There’s a lot of discussion in the digital marketing space about various marketing channels and their effectiveness in producing conversions and sales. You’ve got SEO, retargeting, paid search, content marketing and display advertising. However, there’s one thing all these channels have in common that will play a huge role in the effectiveness of your marketing campaigns: The landing page.

Unfortunately, optimizing landing pages is often overlooked when setting up and executing marketing campaigns. Below we’ll go over some of the top mistakes people make on their landing page and how you can avoid the same fate.

Lacking Calls to Action

Your website really has one goal: Turn visitors into conversions. In order to do that, you need clear calls to action (CTAs) on your landing pages. Other landing page elements, like content marketing, attractive visuals and a good slogan are helpful in convincing people to become customers, but they need that CTA to draw their eye and get them to start the conversion process (whether that be ordering a product, completing a contact information form or signing up for an email newsletter). When adding a CTA to your landing page, make sure it is:

  • Visible: This sounds obvious, but you might be surprised by the number of landing pages that bury the CTA below the fold. Users shouldn’t have to scroll in order to find what they’re looking for, so make sure the CTA is one of the first things they see when they click through to your site. If your CTA is already above the fold but still not getting a lot of clicks, it might not be optimally placed. Use a heat map tool such as Crazy Egg to record where users click on your site — if people tend to click links on the right side of your page, try moving the CTA over there.
  • Distinct: Calls to action should stand out from the rest of the page content, to better attract visitors’ attention. The most common way people do this is through the use of color. Choose a bright color that contrasts with the overall design of your page so it stands out, but not so much that it clashes. You don’t have to use just color — some pages get a little more obvious by adding arrows or other animated elements. Use this tactic with care; if you get it wrong you could make your page look spammy, which is not good for usability or SEO.
  • Clear: CTAs need to be easy to read, but that’s not all we mean by ‘clarity.’ What’s really important is that there isn’t any ambiguity about what clicking the CTA will do for the user. Craft the text around what the end result of the action will be: signing up for a newsletter or free trial, adding a product to a shopping cart, sending contact information for follow-up communication, etc. Avoid generic language like "click here," “buy now” or “submit” — users will scan it without registering it.

In the case of CTAs, more is definitely not better. Having multiple actions on your site will only overwhelm and confuse readers. Which offer is the right one? Should they be signing up for a newsletter or submitting their information for lead generation? They’ll end up leaving your site and doing neither. So if you’re lacking calls to action on your landing pages, don’t swing in the opposite direction by adding more than one for each page.

Cluttered or Ugly Design

It’s no secret that design is incredibly important for landing pages: Visitors form their opinion of your site and business in the first half second of looking at your content. Put your best foot forward by using a clean, attractive design. 95% of those first opinions are formed based on the visual design of the page.

When designing a landing page for a particular marketing campaign, use one principle to guide all of your decisions: do not make people think. Get your messaging across in as few words as possible and use visual elements readily. Rely on these page elements to communicate with visitors effectively, without burdening them with the requirement of too much thought:

  • Primary CTA: We just talked about this above: make your CTA clear, to the point and enticing. If you can, make the CTA the focus of the entire landing page — put it front and center and make it large and in charge so it’s obviously number one in your page’s hierarchy. If the call to action is more than just a button, consider options to visually set it apart; change the background color for a signup form or use paler colors for the rest of the page.
  • Headline: Again, the guiding principles are clarity and brevity. Try to boil your value proposition down to just a few simple words. For example, a consulting firm might use "Business Solutions," while an HVAC company could use “Keep Cool” (or warm, depending on the season). If you’ve got a special offer, create a sense of urgency by adding the expiration date, or maybe even a countdown timer, as a sub-head.
  • Product/Service Information: At the risk of repeating ourselves, make any product or service information you have on your landing page as short as possible, and don’t make people think about what you’re telling them. Focus on how your product will help customers achieve their goal and then tell them in a few sentences. Remember, this isn’t your homepage so you can get a little bit wordier here. Break up sections of text using illustrations or other images so you don’t burden your readers.
  • Visuals: Images are some of your best friends when building landing pages dedicated to marketing campaigns. Use them incorrectly, though, and they can depress the conversion rate of your campaign. One of the best things you can do for your page is to avoid stock images — using custom images can increase conversion rate by 35%. They can help show what sort of industry or niche your product is in, but not how it works to add value to their lives. Instead, use custom photos to show your product in action or illustrations to show off a bit of your company culture or values.

Inaccurate Messaging

Matching your landing page to expectations set in your ads or search snippet (the title, URL, link and description of your page displayed in search results) is vital to maintaining your audience’s trust in your business. Losing their trust will hold back your marketing efforts in multiple ways:

  • High Bounce Rate: Promising a product or offer without delivering immediately when the visitor arrives on the page will cause them to exit the page without engaging with your site. This is bad for your SEO since it tells search engines that your site is either irrelevant to the keyword or provides a bad user experience.
  • Low Quality Score: Quality Score is Google’s secret recipe to determine an ad’s relevance to a keyword. Landing pages that don’t back up what’s in the ad severely lower your Quality Score. This will require you to bid much, much higher to get your ads to appear in search results, if at all.
  • Retargeting: Retargeting is a great way to recapture people who don’t convert the first time around. However, if your site doesn’t jive with the ads that bring people to the landing pages, they won’t trust your retargeting messaging and will be much less likely to come back and finish converting. Even worse, if you follow people around the web with an offer you don’t have on your pages, you’ll look like a scam and risk damaging your brand.

If you advertise any discounts or other deals, reinforce them prominently at the top of the landing page where visitors can’t miss it. Don’t advertise any features your products don’t have (or don’t do well enough to retain customers). If you do talk about specific product features or services, explain them quickly in your landing page content (remember to do it in a way that your users won’t have to think too hard about).

Continue reading %5 Top Landing Page Mistakes%


by Greg Snow-Wasserman via SitePoint

Julien Lejeune

Personal Portfolio – Web & Graphic Designer / Front End Developper, from Belgium


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery