Tuesday, 28 October 2014

Android Swipe Views with Tabs

In this post we are going to learn about how to integrate the android tab view with the fragments using ViewPager and ActionBar class. For displaying the tabs on the top of the screen you need to interact with the android action bar, this is because the tab views is connected with the action bar.
Ads by Google



In this example application we make three tabs called "java", "php" and ".Net" and there are three seperate fragement view for each of these tabs.

First you need to add the ViewPager into the activity_main.xml file.
 <android.support.v4.view.ViewPager  
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
</android.support.v4.view.ViewPager>

Now create three layout files for the fragments.

1. java_layout.xml
 <?xml version="1.0" encoding="utf-8"?>  
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D881DA"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="58dp"
android:text="Welcome to java page"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>

2. php_layout.xml
 <?xml version="1.0" encoding="utf-8"?>  
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0B9AE2"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="97dp"
android:text="Welcome to php page"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>


3. dotnet_layout.xml
 <?xml version="1.0" encoding="utf-8"?>  
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E2D40B"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="42dp"
android:text="Welcome to .Net page"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>


Now we need to inflate each of these layouts using the inflate() method.

1. JavaFragment.java
 package com.tabdemo;  
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class JavaFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
return inflater.inflate(R.layout.java_layout, container,false);
}
}

2.  PhpFragment.java
 package com.tabdemo;  
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class PhpFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
return inflater.inflate(R.layout.php_layout, container,false);
}
}


3. DotNetFragment.java
 package com.tabdemo;  
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class DotnetFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
return inflater.inflate(R.layout.dotnet_layout, container,false);
}
}


Now create an adapter class that extends FragmentPagerAdapter and define override method getItem. The getItem() method will return an object of fragment.

FragmentPageAdapter.java
 package com.tabdemo;  
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
public class FragmentPageAdapter extends FragmentPagerAdapter {
public FragmentPageAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int arg0) {
// TODO Auto-generated method stub
switch (arg0) {
case 0:
return new JavaFragment();
case 1:
return new PhpFragment();
case 2:
return new DotnetFragment();
default:
break;
}
return null;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return 3;
}
}

MainActivity.java
 package com.tabdemo;  
import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
public class MainActivity extends FragmentActivity implements ActionBar.TabListener{
ActionBar actionbar;
ViewPager viewpager;
FragmentPageAdapter ft;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewpager = (ViewPager) findViewById(R.id.pager);
ft = new FragmentPageAdapter(getSupportFragmentManager());
actionbar = getActionBar();
viewpager.setAdapter(ft);
actionbar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionbar.addTab(actionbar.newTab().setText("Java").setTabListener(this));
actionbar.addTab(actionbar.newTab().setText("Php").setTabListener(this));
actionbar.addTab(actionbar.newTab().setText(".Net").setTabListener(this));
viewpager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageSelected(int arg0) {
actionbar.setSelectedNavigationItem(arg0);
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
// TODO Auto-generated method stub
}
@Override
public void onPageScrollStateChanged(int arg0) {
// TODO Auto-generated method stub
}
});
}
@Override
public void onTabReselected(Tab tab, FragmentTransaction ft) {
// TODO Auto-generated method stub
}
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
viewpager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
// TODO Auto-generated method stub
}
}


Deciduous blog posts leave evergreens for dead

In a social-media world, deciduous blog posts have an enormous advantage of both ever-green and ephemeral content - find out what they are, and how to use them to best advantage.



Introducing deciduous blog posts

In botany and horticulture, deciduous plants
... are those that lose all of their leaves for part of the year. (Wikipedia)

In blogging, deciduous posts are ones that your readers lose all interest in at certain times - eg posts about Christmas carols during January, or winter gardening tips during spring.

Which sounds bad.

Until you realise that deciduous posts are also ones that your readers (both current and new ones) gain renewed interest in at certain times. That means it's quite reasonable for you - and everyone else  - to mention them on Facebook, Twitter, Google+ each time that the new "season" starts.   If your posts are good, you might even get more new visits from social media in the subsequent seasons than in the first time around.

When you think about it, it's easy to see that in a social-media world ...

Text superimposed on an ever-green pine forest, photographed from the air (aerial photo, not satellite)


Deciduous blog posts leave evergreens for dead.


What does this mean for bloggers

If getting more visitors through either search or referrals is important for your blog, then you should :
  • Be systematic about  how you remember to promote seasonal posts you've already published.   
  • Find ways to write posts that will be become popular on a cyclical basis.
  • Make strategic decisions about whether to change an existing post vs when to make a new post about a seasonal topic.
  • Set up Labels or custom-redirects to send people who end up on a previous-year post to the most recent one.


Remember to promote your seasonal posts

santa claus with a sack of toys on his back - the seasonal gift-giving symbol
Make a calendar of significant factors that should cause extra traffic for your blog, and send yourself a reminder message in time to review and re-share the relevant posts, according to your blog's social media strategy.

Working out exactly when do these promotions can be tricky. Ideally this is based on studying your visitor statistics (Analytics or whatever tool you use) to see when the posts got popular last time around.

You might think that you know anyway, because the seasons are obvious, but it's easy to miss earlier-than-expected surges in interest. For example, posts about Christmas music might actually be popular with music directors who're choosing their Christmas programs in September. But you do need to be careful about and where how you promote posts like this - because no one else wants to be reminded about Christmas so soon!

Finding seasonal posting reasons in non-seasonal blogs

Some blogs clearly have cyclic patterns: gardens follow the natural world, folk songs follow holidays (eg workers-rights songs for labor day, patriotic songs for national days), gift suggestions follow established human seasons (Christmas, Valentines), homeschoolers generally follow the school year.

