Subscribe For Free Updates!

We'll not spam mate! We promise.

Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Jul 18, 2016

Android Development Step by step

Views:

Android is a mobile operating system developed by Google. It is primarily designed for Touchscreen mobile devices such as smartphone and tablets.
As we know, a large number  of  audience is using Android smartphone. So you have a huge market to publish your android apps on play store.

May 19, 2013

Access Asp.net J-son Web service on Android

Views:

To day I will show you how to access Asp.net web service that's return data in Json (Java Script object notation )  Data Format.

I have already shared how to make web service on asp.net.

I also shared how to deploy asp.net service on local host and how to access deployed web service on Android browser .

I also shared how to access asp.net XML Service on android , so must have to go through all these tutorials before reading this tutorial.

Json service are better the XML web service because,
Json service is Light weight, fast and don't cray any extra data like XML start and end Tags tags.


Sep 13, 2012

Samsung Announces New Price:Galaxy S3 For Only $99 After iPhone 5 Release

Views:

Samsung Galaxy S3
If you are thinking of buying the smartphone king Galaxy S3 ?? Then wait no more my friend! 
Samsung has now turned into party wrecker by dropping the price of Galaxy S3 to an unbelievable 99$. Yes you read it correct Get all the features of iPhone5 at just $99.

Aug 20, 2012

Show Images Remotely Or from URL in android

Views:

Show Images Remotely Or from URL in android
Today I will show you how to Show Images Remotely (Hosted on a web server or Website) Or from URL in android.

It is very Difficult to Load Images From Remote Server Because there is No Such built-in support in IMAGE VIEW Control of android .

But now  you  Can Easily Access Images Remortely  in android .

I researched A lot and Finally got a Suitable Coding technique for Accessing Images from Website(Remotely)  in Image View android.

One Major Advantage with my code is that allows you to access any image format e.g  .png ,   .jpg  ,  .bmp   or  .gif.



Aug 16, 2012

Top Must Have Android Apps:Best Apps You Can't Miss

Views:


Have an android smartphone and looking for great apps to download and use?. Following is the list of top highly rated android apps that you must have. 

Top Must Have Android Apps
1. Seesmic
There are numerous Twitter apps on Android and Twitter itself joined in the party with the launch of its own app but Seesmic seems more amazing in comparison. Offering support for several accounts, a home page widget showing latest tweets and an extraordinarily expert design, it's one of the finest specimens of app development present.
 

Aug 15, 2012

Show images in Grid View in android

Views:

Show images in Grid View in android
To day I will show how to Show or Bind images in Grid View in android .
Basically GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using a ListAdapter.
GridView Control or layout is one of the most useful layouts in android. Gridview is mainly useful when we want to show data in grid layout like displaying images or icons. This layout can be used to build applications like image viewer, audio or video players in order to show elements in grid manner.
In This Tutorial I will showing you how Images are binded in GridView .
When You Click or Tap on an image the Image will Open in activity with Full Sizes.



Aug 12, 2012

The Smart Phone King Of 2012- S3 Vs iPhone 5

Views:

S3 vs iphone5
It’s hard to believe that any one at the moment can suggest which phone is best. The iPhone 5 isn’t out and when it does come out then you can state the claim of a winner. The Samsung Galaxy SIII is out there and currently is ruling the market with approximately $10 million sales. 
The iPhone 5 currently has not been released and Apple has not officially released the stats on this phone. You can not compare, suggest or determine a winner as well as compare both phones. But let us compare the facts:-

Aug 11, 2012

Smartphones To Look For This Fall

Views:


Smartphones To Look Up to This Fall
Going through an upgrade this fall ?? Better read this before…
1. Samsung Galaxy s III
Samsung Galaxy S III is a beast in smartphones a stunning and massive screen, fast dual-core performance, and Android 4.0 Ice Cream Sandwich. It comes fully loaded with Android 4.0 Ice Cream Sandwich, 4G LTE/HSPA+ 42 capability, a zippy dual-core processor, and a strong 8-megapixel camera. S Beam is an excellent software enhancement, and the handset's price is right. Pumped with high-performing hardware and creative software features, the Samsung Galaxy S3 is an excellent, top-end phone that's neck and neck with the HTC One X.

