This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface monitor{ | |
public void displayText(); | |
public void displayGraphics(); | |
} //定义监视器接口 | |
----------------------------------------------------- | |
class LCD implements monitor{ | |
public void displayText(){ | |
System.out.println("this is the lcd screen"); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
首先SAXParserFactory来创建一个SAXParserFactory实例 | |
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); | |
然后根据SAXParserFactory实例来创建SAXParser,再从SAXParser中得到一个XMLReader的实例,XMLReader是一个接口 | |
XMLReader xmlReader = saxParserFactory.newSAXParser().getXMLReader(); | |
把自己编写的Handler注册到XMLReader中去,一般最重要的就是ContentHandler | |
xmlReader.setContentHandler(ContentHandler); | |
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.evasion.listviewdemo; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import android.widget.TextView; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends ActionBarActivity { | |
private EditText nameText; | |
private EditText pwdText; | |
private Button button; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Button button1,button2,button3; | |
private TextView textView1; | |
button1.setOnClickListener(new Button.OnClickListener(){ | |
@Override | |
public void onClick(View arg0) { | |
// TODO Auto-generated method stub | |
//URLַ | |
// String uriAPI = "http://www.dubblogs.cc:8751/Android/Test/API/Post/index.php"; | |
String uriAPI = "http://172.20.0.206:8082//TestServelt/login.do"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SocketActivity extends Activity { | |
/** Called when the activity is first created. */ | |
private Button startButton = null; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
startButton = (Button)findViewById(R.id.startListener); | |
startButton.setOnClickListener(new StartSocketListener()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WifiActivity extends Activity { | |
/** Called when the activity is first created. */ | |
private Button startButton = null; | |
private Button stopButton = null; | |
private Button checkButton = null; | |
private WifiManager wifiManager = null; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SMSReceiver extends BroadcastReceiver{ | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
// TODO Auto-generated method stub | |
System.out.println("receive message"); | |
//接受Intent对象当中的数据 | |
Bundle bundle = intent.getExtras(); | |
//在Bundle对象当中有一个属性名为pdus,这个属性的值是一个Object数组 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mars.download; | |
import mars.utils.HttpDownloader; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
public class Download extends Activity { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends Activity { | |
private Button btnn; | |
private TextView tvv; | |
private int[] colorArray; | |
private int colorNum; | |
private String strColor[]; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
NewerOlder