But if you look harder, you can find seasonal patterns that apply to lots of other blogs, too. For example, one well-known blogger-helper often does a post towards the end of the American college year reminding people to transfer ownership of their blogs to a non-college Google account.

Ways to do this include:
  • Blogging about the similarities (or differences) between your niche and some unrelated by widely-known seasonal event  (eg "Writing poetry is not like Christmas because ...".
  • Writing about famous people in your topic who have died - close to their anniversary or birthday.   
  • Making up your own seasonal patter  eg   "In March, Crotchet-Blogger celebrates cable-stitch". 

Promotion existing posts vs publishing new ones

A big question for bloggers with deciduous blog topics is whether they should publish a new post each season, or just polish and promote the existing post(s).

The answer depends on the nature of the information each season:

SituationWhat do do
Are there changes to the information each season?

Make a new post, link to it from the last season's posts, promote it like you do any other post.

Does exactly the same information apply each year

Review the existing post, and then promote it on social media - and perhaps in the blog itself or in other new posts.


For example, one of my blogs is about public transport news in my city.  This has clear seasonal patterns around public holidays, the tourist season, a major sporting event, and the academic year.   The sporting event causes the biggest peak, with web-traffic up by 600%, week-on-week.  Each year's  information for it is very similar: buses leave at (roughly the same time) from (exactly the same place) for (close to the same fare) as last year. But each year there are changes: slightly different times, different effects on other bus services, one year there was a park-and-ride. So for this blog, I do a new post each year.   And I go back into last year's post and add a line like
"This information is for 2013.   Click here for this year's bus services."
and I make the "here" link to a label search for the topic, so that the most recent post will always come up first in the list.

By comparison, in another blog, I've published a printable sheet of non-religious Christmas carol words for which copyright has expired.  Over time, it will be possible to add extra carols to this.  But this won't happen each year - and all the existing content will continue to be relevant forever. So I don't republish this in a new post each year.   Instead, I promote it with a gadget on the sidebar, and I share the post on my social media accounts for the blog.

Be aware that if you do decided to make a slight change to an existing seasonal post, rather than write a new one:



Other things to think about

When you thinking about how you can get the more traffic using the deciduous posts in your blog, there are a few other factors to keep in mind:

Look for multi-year cycles

Some events happen once every 2, 3 or more years. For example:
  • Some sports events (the Olympics, the Volvo Ocean race, the Commonwealth games) happen every-so-many years. 
  •  Leap years happen once every four years.
  • In some countries, elections happen every five years.

These multi-year patterns can be even more powerful than the every-year ones, because less people are aware of them, and readers in general are not-so-likely to remember what you wrote four years ago.

Don't forget the Southern Hemisphere

Spring starts in September, not February, if you live in the bottom half of the world. And cars need to be prepared for winter in April, not November.

This may mean that you can re-promote posts based on natural seasons twice a year - or that you should target some seasonal posts by hemisphere.

Some readers have different holidays

festival of light decoration:  central candle circled by shells each with a small candle on it, with a yellow-woven backing cloth
It's easy to think that all your readers are just like you, and live with the same seasonal patterns that you do.   But that's not always true:
  • People who don't live in America might not even know when Thanksgiving or Black Friday is, much less what it means.
  • In many Western countries, Christmas is a holiday even for people who aren't religious. But there are countries where Christmas isn't a holiday at all and most people don't even know it exists.



How have you used seasonal / deciduous topics to get new interest in your blog?




Related Articles:

Mapping out your blog's social media strategy: how your blog works with your Facebook, Twitter, Pinterest, etc accounts

5 reasons why SEO doesn't matter for your blog

Using labels to categorise blog posts

Transferring a blog to a new owner

Follow-by-email, an easy way to offer email subscription to your blog

Sunday, 26 October 2014

How to create your own author-centered knowledge graph

own author-oriented knowledge graph
I'm not a fear salesman, really! But the thought to name this article as "how to defend abusive content removal requests" comes to me from the reading of the Google's updated report on "How Google Fights Piracy". The following sentence makes me conceiving suspicion:
...sites with high numbers of removal notices may appear lower in search results.
On the background of all known Negative SEO cases this can be the next thing, where a honest publisher will be punished for nothing.

There are enough known cases, where content scraping sites get better SERP places as the unique content providers. And there are enough abusive content removal requests - just read the Google's report. The best defense is a good offence. We construct our publishing identities network, which serves as our own author-oriented knowledge graph. Its purposes are, that
  • always working removal requests at Google and DMCA takedowns,
  • lack of effect in case of abusive third part removal requests,
  • doubtless machine-readable relations between author's entity and author's creative work.
Our objective is a solid, structured and chained publisher identity, which will include the author, the publishing medium and the publication itself. Let's work!
Read full article »

How to create nested lists in Blogspot

I've struggled some time with creating of nested lists in my blog at Blogspot. Then i realized a simple workaround to get them done. To create nested lists in Blogspot, you must
Read full article »

How to put Adsense Ads anywhere inside Blogger Posts

Bloggers often struggle to put adsense ads at the correct place so that they get sufficient clicks on their ads. One such place is in middle of the post (not on the homepage). One way is to add the same code in the HTML coding of each post, but its too complicated and need repetition of same thing again and again. There is an alternate method to achieve this goal.
It will take some time and skill of yours to implement it, but in the end results will be amazing.

What do u need:

  • Basic understanding of HTML coding.
  • Fluent in using Notepad (Find and Replace Function)
  • Able to press Ctrl+C and Ctrl+V buttons on your keyboard.


So lets start it. Follow the following steps to put adsense ads anywhere inside blogger posts.

1. Edit any post and place the following code in the HTML coding where you want the adsense ad to appear and then save and close.

<!-- adsense -->

2. Open your adsense account and create a new adsense unit of the desired shape and size. Copy the asynchronous code of ad unit and paste it in a notepad.
3. Use find and replace feature of notepad and perform the following things

  • Find < replace with &lt;
  • Find > replace with &gt;
  • Find " replace with &quot;

4. Now your Ad code is ready. You can put it inside <center> and </center> to align it in the center position in the blog.
5. Paste the following code above the ad code in the notepad

<div expr:id='"adsmiddle1" + data:post.id'></div>
<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div style="clear:both; margin:10px 0">


6. Paste the following code after the ad code in the notepad

</div>
</b:if>
</b:if>
<div expr:id='"adsmiddle2" + data:post.id'>
<data:post.body/>
</div>
<script type="text/javascript">
var obj0=document.getElementById("adsmiddle1<data:post.id/>");
var obj1=document.getElementById("adsmiddle2<data:post.id/>");
var s=obj1.innerHTML;
var r=s.search(/\x3C!-- adsense --\x3E/igm);
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>


7. Now open the template in blogger. Now you have to edit its HTML coding. Its better to take backup of your template coding before editing.
8. Once you are inside Template HTML coding, click inside 1st line of code and press Ctrl+F and try to find the following code

<data:post.body/> 

9. There may be three instances of this code inside template code. You have to replace the second instance of it with the complete code in the notepad. Save the template.
10. You should get the desired results now. But if you don't then revert back the step 9 and replace the 3rd instance of <data:post.body/> with the code in notepad.

Note: Different blogger templates work in different way. Thats why in some templates step 9 works while in some step 10 works.

You may leave your comments to let me know if this trick works for you. Your suggestions are most welcome.

How Penguin evaluates the link quality

Google's Penguin update is about links, namely about good and bad backlinks to your site. It will evaluate anchors of your backlinks and the quality of backlinking sites. Further it will look deeper into relations between your site and sites linking to you.

Further are some factors listed, which will help you to rethink your linking strategy and, maybe, enlighten you in purifying your link profile, so the Penguin gets no appetite for eating your site;)