Aug 10, 2012

The Cheapest Tablet PC Ever

Views:


The Cheapest Tablet PC Ever
You want a tablet but don’t have much to spend??
The answer to this question is HP touchpad, period. The best your money can buy with all the necessary features including face cam, multitasking, elegant design coming in both 16gig and 32gig memory.
The HP TouchPad is a touchscreen tablet that runs HP webOS but can be tweaked to run ANDROID also with full functionality. The TouchPad uses card multitasking found in Palm Pre phones.

Aug 9, 2012

Read Or Parse XML File From Web Server in Android

Views:

Read Or Parse XML File From Web Server in Android
To Day I will show you How to read or Parse Xml File Hosted on Web Server or Hosting Server using Android .
In this tutorial we Will Talk about How to Parse Xml file and How to Bind With List View in Android.

In This Tutorials We will be Using .
1) HTTP Request to get XML File from Web Server or Hosting Server.
2) Read Or access XML Data .

Jul 15, 2012

Access Asp.Net Web Service KSoap In android

Views:

Access Asp.Net Web Service KSoap In android

To day I show you how to Access .NET Web service (K Soap  Service) in android .
 As you may know, we often want to access Web services via hand-held devices, and most likely you will run into trouble parsing the WSDL and the SOAP messages.

This is very Important topic by knowing this technique you can easily make Android application of you asp.net website ,web Application and web services.

Please follow the Following Steps:


First You have to Download the Ksoap assembly jar file and to include in Project .

Getting Started with KSOAP on Android


First things first, so you should now go ahead and download the KSOAP library from Sourceforge Google code (*UPDATE* thanks Freddy):
http://code.google.com/p/ksoap2-android/downloads/detail?name=ksoap2-android-assembly-2.4-jar-with-dependencies.jar&can=2&q=


Then copy and paste the KSOAP library in the folder where your Android project will reside. Open Eclipse, start a new Android Project, right-click on the project's name and choose Properties, like this:

Access Asp.Net Web Service KSoap In android

The next thing you need to do is to Add the KSOAP .JAR into the Android Project:

Access Asp.Net Web Service KSoap In android



Go ahead an press Add JARs... button. Then navigate to the folder where your KSOAP library is and select it. Once you have this done, you are ready to start working with your Web Service library.

Simple Web Service Calls with KSOAP


First, let's take a look at our web service call in Visual Studio:

[WebService(Namespace = "http://vladozver.org/")]
public class SimpleWebServices : System.Web.Services.WebService
{
      [WebMethod]
      public int GetSumOfTwoInts(int Operand1, int Operand2 )
      {
         return Operand1 + Operand2;
      }
}
 
The service is deployed on my local machine which is on the address: 
192.168.1.3. Pay attention on the ending "/" in the Namespace.
So it mean when you access the  web service you have to use your desktop machine 
ip address  like (192.168.1.3) instead of Local host.
While creating this webservice, it asks for a namespace and here the namespace is www.tempura.org (pretty much the default namespace which I have not changed!). You can open this service from http://grasshoppernetwork.com/NewFile.asmx.
When you open this webservice in browser, you can see a window like in the figure below:
Access Asp.Net Web Service KSoap In android
I have marked it to show how to get the namespace name. It will also show the list of methods, which you cannot test. So how to know the arguments and return type? Click on the method and see the figure below:
Figure2-soap_structure.png
Now you know what function you are calling, its arguments, return type and namespace (and of course URL).
For calling this method you need ksoap library, which you can download from here.
Copy the downloaded zip file in any appropriate location. This is an external jar file which you need to include in your Android project.
Start an Android project and select Android API. Right click on the project node in the workspace, properties->java build path->libraries->Add external jar.
Browse and select your ksoap jar file.
All we have to do now is to write a method which can call the web service and return the result. Remember that Android gives you an exception if you try any socket operation from main activity thread. Therefore it is better to write a separate class and isolate soap related functions.
Let us now understand the logic of this class.

