Thứ Năm, 29 tháng 10, 2015

Google to Merge Android With Chrome OS

Update: Hiroshi Lockheimer, Google's SVP for Android, Chrome OS and Chromecast says that Chrome OS is here to stay: "While we've been working on ways to bring together the best of both operating systems, there's no plan to phase out Chrome OS."

Original post:

Wall Street Journal reports that Google works on integrating Chrome OS into Android and will release a unified OS that runs on phones, tablets, laptops and more. "The company plans to unveil its new, single operating system in 2017, but expects to show off an early version next year."

So why kill Chrome OS and switch to Android? Chrome OS has a small desktop market share, while Android is the dominant mobile OS. There are a lot more apps in the Google Play Store than in the Chrome Web Store and Google had a hard time convincing developers to build Chrome apps. Google even ported the Android runtime to Chrome, so that you can run Android apps in Chrome OS.

Google's CEO, Sundar Pichai, has recently said that "mobile as a computing paradigm is eventually going to blend with what we think of as desktop today". Most likely, Google wants to bring Android to the desktop and provide a coherent experience. This solves some of the issues with Chrome OS (the lack of apps, low market share), but brings more challenges (Android is less secure than Chrome OS, it's updated less often, has a more complicated interface, it doesn't have a windowing system, apps aren't optimized for desktop).

I like Chromebooks because they're simple devices that require no maintenance. There are few things you can change, few things that can go wrong. It's easy to share them with other people, you don't have to worry about backups or saving your data.

Pixel C's announcement makes more sense now. It's an Android tablet developed by the Chromebook Pixel team. “We think the Pixel C’s tablet and keyboard experience really unlocks new ways to both play and be productive on one device,” mentioned Google.


Google has a lot of work to do. Android's tablet interface is pretty poor, there's no native multi-window support, Chrome for Android doesn't support extensions, apps and themes.

Chromebooks were all about the web, but native apps turned out to be more important for users. Better performance, better integration with the operating system, better interface - native apps trumped web apps and Chrome OS couldn't find a way to turn the tide.

{ Thanks, David. }

Thứ Tư, 28 tháng 10, 2015

YouTube Red Launched

As promised, YouTube Red was launched today in the US. If you use the mobile apps for Android and iOS, you probably noticed that the title changed to "YouTube Red" and there's a new "YouTube Red" section in the settings. YouTube didn't even update the apps: the changes were probably triggered automatically.


There are 3 different ways to sign up for YouTube Red: from YouTube.com or the Android app, from Google Play Music and from YouTube's iOS app. If you use in-app purchases on iOS, you'll spend 30% more every month ($12.99 vs $9.99 regular pricing), so it's not a good idea to do that.


The desktop site has a new logo:


Here are some screenshots from the iPad app:




"With a YouTube Red membership, you’ll experience YouTube without video ads, be able to save videos to watch offline, and play videos in the background on your mobile device, all for $9.99 a month. And just like with our advertising revenue, the majority of revenue we get from YouTube Red memberships will go to our creator community," mentions YouTube's blog.

YouTube Red is free for Google Play Music subscribers and there's a free 30-day trial for US users. For now, YouTube Red is limited to the US and there are some additional restrictions: "if you leave the U.S., you won't be able to save videos offline, videos won't play in the background, and you will see ads. Any videos that you've saved offline before leaving the U.S., will continue to be available offline for 30 days."

New Google Calendar URL

Daniel Fletcher, a reader of this blog, noticed that Google Calendar's URL changed from www.google.com/calendar to calendar.google.com. This seems to be a recent change, even though the Google Apps Blog announced it back in September.

"In an effort to further increase security, in the coming weeks we'll be changing the main Google Calendar URL from 'www.google.com/calendar' to 'calendar.google.com.' Following the launch, the old Calendar url will simply redirect to the new one, so the overall impact of this change on Google Apps customers should be minimal," informed Google.


Browsers like Chrome and Safari will ask you for permission again to show notifications. Greasemonkey scripts and extensions that use the old URLs will probably stop working, so developers will need to update them.

Daniel Fletcher wonders why "Maps is now google.com/maps, when it used to be maps.google.com and Calendar seems to have gone the other way". Maybe Google Maps will go back to the old URL.

Android Auto Backup

One of the best features from Android Marshmallow is auto backup for apps. Android used to have a backup feature that only worked for system settings and a few apps that enabled it. Now Google saves the settings and data for all the apps and backs it up to Google Drive, so you can quickly restore it when needed.

I've checked the Android section from Google Dashboard and noticed the difference between Nexus 7 running Android 4.3 and Nexus 5 running Android 6.0. While Nexus 7 only backed up system settings, the wallpaper and some data for Gmail, Google Calendar and Google Keyboard, Nexus 5 backed up the data for almost all the apps: from QuickPic Gallery to MyFitnessPal, from Firefox to Opera Mini and Angry Birds 2. There are still some apps that don't support auto backup, but at least the feature is now opt-out instead of opt-in.