Following characteristics do influence on how Penguin evaluates link profile quality of your site:
Read full article »

Monday, 20 October 2014

Letting other people send email from your Google account - and checking who can do this already

This article explains how you can control who can send mail on your behalf if you have a gmail account, why you might want to do that, and how to stop people from sending email messages on your behalf.



If you have given other people rights to publish to your blog , then you may also want to let them send emails on your blog's behalf - particularly if you are using an "organisational" email account.   I do this for several blogs - eg the one for the choir that I'm currently doing public relations for.

This is a way to let the the other people use their current email client, ie what looks to them like their "normal email", but still to send official-looking messages from your organisation or blog.

Note that this is not the same as spoofing, which is a way that people with malicious intentions create email messages which appear to come from your account, even though you didn't send them and did give anyone else permission to send them.
  • Spoofing, ie sending "on behalf of" without permission is bad.
  • Granting "Send as" rights is good - and is a very useful feature that Gmail offers.

How to allow another email account send emails on your behalf

Log into www.gmail.com, using the Google / Blogger account that you want to lets other people send from.

From the Options gear-wheel (top right corner), choose Settings.

Choose the Accounts and Imports tab.

Click the "Add another email address that you own" link in the "Send mail as" section.

Enter the email address you want to give rights to, and the name which you want to be displayed when people receive email sent by this address on your behalf.




Click Next

Enter the other account's password. (This is a first step to stop you from impersonating someone by sending emails on behalf of accounts which you don't own.)




Click Add Account

Wait for the verification email to arrive at the other email address (if you use a web-based system for it, you may need to open it in a different browser).

Open the message and either click the link provided or copy-and-paste the code into the gmail window.



Job done!   The email account that you named should now be able to send messages which look like they came from you.


How another email account can send emails on your behalf

Firstly, you must give the other account permission to send emails which look as though they come from you - as explained in the section above.

Once you have done that, anyone using the other account can enter you (ie your gmail account) as the message-sender, and they will be permitted to send the message like this.

How specifically they do it depends on the email system which they use: In Gmail there is simply a drop-down box beside the From address, while other tools have different approaches.



Controlling who can send emails on your behalf - how to stop people sending emails from you

If you manage an email account which regularly gives other people the right to send on your behalf, then it is a good idea to regularly review the list, and revoke the access of anyone who doesn't need to send any more. To do this:

Log into www.gmail.com

Choose Settings from the Options gear-wheel (top right corner).

Choose the Accounts and Imports tab.

The list of email addresses beside Send Mail As is all the people who have been authorized to write emails that are sent as though they come from the current account.




Beside every entry on this list, there are options to:
  • Make it the sending default for your account
  • Edit the sending information (mainly the display name)
  • Delete its rights to send on your behalf.
If you see an email address which shoudn't be sending any more, then delete it, by clicking the Delete link.

It's a good idea to check this, also, if someone has just given you a Google account instead of using the full procedure to transfer ownership of a blog to you.



Questions / Troubleshooting

Does this only work for Gmail accounts?

No. These instructions show you how to set up your gmail account so that other email accounts can send email "from" your account. But the other acccount does not need to be a Gmail account or a Google account - provided it has a feature to let the user say what account to use as the sender.


Where is the Sent-Mail copy of the message kept?

When you send a message from Gmail with a different account selected as the sender, then the "send mail" copy of the message is put into the send-mail folder of the account that you are logged into.