package my.MySOAPCallActivity.namespace; 
import org.ksoap2.SoapEnvelope; 
import org.ksoap2.serialization.PropertyInfo; 
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
public class CallSoap 
{
public final String SOAP_ACTION = "http://tempuri.org/Add";

public  final String OPERATION_NAME = "Add"; 

public  final String WSDL_TARGET_NAMESPACE = "http://tempuri.org/";

public  final String SOAP_ADDRESS = "http://grasshoppernetwork.com/NewFile.asmx";
public CallSoap() 
{ 
}
public String Call(int a,int b)
{
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
PropertyInfo pi=new PropertyInfo();
pi.setName("a");
        pi.setValue(a);
        pi.setType(Integer.class);
        request.addProperty(pi);
        pi=new PropertyInfo();
        pi.setName("b");
        pi.setValue(b);
        pi.setType(Integer.class);
        request.addProperty(pi);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;

envelope.setOutputSoapObject(request);

HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
Object response=null;
try
{
httpTransport.call(SOAP_ACTION, envelope);
response = envelope.getResponse();
}
catch (Exception exception)
{
response=exception.toString();
}
return response.toString();
}
}
 
First SOAP_ACTION = namespace as seen in figure 1+function name;
  • OPERATION_NAME = name of the web method;
  • WSDL_TARGET_NAMESPACE = namespace of the webservice;
  • SOAP_ADDRESS = absolute URL of the webservice;
SOAP works on request response pair. So first you need to build a request object which can call the web service.

SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
 Now the operation or the method that you intend to call has some arguments which you need to attach to the request object. This is done through PropertyInfo Instance pi. The important thing to notice here is that the name that you use in setName() method must be the exact name of the property that you have seen in the figure above and in setType(), the data type of the variable must be specified. Using addProperty(), add all the arguments.
Using setValue() method, set the value to the property.
PropertyInfo pi=new PropertyInfo(); 
pi.setName("a"); 
pi.setValue(a); 
pi.setType(Integer.class); 
request.addProperty(pi);

Create a serialized envelope which will be used to carry the parameters for SOAP body and call the method through HttpTransportSE method.
Now you are very much ready with techniques for calling web method and getting the result. For simplicity, we have made a simple Android GUI with two EditText and one Button.
See the main.xml code as below:
 
 
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<EditText 
        android:id="@+id/editText1"
    android:layout_width="230dp"
    android:layout_height="wrap_content" >
    <requestFocus />
</EditText> 
<EditText
    android:id="@+id/editText2"
    android:layout_width="232dp"
    android:layout_height="wrap_content" />
<Button
    android:id="@+id/button1"
    android:layout_width="229dp"
    android:layout_height="wrap_content"
    android:text="@string/btnStr" />
</LinearLayout>
 
 
We want to call the method from button click event from activity class. See the code below:
 
package my.MySOAPCallActivity.namespace;
import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class SimpleAsmxSOAPCallActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button b1=(Button)findViewById(R.id.button1);
       final  AlertDialog ad=new AlertDialog.Builder(this).create();
         
        b1.setOnClickListener(new OnClickListener() { 
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
CallSoap cs=new CallSoap();

try
{
EditText ed1=(EditText)findViewById(R.id.editText1);
EditText ed2=(EditText)findViewById(R.id.editText2);
int a=Integer.parseInt(ed1.getText().toString());
int b=Integer.parseInt(ed2.getText().toString());

ad.setTitle("OUTPUT OF ADD of "+a+" and "+b);

String resp=cs.Call(a, b);
ad.setMessage(resp);
}catch(Exception ex)
{
ad.setTitle("Error!");
ad.setMessage(ex.toString());
}
ad.show(); }
});
    }
}
 
 
 
 
All you do now is get the values for a and b from EditTexts and pass the values to call method. Call method returns the result of the web method.
 
