I just learned about Android and saw that the events in the book have always been fixed. I am not quite clear about this in Java. What kind of Anonymous class should I think, the event can be specified at runtime for flexibility. So I searched
During debugging, the following error occurs: Java. Io. ioexception: Unable to upload file: no space left on device. The reason is that my APK is too big. The solution is as follows: Find the simulator directory under the AVD directory C: \
In the past two days, the communication between PC and Android mobile phones is limited to the level. There are two methods available: socket based on data packets and Bluetooth. Although it looks simple, it has been adjusted for more than two days.
The Cocos2d was finally run on Andriod. Various pitfalls were encountered during installation. Here I will summarize these pitfalls. According to official Cocos2dx documents, we know that the following four prerequisites are required for building an
The drop-down list is a spinner. This is easy to use. Define a tag in xml and specify the ArrayAdapter , You must specify the drop-down layout for the Adapter. For the drop-down data, the book uses static arrays. I changed it to read from the
Just learned listview, refer to online tutorials Http://www.cnblogs.com/allin/archive/2010/05/11/1732200.html Implemented a listview by myself, using SimpleAdapter, slightly changed The Code is as follows: Public class SListViewActivity extends
Automatic completion means entering letters in the input box and finding similar words by yourself. In android, You need to specify the words first. Static arrays are used in the book, and resource files are changed here. There are two automatically
Radio is composed of RadioGroup and RadioButton. This is very simple. Main. xml Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: orientation = "vertical"> Android: layout_width = "fill_parent"Android:
CheckBox exercises : Compared with radioButton, the checkbox does not require a RadioGroup. Each checkbox is a separate control. It is easy to use isChecked to determine whether to select a CheckedChangeListener listener. For details, refer to
ImageButton is an image Button. You can specify an image resource. Other operations are the same as Button. Here you are familiar with the usage of the dialog box. The Code is as follows: Xml Code Android: layout_width = "fill_parent" Android:
AlertDialog dialog box in android Created by AlertDialog. builder and displayed in show after creation. The Code is as follows: Xml definition of the dialog box Android: layout_width = "match_parent" Android: layout_height =
Image view is used to display images in android. The code here is from the example in the book. It is easy to use. Now I think android development is really convenient. The Code is as follows: Xml Android: layout_width = "fill_parent" Android:
SharedPreferences storage, which is often used for storing some configuration items in the program. It is much simpler to use than symbian, and the code is very simple. It is used for testing. You can also try other methods. The Code is as
Switch between the two activities, use Intent object, and use very simple Intent in = new Intent (); In. setClass (this, active2.class ); // Send a value to active2 In. putExtra ("tt", et. getText (). toString ()); This. startActivity (in ); This.
Gallery is used to display images. You need to specify the source adapter of an image, which is inherited from BaseAdapter. The Code is as follows: Xml Code Xmlns: android = "http://schemas.android.com/apk/res/android" Android: id = "@ + id/gallery"
1. sample projects provided by the Android teamIf you do not start by learning the sample code provided by the Android SDK, there may be no better way to master the development on the Android framework. The core development team of Android provides 1
ImageSwitch requires a ViewFactory interface method to return an ImageView object and specify the setFactory method. It tried to use ImageView to implement ImageSwitcher. There was no difference, but what was the difference? The Code is as follows:
Common attributes Android: id --- specify the corresponding ID for the controlAndroid: text --- specifies the text displayed in the control. Note that strings in the strings. xml file should be used as much as possible here.Android: grimace ---
Android 1.5 passed the test You only need to call setCurrentView (); in the following code. Http://hi.baidu.com/wishwingliao/blog/item/38feb71c994ae98587d6b6e0.html /*** Hide the title bar and call this method before Activity. setCurrentView
// Create a Toast object 02 Toast mToast = Toast.makeText(ShareYourLifeActivity.this, "Memory Card unavailable, please check ...", Toast.LENGTH_LONG); 03 04