The Android section from Google Dashboard shows a lot of useful information about your Android devices (IMEI number, registered date, last activity date, carrier) and it also lets you delete backup data. "Please note that new backup data will be created if backup is enabled on any of your Android devices," informs Google.

The list of apps backed up to Google Drive is also available in the Settings section of the Google Drive app for Android. You can enable or disable the backup feature, automatic restore, reset network settings, add backup accounts. The nice thing is that all this data doesn't use your Google Drive storage quota, but each app is limited to 25MB.

"Apps running on the new backup system aim to save their data every 24 hours, but there are a few requirements for the backup system to trigger automatically. The new backup system uses the JobScheduler API introduced in Lollipop and only triggers a backup if the device is connected to power, on Wi-Fi, and has been idle for at least an hour. The data then gets encrypted and uploaded to Google Drive," reports Ars Technica.

It's worth pointing out that reinstalling an app from the Play Store restores its settings and data. This way, you won't lose your data when you uninstall an app and you don't have to reconfigure an app you've previously used. In my opinion, this is a game-changing feature.



The new backup service is powered by Google Play Services, so it can be improved without updating the operating system. Hopefully, Google will allow users to disable backup for certain apps, remove the 25MB limitation and backup even more data.

ASUS OnHub Router

For many people, routers are an afterthought. Stuck in a closet, out of sight and out of mind, regular users only think about their routers when something is wrong. Dealing with routers is frustrating: they usually have poor user interfaces, buggy firmware, annoying lights and most people don't know how to change their settings, update firmware or improve their performance.

Google hopes to solve these issues with OnHub, a series of routers designed by Google and manufactured by third-party companies. After launching a TP-LINK router, Google announced a second router with similar specs, this time from ASUS. The new router is even more expensive ($219.99) and can only be preordered in the US.


OnHub routers are designed to be fast, secure, easy to use and to look good. "Like our first router, the ASUS OnHub comes with faster Wi-Fi, easy set-up, and simple management with the Google On app. With the ASUS OnHub, we're also introducing Wave Control, which lets you boost the Wi-Fi speed for a particular device by simply waving your hand over the top of the ASUS OnHub - great for busy houses," informs Google.

It's worth pointing out that OnHub routers run Google's software and they're automatically updated, without having to be restarted. That's an impressive achievement. No other router can be updated without disrupting your Internet connectivity for a few minutes and most users don't bother updating their routers.

Both OnHub routers have powerful specs and they're designed for the future. That's why they only have a single LAN port, they support Bluetooth and Weave and have many other features borrowed from smartphones. They're supposed to be smarter, just like all the other smart devices they enable. As Google says in the following video, hopefully one day you'll love your router.


I've only liked two routers: an old Linksys router running Tomato and an Apple Airport Express. They're very different routers, but they have a few things common: they're stable, reliable and secure. Hopefully, OnHub routers will be just even better.

Thứ Ba, 27 tháng 10, 2015

7 Years of Google Chrome

A lot has changed since Google launched Chrome back in September 2008. Chrome's popularity has been growing ever since then and all the other important browsers became more like Chrome. Google focused on the things that mattered and transformed the browser from a simple application into a "modern OS" for web apps.

While there are many services that claim to measure the market share for browsers, I tend to think that StatCounter is the most accurate. StatCounter's stats for 2008-2015 show that Chrome's market share grew from 0% to 53% in 7 years, while IE's share declined from 67% to 15%. According to StatCounter, Chrome is now the dominant browser, while IE and Firefox are continually losing market share.


It's clear that Google did a lot things right when it launched Chrome, but few people anticipated that Google's browser will take over the world. Most people didn't know what's a browser and only knew that they were supposed to click on the blue E icon to go online. Google changed this by promoting a constantly evolving browser, which was faster and more secure.

RankBrain Helps Google Understand Queries

Google's search engine hasn't always been very smart. In its early years, Google only tried to find the pages that matched the words from your query and ranked them. It's hard to answer a question without understanding it, but that's what Google did.

Google constantly improved its algorithms, added personalization options, started to match synonyms and expand abbreviations, but Knowledge Graph and Hummingbird were the greatest leaps that put machine learning to work and made Google smarter. Google started to understand the meaning behind a question, to disambiguate words and to find answers, not just pages that include the words from the query.

Bloomberg reports that Google uses even more artificial intelligence to answer questions and rank results. RankBrain is a new AI system that has been used for the past few months to improve search results. "If RankBrain sees a word or phrase it isn't familiar with, the machine can make a guess as to what words or phrases might have a similar meaning and filter the result accordingly, making it more effective at handling never-before-seen search queries."

