Wednesday, 7 August 2013

Android SQLite Database Demo

1 comment


Today we will discussed about SQLite Database in android.
android.database Package have all necessary classes for working with database. android.database.sqlite Package contains the SQLite related classes.
To extends the functionality of SQLite in your application we have to extends SQLiteOpenHelper.
This class have two methods
onCreate() – will create database for the first time.
onUpdate() – will be used to update the existing database.


Lets Begins.
Step 1:-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="5dp"
   
  >
    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Name"
        android:textAppearance="?android:attr/textAppearanceMedium" />
    <EditText
        android:id="@+id/editText_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:ems="10" >
       
    </EditText>
    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Marks"
        android:layout_marginTop="10dp"
        android:textAppearance="?android:attr/textAppearanceMedium" />
    <EditText
        android:id="@+id/editText_marks"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:layout_marginTop="10dp"
        android:inputType="phone" >
   
    </EditText>
    <Button
        android:id="@+id/buttonAddDetail"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="Add Details" />
</LinearLayout>
Step 2:- create database via DatabaseManager Class
package com.arpit.sqlitedemo;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
public class DatabaseManager extends SQLiteOpenHelper {
    private Context context;
    private static String DB_NAME = "SampleDatabase";
    private static int DB_VERSION = 1;
    public static final String TABLE_STUDENT = "Student";
   

    public DatabaseManager(Context context) {
        // TODO Auto-generated constructor stub
        super(context, DB_NAME, null, DB_VERSION);
        this.context = context;
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        db.execSQL("CREATE TABLE Student(    Id INTEGER NOT NULL PRIMARY KEY, Name TEXT NOT NULL, Marks TEXT NOT NULL)");
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        db.execSQL("DROP TABLE " + TABLE_STUDENT + "IF EXISTS");
        this.onCreate(db);
    }
}
Step 3:- Create MainActivity Class
package com.arpit.sqlitedemo;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends Activity {
    EditText etName, etMarks;
    Button btn_add;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        etName = (EditText) findViewById(R.id.editText_name);
        etMarks = (EditText) findViewById(R.id.editText_marks);
        btn_add = (Button) findViewById(R.id.buttonAddDetail);
        btn_add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                boolean isInserted = false;
                String name = etName.getText().toString();
                String marks = etMarks.getText().toString();
                if (etName.getText().length() <= 0) {
                    Toast.makeText(MainActivity.this, "Please Enter name",
                            Toast.LENGTH_SHORT).show();
                } else if (etMarks.getText().length() <= 0) {
                    Toast.makeText(MainActivity.this, "Please Enter Marks",
                            Toast.LENGTH_SHORT).show();
                } else {
                    DatabaseController controller = new DatabaseController(
                            MainActivity.this);
                    isInserted = controller.addValuesIntoTable(name, marks);
                    if (isInserted) {
                        Toast.makeText(getBaseContext(),
                                "Successfuly Inserted", Toast.LENGTH_SHORT)
                                .show();
                    }
//                    etName.setText("");
//                    etMarks.setText("");
                }
            }
        });
    }
}
Step 4:- Create a controller class ie DatabaseController.java which will put the information in the database via the help of ContentValues.

package com.arpit.sqlitedemo;
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
public class DatabaseController {
    private Context context;
    public DatabaseController(Context context) {
        // TODO Auto-generated constructor stub
        this.context = context;
    }
    public boolean addValuesIntoTable(String name, String marks) {
   
        boolean inserted=false;
        ContentValues values=new ContentValues();
        values.put("Name", name);
        values.put("Marks", marks);
        try
        {           
        SQLiteDatabase sqlDb=new DatabaseManager(context).getWritableDatabase();
       
        if(sqlDb.isOpen())
        {
            long inserted_row=sqlDb.insert(DatabaseManager.TABLE_STUDENT, null, values);
            if(inserted_row>0)
            {
                inserted=true;
            }
        }
       
        sqlDb.close();
        }
        catch(Exception exception)
        {
            exception.printStackTrace();
        }
       
        // TODO Auto-generated method stub
        return inserted;
       
    }
   
}