If you would like the nominated account to also get a copy of the message, then the person who is writing it needs to put that nominated account is as a carbon copy (CC) or blind-carbon-copy (BCC) recipient, as well as selecting it as the From address.




Related Articles:

Letting other people post on your blog

Understanding Google accounts

Transferring blog-ownership to a different account

Sunday, 19 October 2014

AUD/USD Monthly Report 20/10/2014

The current price action is following a retest pattern, where it retests last year's breakout that often aligns with the Yearly 50% level. Once that completes, my view is that the AUD will resume its downward trend towards the 2014 lows.

Previous Monthly Report

AUD Primary cycles
 
As we can see the AUD has tested the 2014 50% level and failed, as part of the Primary cycle break and extend pattern from the 2013 lows towards the 2014 lows.  (minimum move .8564 towards .8310).
 
Current resistance is around the monthly 50% levels @.8930, as part of the monthly break and extend pattern from September lows to the November lows.
 
 
Long term trend will be define by the next Primary cycle in 2015, and whether those cycles dip lower, as the AUD is currently in a 2 period Primary Cycle downward trend.

Add 6 Stylish Custom Search Boxes To Blogger

There's an unspoken rule in the world of web design that says that every website have a search box. You can, and should, design a custom search gadget to Blogger that contributes to the theme of your site while providing some key benefits to both your customers and you.

Benefits to Customers

Search boxes not only help to increase your website's design usability, but they're very convenient to site visitors and regulars. For those that have been to your site before, they know what they want and they want it now. These are the impatient people who don't feel like wading through different links. If you don't accommodate this problem you might risk losing those readers.

For newer customers who want to get a feel for your site before investing any more time, it gives them the chance to look for their interests on both eCommerce sites and blog sites.

Benefits To You

Adding a custom search gadget to Blogger perhaps best benefit eCommerce sites because it's an industry that inherently offers a lot of very specific products. For instance, if you sold clothing apparel and someone was only look for shirts, the search would result would only bring up shirts so that person can look through everything in one place.

Bloggers might not have products to offer, but adding a custom search gadget to Blogger can help site analytics and SEO. Google Analytics offers a tool that will track all the searches performed by your search bar, so that you can use this data when improving your keyword usage and content choices. Google web crawlers and search engine bots will also test out phrases in these boxes on the rare occasion to make sure that all your content leads to somewhere creates a closed loop.

Add Your Own Custom Search Gadget To Blogger

Just because you should have a search bar doesn't mean you you're restricted to what time. Your site's search bar should be easy to find and readily available whenever someone needs it, but other than that the look of the design is up to you. If you want to add a custom search gadget to Blogger, here are 6 stylish choices to pick from. Just copy the code below the search box that you want to add and follow the steps below:

<style type="text/css">
#searchbox{background:#d8d8d8;border:4px solid #e8e8e8;padding:20px 10px;width:250px}input:focus::-webkit-input-placeholder{color:transparent}input:focus:-moz-placeholder{color:transparent}input:focus::-moz-placeholder{color:transparent}#searchbox input{outline:none}#searchbox input[type="text"]{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSUcZFP0661qQx0TKLPQ_bpN607LnmvHlGx5IBc_aJTSTVrWkU92E_DgWj41emEOmekscHFfWMiC0QBVlYMRiKw5NJDjrHHhgPOvcq2pnutp41doak9tKYu46JxxLSvS1627TaOIl_3lkN/s1600/search-dark.png) no-repeat 10px 6px #fff;border-width:1px;border-style:solid;border-color:#fff;font:bold 12px Arial,Helvetica,Sans-serif;color:#bebebe;width:55%;padding:8px 15px 8px 30px}#button-submit{background:#6A6F75;border-width:0;padding:9px 0;width:23%;cursor:pointer;font:bold 12px Arial,Helvetica;color:#fff;text-shadow:0 1px 0 #555}#button-submit:hover{background:#4f5356}#button-submit:active{background:#5b5d60;outline:none}#button-submit::-moz-focus-inner{border:0}
</style>
<form id="searchbox" method="get" action="/search">
<input name="q" type="text" size="15" placeholder="Type here..." />
<input id="button-submit" type="submit" value="Search" /></form>

<style type="text/css">
#searchbox{width:240px}#searchbox input{outline:none}input:focus::-webkit-input-placeholder{color:transparent}input:focus:-moz-placeholder{color:transparent}input:focus::-moz-placeholder{color:transparent}#searchbox input[type="text"]{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSUcZFP0661qQx0TKLPQ_bpN607LnmvHlGx5IBc_aJTSTVrWkU92E_DgWj41emEOmekscHFfWMiC0QBVlYMRiKw5NJDjrHHhgPOvcq2pnutp41doak9tKYu46JxxLSvS1627TaOIl_3lkN/s1600/search-dark.png) no-repeat 10px 13px #f2f2f2;border:2px solid #f2f2f2;font:bold 12px Arial,Helvetica,Sans-serif;color:#6A6F75;width:160px;padding:14px 17px 12px 30px;-webkit-border-radius:5px 0 0 5px;-moz-border-radius:5px 0 0 5px;border-radius:5px 0 0 5px;text-shadow:0 2px 3px #fff;-webkit-transition:all 0.7s ease 0s;-moz-transition:all 0.7s ease 0s;-o-transition:all 0.7s ease 0s;transition:all 0.7s ease 0s;}#searchbox input[type="text"]:focus{background:#f7f7f7;border:2px solid #f7f7f7;width:200px;padding-left:10px}#button-submit{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2rr-3E-xqszQymLiCn2y0QVtSZcyhuplTLBfkQjEvNX-O66MpRCIsi7_lclP2QUNjpE35sh55psvuUN9yDPNge3C7tCdOFpyd3yUrHWc8TL6TnlP9TqEOKk4udj7YInDT0YclITKuqy7_/s1600/slider-arrow-right.png) no-repeat;margin-left:-40px;border-width:0;width:43px;height:45px}
</style>
<form id="searchbox" method="get" action="/search" autocomplete="off"><input name="q" type="text" size="15" placeholder="Enter keywords here..." />
<input id="button-submit" type="submit" value=" "/></form>

