A Simple Android Application Which Shows How to Show a List View And Toast Notification


If you are quite new to Android app development, I would recommend a simple android app for adding two numbers.
In this android application tutorial, we'll see how to use list view in android programming and how to display pop up notification using Toast function in android programming.

A Simple Android Application Which Shows How to Show a List View And Toast Notification


So first of all lets create a a new project in eclipse and let name it Listing App.Now after the project structure has been created navigate to the res/layout directory of the project and in that open the main.xml and paste the following code.

 <?xml version="1.0" encoding="utf-8" ?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/content2" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
 </LinearLayout>
After that add another file in the same res/layout directory called the list_item.xml and paste the following code in there

 <?xml version=”1.0″ encoding=”utf-8″?>
 <TextView xmlns:android=”http://schemas.android.com/apk/res/android”
    android:layout_width=”fill_parent”
    android:layout_height=”fill_parent”
    android:padding=”10dp”
    android:textSize=”16sp” >
 </TextView>
When we display a list view we populate the list_item.xml into our main.xml each time a new item is added into the list view.
After that open up your .java file from the src/yourcomfile/.java and paste the following code into that file.

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
 
public class listingactivity extends ListActivity {
  /** Called when the activity is first created. */
  LinearLayout.LayoutParams layoutParams;
  LinearLayout ll;
  static int i;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setListAdapter(new ArrayAdapter(this, R.layout.list_item, NAMES));
 
    ListView lv = getListView();
    lv.setTextFilterEnabled(true);
 
    lv.setOnItemClickListener(new OnItemClickListener() {
 
      @Override
      public void onItemClick(AdapterView parent, View view, int position,
        long id) {
        // TODO Auto-generated method stub
        Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
          Toast.LENGTH_SHORT).show();
      }
    });
  }
  static final String[] NAMES = new String[] {"
    Harry", "Ron", "Hermioni", "Snapes", "Dumbuldoree", "Weasley", "Potter", "Smaerty", "Lord Voldemort", "Smelly"
  };
}
Thats it now you are ready to run your small application.

SIM Relay Response Timeout Error While Integrating Authorize.Net SIM Method using c#

While integrating Authorize.Net's SIM using c# into my web application i kept getting a timeout error while redirecting response to a response url. The error is as follows

Your script timed out while we were trying to post transaction results to it.
  Transaction ID: xxxxxxxxx
Transaction Result: This transaction has been approved.

The following message was displayed to the customer:

------------------------------An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction has been approved.

It is advisable for you to contact the merchant to verify that you will receive the product or service. 

A Simple Application Using Google App Engine and Twitter API

Here is a simple application which i have developed and hosted using Google App Engine.This application is called PerkyQuotes. This app makes use of the Twitter API to fetch data from twitter with keyword perkytweets and display them as it is.

Here is a link to the application PerkyQuotes.
Source Code : https://github.com/jay3dec/PerkyQuotes