Screenshot_2013-08-07-15-59-19Screenshot_2013-08-07-16-00-09Screenshot_2013-08-07-16-24-19

Catch Me On: CreateAppFaster.com
Read More...

Tuesday, 6 August 2013

PhoneGap Application – “Words of Wisdom”

1 comment
 
banner_512 

"Words Of Wisdom" is a motivational and inspirational application covering each and every aspect of an individual’s life that requires continuous source of motivation and correct guidance in order to live a happy and a meaningful life. Inspiration comes in many forms to people. Some individuals respond to books, while other might respond to stories, movies, reflections or autobiographies from various well-known leaders and scholars.
As we are living in a techno world with smart-phones in hand; WOW serves a great need for a larger audience in order to bring a source of motivation on the fingertips. Covering the major concerns of each person’s life, it will allow users to use it anytime, anywhere and keep themselves motivated thereby winning in every phase of their lives. WOW can be seen as a "Happiness Manufacturing Application.

Technical aspect of this application, that this application is an attempt to explore and understand the Phone Gap Framework. In Order to make this application, we got to know various thing about Phone Gap application building process.

This application is made by my colleague and me, you can download this application at Google Store.


Read More...

Sunday, 4 August 2013

Delete Row Item in ListView Android

2 comments
Today I will display how to delete row item from List in android. In this project I will be having list, on long press of item  an alert dialog box will pop out asking you for confirmation with having Yes and Cancel Button.




Step 1:- create activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>
</LinearLayout>



Step 2:- create list_row.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="10dip"
    android:textSize="16dip"
    android:textStyle="bold" >
</TextView>

Step 3:- MainActivity.java
package com.arpit.deleterowlistview;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends Activity {
    ListView lv;
    ArrayAdapter<String> adapter;
    List<String> arr;
    String[] language = { "C", "Java", "C++", "C-sharp", ".Net", "SQL",
            "Android", "PhoneGap", "Ios", "windows", "PHP", "Phyton", "Perl" };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        lv = (ListView) findViewById(R.id.listView1);
        arr = new ArrayList<String>(Arrays.asList(language));
        adapter = new ArrayAdapter<String>(this, R.layout.list_row, arr);
        lv.setAdapter(adapter);
       
        lv.setOnItemLongClickListener(new OnItemLongClickListener() {
            // setting onItemLongClickListener and passing the position to the function
                      @Override
            public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
                    int position, long arg3) {
                removeItemFromList(position);  
               
                return true;
            }
        });
    }
// method to remove list item
    protected void removeItemFromList(int position) {
        final int deletePosition = position;
       
        AlertDialog.Builder alert = new AlertDialog.Builder(
                MainActivity.this);
   
        alert.setTitle("Delete");
        alert.setMessage("Do you want delete this item?");
        alert.setPositiveButton("YES", new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                // TOD O Auto-generated method stub
                   
                    // main code on after clicking yes
                    arr.remove(deletePosition);
                    adapter.notifyDataSetChanged();
                    adapter.notifyDataSetInvalidated();
     
            }
        });
        alert.setNegativeButton("CANCEL", new OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub
                dialog.dismiss();
            }
        });
     
        alert.show();
     
    }
}


Catch Me On: CreateAppFaster.com
Read More...

Saturday, 3 August 2013

Search Bar in ListView Android

1 comment
We have made list many a time’s in android, in this tutorial I will be adding search bar functionality to the ListView. In this project I have added a search bar above the list. ListView will be filtered on the basis of text added on the search bar. It is useful where you have a  long list.


Step 1:- create activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
   <EditText
       android:id="@+id/search_editText"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:hint="Search"/>
  
    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
       >
    </ListView>
</LinearLayout>

Step 2:- create list_row.xml for particular row
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="10dip"
    android:textSize="16dip"
    android:textStyle="bold" >
</TextView>