15% of the queries Google gets every day are new and RankBrain helps Google understand them. Here's an example of complicated query: "What's the title of the consumer at the highest level of a food chain?" RankBrain finds words and phrases that have a similar meaning and highlights them (for example: predators). "In the few months it has been deployed, RankBrain has become the third-most important signal contributing to the result of a search query."


Google's CEO, Sundar Pichai, says that "machine learning is a core transformative way by which we are rethinking everything we are doing". Machine learning has already helped Google improve image search, automatic translation, speech recognition and deep learning is already showing some promising results: smarter photo search with object recognition.

"In tandem with other researchers at Google, Andrew Ng is building one of the most ambitious artificial-intelligence systems to date, the so-called Google Brain. This movement seeks to meld computer science with neuroscience — something that never quite happened in the world of artificial intelligence," reports Wired. "Deep Learning is a first step in this new direction. Basically, it involves building neural networks — networks that mimic the behavior of the human brain. Much like the brain, these multi-layered computer networks can gather information and react to it. They can build up an understanding of what objects look or sound like."

Newer Is Not Always Better

With all this talk about Android and software updates, I realized that one of the biggest Android advantages is that you can install custom firmware or downgrade to an old Android version.

My old Nexus 7 tablet from 2012 doesn't support the latest Android release. Instead of installing custom firmware from some independent developers, I decided to go back to the smoothest Android version I can find. Asus skimped on quality storage and Nexus 7 was pretty slow and laggy, especially when using Android 5.x.

Google has a page with factory images for Nexus devices and it's pretty easy to install any Android version that's officially available. You have to backup your data, enable USB debugging and run some scripts.

I've installed Android 4.4.4 and Nexus 7 was much smoother, but there was still room for improvement. Android 4.3 was even better and I decided to keep it. It's like having a completely new device, even if it runs some outdated software released 2 years ago.


It's difficult to optimize new software for old hardware, especially if manufacturers don't care about quality, cut costs and ship poorly made devices with obvious design flaws. On there other hand, Google has its own issues with software optimization, memory leaks, battery draining software and other bugs. When properly optimised, Android runs well and users are happy, but this doesn't happen often. With so many devices to update, manufacturers and even Google take shortcuts when it comes to old phones and tablets. Some stop updating them, others release unfinished software, hoping to encourage users to buy new hardware, while others spend more time improving the software for the latest flagships.

Thankfully, you can downgrade and go back to a software that actually works well. Apple devices rarely allow you to downgrade and usually for a limited time, so you're stuck with phones and tablets that are suddenly slow, laggy and crashy.

This post was written on my Nexus 7 running Android 4.3.

Thứ Năm, 22 tháng 10, 2015

Google Photos Stats

Google has some stats about Google Photos, the online photo sharing service released 5 months ago. Google Photos has 100 million monthly active users. They created more than 15 million animations and collages and their backed-up photos and videos use more than 3,720 TB of storage.



Paris is the top photographed place, followed by New York and Barcelona. Besides people, food and cars are the most photographed things. Sky, beaches and mountains are also included in the top 10 things photographed by Google users. The top 6 events in Google Photos are: wedding, concerts, Christmas, dancing, birthday and clubbing.

The most popular searches are for baby photos, but "me" is also a popular query.

Google's Play

Android started as an open platform that brought together many competing companies. iPhone's launch changed Android's development and was an important reason for Android's success. Phone manufacturers and carriers wanted an "iPhone killer" and Android was a good bet, but it still had a lot of rough edges and there were many missing features. This was a great opportunity for manufactures to fill in the gaps, create their own user interfaces and develop their own apps and widgets that brought value and differentiation.

Here's an image from Android's original SDK emulator:



Why did Google acquire Andy Rubin's company and invested in Android? One of the reasons was to make a better platform for developing mobile apps. Google already had a few mobile apps for feature phones, Symbian, Blackberry and it was very difficult to add new features and to test the applications because of the inconsistent APIs and their implementations. Android seemed like an interesting opportunity, but Google never anticipated that it will take over the world. It's obvious that Android became the dominant mobile OS because so many companies invested in Android, hoping to come up with better phones than Apple's iPhone.

While Android was open source, Google created a few proprietary apps that weren't part of the Android Open Source Project (AOSP). The most important proprietary Google app was Android Market, which is now called Google Play Store, but Google developed other apps as well: Gmail, Google Search, Google Maps etc. Over time, many open source apps were replaced by proprietary Google apps: the music player became Google Play Music, the calendar app became Google Calendar, the browser became Chrome etc.



Android Market/Google Play is Google's own service and it was licensed to phone manufactures subject to confidential terms and conditions. According to the distribution agreements (MADA) revealed by companies like HTC and Motorola, Android Market was bundled with other Google apps and services, including Google Search and Network Location Provider, which had to be the default search and location services. "Devices may only be distributed if all Google Applications [listed elsewhere in the agreement] ... are pre-installed on the Device," mentions one of the distribution agreements.