<style type="text/css">
#searchbox{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaQdEHosjRiexyg65K55h8pz36k4dCNFT0juKZ26baM0Tghx5jURqth6eTwpWJ3frBYElNbQQBmPL4Hv0ooz48StGwxt0GDnX9lEqAbF53ZRwB3U5dpymsSETK1a53r8npIf6akRgKVWZ3/s1600/searchbar.png) no-repeat;width:208px;height:29px}input:focus::-webkit-input-placeholder{color:transparent}input:focus:-moz-placeholder{color:transparent}input:focus::-moz-placeholder{color:transparent}#searchbox input{outline:none}#searchbox input[type="text"]{background:transparent;margin:3px 0 0 20px;padding:5px 0;border-width:0;font-family:"Arial Narrow",Arial,sans-serif;font-size:12px;color:#828282;width:70%;display:inline-table;vertical-align:top}#button-submit{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwONPeusKscMiWUPyNifO00FVnym7LQ8k2nSzJYYMAq_z2MtDPzKDCi6wpJKVSCu-TTqnasZvvnw65GIjy_QZ2M3pZtyCdTDnpmpPXVXuMx1Fsbdpv6Z684-ThUucWN196MHwsNPBcE3Nj/s1600/magnifier.png) no-repeat;border-width:0;cursor:pointer;margin-left:10px;margin-top:4px;width:21px;height:22px}#button-submit:hover{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS36k7UYhgZ8b928ssYkXQ8VUYem7kHwFAQ3Sm6VXpB82MViWxKG5bl_PwJtioISg8nM5u6V_SPvTEK4zOZyjdFCYtSTlu-_skswhexEKDBtoJQvSdudqCk6btS9I1dqEhzrNCuBYwhCsC/s1600/magnifier-hover.png) no-repeat}#button-submit:active{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS36k7UYhgZ8b928ssYkXQ8VUYem7kHwFAQ3Sm6VXpB82MViWxKG5bl_PwJtioISg8nM5u6V_SPvTEK4zOZyjdFCYtSTlu-_skswhexEKDBtoJQvSdudqCk6btS9I1dqEhzrNCuBYwhCsC/s1600/magnifier-hover.png) no-repeat;outline:none}#button-submit::-moz-focus-inner{border:0}
</style>
<form id="searchbox" method="get" action="/search" autocomplete="off"><input name="q" type="text" size="15" placeholder="search..." /><input id="button-submit" type="submit" value="" /></form>

<style type="text/css">
#searchbox{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOJ2mOTuFaoIF0LemZmxlzBB0ILWZPjVhjT6G9VszpxcGefDdhg1OoboTBIbeu7OYbPOy0uXERpSlVqoPNuCTf_xpyozmXVdOeMY0svBDb76vDPIDwTquWTNmZwaXxNf6qJbzjkQnhw_UP/s1600/search-box.png) no-repeat;height:27px;width:202px}input:focus::-webkit-input-placeholder{color:transparent}input:focus:-moz-placeholder{color:transparent}input:focus::-moz-placeholder{color:transparent}#searchbox input{outline:none}#searchbox input[type="text"]{background:transparent;margin:0 0 0 12px;padding:5px 0;border-width:0;font:italic 12px "Arial Narrow",Arial,sans-serif;width:77%;color:#828282;display:inline-table;vertical-align:top}#button-submit{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgG1hrcduvitwc_EV9CFwr0H91279bsdEq5aXJkhUGysEtz7H5GwGedB73rzJfz9bxryTBss5o2gONoQHDsNwEpygz-OdE_zbnYpZ3SieMKxed50zPpfPERlEa8c7Grn-6-Ja-EQuIfSg7/s1600/search-button.png) no-repeat;border-width:0;cursor:pointer;width:30px;height:25px}#button-submit:hover{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgry64nW_sQOHmnPIjEgHJanIhZ5UT_8K-XIhQo2aUQcajJD8Jgesuka7ZUHCzErd9i6Zlx-YUVLuoKvVv6hzie-2xT8W7YqgksPApTa53OTAL87DsgAedqVd5EFn2Xt_e2I1i1kw50FDmM/s1600/search-button-hover.png) no-repeat}#button-submit::-moz-focus-inner{border:0}
</style>
<form id="searchbox" method="get" action="/search" autocomplete="off"><input name="q" type="text" size="15" placeholder="search..." /><input id="button-submit" type="submit" value="" /></form>