String resp=cs.Call(a, b);
ad.setMessage(resp);

 
Once you get this up and running, you are very much likely to get an error like android.os.NetworkOnMainThreadException.
That is because Android does not permit you to run socket related operations from main thread as we had already discussed. So you need to run a thread or create a thread from where you can perform these operations. You can easily model the CallSoap class as one implementing runnable and get the stuff. But I wanted to have the calling part as a separate entity. So I just made a separate thread class for calling the CallSoap method. It gives a nice layered implementation so that the thread that is calling the function where SOAP related activities are performed is completely different.
But now the problem is your activity thread and the network thread are in multi-thread operation and chances are your main thread ends before getting the result from the SOAP operation. So I used a primitive way of waiting for the result to arrive and then using it.
The caller class.
public class Caller  extends Thread  
{ public CallSoap cs;       public int a,b; 

       public void run(){

            try{

               cs=new CallSoap();

               String resp=cs.Call(a, b);

MySOAPCallActivity.rslt=resp;}catch(Exception ex)

{MySOAPCallActivity.rslt=ex.toString();
}    
}
}



Modified OnClick method of the button in activity thread which calls SOAP through this simple caller class.
package my.MySOAPCallActivity.namespace;
import android.app.Activity;
import android.os.Bundle;
import android.app.AlertDialog;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class MySOAPCallActivity extends Activity {
public static String rslt="";    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button b1=(Button)findViewById(R.id.button1);
        final  AlertDialog ad=new AlertDialog.Builder(this).create();
          
         b1.setOnClickListener(new OnClickListener() {
  
@Override public void onClick(View arg0) {
// TODO Auto-generated method stub 

 try
{ 
EditText ed1=(EditText)findViewById(R.id.editText1);
EditText ed2=(EditText)findViewById(R.id.editText2); 
int a=Integer.parseInt(ed1.getText().toString());
int b=Integer.parseInt(ed2.getText().toString()); rslt="START"; 
Caller c=new Caller(); c.a=a;
c.b=b; c.ad=ad;
c.join(); c.start();
while(rslt=="START") {
try {
Thread.sleep(10); 

}catch(Exception ex) {

 }
} ad.setTitle("RESULT OF ADD of "+a+" and "+b);
ad.setMessage(rslt); 

}catch(Exception ex) {
ad.setTitle("Error!"); ad.setMessage(ex.toString());
}
ad.show(); 
} });
    }
}



Finally you get the results as shown below:
Access Asp.Net Web Service KSoap In android

DOWNLOAD SOURCE CODE OR DOWNLOAD SOURCE CODE (Recommended To Download)

Jun 27, 2012

Draw Routs on google maps in android

Views:

Draw Routs  on google maps in androidTo day i show you how

draw Rout between Two location on google maps in android

.

 So lets Start ...

Firstly you can get the directions between two location co-ordinates using the Google Directions API.
The example I have used in this post is this XML.
 You can change the parameters to the locations you wish and get the co-ordinates from this site.




The following method returns the list of GeoPoints from the request made using the directions API.