The list of bundled Google apps increased over the years, as Google released more and more apps. Phone manufacturers were allowed to bundle competing apps from third-party companies and you'll find many phones that include Whatsapp and Hangouts, Microsoft OneDrive/Dropbox and Google Drive, Facebook and Google+. Here's a screenshot from Samsung Note 4, courtesy of Gsmarena, which shows that Samsung preinstalled Facebook and Google+, Hangouts, WhatsApp and Facebook Messenger, Instagram and Google Photos.


While many Android users complain that their phones have too much bloatware, some companies aren't happy that Google ties the Google Play Store with other Google apps and some default settings (Google = default search engine, Google Network Location Provider = default location provider).

Deutsche Telekom will file an anti-trust charge against Google, complaining that "Google uses its Android mobile operating system to unfairly promote its own products like Google Maps and online search over those of rivals". According to New York Times, "a number of large tech companies, including Oracle and Nokia, as well as small start-ups like Aptoide, a Portuguese online marketplace for smartphone applications, already have filed complaints to European officials connected to the Android investigation." The European Commission has opened a formal investigation into Google's mobile operating system and the Federal Trade Commission started a similar investigation last month.

Is it fair for Google to bundle the Play Store with other apps and to dictate its own terms and conditions? It's obvious that the Play Store is the most important Android app and few people outside of China would buy an Android device that can't access the Play Store. By now, Google Play Store and the associated Google Play Services are hard to separate from Android, even if they're not technically part of Android. This is Google's play: it's holding the keys to more than 1 million apps and dictates its own terms to phone manufacturers. Many of Google's apps are actually useful and they are hard to beat by competitors (Google Maps, Google Search, Gmail, YouTube), but some of the apps aren't the best in their category and Google uses distribution agreements to promote them (Hangouts, Keep, Play Books).

Back in 2008, Android Market was just another Android app store, but now it's the most important by far and it also comes with APIs that tie Android apps to the Google Play Store. I think it's not fair to tie Play Store licensing with bundling other Google apps and Google should use separate distribution agreements for them, just like Facebook and Microsoft.

Thứ Tư, 21 tháng 10, 2015

YouTube Red

Do you remember Music Key, YouTube's subscription service that allowed you watch ad-free music videos, download them and play music videos in the background? It's now called YouTube Red and it's no longer limited to music videos.

YouTube Red is launching on October 28 in the US and it will bring the features from Music Key to all the YouTube videos. "YouTube Red lets you enjoy videos across all of YouTube without ads, while also letting you save videos to watch offline on your phone or tablet and play videos in the background, all for $9.99 a month. Your membership extends across devices and anywhere you sign into YouTube, including our recently launched Gaming app and a brand new YouTube Music app we're announcing today that will be available soon."



Just like Music Key, YouTube Red will include the Play Music subscription and Play Music subscribers will get access to YouTube Red for free. Of course, YouTube Red will need to be available in your country first.

There's another bonus feature for YouTube Red subscribers: exclusive shows and movies from some of YouTube's biggest stars. Reality shows, drama series, adventure series, scripted comedies, feature-length movies - there's something for everyone.


You can try YouTube Red for free and start a one-month trial. The service launches on October 28 in the US and Google plans to add more countries soon.

Thứ Năm, 15 tháng 10, 2015

Chrome Notifications in Google's Navigation Bar

It looks like the Google Notifications section is not only for Google+ and Google Photos. Daniel Fletcher, a reader of this blog, noticed a Chrome notification from a supervised user who sent a permission request.


It's likely that more Google services and products will show notifications in the navigation bar. Google already stacks the notification cards for Google Photos.

{ Thanks, Daniel. }

Google Families?

Google's password manager available at passwords.google.com has an interesting list of URLs in the source code. Most URLs redirect to Google's My Account page, but there's a new subdomain which returns a 404 error: families.google.com. It's not clear if Google intends to launch a new account manager for families.


Google Chrome already has a feature that lets you add supervised users and setup parental controls. You can block certain websites, review browsing history, change settings. Google Play has a Family section that highlights family-friendly content and Google Play Music will offer a family plan for $14.99. There's also YouTube for Kids.

{ Thanks, PhistucK Productions. ]

Google Shows Other Recordings of a Song

