Friday, 1 February 2013

Needed Software for do Android Programming


We Need 4 softwares to do the Android Programming.

1.JDK ( Java )
2.eclipse IDE for Java Developers
3.ADT Plugin
4.SDK for Android

There are two ways to download all softwares 
1)Old Process 
2)New Process

I am giving idea about download software in New Process only.

New Process:

1)Download Java software and install.

i)Goto http://www.oracle.com/technetwork/java/javase/downloads/index.html  and download java software
ii)Install java software.
iii)Check your java software running or not ?

2)Download ADT Bundle (it combined eclipse ,ADT plugin and SDK)

i)Goto http://developer.android.com/sdk/index.html this url and select ADT Bundle for windows.
ii)After download extract the software.
iii)open adt bundle for windows folder and again open eclipse folder click eclipse exe file.
iv)do your programs in happily.

OLD Process:
This process we must download all softwares and need to set the paths and choose which place existing your SDK.
In this process is very lengthy and creating headache.

Spinner Demo

Demo:





1.main.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="fill_parent"
    android:background="#EEA9B8"
    android:orientation="vertical" >

    <Spinner
        android:id="@+id/spinnerMonths"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp" />

    <Button
        android:id="@+id/btnShowMonth"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="15dp"
        android:text="Show selected Month" />

</LinearLayout>


2.Activity:

package com.venky.spinnerdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;

public class SpinnerDemoActivity extends Activity {
      /** Called when the activity is first created. */

      Spinner spinnerMonth;

      String[] months = {"January", "February", "March", "April", "May", "June",
                  "July", "August", "September", "October", "November", "December" };

      String selectedMonth;

      @Override
      public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);

            spinnerMonth = (Spinner) findViewById(R.id.spinnerMonths);

            ArrayAdapter<String> adapter = new ArrayAdapter<String>(
                        SpinnerDemoActivity.this, android.R.layout.simple_spinner_item,
                        months);

            spinnerMonth.setAdapter(adapter);

            Button btnShow = (Button) findViewById(R.id.btnShowMonth);

            btnShow.setOnClickListener(new OnClickListener() {

                  @Override
                  public void onClick(View v) {
                        // TODO Auto-generated method stub

                        selectedMonth = spinnerMonth.getSelectedItem().toString();

                        Toast.makeText(SpinnerDemoActivity.this,
                                    "Selected Month ==> " + selectedMonth,
                                    Toast.LENGTH_LONG).show();
                  }
            });
      }
}


3)Download this Project Click Here