public static ArrayList getDirections(double lat1, double lon1, double lat2, double
lon2) { String url = "http://maps.googleapis.com/maps/api/directions/xml?origin=" +lat1 +
"," + lon1 + "&destination=" + lat2 + "," + lon2 + "&sensor=false&
amp;units=metric"; String tag[] = { "lat", "lng" }; ArrayList list_of_geopoints = new ArrayList(); HttpResponse response = null; try { HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); HttpPost httpPost = new HttpPost(url); response = httpClient.execute(httpPost, localContext); InputStream in = response.getEntity().getContent(); DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(in); if (doc != null) { NodeList nl1, nl2; nl1 = doc.getElementsByTagName(tag[0]); nl2 = doc.getElementsByTagName(tag[1]); if (nl1.getLength() > 0) { list_of_geopoints = new ArrayList(); for (int i = 0; i < nl1.getLength(); i++) { Node node1 = nl1.item(i); Node node2 = nl2.item(i); double lat = Double.parseDouble(node1.getTextContent()); double lng = Double.parseDouble(node2.getTextContent()); list_of_geopoints.add(new GeoPoint((int) (lat * 1E6), (int)
(lng * 1E6))); } } else { // No points found } } } catch (Exception e) { e.printStackTrace(); } return list_of_geopoints; }




Once a MapView layout is created in your android app, you can include this customized Overlay class.
public class MyOverlay extends Overlay {

    private ArrayList all_geo_points;

    public MyOverlay(ArrayList allGeoPoints) {
        super();
        this.all_geo_points = allGeoPoints;
    }

    @Override
    public boolean draw(Canvas canvas, MapView mv, boolean shadow, long when) {
        super.draw(canvas, mv, shadow);
        drawPath(mv, canvas);
        return true;
    }

    public void drawPath(MapView mv, Canvas canvas) {
        int xPrev = -1, yPrev = -1, xNow = -1, yNow = -1;
        Paint paint = new Paint();
        paint.setColor(Color.BLUE);
        paint.setStyle(Paint.Style.FILL_AND_STROKE);
        paint.setStrokeWidth(4);
 paint.setAlpha(100);
        if (all_geo_points != null)
            for (int i = 0; i < all_geo_points.size() - 4; i++) {
                GeoPoint gp = all_geo_points.get(i);
                Point point = new Point();
                mv.getProjection().toPixels(gp, point);
                xNow = point.x;
                yNow = point.y;
                if (xPrev != -1) {
                    canvas.drawLine(xPrev, yPrev, xNow, yNow, paint);
                }
                xPrev = xNow;
                yPrev = yNow;
            }
    }
}


The getDirections() function can be called right before before adding this Overlay to the MapView’s overlays.

MapView mv = (MapView) findViewById(R.id.mvGoogle);
mv.setBuiltInZoomControls(true);
MapController mc = mv.getController();
ArrayList all_geo_points=getDirections(10.154929, 76.390316, 10.015861,
76.341867); GeoPoint moveTo = all_geo_points.get(0); mc.animateTo(moveTo); mc.setZoom(12); mv.getOverlays().add(new MyOverlay(all_geo_points)); 

May 15, 2012

ListView with Check box in android

Views:

To Day I show You to Add check boxes in list box and how to access it in android .

In my Previous Post i show How to install android  and Demo Program and Basic Intro To android .

Some you must Know about it if not the please watch it First .

This example shows how to create a ListView with a CheckBox in each row, without having our Activity extend ListActivity.

Most of the functionality is contained in the Activity class.




  1. package com.windrealm.android;  
  2.   
  3. import java.util.ArrayList;  
  4. import java.util.Arrays;  
  5. import java.util.List;  
  6.   
  7. import android.app.Activity;  
  8. import android.content.Context;  
  9. import android.os.Bundle;  
  10. import android.view.LayoutInflater;  
  11. import android.view.View;  
  12. import android.view.ViewGroup;  
  13. import android.widget.AdapterView;  
  14. import android.widget.ArrayAdapter;  
  15. import android.widget.CheckBox;  
  16. import android.widget.ListView;  
  17. import android.widget.TextView;  
  18.   
  19. public class PlanetsActivity extends Activity {  
  20.     
  21.   private ListView mainListView ;  
  22.   private Planet[] planets ;  
  23.   private ArrayAdapter<Planet> listAdapter ;  
  24.     
  25.   /** Called when the activity is first created. */  
  26.   @Override  
  27.   public void onCreate(Bundle savedInstanceState) {  
  28.     super.onCreate(savedInstanceState);  
  29.     setContentView(R.layout.main);  
  30.       
  31.     // Find the ListView resource.   
  32.     mainListView = (ListView) findViewById( R.id.mainListView );  
  33.       
  34.     // When item is tapped, toggle checked properties of CheckBox and Planet.  
  35.     mainListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {  
  36.       @Override  
  37.       public void onItemClick( AdapterView<?> parent, View item,   
  38.                                int position, long id) {  
  39.         Planet planet = listAdapter.getItem( position );  
  40.         planet.toggleChecked();  
  41.         PlanetViewHolder viewHolder = (PlanetViewHolder) item.getTag();  
  42.         viewHolder.getCheckBox().setChecked( planet.isChecked() );  
  43.       }  
  44.     });  
  45.   
  46.       
  47.     // Create and populate planets.  
  48.     planets = (Planet[]) getLastNonConfigurationInstance() ;  
  49.     if ( planets == null ) {  
  50.       planets = new Planet[] {   
  51.           new Planet("Mercury"), new Planet("Venus"), new Planet("Earth"),   
  52.           new Planet("Mars"), new Planet("Jupiter"), new Planet("Saturn"),   
  53.           new Planet("Uranus"), new Planet("Neptune"), new Planet("Ceres"),  
  54.           new Planet("Pluto"), new Planet("Haumea"), new Planet("Makemake"),  
  55.           new Planet("Eris")  
  56.       };    
  57.     }  
  58.     ArrayList<Planet> planetList = new ArrayList<Planet>();  
  59.     planetList.addAll( Arrays.asList(planets) );  
  60.       
  61.     // Set our custom array adapter as the ListView's adapter.  
  62.     listAdapter = new PlanetArrayAdapter(this, planetList);  
  63.     mainListView.setAdapter( listAdapter );        
  64.   }  
  65.     
  66.   /** Holds planet data. */  
  67.   private static class Planet {  
  68.     private String name = "" ;  
  69.     private boolean checked = false ;  
  70.     public Planet() {}  
  71.     public Planet( String name ) {  
  72.       this.name = name ;  
  73.     }  
  74.     public Planet( String name, boolean checked ) {  
  75.       this.name = name ;  
  76.       this.checked = checked ;  
  77.     }  
  78.     public String getName() {  
  79.       return name;  
  80.     }  
  81.     public void setName(String name) {  
  82.       this.name = name;  
  83.     }  
  84.     public boolean isChecked() {  
  85.       return checked;  
  86.     }  
  87.     public void setChecked(boolean checked) {  
  88.       this.checked = checked;  
  89.     }  
  90.     public String toString() {  
  91.       return name ;   
  92.     }  
  93.     public void toggleChecked() {  
  94.       checked = !checked ;  
  95.     }  
  96.   }  
  97.     
  98.   /** Holds child views for one row. */  
  99.   private static class PlanetViewHolder {  
  100.     private CheckBox checkBox ;  
  101.     private TextView textView ;  
  102.     public PlanetViewHolder() {}  
  103.     public PlanetViewHolder( TextView textView, CheckBox checkBox ) {  
  104.       this.checkBox = checkBox ;  
  105.       this.textView = textView ;  
  106.     }  
  107.     public CheckBox getCheckBox() {  
  108.       return checkBox;  
  109.     }  
  110.     public void setCheckBox(CheckBox checkBox) {  
  111.       this.checkBox = checkBox;  
  112.     }  
  113.     public TextView getTextView() {  
  114.       return textView;  
  115.     }  
  116.     public void setTextView(TextView textView) {  
  117.       this.textView = textView;  
  118.     }      
  119.   }  
  120.     
  121.   /** Custom adapter for displaying an array of Planet objects. */  
  122.   private static class PlanetArrayAdapter extends ArrayAdapter<Planet> {  
  123.       
  124.     private LayoutInflater inflater;  
  125.       
  126.     public PlanetArrayAdapter( Context context, List<Planet> planetList ) {  
  127.       super( context, R.layout.simplerow, R.id.rowTextView, planetList );  
  128.       // Cache the LayoutInflate to avoid asking for a new one each time.  
  129.       inflater = LayoutInflater.from(context) ;  
  130.     }  
  131.   
  132.     @Override  
  133.     public View getView(int position, View convertView, ViewGroup parent) {  
  134.       // Planet to display  
  135.       Planet planet = (Planet) this.getItem( position );   
  136.   
  137.       // The child views in each row.  
  138.       CheckBox checkBox ;   
  139.       TextView textView ;   
  140.         
  141.       // Create a new row view  
  142.       if ( convertView == null ) {  
  143.         convertView = inflater.inflate(R.layout.simplerow, null);  
  144.           
  145.         // Find the child views.  
  146.         textView = (TextView) convertView.findViewById( R.id.rowTextView );  
  147.         checkBox = (CheckBox) convertView.findViewById( R.id.CheckBox01 );  
  148.           
  149.         // Optimization: Tag the row with it's child views, so we don't have to   
  150.         // call findViewById() later when we reuse the row.  
  151.         convertView.setTag( new PlanetViewHolder(textView,checkBox) );  
  152.   
  153.         // If CheckBox is toggled, update the planet it is tagged with.  
  154.         checkBox.setOnClickListener( new View.OnClickListener() {  
  155.           public void onClick(View v) {  
  156.             CheckBox cb = (CheckBox) v ;  
  157.             Planet planet = (Planet) cb.getTag();  
  158.             planet.setChecked( cb.isChecked() );  
  159.           }  
  160.         });          
  161.       }  
  162.       // Reuse existing row view  
  163.       else {  
  164.         // Because we use a ViewHolder, we avoid having to call findViewById().  
  165.         PlanetViewHolder viewHolder = (PlanetViewHolder) convertView.getTag();  
  166.         checkBox = viewHolder.getCheckBox() ;  
  167.         textView = viewHolder.getTextView() ;  
  168.       }  
  169.   
  170.       // Tag the CheckBox with the Planet it is displaying, so that we can  
  171.       // access the planet in onClick() when the CheckBox is toggled.  
  172.       checkBox.setTag( planet );   
  173.         
  174.       // Display planet data  
  175.       checkBox.setChecked( planet.isChecked() );  
  176.       textView.setText( planet.getName() );        
  177.         
  178.       return convertView;  
  179.     }  
  180.       
  181.   }  
  182.     
  183.   public Object onRetainNonConfigurationInstance() {  
  184.     return planets ;  
  185.   }  
  186. }  