When you're searching Google for a song that has multiple cover versions, Google shows a new section below the video: "other recordings of this song". For example, if you're searching for [Felix Jaehn Ain't Nobody], Google shows the original version of the song from 1983 (Rufus and Chaka Khan) and a recent cover version from 2013 (Jasmine Thompson), which was remixed by Felix Jaehn, a German DJ.


You can click the other recordings to find more about them and watch their videos.

Thứ Tư, 14 tháng 10, 2015

Stop Blogger from Redirecting Blogspot to Country Specific URLs

Let's say you're from France and have set up - just for examples sake - a blog called frenchlitgeek.blogspot.com where you share your thoughts and insights on French literature. Now, with Google's country specific redirection in Blogger, you might be redirected to frenchlitgeek.blogspot.fr when you try to access your site. The thing is, you perfectly liked the .com and didn't sign up for the .fr but you find yourself being directed there. Sure, your blog works and all but you also wonder why.
blogger country specific redirection

Why Did Google Do This?

Google has always supported the expression of views, and they stated as much on their official blog. In the post Free expression and controversial content on the web, which was published in 2007, it said "Our world would be a very boring place if we all agreed all the time. So, while people may strongly disagree with what someone says, or think that a particular newspaper is total nonsense, we recognize that each of us have the right to an opinion."

The post continued, "We also know that letting people express their views freely has real practical benefits. Allowing individuals to voice unpopular, inconvenient or controversial opinions is important. Not only might they be right (think Galileo) but debating difficult issues in the open often helps people come to better decisions".

blogspot country redirection

While the company is clearly on the side of people freely expressing their opinions, they also believe that a line has to be drawn somewhere. Then again, for a company providing services in over 100 countries around the world and each with their own national laws and cultural norms, it's surely difficult for a company like Google to decide where to draw boundaries.

However, there are cases like child pornography which is illegal in just about any country where decisions are clear cut.

For a company whose products are "specifically designed to help people create and communicate, to find and share information and opinions across the world", how does Google deal with this challenge?

One of the most challenging areas where Google deals with issues regarding free expression is in Blogger, their content generation platform. Since Google can't check what you've written before you publish, they rely on active vocal users who are diligent in alerting the proper if a post borders on offensive. Then again, that in itself is a tricky issue as well because what one person may view as offensive, another might not.

In other words, it's always a work in progress with Google.

Fast forward to January 9, 2012 when Google announced it was making changes to the Blogger platform with regards to censorship. That said change would make use of a country specific domain to the Blogger platform. Doing this would allow Google to censor and remove content specific to a certain country.

In their announcement, Google said: "Migrating to localized domains will allow us to continue promoting free expression and responsible publishing while providing greater flexibility in complying with valid removal requests pursuant to local law. By utilizing ccTLDs, content removals can be managed on a per country basis, which will limit their impact to the smallest number of readers."

The move by Google come after pressure from countries like India that are working on hunting down content on social media sites which are considered inappropriate. Also, the move followed closely on the heels of Twitter's new censorship policies.

Since Google aims to "help people create and communicate, to find and share information and opinions across the world", it would be strange to take down a post that was just banned in a certain area. In essence, with country specific redirection, a piece of content can still be accessible by the world save for the country where it was blocked.

How Would Country Specific Redirection Affect Your Site?

Of course, not all site owners greeted the country specific URL change with open arms. A few of the issues brought up in regard to the change include:

1. A reduction in social stats. These are your Facebook Likes, Google +1s and so on from your blog posts. They might be reduced because the URLs from one blog post will be different depending on where your readers are from.

2. A problem with external commenting platforms. If you use Disqus - for example - for your comments section, then you might run into trouble because blog URLs will be different even if essentially the page being accessed is just the same.

3. A slight problem with AdSense earnings. Some users have complained about seeing a dip in their earnings when their pages are served through country specific domains.

4. An issue with link juice. You want external sites to link to you and not your country specific URL. But the issue here is that you can't control how others link to your page. They might use the top level domain or they might use the country code top-level domain.

Stop Blogger from Redirecting to Country-Specific Domains

If country specific redirection affects important factors such as traffic and link juice, and you need those in order to rank well, what can you possibly do? Well, thankfully, Google has provided a way to get around this. All you have to do is add an ncr/ to the end of the URL - ncr here stands for No Country Redirect. So basically, it goes frenchlitgeek.blogspot.com/ncr/.

That solution is great but do you want your users to always have to do that every time they visit your blog? To eliminate that hassle, and for the good of your site statistics, a simple redirection script will do the trick. Here's how:

1. Log in to your Blogger account.

2. Click on Template → Edit HTML.

3. Find the <head> tag in the HTML editor by opening the search box using Ctrl + F.

blogger country redirection

4. Copy the redirection code seen below after the <head> tag.
<script type="text/javascript">
var blog = document.location.href.toLowerCase();
if (!blog.match(/\.blogspot\.com/)) {
blog = blog.replace(/\.blogspot\..*?\//, ".blogspot.com/ncr/");
window.location.replace(blog);
}
</script>

5. Click on "Save Template".

Credit: labnol.com

And that's it! Whenever someone accesses your Blogger, they'll be taken to the top level domain rather than the country specific one.

Thứ Bảy, 10 tháng 10, 2015

Insert Adsense Inside Posts: After the First Paragraph

Want to know which part of your site or blog will bring you more profit? Add AdSense inside posts and then check out the famous Google AdSense heat map. Recent studies, however, showed that placing AdSense after the first paragraph of a site or blog is one of the best AdSense placement. Unfortunately, the default Blogger platform offered by Google doesn't allow placement of ad after the first paragraph. But because it has become one of the most profitable areas, plenty of webmasters have tried to take advantage of the best AdSense placement. How can you enjoy the same level of profit?

To solve the problem, we will just move the locations of the ads to be displayed by adding JavaScript and DIVs. With the following script, you can easily choose the paragraph or heading after which you want to inject the ad to. This way, you won't have to manually change every post.

adsense inside posts, adsense placement

How to Display AdSense Ads after the First Paragraph in Blogger

1. Log into your Blogger account, select your blog and click "Template" on the left side. Open the Template editor using the "Edit HTML" button.

2. Once the editor has opened, click anywhere inside the code area and press the CTRL + F keys (or Command + F) on your keyboard to open the editor' search box. Search the following line (press Enter to find it):
<data:post.body/>
Note: You will find multiple occurrences of <data:post.body/> but you need to stop at the second one, or if you don't see any changes, test the last one.

3. Add the below DIVs in red before and after like this:
<div id='adsense-target'><data:post.body/></div>
4. Copy the AdSense code that you want to show and use this tool to convert it into plain text. After conversion, add the following HTML and replace the "ADSENSE CODE HERE" text with the converted ad code just above the line that we just found:
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='adsense-content' style="display:block;text-align: center">ADSENSE CODE HERE</div></b:if>


Align AdSense Left or Right

By default, the Google AdSense ad unit will appear in the middle just after the first paragraph. If you are unhappy with the results and want to wrap text around the ad, you can choose one of the options below:

a) Align AdSense on the left - change <div id='adsense-content' style="display:block;text-align: center"> with:
<div id='adsense-content' style="display: inline-block;float: left;margin:15px 15px 15px 0px">
After modifying it, the ad will display something like this:

adsense inside posts, adsense placement

b) Align AdSense ad on the right of the content - change <div id='adsense-content' style="display:block;text-align: center"> with:
<div id='adsense-content' style="display:inline-block;float:right;margin:15px 0px 15px 15px">
5. Finally, right after <div id='adsense-target'><data:post.body/></div> from step 2, add this script:
<script type='text/javascript'>
function insertAfter(addition,target) {
var parent = target.parentNode;
if (parent.lastChild == target) {
parent.appendChild(addition);
} else {
parent.insertBefore(addition,target.nextSibling);
}
}
var adscont = document.getElementById(&quot;adsense-content&quot;);
var target = document.getElementById(&quot;adsense-target&quot;);
var linebreak = target.getElementsByTagName(&quot;br&quot;);
if (linebreak.length &gt; 0){
insertAfter(adscont,linebreak[0]);
}
</script>
Note:
- To insert the ad after the second paragraph, change "0" from the line in red with "2".
- If you want to put AdSense just below the heading h2 or heading h3 of a post, replace br from &quot;br&quot; with h2 or h3.

