Google Android

Lets develop mobile applications with using google android SDK.

Firstly we have to download Eclipse (at least i download it 😛 ).From Eclipse.Org

after that extract it some where and open Eclipse 3.4 Ganymede

  1. Start Eclipse, then select Help > Software Updates….
  2. In the dialog that appears, click the Available Software tab.
  3. Click Add Site…
  4. Enter this as the Location:
    https://dl-ssl.google.com/android/eclipse/
    Alternatively, you can use http in the Location URL, if you are having trouble with https (https is preferred for security reasons).
    http://dl-ssl.google.com/android/eclipse/
    Click OK.
  5. Back in the Available Software view, you should see the plugin. Select the checkbox next to Developer Tools and click Install…
  6. On the subsequent Install window, “Android Developer Tools”, and “Android Editors” should both be checked. The Android Editors feature is optional, but recommended. If you choose to install it, you need the WST plugin mentioned earlier in this page. Click Next.
  7. Accept the license agreement and click Finish.
  8. Restart Eclipse.

After all these operations lets add our SDK.Download sdk from here

Extract your sdk somewhere and add your sdk’s path with clicking Window->Preferences-Android

then with using browse select your sdk location. That’s it.Lets watch how its simple to write code for mobile phones.

main.xml :

  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5. android:orientation="vertical"
  6.  
  7. android:layout_width="fill_parent"
  8.  
  9. android:layout_height="fill_parent"
  10.  
  11. >
  12.  
  13. <TextView
  14.  
  15. android:layout_width="fill_parent"
  16.  
  17. android:layout_height="wrap_content"
  18.  
  19. android:text="@string/hello"
  20.  
  21. />
  22.  
  23. <EditText android:id="@+id/EditText01" android:layout_width="wrap_content" android:layout_height="wrap_content"></EditText>
  24.  
  25. <EditText android:id="@+id/EditText02" android:layout_width="wrap_content" android:layout_height="wrap_content"></EditText>
  26.  
  27. <CheckBox android:id="@+id/CheckBox01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Copy From Down"></CheckBox>
  28.  
  29. <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Make it simpler"></Button>
  30.  
  31. </LinearLayout>

HelloAndroid.Java :

  1. span class=”co2″>import android.app.Activity;
  2. import android.os.Bundle;
  3. import android.view.View;
  4. import android.view.View.OnClickListener;
  5. import android.widget.Button;
  6. import android.widget.CheckBox;
  7. import android.widget.EditText;
  8. /** Called when the activity is first created. */// TODO Auto-generated method stub


Tags: , , , , , ,

Thursday, March 5th, 2009 Java, Programming