<style type="text/css">
#searchbox{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiv70ou96cEyNGAFP5eM8X59d4Lw6GjFM8-L_-N71NlwxB3_xZ7-yYr4LhG8Jglwgy1E0ITkZyKCTnT2dgwagaURf-ryL6Y2ISM3vPN23Xmacjb6RDGJcC1i74rHDNnCZ0dsfOwurGm2Yy6/s1600/search-box1.png) no-repeat;width:250px;height:65px}input:focus::-webkit-input-placeholder{color:transparent}input:focus:-moz-placeholder{color:transparent}input:focus::-moz-placeholder{color:transparent}#searchbox input{outline:none}#searchbox input[type="text"]{background:transparent;padding:2px 0 2px 20px;margin:10px 15px 0 0;border-width:0;font:bold 16px "Brush Script MT",cursive;color:#595959;width:65%;display:inline-table;vertical-align:top}#button-submit{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUlc9vNgcSjyP2kZfHZN4_PNBpG14wk_9AFzVYDr-9DU576uhzGinXnCLXHsPGYQqPSc3N2Z8Rccz9Txi_PJoTY5M2m5wKr8g4M3nd6IvNJZ1HmiMu4di0k5QfIDsnteV6OPqcz4qvPDd9/s1600/magnifier.png) no-repeat;border-width:0;cursor:pointer;margin-top:10px;width:19px;height:25px}#button-submit:hover{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY_O1YEHlrGD0SF24pNbBHSSC6Toz_hw2mjULX0ufVslCiwPdtMb5CdAtkjrxyyFoFWKmCNyY4T6IEiCm3he8xNfrvpEOsouRCW5q6BOB__HddyrLdwBoYVJXibOpO6U1w6RzokOQDASh_/s1600/magnifier-hover.png) no-repeat}#button-submit:active{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY_O1YEHlrGD0SF24pNbBHSSC6Toz_hw2mjULX0ufVslCiwPdtMb5CdAtkjrxyyFoFWKmCNyY4T6IEiCm3he8xNfrvpEOsouRCW5q6BOB__HddyrLdwBoYVJXibOpO6U1w6RzokOQDASh_/s1600/magnifier-hover.png) no-repeat;outline:none}#button-submit::-moz-focus-inner{border:0}
</style>
<form id="searchbox" method="get" action="/search" autocomplete="off"><input class="textarea" name="q" type="text" size="15" placeholder="Search here..." /><input id="button-submit" type="submit" value="" /></form>

<style type="text/css">
#searchbox{width:280px;background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia54aAHWdc1223eAiDsIgWPBeJrbVnXzJymZE1cOg9DtwSxuLeUcvAz5jcRqO5oyYK0HWvfkM66JjDkW5j5D_UwAxT1BMGtg1OnyYyqh5gNtsWKG_8g2_qUzQfLKSdR-M4B-Zu_80rRL_C/s1600/search-box.png) no-repeat}#searchbox input{outline:none}input:focus::-webkit-input-placeholder{color:transparent}input:focus:-moz-placeholder{color:transparent}input:focus::-moz-placeholder{color:transparent}#searchbox input[type="text"]{background:transparent;border:0;font:14px "Avant Garde",Avantgarde,"Century Gothic",CenturyGothic,"AppleGothic",sans-serif;color:#f2f2f2!important;padding:10px 35px 10px 20px;width:220px}#searchbox input[type="text"]:focus{color:#fff}#button-submit{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU1c0S_r-O4gpDclMyXYWuaJVJSKExZpHjLdtSImKMKbf-gMC4WV9P-mB6vM68haCI45Hb-y3oSMxeL74q-fVu_8wz8nKOd_QoavniBnOKLrkDK5Lmf7D8Swwx0MMF76uCBs1meRJ-gAK8/s1600/search-icon.png) no-repeat;margin-left:-40px;border-width:0;width:40px;height:50px;cursor:pointer}#button-submit:hover{background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq_Hs2WZUI-O_UlzwpXq6pTAZaGZJnqIrDjz5UNr5sf7WetF0mo0HFiW0C3qtDpoIfJ4btTuXAIEmI6WJ_cE4N_pq_JXuR_MiT0_-7lLXhFyj8bkv9slW3gqA1J3d6JmWwA5XDTDcggvch/s1600/search-icon-hover.png)}
</style>
<form id="searchbox" method="get" action="/search" autocomplete="off"><input name="q" type="text" size="15" placeholder="Enter keywords here..." /><input id="button-submit" type="submit" value=" "/></form>

Steps: How to Add a Custom Search Box to Blogger

Step 1. Log in to your Blogger account, then go to Layout > click on the 'Add a gadget' link on the left side.

Step 2. Choose HTML/JavaScript from the pop-up window > paste the code of the search box inside the empty box.

Step 3. Press Save.


That's it!

There you have it, 6 stylish choices that will let you take advantage from all the great benefits of using a search box, while still helping you make your blog stand out. After adding your new search bar, your visitors will be able to navigate through your site and get to the same place using both the box and the navigation bar.

Android Chat Bubble tutorial

In this post we will discus about how to create a simple android chat application graphical user interface and how the data is displayed in it.  

Before going to create this application, you need to know about the 9 patch images. A 9 patch image is a normal png image with 1 dp pixels extra wide border.  In a chat application you can notice that the length and width of the chat bubble (image displayed at the background of the chat message) is automatically stretched based on its contents like shown below. Such type of an image is called a 9 patch image. You can save the 9 patch images in the drawable folder of your application with file extension .9.png.
Ads by Google



You have a lot of on-line tools are available to make 9 patch images and of-course you can use Photoshop to create your own 9 patch image. You can also use the draw9patch tool available with the android sdk. You can find this tool in the tools folder of your android sdk.
Watch video How to create 9 patch images. 


Here in this application we use a list view with a text view on it for display the message and we set a 9 patch image as the textview background. 

MainActvity.java
 public class MainActivity extends Activity {  
ListView listview;
EditText chat_text;
Button SEND;
boolean position = false;
ChatAdapter adapter;
Context ctx = this;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listview = (ListView) findViewById(R.id.chat_list_view);
chat_text = (EditText) findViewById(R.id.chatTxt);
SEND = (Button) findViewById(R.id.send_button);
adapter = new ChatAdapter(ctx,R.layout.single_message_layout);
listview.setAdapter(adapter);
listview.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
adapter.registerDataSetObserver(new DataSetObserver() {
@Override
public void onChanged() {
super.onChanged();
listview.setSelection(adapter.getCount()-1);
}
});
SEND.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
adapter.add(new DataProvider(position, chat_text.getText().toString()));
position = !position;
chat_text.setText("");
}
});
}
}