6. Click "Save template" to save the changes and you're done.

With this trick, you can insert AdSense after the first paragraph automatically in Blogger with ease. Now it's your turn to decide which format works best on your site.

Thứ Tư, 7 tháng 10, 2015

How to Add Font Awesome Social Icons in Blogger

It's near impossible to find a blog or site these days without at least one social media account to their name. Be it Twitter or Facebook, Instagram or Pinterest, or all of those for that matter, what's become increasingly clear is that social media helps increase your online presence.

Gone are the days when you used to rely on good old search engine results alone. These days, maybe you don't rank well in results for your keyword on Google or any other search engine, but you can launch a social media campaign that can hopefully give you the results that you want.

Essentially, your site and social media need to co-exist. One cannot live without the other, if you want another way of putting it. Social media is one of the best drivers of traffic on the internet, and if you want to increase your chances of being seen, then you have got to get an account on one or more platforms as long as it fits with your brand's identity.

font awesome social icons

Spreading Awareness of Your Social Media Presence

Once you've set up your social media accounts, you don't just leave it there to be discovered. Sure, you can make use of hashtags and communicate with industry leaders, but that's not enough to bring awareness to your customers. To let them know you have a presence on Facebook, Twitter, Instagram, Vine or Pinterest, you have to make use of the real estate on your website.

How exactly do you do that, you ask? Well, by means of social icons.

Social icons are those little images you see that represent a symbol associated with a particular social network. For example, social icons for Twitter usually feature a blue bird. If not that, then a lowercase letter T.

The presence of these images remind your viewers that they have other ways of being up to date with whatever you put out. Social media use is pretty high these days thanks to the immediacy of the medium as well as the fun factor. And more likely than not, your audience would want to know whether you're on any social network.