Step 3:- MainActivity.java
package com.arpit.searchbarandroidlistview;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
public class MainActivity extends Activity {
    ListView lv;
    EditText etsearch;
    ArrayAdapter<String> adapter;
    List<String> arr;
    String[] language = { "C", "Java", "C++", "C-sharp", ".Net", "SQL",
            "Android", "PhoneGap", "Ios", "windows", "PHP", "Phyton", "Perl" };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        lv = (ListView) findViewById(R.id.listView1);
        etsearch = (EditText) findViewById(R.id.search_editText);
        arr = new ArrayList<String>(Arrays.asList(language));
        adapter = new ArrayAdapter<String>(this, R.layout.list_row, arr);
        lv.setAdapter(adapter);
       
      // code for searching from list
 
etsearch.addTextChangedListener(new TextWatcher() {
           
            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                // TODO Auto-generated method stub
                 MainActivity.this.adapter.getFilter().filter(s);
               
            }
           
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count,
                    int after) {
                // TODO Auto-generated method stub
               
            }
           
            @Override
            public void afterTextChanged(Editable s) {
                // TODO Auto-generated method stub
               
            }
        });       
           }
}



Catch Me On: CreateAppFaster.com
Read More...

Android Slide Animation Effect Between Page Transition

Leave a Comment
Today I am going to make a demo project on slide animation effect between page transition
Step 1 :- Create anim folder under res folder
Step 2:- In anim folder create two xml file,
  • anim_in.xml
<?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
    android:fromXDelta="-100%"
    android:toXDelta="0"
    android:duration="1250" />
</set>
  • anim_out.xml
<?xml version="1.0" encoding="utf-8"?>
   <set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
    android:fromXDelta="0"
    android:toXDelta="100%"
    android:duration="1250" />
  </set>
Step 3:- Create two xml file under layout folder
  • first.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
>
    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="Next" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:textSize="25sp"
        android:layout_marginTop="42dp"
        android:text="@string/hello_world" />
</RelativeLayout>
  • second.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/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Second Activity"
        android:textSize="25sp" />
</LinearLayout>
Step 4:- Create MainActivity.java file
package com.arpit.activitypagetransition;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
    Button btnNext;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

     overridePendingTransition(R.anim.anim_in, R.anim.anim_out);
        setContentView(R.layout.first);
        System.out.println("----main activity---onCreate---");
        btnNext = (Button) findViewById(R.id.button1);
        btnNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent ob = new Intent(MainActivity.this, Second.class);
                startActivity(ob);
            }
        });
    }
    @Override
    protected void onStart() {
        // TODO Auto-generated method stub
        super.onStart();
        System.out.println("----main activity---onStart---");
    overridePendingTransition(R.anim.anim_in, R.anim.anim_out);    
  }
}
Step 5:- create Second.java file
package com.arpit.activitypagetransition;
import android.app.Activity;
import android.os.Bundle;
public class Second extends Activity {
    protected void onCreate(Bundle savedInstance){
        super.onCreate(savedInstance);
overridePendingTransition(R.anim.anim_in, R.anim.anim_out);
        setContentView(R.layout.second);
        System.out.println("----Secondactivity activity---onCreates---");
    }
   
}
Step 6:- AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.arpit.activitypagetransition"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.arpit.activitypagetransition.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Second"></activity>
    </application>
</manifest>

Follow Fade-in and Fade-out effect



Catch Me On: CreateAppFaster.com
Read More...

Android Fade in and Fade out Animation Effect between page Transition

Leave a Comment
Android Comes with pretty cool animation, today I am going to discuss how to do fade in and fade out transition between the pages.
Step 1 :- Create anim folder under res folder
Step 2:- In anim folder create two xml file,
  • fadein.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
   android:interpolator="@android:anim/accelerate_interpolator"
   android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="2000" />
  • fadeout.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
   android:interpolator="@android:anim/accelerate_interpolator"
   android:fromAlpha="1.0" android:toAlpha="0.0" android:
duration="2000" />
Step 3:- Create two xml file under layout folder
  • first.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
>
    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="Next" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:textSize="25sp"
        android:layout_marginTop="42dp"
        android:text="@string/hello_world" />
</RelativeLayout>
  • second.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/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Second Activity"
        android:textSize="25sp" />