Downloads

The source code and Eclipse project files for this tutorial can be downloaded here.

Apr 27, 2012

How to Install Android

Views:

http://martin.iturbide.com/wp-content/uploads/2010/07/Android-Install.jpg TO Day I am show You How to install android on Windows XP, windows Vista and Windows 7 . Android is an Operating System for smart Devices and Smart Phone Create By Google using java.Android Support Java Programming Language for Application Development .






For Installing android We need Software .

1) JDK JAVA DEVELOPMENT KIT (Latest)
2)eclipse IDE 
3) android SDK

you can also get more information about installation and development from android developer

Supported Operating Systems

  • Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)
  • Mac OS X 10.5.8 or later (x86 only)
  • Linux (tested on Ubuntu Linux, Lucid Lynx)
    • GNU C Library (glibc) 2.7 or later is required.
    • On Ubuntu Linux, version 8.04 or later is required.
    • 64-bit distributions must be capable of running 32-bit applications. For information about how to add support for 32-bit applications, see the Ubuntu Linux installati

Below some installation videos

Video # 2

Mar 12, 2012

A basic Intro To Android Developer

Views:

http://www.mobilemarketingwatch.com/wordpress/wp-content/uploads/2010/04/Android-Growing-Quickly-App-Growth-Up-70-Percent-60K-Activations-Per-Day-300x300.jpg The Following Are Some basic Concept of android for developers