If you're on the Blogger platform, you can add these social media representations through Font Awesome social icons.

What is Font Awesome?

Font Awesome "gives you scalable vector icons that can instantly be customized - size, color, drop shadow, and anything that can be done with the power of CSS". In essence, it functions as a toolkit where you get access to more than 500 icons for use on your site - free of charge.

Now, if you've used social media icons before, you know that there are non-vector varieties. But those offered by Font Awesome are scalable vector icons, and in the long run, they are the better option for your site.

Why is that the case?

Well, a very good reason would be that images take time to load. Yes, these images are tiny but the point still stands. Plus, images tend to lose their quality as computer resolution increases. In other words, if you want your icons to load faster and have a nice, crisp and clean look, then you're better off with using the collection of Font Awesome. Also, the chance to customize your icons accordingly is definitely an attractive factor too.

Why you should start using Font Awesome?

Of the many providers out there, why stick with Font Awesome?
  • Large collection of icons. You'll not only find social media icons here, but other traditional icons as well.
  • CSS support. With CSS, you can adjust the icons according to what suits your site best. You can tinker with the colors, size, shadows and other components. This is something sorely lacking with non-vector images because you're stuck with the icon you chose.
  • Speed. Vector images are lightweight and therefore load faster.
  • Free. You don't have to pay a single thing when you use Font Awesome.
So now you know the importance of icons on your site, it's time to learn how to add Font Awesome icons in Blogger.

Adding Font Awesome Social Icons in Blogger

The adding of icons to your Blogger isn't rocket science. In fact, the process is pretty straightforward.
Here's what you have to do:

Add Font Awesome Stylesheet into Blogger

Follow the steps below to get Font Awesome working with your blog:

1. Open your Blogger dashboard, go to Template and press the Edit HTML button.
2. Click anywhere inside the code area and press CTRL + F keys to open the search box.
3. Type the <head> tag inside the search box and press Enter to find it.

font awesome stylesheet

4. Add the following line of code referencing the location of the font-awesome.min.css stylesheet just below the <head> tag:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />

5. Click the 'Save template' button to save the changes and start playing with Font Awesome!

Using the Font Awesome Icons

After you get the steps in the previous section done, you're now ready to use Font Awesome in your blog. The first thing you need to do is add the social icons links to the HTML and delete the icons that you don't need anymore. This is a sample HTML that you can add:
<div id="fawesomeicons">
<a href="URL-HERE" title="Facebook" target="_blank" rel="nofollow"><i class="fa fa-facebook"></i></a>
<a href="URL-HERE" title="Google Plus" target="_blank" rel="nofollow"><i class="fa fa-google-plus"></i></a>
<a href="URL-HERE" title="Twitter" target="_blank" rel="nofollow"><i class="fa fa-twitter"></i></a>
<a href="URL-HERE" title="Pinterest" target="_blank" rel="nofollow"><i class="fa fa-pinterest"></i></a>
<a href="URL-HERE" title="Instagram" target="_blank" rel="nofollow"><i class="fa fa-instagram"></i></a>
<a href="URL-HERE" title="Bloglovin" target="_blank" rel="nofollow"><i class="fa fa-heart"></i></a>
<a href="URL-HERE" title="Tumblr" target="_blank" rel="nofollow"><i class="fa fa-tumblr"></i></a>
<a href="URL-HERE" title="RSS" target="_blank" rel="nofollow"><i class="fa fa-rss"></i></a>
</div>
In the above HTML code, we can see 8 separate social icons which can be recognized by looking at the link title attribute. For example, the first one is for Facebook.

To use the social icons, paste your URL where it says URL-HERE for each social icon you want to include. Put the link between the quotes and make sure to not remove any of the quotation marks.

If you want to remove a social icon, just delete that line of code starting with "<a href" and ending with "</a>".

Now, keep in mind that Font Awesome works anywhere with the <i> tag as it was designed to work with inline elements. Although you can use <span>, official documentation prefers the <i> option for brevity.

Font Awesome icons can be placed anywhere using the CSS prefix fa together with the name of the icon. For a list of social media icon names, you can refer to the official website of Font Awesome.

Let's say that you want to display a Youtube icon so you can link it to your official account on the platform. Find the Youtube icon on the list and click on it:

font awesome icon

That will bring you to a page for Youtube where you will see this code:

font awesome social icons

To include the icon within the list, copy any line starting with "<a href" and ending with "</a> from the code above, paste where you want it to appear and replace the code starting with "<i class="fa " and ending with "</i>" with that of your chosen icon.