</LinearLayout>
Step 4:- Create MainActivity.java file
package com.arpit.activitypagetransition;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
    Button btnNext;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        overridePendingTransition(R.anim.fadein, R.anim.fadeout);
        setContentView(R.layout.first);
        System.out.println("----main activity---onCreate---");
        btnNext = (Button) findViewById(R.id.button1);
        btnNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent ob = new Intent(MainActivity.this, Second.class);
                startActivity(ob);
            }
        });
    }
    @Override
    protected void onStart() {
        // TODO Auto-generated method stub
        super.onStart();
        System.out.println("----main activity---onStart---");
        overridePendingTransition(R.anim.fadein, R.anim.fadeout);
       }
}
Step 5:- create Second.java file
package com.arpit.activitypagetransition;
import android.app.Activity;
import android.os.Bundle;
public class Second extends Activity {
    protected void onCreate(Bundle savedInstance){
        super.onCreate(savedInstance);
        overridePendingTransition(R.anim.fadein, R.anim.fadeout);
        setContentView(R.layout.second);
        System.out.println("----Secondactivity activity---onCreates---");
    }
   
}
Step 6:- AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.arpit.activitypagetransition"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.arpit.activitypagetransition.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Second"></activity>
    </application>
</manifest>


Catch Me On: CreateAppFaster.com
Read More...

Friday, 2 August 2013

Image ListView in Android

1 comment
Today I will discussed how to make Image ListView in android. I have made a demo project named ImageListView.
Step 1:- create activity_main.xml,  in this xml I have defined how image and text will come with respective to each other.
Step 2:- the image used in the project is in the drawable folder. Please put image in your drawable folder before you are going to refer them.
Step 3:- This is how my main.java looks

package com.example.imagelistview;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.Toast;
public class Main extends ListActivity implements OnItemClickListener {
    String []proList ={"Android", "C", "C++", "Java", "JavaScript", "Jquery", "Objective C", "iOS"};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       // setting up an adapter and passing an array and context of this class        setListAdapter(new MyListAdapter(this,proList));
       
        ListView listView = getListView();
        listView.setOnItemClickListener(this);
       
    }
    @Override
    public void onItemClick(AdapterView<?> adapter, View arg1, int position, long arg3) {
         
        String str = adapter.getItemAtPosition(position).toString();
        Toast.makeText(getBaseContext(), "You Clicked on: "+str, Toast.LENGTH_SHORT).show();
       
    }
}   

Step 4:- Setting up an Adapter named MyListAdapter.java
package com.example.imagelistview;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class MyListAdapter extends ArrayAdapter<String>{
   
    private String []values;
    private Context context;
   
    public MyListAdapter(Context context, String []values) {
        // TODO Auto-generated constructor stub
        super(context,R.layout.activity_main,values);
        this.context = context;
        this.values = values;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
       
        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
       
        View rowView = inflater.inflate(R.layout.activity_main, parent,false);
       
        TextView textV = (TextView)rowView.findViewById(R.id.textView1);
        ImageView imgV = (ImageView)rowView.findViewById(R.id.imageView1);
       
        textV.setText(values[position]);
       
        String str =values[position];
       
            if(str.equalsIgnoreCase("android")){
                imgV.setImageResource(R.drawable.ic_launcher);
            }else
                if(str.equalsIgnoreCase("c")){
                    imgV.setImageResource(R.drawable.c);
                }else
                    if(str.equalsIgnoreCase("c++")){
                        imgV.setImageResource(R.drawable.cplus);
                    }else
                        if(str.equalsIgnoreCase("Java")){
                            imgV.setImageResource(R.drawable.java);
                        }else
                            if(str.equalsIgnoreCase("javascript")){
                                imgV.setImageResource(R.drawable.javascript);
                            }else
                                if(str.equalsIgnoreCase("jquery")){
                                    imgV.setImageResource(R.drawable.jquery);
                                }else
                                    if(str.equalsIgnoreCase("objective c")){
                                        imgV.setImageResource(R.drawable.objectivec);
                                    }else
                                        if(str.equalsIgnoreCase("ios")){
                                            imgV.setImageResource(R.drawable.ios);
                                        }
               
       
        return rowView;
    }
}
Read More...