.JAR Files:-
The Java™ Archive (JAR) file format enables you to bundle multiple files into a single archive file.
Android Operation System
Android is an operating system based on Linux with a Java programming interface. Created By Google Through JAVA Language.

Activity

Activity represents the presentation layer of an Android application. A simplified (and slightly incorrect) description is that an Activity is a screen. This is slightly incorrect as Activities can be displayed as Dialogs or can be transparent. An Android application can have several Activities.

Views and ViewGroups

Views are user interface widgets, e.g. buttons or text fields. The base class for all Views is android.view.View. Views often have attributes which can be used to change their appearance and behavior.
A ViewGroup is responsible for arranging other Views e.g. a ViewGroup is a layout manager. The base class for a layout manager is android.view.ViewGroups. ViewGroup also extends View. ViewGroups can be nestled to create complex layouts. You should not nestle ViewGroups too deeply as this has a negative impact on the performance.

Intents

Intents are asynchronous messages which allow the application to request functionality from other components of the Android system, e.g. from Services or Activities. An application can call a component directly (explicit Intent ) or ask the Android system to evaluate registered components for a certain Intent (implicit Intents ). For example the application could implement sharing of data via an Intent and all components which allow sharing of data would be available for the user to select. Applications register themselves to an Intent via an IntentFilter.
Intents allow to combine loosely coupled components to perform certain tasks.