Finally, after adding the icon, the list will look like this:
<div id="fawesomeicons">
<a href="URL-HERE" title="Facebook" target="_blank" rel="nofollow"><i class="fa fa-facebook"></i></a>
<a href="URL-HERE" title="Google Plus" target="_blank" rel="nofollow"><i class="fa fa-google-plus"></i></a>
<a href="URL-HERE" title="Twitter" target="_blank" rel="nofollow"><i class="fa fa-twitter"></i></a>
<a href="URL-HERE" title="Pinterest" target="_blank" rel="nofollow"><i class="fa fa-pinterest"></i></a>
<a href="URL-HERE" title="Instagram" target="_blank" rel="nofollow"><i class="fa fa-instagram"></i></a>
<a href="URL-HERE" title="Bloglovin" target="_blank" rel="nofollow"><i class="fa fa-heart"></i></a>
<a href="URL-HERE" title="Tumblr" target="_blank" rel="nofollow"><i class="fa fa-tumblr"></i></a>
<a href="URL-HERE" title="RSS" target="_blank" rel="nofollow"><i class="fa fa-rss"></i></a>
<a href="URL-HERE" title="Youtube" target="_blank" rel="nofollow"><i class="fa fa-youtube"></i></a>
</div>
Note: don't forget to change the title and add your URL between the quotes.

Once you've finished editing the icons, insert the code into a HTML/Javascript gadget by going to "Layout" and click on the "Add a gadget" link. If you're using WordPress, paste it in a Text widget.

Customize the Font Awesome Icons Using CSS

Suppose you want to make the icons a lot bigger than they currently are. That task is made simple with the use of CSS. Here's a sample code:
#fawesomeicons a {
    font-size: 16px;
    width: 30px;
    height: 30px;
    line-height: 30px;
}
To change the font size, increase or decrease the 16px value. Below are the values (30px) for the container's width and height which should always match. Increasing/decreasing these values, will increase/decrease the size of the container where is the font.

Here are some different styles for the font awesome social icons. In the CSS, look for the #background-color, #border-color, #font-color and #hover-color text so that you can know here to put the color codes. You can use this tool to generate the color code: Color Code Generator. If you don't know how to add CSS, follow this tutorial.

font awesome social icons

#fawesomeicons {
text-align: center;
}
#fawesomeicons a {
background: #background-color;
color: #font-color;
display: inline-block;
font-size: 16px;
width: 30px;
height: 30px;
line-height: 30px;
margin: 0 1px 6px;
}
#fawesomeicons a:hover{
background: #hover-color;
}

font awesome social icons

#fawesomeicons {
text-align: center;
}
#fawesomeicons a {
background: #background-color;
color: #font-color;
display: inline-block;
font-size: 16px;
width: 30px;
height: 30px;
line-height: 30px;
margin: 0 1px 6px;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
}
#fawesomeicons a:hover{
background: #hover-color;
}

font awesome social icons

#fawesomeicons {
text-align: center;
}
#fawesomeicons a {
border: 1px solid #border-color;
color: #font-color;
display: inline-block;
font-size: 16px;
width: 30px;
height: 30px;
line-height: 30px;
margin: 0 1px 6px;
}
#fawesomeicons a:hover{
background: #hover-color;
}

font awesome social icons

#fawesomeicons {
text-align: center;
}
#fawesomeicons a {
border: 1px solid #border-color;
color: #font-color;
display: inline-block;
font-size: 16px;
width: 30px;
height: 30px;
line-height: 30px;
margin: 0 1px 6px;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
}
#fawesomeicons a:hover{
background: #hover-color;
}

font awesome social icons

#fawesomeicons {
text-align: center;
}
#fawesomeicons a {
color: #font-color;
display: inline-block;
font-size: 23px;
margin: 0 6px 6px;
}
#fawesomeicons a:hover{
background: #hover-color;
}

Now, what if we want to change the background or font color of a specific icon? First, we need to identify the icon class which is just after the <i class="fa ..." and add it like this:
#fawesomeicons a .fa-facebook {
background: #background-color;
color: #font-color;
}
Here, we can change the background and color for the Facebook icon but we can do it for any icon you want. For example, let's add another rule for the twitter icon:
#fawesomeicons a .fa-facebook {
background: #background-color;
color: #font-color;
}
 #fawesomeicons a .fa-twitter {
background: #background-color;
color: #font-color;
}
To make the fonts bigger, we can add the CSS code like this:
#fawesomeicons {
text-align: center;
}
#fawesomeicons a .fa{
display: inline-block;
font-size: 16px;
width: 30px;
height: 30px;
line-height: 30px;
}
#fawesomeicons a .fa-facebook {
background: #background-color;
color: #font-color;
}
 #fawesomeicons a .fa-twitter {
background: #background-color;
color: #font-color;
}
To apply, copy the code above and add the CSS rule with the icon class that you wish to change.

Important: When adding the class for your icon, always put a dot (.) in front of it as you can see in the example above, otherwise it won't work.

And that's it! Hopefully, this tutorial helped you to add Font Awesome social icons in Blogger. If you're still in trouble adding them, please take a look at Examples page.