ChatAdapter.java
 public class ChatAdapter extends ArrayAdapter<DataProvider>{  
private List<DataProvider> chat_list = new ArrayList<DataProvider> ();
private TextView CHAT_TXT;
Context CTX;
public ChatAdapter(Context context, int resource) {
super(context, resource);
CTX = context;
// TODO Auto-generated constructor stub
}
@Override
public void add(DataProvider object) {
// TODO Auto-generated method stub
chat_list.add(object);
super.add(object);
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return chat_list.size();
}
@Override
public DataProvider getItem(int position) {
// TODO Auto-generated method stub
return chat_list.get(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null)
{
LayoutInflater inflator = (LayoutInflater) CTX.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflator.inflate(R.layout.single_message_layout,parent,false);
}
CHAT_TXT = (TextView) convertView.findViewById(R.id.singleMessage);
String Message;
boolean POSITION;
DataProvider provider = getItem(position);
Message = provider.message;
POSITION = provider.position;
CHAT_TXT.setText(Message);
CHAT_TXT.setBackgroundResource(POSITION ? R.drawable.left : R.drawable.right);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
if(!POSITION)
{
params.gravity = Gravity.RIGHT;
}
else
{
params.gravity = Gravity.LEFT;
}
CHAT_TXT.setLayoutParams(params);
return convertView;
}
}

DataProvider.java
 public class DataProvider {  
public boolean position;
public String message;
public DataProvider(boolean position, String message) {
super();
this.position = position;
this.message = message;
}
}

activity_main.xml
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/list_background"
>
<ListView
android:id="@+id/chat_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="80dp">
</ListView>
<RelativeLayout
android:id="@+id/chat_form"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:orientation="vertical"
>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:ems="10"
android:id="@+id/chatTxt"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@+id/send_button" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Send"
android:id="@+id/send_button"
android:layout_alignBottom="@+id/chatTxt"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</RelativeLayout>

single_message_layout.xml
 <?xml version="1.0" encoding="utf-8"?>  
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/singleMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:paddingLeft="10dip"
android:textColor="@android:color/primary_text_light"
android:background="@drawable/left"
android:text="hello worldvfvdfvdfvdfv"
/>
</LinearLayout>


Watch video of this topic
Download this Project

Monday, 13 October 2014

How to Reduce Image File Size in Paint (Decrease JPG file size)

Paint the most popular image editing tool which is available in Microsoft Windows. Sometimes people struggle with different softwares to reduce the Image File Size. However Paint can't can't do some complex tasks but it can reduce the image size by resizing it. Here resizing means that you can reduce the pixels in the image and thus reduce its size.


How to Reduce Image File Size in Paint


I am using Windows 8 Paint to reduce the image file size. But steps described here are almost same in all windows. Follow the following steps to reduce the size of a Image file.


  • Open the image in Paint.
  • Then go to Home tab, Image Group and then go to Resize
  • Here you will get option to resize the image by Pixels and by Percentage. You can choose any one of them. 
  • If you choose pixels then pixel size of original image are displayed in the boxes below. You can reduce the pixels as per your wish. Make sure that "Maintain Aspect Ratio" is checked. If its not checked then image width/height ratio will be disturbed and you might not like it.
  • You can also choose to reduce the image size by percentage. But make sure that "Maintain Aspect Ratio" is checked.
  • Once the pixels are reduce, then you can save the file from File menu. If you choose the "Save" option from "File" menu, then same image file be replaced with new image of lesser size. But better option will be to choose "Save As" option from file menu, as it will keep both files, so that you can compare them later. 


Decrease JPG File Size


So here we told you how to decrease the image size by using Paint in Windows. Mostly we use JPG image format to stores files in computers. Its the most widely used image format in all devices such as digital cameras. mobile phones and computers. But Paint can be used to decrease file size of a number of different formats apart from JPG. Some of these formats are PNG, BMP and GIF .

Saturday, 11 October 2014

Terminal Overload 0.3 released + support the developer on Patreon

The very innovative and awesome looking (+ fully FOSS) multiplayer FPS Terminal-Overload got a new release today. Edit: By now there is actually already a 0.4.0 release, get it here.

Charged x-jump on the new ETH5 map (3rd person camera turned on)
One of the new features is a charged jump that lets one take big leaps to reach good sniping spots or evade an enemy etc. Other changes for this release:
- New map: ETH5
- Prettier GUI
- Replace re-jumping with instant & charged x-jump.
- Tweak CAT movement speeds.
- Simplify disc controls.
- ETH mode: Each class only has one type of offensive disc.
- SMG changes: Increase firing rate, decrease damage, shorter range.
- MGL changes: Remove recoil, decrease firing rate, fire only one projectile.
- MG changes: Projectiles are affected by gravity.
- Remove etherboard from class #4 (Minigunner) loadout.
- Remove SG2 from class #2 loadout.
- Improve responsiveness of mouse look while in CAT form.
- New projectile visuals (except discs & grenade).
The new GUI looks like this:
New menu graphics with options window
While it is is quite awesome looking and playable already, it obviously still needs a bit of further development. Since the funds of an earlier crowd-funding drive have been used up, the developer is now looking for other ways to survive. If you like what he is doing, you can head over to his new Patreon page to support him with a monthly payment.

Yes, YOU! Right NOW! ;)

Developer contributions to code and art are of course also welcome.

Friday, 10 October 2014

Android Expandable ListView

