Code Library

Free Source Code, Program Tips and Technology Documents

Android Application Development, 1st EditionBy Rick Rogers, John Lombardo ………………………………… …….. Publisher: O'Reilly Media, Inc.Pub Date: May 26, 2009Print ISBN-13: 978-0-596-52147-9Pages: 336Slots: 1.0

Download, download link

Copyright Preface Part 1: Development Kit Walk-Through Chapter 1. Getting to Know Android Section 1.1. Why Android? Section 1.2. The Open Handset Alliance [...]

Android: Actions for BroadcastReceiver

android.bluetooth.intent.action.BONDING_CREATED android.bluetooth.intent.action.BONDING_REMOVED android.bluetooth.intent.action.DISABLED android.bluetooth.intent.action.DISCOVERY_COMPLETED android.bluetooth.intent.action.DISCOVERY_STARTED android.bluetooth.intent.action.ENABLED android.bluetooth.intent.action.HEADSET_STATE_CHANGED android.bluetooth.intent.action.MODE_CHANGED android.bluetooth.intent.action.NAME_CHANGED android.bluetooth.intent.action.PAIRING_CANCEL android.bluetooth.intent.action.PAIRING_REQUEST android.bluetooth.intent.action.REMOTE_ALIAS_CHANGED android.bluetooth.intent.action.REMOTE_ALIAS_CLEARED android.bluetooth.intent.action.REMOTE_DEVICE_CONNECTED android.bluetooth.intent.action.REMOTE_DEVICE_DISAPPEARED android.bluetooth.intent.action.REMOTE_DEVICE_DISAPPEARED android.bluetooth.intent.action.REMOTE_DEVICE_DISCONNECTED android.bluetooth.intent.action.REMOTE_DEVICE_DISCONNECT_REQUESTED [...]

HelloSpinner.java Source

package com.example.test; import android.app.Activity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.Spinner; public class HelloSpinner extends Activity (@ Overridepublic void onCreate (Bundle savedInstanceState) ( super.onCreate (savedInstanceState); setContentView (R.layout.main); Spinner s = (Spinner) findViewById (R.id.spinner); ArrayAdapter adapter = ArrayAdapter.createFromResource (this, R.array.planets, android.R. layout.simple_spinner_item); adapter.setDropDownViewResource (android.R.layout.simple_spinner_dropdown_item); s.setAdapter (adapter);))

layout-> main.xml

[...]

HelloFormStuff. Java code is as follows

package com.example.test; import android.app.Activity; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.widget.CheckBox; import android.widget.EditText; import android.widget.ImageButton; import android.widget.RadioButton; import android.widget.Toast; import android.widget.ToggleButton; public class HelloFormStuff extends Activity (/ ** Called when the activity is first created. * / @ Override public void onCreate (Bundle savedInstanceState) (super.onCreate [...]

Hello, TimePicker

A TimePicker is a Widget that allows the User to Select the time by hour, minute and AM or PM.

Start a new project / Activity called HelloTimePicker.

Modify HelloTimePicker.java code is as follows:

package com.example.test; import java.util.Calendar; import android.app.Activity; import android.app.Dialog; import android.app.TimePickerDialog; [...]

Eclipse developed Android, Hello, WebView (study 6)

Hello, WebView

A WebView allows you to Create your own Web Browser Activity. In this Tutorial, we'll Create a simple Activity that can View Web pages.

Learning Address: http://androidappdocs.appspot.com/guide/tutorials/views/hello-webview.html

HelloWebView.java Code

package com.example.test; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class HelloWebView extends Activity (WebView webview; [...]