Services

Services perform background tasks without providing a user interface. They can notify the user via the notification framework in Android.

 ContentProvider

ContentProvider provides a structured interface to application data. Via a ContentProvider your application can share data with other applications. Android contains an SQLite database which is frequently used in conjunction with a ContentProvider to persist the data of the ContentProvider.

 BroadcastReceiver

BroadcastReceiver can be registered to receive system messages and Intents. A BroadcastReceiver will get notified by the Android system, if the specified situation happens. For example a BroadcastReceiver could get called once the Android system completed the boot process or if a phone call is received.

 (HomeScreen) Widgets

Widgets are interactive components which are primarily used on the Android homescreen. They typically display some kind of data and allow the user to perform actions via them. For example a Widget could display a short summary of new emails and if the user selects an email, it could start the email application with the selected email.

 Other

Android provide many more components but the list above describes the most important ones. Other Android components are "Live Folders" and "Live Wallpapers". Live Folders display data on the homescreen without launching the corresponding application.

 AndroidManifest.xml

The components and settings of an Android application are described in the file AndroidManifest.xml. For example all Activities and Services of the application must be declared in this file.
It must also contain the required permissions for the application. For example if the application requires network access it must be specified here.

 R.java and Resources

The " gen " directory in an Android project contains generated values. R.java is a generated class which contains references to certain resources of the project.
These resources must be defined in the "res" directory and can be XML files, icons or pictures. You can for example define values, menus, layouts or animations via XML files.

Context

The class android.content.Context provides the connections to the Android system. It is the interface to global information about the application environment. Context also provides access to Android Services, e.g. the Location Service. Activities and Services extend the Context class and can therefore be used as Context

Implement KeyWord
In Java Programming Language the Keywprd implement Specifies that given  Class implements an interface.

Extends Keyword
The extends is jave keyword , which in inheritance Process of java. It specifies the super class in a class declaration using extends keyword.

Eclipse ADT PLUGIN LINK

https://dl-ssl.google.com/android/eclipse/.

 Emulator Shortcuts

The following shortcuts are useful for working with the emulator.
Alt+Enter Maximizes the emulator. Nice for demos.
Ctrl+F11 changes the orientation of the emulator.
F8 Turns network on / off.

Warnings Messages for Strings

The Android development tools are show warnings if you use hard-coded strings, for example in layout files. While for real application its best practice to use string resource files we use use Strings directly to simplify the creation of the examples.

HOW TO ADD RESOURCES in String.XML file
<resources>
                    <string name="hello">Hello World, Convert!</string>
                    <string name="app_name">Temperature Converter</string>
                    <color name="myColor">#3399CC</color>
                    <string name="myClickHandler">myClickHandler</string>
                    <string name="celsius">to Celsius</string>
                    <string name="fahrenheit">to Fahrenheit</string>
                    <string name="calc">Calculate</string>
</resources>

Make a Edith Text control to Password
android:inputType="textPassword"
 
Videos PROMO

2nd Video

Become a Fan

visual studio learn