CLICK HERE TO DOWNLOAD THIS PROJECT

activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_height="match_parent"
    android:layout_width="wrap_content"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    android:paddingBottom="16dp"
    >
<ExpandableListView
    android:id="@+id/exp_list"
    android:layout_height="match_parent"
   android:layout_width="match_parent"
  android:indicatorLeft="?android:attr/expandableListPreferredItemIndicatorLeft"
    android:divider="#A4C739"
    android:dividerHeight="0.5dp"
     ></ExpandableListView>
    </RelativeLayout>

parent_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
   >
   <TextView
    android:id="@+id/parent_txt"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
    android:textColor="#A4C739"
    android:paddingTop="10dp"
    android:paddingBottom="10dp"
    />
 
    </LinearLayout>

child_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:orientation="vertical"
     >
    <TextView
        android:id="@+id/child_txt"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="?android:attr/expandableListPreferredChildPaddingLeft"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        />

    </LinearLayout>

MainActivity.java

package com.easyway2in;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ExpandableListView;


public class MainActivity extends Activity {
HashMap<String, List<String>> Movies_category;
List<String> Movies_list;
ExpandableListView Exp_list;
MoviesAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Exp_list = (ExpandableListView) findViewById(R.id.exp_list);
        Movies_category = DataProvider.getInfo();
        Movies_list = new ArrayList<String>(Movies_category.keySet());
        adapter = new MoviesAdapter(this, Movies_category, Movies_list);
        Exp_list.setAdapter(adapter);
    }
}

MoviesAdapter.java

package com.easyway2in;

import java.util.HashMap;
import java.util.List;

import android.content.Context;
import android.graphics.Typeface;
import android.util.MonthDisplayHelper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;

public class MoviesAdapter extends BaseExpandableListAdapter{
private Context ctx;
private HashMap<String, List<String>> Movies_Category;
private List<String> Movies_List;
public MoviesAdapter(Context ctx, HashMap<String, List<String>> Movies_Category, List<String> Movies_List )
{
this.ctx = ctx;
this.Movies_Category = Movies_Category;
this.Movies_List = Movies_List;
}

@Override
public Object getChild(int parent, int child) {
return Movies_Category.get(Movies_List.get(parent)).get(child);
}

@Override
public long getChildId(int parent, int child) {
// TODO Auto-generated method stub
return child;
}

@Override
public View getChildView(int parent, int child, boolean lastChild, View convertview,
ViewGroup parentview) 
{
String child_title =  (String) getChild(parent, child);
if(convertview == null)
{
LayoutInflater inflator = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   convertview = inflator.inflate(R.layout.child_layout, parentview,false);
}
TextView child_textview = (TextView) convertview.findViewById(R.id.child_txt);
child_textview.setText(child_title);
return convertview;
}

@Override
public int getChildrenCount(int arg0) {
return Movies_Category.get(Movies_List.get(arg0)).size();
}

@Override
public Object getGroup(int arg0) {
// TODO Auto-generated method stub
return Movies_List.get(arg0);
}

@Override
public int getGroupCount() {
// TODO Auto-generated method stub
return Movies_List.size();
}

@Override
public long getGroupId(int arg0) {
// TODO Auto-generated method stub
return arg0;
}

@Override
public View getGroupView(int parent, boolean isExpanded, View convertview, ViewGroup parentview) {
// TODO Auto-generated method stub
String group_title = (String) getGroup(parent);
if(convertview == null)
{
LayoutInflater inflator = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   convertview = inflator.inflate(R.layout.parent_layout, parentview,false);
}
TextView parent_textview = (TextView) convertview.findViewById(R.id.parent_txt);
parent_textview.setTypeface(null, Typeface.BOLD);
parent_textview.setText(group_title);
return convertview;
}

@Override
public boolean hasStableIds() {
// TODO Auto-generated method stub
return false;
}

@Override
public boolean isChildSelectable(int arg0, int arg1) {
// TODO Auto-generated method stub
return false;
}

}

DataProvider.java

package com.easyway2in;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class DataProvider {
public static HashMap<String, List<String>> getInfo()
{
HashMap<String, List<String>> MoviesDetails = new HashMap<String, List<String>>();
List<String> Action_Movies = new ArrayList<String>();
Action_Movies.add("300 Rise of an Empire");
Action_Movies.add("Robocop");
Action_Movies.add("The Hunger Games");
Action_Movies.add("The Expendables 3");
Action_Movies.add("Guardian of the Galaxy");
List<String> Romntic_Movies = new ArrayList<String>();
Romntic_Movies.add("Mean Girls");
Romntic_Movies.add("Failure To Launch");
Romntic_Movies.add("The House Bunny");
Romntic_Movies.add("Ghost of Girlfriends Past");
Romntic_Movies.add("The Devil Wears Prada");
List<String> Horror_Movies= new ArrayList<String>();
Horror_Movies.add("The Conjuring");
Horror_Movies.add("Drag Me to Hell");
Horror_Movies.add("Sinister");
Horror_Movies.add("Sleepy Hollow");
Horror_Movies.add("Eden lake");
List<String> Comedy_Movies = new ArrayList<String>();
Comedy_Movies.add("Ride Along");
Comedy_Movies.add("That Awkward Moment");
Comedy_Movies.add("Wish I Was Here");
Comedy_Movies.add("About last Night");
Comedy_Movies.add("This is the End");
MoviesDetails.put("Action Movies", Action_Movies);
MoviesDetails.put("Romantic Movies", Romntic_Movies);
MoviesDetails.put("Horror Movies", Horror_Movies);
MoviesDetails.put("Comedy Movies", Comedy_Movies);
return MoviesDetails;
}

}