Android程序----工廠測試軟件

1.Lcd測試代碼:

  1. package  com.android.factorytest;  
  2.   
  3.   
  4. import  android.app.Activity;  
  5. import  android.content.Intent;  
  6. import  android.graphics.Color;  
  7. import  android.os.Bundle;  
  8. import  android.util.Log;  
  9. import  android.view.View;  
  10. import  android.widget.Button;  
  11. import  android.widget.TextView;  
  12.   
  13. public   class  TestColor  extends  Activity{  
  14.     private   static   final  String TAG =  "TestColor" ;  
  15.       
  16.     private  Button mReturn =  null ;  
  17.     private  Button mChangeColor =  null ;  
  18.     private  Button mNext =  null ;  
  19.     private  TextView mText1 =  null ;  
  20.     private  TextView mText2 =  null ;  
  21.     private  TextView mText3 =  null ;  
  22.     private  Intent mIntent =  null ;  
  23.       
  24.     private   int  mNum =  0 ;  
  25.       
  26.     protected   void  onCreate(Bundle savedInstanceState)   
  27.     {  
  28.         super .onCreate(savedInstanceState);  
  29.         setContentView(R.layout.test_color);  
  30.         initView();  
  31.     }  
  32.   
  33.     private   void  initView()  
  34.     {  
  35.         setTitle(R.string.test_color_mess);  
  36.         mReturn = (Button)findViewById(R.id.but_return);  
  37.         mChangeColor = (Button)findViewById(R.id.but_changecolor);  
  38.         mNext = (Button)findViewById(R.id.but_next);  
  39.           
  40.         mText1 = (TextView)findViewById(R.id.test_color_text1);  
  41.         mText2 = (TextView)findViewById(R.id.test_color_text2);  
  42.         mText3 = (TextView)findViewById(R.id.test_color_text3);  
  43.           
  44.         mReturn.setOnClickListener(new  View.OnClickListener()   
  45.         {  
  46.             public   void  onClick(View v)   
  47.             {  
  48.                 mIntent = new  Intent(TestColor. this , MainActivity. class );  
  49.                 startActivity(mIntent);  
  50.             }  
  51.         });  
  52.   
  53.         mNext.setOnClickListener(new  View.OnClickListener()   
  54.         {  
  55.             public   void  onClick(View v)   
  56.             {  
  57.                 mIntent = new  Intent(TestColor. this , TestSd. class );  
  58.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  59.                 finish();   
  60.                 startActivity(mIntent);  
  61.             }  
  62.         });  
  63.         mChangeColor.setOnClickListener(new  View.OnClickListener()   
  64.         {  
  65.             public   void  onClick(View v)   
  66.             {  
  67.                 mNum ++;  
  68.                 changeColor(mNum);  
  69.             }  
  70.         });  
  71.     }  
  72.       
  73.     private   void  changeColor( int  num)  
  74.     {  
  75.         Log.e(TAG, "num = "  + (num% 6 ));  
  76.         switch (num %  6 )  
  77.         {  
  78.         case   0 :  
  79.             mText1.setBackgroundColor(Color.RED);  
  80.             mText2.setBackgroundColor(Color.RED);  
  81.             mText3.setBackgroundColor(Color.RED);  
  82.             break ;  
  83.         case   1 :  
  84.             mText1.setBackgroundColor(Color.GREEN);  
  85.             mText2.setBackgroundColor(Color.GREEN);  
  86.             mText3.setBackgroundColor(Color.GREEN);  
  87.             break ;  
  88.         case   2 :  
  89.             mText1.setBackgroundColor(Color.BLUE);  
  90.             mText2.setBackgroundColor(Color.BLUE);  
  91.             mText3.setBackgroundColor(Color.BLUE);  
  92.             break ;  
  93.         case   3 :  
  94.             mText1.setBackgroundColor(Color.RED);  
  95.             mText2.setBackgroundColor(Color.RED);  
  96.             mText3.setBackgroundColor(Color.RED);  
  97.             break ;  
  98.         case   4 :  
  99.             mText1.setBackgroundColor(Color.GREEN);  
  100.             mText2.setBackgroundColor(Color.GREEN);  
  101.             mText3.setBackgroundColor(Color.GREEN);  
  102.             break ;  
  103.         case   5 :  
  104.             mText1.setBackgroundColor(Color.BLUE);  
  105.             mText2.setBackgroundColor(Color.BLUE);  
  106.             mText3.setBackgroundColor(Color.BLUE);  
  107.             break ;  
  108.         }  
  109.     }  
  110. }  

LCD測試XML:

  1. <?xml version= "1.0"  encoding= "utf-8" ?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
  3.     android:layout_width="fill_parent"   
  4.     android:layout_height="fill_parent"    
  5.     android:background="#383838"   
  6.     android:orientation="vertical"   
  7.     android:gravity="center"     >  
  8.         
  9.      <LinearLayout   
  10.         android:orientation="horizontal"   
  11.         android:layout_width="fill_parent"    
  12.         android:layout_height="fill_parent"   
  13.         android:layout_weight="1"  >  
  14.           
  15.         <TextView android:id="@+id/test_color_text1"   
  16.             android:layout_width="fill_parent"    
  17.             android:layout_height="fill_parent"    
  18.             android:layout_weight="1"   
  19.             android:background="#ffff0000"  />  
  20.         <TextView android:id="@+id/test_color_text2"   
  21.             android:layout_width="fill_parent"    
  22.             android:layout_height="fill_parent"    
  23.             android:layout_weight="1"   
  24.             android:background="#ffff0000"  />  
  25.         <TextView android:id="@+id/test_color_text3"   
  26.             android:layout_width="fill_parent"    
  27.             android:layout_height="fill_parent"    
  28.             android:layout_weight="1"   
  29.             android:background="#ffff0000"  />  
  30.               
  31.     </LinearLayout>  
  32.       
  33.     <LinearLayout   
  34.         android:orientation="horizontal"   
  35.         android:layout_width="fill_parent"    
  36.         android:layout_height="wrap_content"   
  37.         android:layout_marginTop="5dp"   
  38.         android:gravity="center" >  
  39.           
  40.         <Button android:id="@+id/but_return"    
  41.             android:layout_width="200dp"   
  42.             android:layout_height="wrap_content"    
  43.             android:layout_marginLeft="20dp"   
  44.             android:text="@string/but_return"  />  
  45.               
  46.         <Button android:id="@+id/but_changecolor"    
  47.             android:layout_width="200dp"   
  48.             android:layout_height="wrap_content"    
  49.             android:text="@string/but_changecolor"  />  
  50.               
  51.         <Button android:id="@+id/but_next"    
  52.             android:layout_width="200dp"   
  53.             android:layout_height="wrap_content"    
  54.             android:layout_marginRight="20dp"   
  55.             android:text="@string/but_next"  />  
  56.     </LinearLayout>  
  57. </LinearLayout>  

2.SD卡測試代碼:

  1. package  com.android.factorytest;  
  2.   
  3. import  java.io.File;  
  4. import  android.app.Activity;  
  5. import  android.content.Intent;  
  6. import  android.graphics.Color;  
  7. import  android.os.Bundle;  
  8. import  android.os.Environment;  
  9. import  android.util.Log;  
  10. import  android.view.View;  
  11. import  android.widget.Button;  
  12. import  android.widget.TextView;  
  13. import  java.io.FileOutputStream;  
  14. import  java.io.OutputStreamWriter;  
  15.   
  16.   
  17. public   class  TestSd  extends  Activity   
  18. {  
  19.     private   static   final  String LOG_TAG =  null ;  
  20.     private  TextView mTestSd =  null ;  
  21.     private  Button mReturn =  null ;  
  22.     private  Button mNext =  null ;  
  23.     private  Intent mIntent =  null ;  
  24.     private  File sdcardDir;  
  25.     //private String PATH ="/abc";   
  26.     private  String FILENAME =  "/sdcard/cet4hard.txt" ;  
  27.     //private String FILENAME = "/mnt/sdcard/cet4hard.txt";//emulator test   
  28.   
  29.     @Override   
  30.     protected   void  onCreate(Bundle savedInstanceState)   
  31.     {  
  32.         super .onCreate(savedInstanceState);  
  33.         setContentView(R.layout.test_sd);  
  34.         sdcardDir = Environment.getExternalStorageDirectory();  
  35.         initView();  
  36.     }  
  37.   
  38.     private   void  initView()   
  39.     {  
  40.         try   
  41.         {  
  42.             Log.d(LOG_TAG,"Start Write" );  
  43.             if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()))  
  44.             {  
  45.                 //File path = new File(sdcardDir+PATH);   
  46.                 File f = new  File(sdcardDir + FILENAME);  
  47.                 //File f = new File(FILENAME);//emulator test   
  48.                 boolean  flag =  false ;  
  49.   
  50.                 //if(!path.exists())   
  51.                 //{   
  52.                 //  flag = path.mkdirs();   
  53.                 //  if(flag)   
  54.                 //  {   
  55.                 //      mTestSd = (TextView)findViewById(R.id.test_sd);   
  56.                 //      mTestSd.setText(R.string.test_sd_mess3);   
  57.                 //  }   
  58.                 //  else   
  59.                 //  {   
  60.                 //      mTestSd = (TextView)findViewById(R.id.test_sd_delete);   
  61.                 //      setContentView(R.id.test_sd_delete);   
  62.                 //  }   
  63.                 //}   
  64.               
  65.                 if (!f.exists())  
  66.                 {  
  67.                     flag = f.createNewFile();  
  68.                         if (flag)  
  69.                         {  
  70.                             mTestSd = (TextView)findViewById(R.id.test_sd_create);  
  71.                             mTestSd.setText(R.string.test_sd_mess3);  
  72.                             mTestSd.setTextColor(Color.GREEN);  
  73.                             OutputStreamWriter osw = new  OutputStreamWriter( new  FileOutputStream(f));  
  74.                             String editor = "fdfd" ;  
  75.                             osw.write(editor.toString());  
  76.                             osw.close();  
  77.                         }  
  78.                         else   
  79.                         {  
  80.                             mTestSd = (TextView)findViewById(R.id.test_sd_create);  
  81.                             mTestSd.setText(R.string.test_sd_mess5);  
  82.                             mTestSd.setTextColor(Color.RED);  
  83.                         }  
  84.                 }  
  85.                 else   
  86.                 {  
  87.                     mTestSd = (TextView)findViewById(R.id.test_sd_create);  
  88.                     mTestSd.setText(R.string.test_sd_mess5);  
  89.                     mTestSd.setTextColor(Color.RED);                      
  90.                 }  
  91.                 if (f.exists())  
  92.                 {  
  93.                     flag = f.delete();  
  94.                     if (flag)  
  95.                     {  
  96.                         mTestSd = (TextView)findViewById(R.id.test_sd_delete);  
  97.                         mTestSd.setText(R.string.test_sd_mess4);  
  98.                         mTestSd.setTextColor(Color.GREEN);  
  99.                     }  
  100.                     else   
  101.                     {  
  102.                         mTestSd = (TextView)findViewById(R.id.test_sd_delete);  
  103.                         mTestSd.setText(R.string.test_sd_mess6);  
  104.                         mTestSd.setTextColor(Color.RED);  
  105.                     }  
  106.                 }  
  107.                 else   
  108.                 {  
  109.                     mTestSd = (TextView)findViewById(R.id.test_sd_delete);  
  110.                     mTestSd.setText(R.string.test_sd_mess6);  
  111.                     mTestSd.setTextColor(Color.RED);                      
  112.                 }  
  113.             }  
  114.             else   
  115.             {  
  116.                 mTestSd = (TextView)findViewById(R.id.test_sd);  
  117.                 mTestSd.setText(R.string.test_sd_mess2);  
  118.                 mTestSd.setTextColor(Color.RED);  
  119.             }  
  120.         }  
  121.         catch (Exception e)  
  122.         {  
  123.                 Log.d(LOG_TAG,"file create error" );  
  124.         }  
  125.         mReturn = (Button)findViewById(R.id.but_return);  
  126.         mNext = (Button)findViewById(R.id.but_next);  
  127.           
  128.         mReturn.setOnClickListener(new  View.OnClickListener()   
  129.         {  
  130.             public   void  onClick(View v)   
  131.             {  
  132.                 mIntent = new  Intent(TestSd. this , MainActivity. class );  
  133.                 startActivity(mIntent);  
  134.             }  
  135.         });  
  136.           
  137.         mNext.setOnClickListener(new  View.OnClickListener()   
  138.         {  
  139.             public   void  onClick(View v)   
  140.             {  
  141.                 mIntent = new  Intent(TestSd. this , TestCamera. class );  
  142.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  143.                 finish();   
  144.                 startActivity(mIntent);  
  145.             }  
  146.         });  
  147.     }  
  148. }  

SD卡測試XML:

  1. <?xml version= "1.0"  encoding= "utf-8" ?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
  3.     android:layout_width="fill_parent"   
  4.     android:layout_height="fill_parent"    
  5.     android:background="#383838"   
  6.     android:orientation="vertical"   
  7.     android:gravity="center"     >  
  8.         
  9.      <LinearLayout   
  10.         android:layout_width="fill_parent"    
  11.         android:layout_height="wrap_content"   
  12.         android:layout_weight="1"   
  13.         android:orientation="vertical"   
  14.         android:gravity="center"  >  
  15.           
  16.         <TextView  
  17.             android:id="@+id/test_sd"   
  18.             android:layout_width="wrap_content"   
  19.             android:layout_height="wrap_content"   
  20.             android:textSize="20sp"   
  21.          />    
  22.               
  23.     </LinearLayout>  
  24.             
  25.      <LinearLayout   
  26.         android:layout_width="fill_parent"    
  27.         android:layout_height="wrap_content"   
  28.         android:layout_weight="1"   
  29.         android:orientation="vertical"   
  30.         android:gravity="center"  >  
  31.               
  32.         <TextView  
  33.             android:id="@+id/test_sd_create"   
  34.             android:layout_width="wrap_content"   
  35.             android:layout_height="wrap_content"   
  36.             android:textSize="20sp"   
  37.          />        
  38.     </LinearLayout>       
  39.      <LinearLayout   
  40.         android:layout_width="fill_parent"    
  41.         android:layout_height="wrap_content"   
  42.         android:layout_weight="1"   
  43.         android:orientation="vertical"   
  44.         android:gravity="center"  >  
  45.       
  46.         <TextView  
  47.             android:id="@+id/test_sd_delete"   
  48.             android:layout_width="wrap_content"   
  49.             android:layout_height="wrap_content"   
  50.             android:textSize="20sp"   
  51.          />  
  52.               
  53.     </LinearLayout>  
  54.     <LinearLayout   
  55.         android:orientation="horizontal"   
  56.         android:layout_width="fill_parent"    
  57.         android:layout_height="wrap_content"   
  58.         android:layout_marginTop="5dp"   
  59.         android:gravity="center" >  
  60.           
  61.         <Button android:id="@+id/but_return"    
  62.             android:layout_width="200dp"   
  63.             android:layout_height="wrap_content"    
  64.             android:text="@string/but_return"  />  
  65.               
  66.         <Button android:id="@+id/but_next"    
  67.             android:layout_width="200dp"   
  68.             android:layout_height="wrap_content"    
  69.             android:text="@string/but_next"  />  
  70.     </LinearLayout>  
  71. </LinearLayout>  

3.Camera測試代碼:

  1. package  com.android.factorytest;  
  2.   
  3.   
  4. import  android.app.Activity;  
  5. import  android.content.BroadcastReceiver;  
  6. import  android.content.Context;  
  7. import  android.content.Intent;  
  8. import  android.content.IntentFilter;  
  9. import  android.os.Bundle;  
  10. import  android.provider.MediaStore;  
  11. import  android.view.View;  
  12. import  android.widget.Button;  
  13.   
  14. public   class  TestCamera  extends  Activity  
  15. {  
  16.       
  17.     private  Button mReturn =  null ;  
  18.     private  Button mChangeCamera =  null ;  
  19.     private  Button mNext =  null ;  
  20.     private  Intent mIntent =  null ;  
  21.     private   static   int  TAKE_PICTURE =  1 ;  
  22.       
  23.     protected   void  onCreate(Bundle savedInstanceState)   
  24.     {  
  25.         super .onCreate(savedInstanceState);  
  26.         setContentView(R.layout.test_camera);  
  27.         initView();  
  28.         RegListener();  
  29.     }  
  30.       
  31.     public   void  RegListener() {    
  32.         ExitListenerReceiver exitre = new  ExitListenerReceiver();    
  33.         IntentFilter intentfilter = new  IntentFilter();    
  34.         intentfilter.addAction(this .getPackageName() +  "."     
  35.                         + "ExitListenerReceiver" );    
  36.         this .registerReceiver(exitre, intentfilter);    
  37.     }    
  38.     
  39.     class  ExitListenerReceiver  extends  BroadcastReceiver {    
  40.             @Override   
  41.             public   void  onReceive(Context arg0, Intent arg1) {  
  42.                 // TODO Auto-generated method stub   
  43.                 ((Activity) arg0).finish();                   
  44.             }     
  45.     }   
  46.   
  47.     private   void  initView()  
  48.     {  
  49.         setTitle(R.string.test_camera_mess);  
  50.         mReturn = (Button)findViewById(R.id.but_return);  
  51.         mChangeCamera = (Button)findViewById(R.id.but_changecamera);  
  52.         mNext = (Button)findViewById(R.id.but_next);  
  53.           
  54.         mReturn.setOnClickListener(new  View.OnClickListener()   
  55.         {  
  56.             public   void  onClick(View v)   
  57.             {  
  58.                 mIntent = new  Intent(TestCamera. this , MainActivity. class );  
  59.                 startActivity(mIntent);  
  60.             }  
  61.         });  
  62.   
  63.         mNext.setOnClickListener(new  View.OnClickListener()   
  64.         {  
  65.             public   void  onClick(View v)   
  66.             {  
  67.                 mIntent = new  Intent(TestCamera. this , TestWiFi. class );  
  68.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  69.                 finish();   
  70.                 startActivity(mIntent);  
  71.             }  
  72.         });  
  73.         mChangeCamera.setOnClickListener(new  View.OnClickListener()   
  74.         {  
  75.             public   void  onClick(View v)   
  76.             {  
  77.                 mIntent = new  Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
  78.                 startActivityForResult(mIntent,TAKE_PICTURE);  
  79.             }  
  80.         });  
  81.     }  
  82. }  

Camera測試XML:

  1. <?xml version= "1.0"  encoding= "utf-8" ?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
  3.     android:layout_width="fill_parent"   
  4.     android:layout_height="fill_parent"    
  5.     android:background="#383838"   
  6.     android:orientation="vertical"   
  7.     android:gravity="center"     >  
  8.   
  9.      <LinearLayout   
  10.         android:orientation="horizontal"   
  11.         android:layout_width="fill_parent"    
  12.         android:layout_height="wrap_content"   
  13.         android:layout_weight="1"    
  14.         android:gravity="center"  >  
  15.           
  16.         <TextView  
  17.             android:layout_width="wrap_content"   
  18.             android:layout_height="wrap_content"   
  19.             android:textSize="20sp"   
  20.             android:text="@string/test_camera_mess"  />  
  21.     </LinearLayout>  
  22.       
  23.     <LinearLayout   
  24.         android:orientation="horizontal"   
  25.         android:layout_width="fill_parent"    
  26.         android:layout_height="wrap_content"   
  27.         android:layout_marginTop="5dp"   
  28.         android:gravity="center" >  
  29.           
  30.         <Button android:id="@+id/but_return"    
  31.             android:layout_width="200dp"   
  32.             android:layout_height="wrap_content"    
  33.             android:layout_marginLeft="20dp"   
  34.             android:text="@string/but_return"  />  
  35.               
  36.         <Button android:id="@+id/but_changecamera"    
  37.             android:layout_width="200dp"   
  38.             android:layout_height="wrap_content"    
  39.             android:text="@string/but_camera_open"  />  
  40.               
  41.         <Button android:id="@+id/but_next"    
  42.             android:layout_width="200dp"   
  43.             android:layout_height="wrap_content"    
  44.             android:layout_marginRight="20dp"   
  45.             android:text="@string/but_next"  />  
  46.     </LinearLayout>  
  47. </LinearLayout>  

4.Wifi測試代碼:

  1. package  com.android.factorytest;  
  2.   
  3. import  android.app.Activity;  
  4. import  android.content.Intent;  
  5. //import android.net.ConnectivityManager;   
  6. //import android.net.wifi.WifiConfiguration;   
  7. import  android.net.wifi.WifiManager;  
  8. import  android.os.Bundle;  
  9. import  android.provider.Settings;  
  10. import  android.util.Log;  
  11. import  android.view.View;  
  12. import  android.widget.Button;  
  13. import  android.widget.Toast;  
  14.   
  15. public   class  TestWiFi  extends  Activity   
  16. {  
  17.     private   static   final  String TAG =  "TestWiFi" ;  
  18.   
  19.     private  Button mReturn =  null ;  
  20.     private  Button mChangeState =  null ;  
  21.     private  Button mNext =  null ;  
  22.     private  Intent mIntent =  null ;  
  23.     private  WifiManager mWifiManager =  null ;   
  24.     //private ConnectivityManager connectivity  = null;   
  25.   
  26.     private   int  mWifiState = - 1 ;  
  27.   
  28.     //private int networkPreference = -1;   
  29.   
  30.       
  31.     @Override   
  32.     protected   void  onCreate(Bundle savedInstanceState)   
  33.     {  
  34.         super .onCreate(savedInstanceState);  
  35.         setContentView(R.layout.test_wifi);  
  36.         initView();  
  37.     }  
  38.   
  39.     private   void  initView()   
  40.     {  
  41.         mReturn = (Button) findViewById(R.id.but_return);  
  42.         mNext = (Button) findViewById(R.id.but_next);  
  43.         mChangeState = (Button) findViewById(R.id.but_changestate);  
  44.   
  45.         if  (mChangeState ==  null )  
  46.             Log.e(TAG, "mChangeState is null " );  
  47.   
  48.         mReturn.setOnClickListener(new  View.OnClickListener()   
  49.         {  
  50.             public   void  onClick(View v)   
  51.             {  
  52.                 mIntent = new  Intent(TestWiFi. this , MainActivity. class );  
  53.                 startActivity(mIntent);  
  54.             }  
  55.         });  
  56.   
  57.         mNext.setOnClickListener(new  View.OnClickListener()   
  58.         {  
  59.             public   void  onClick(View v)   
  60.             {  
  61.                 mIntent = new  Intent(TestWiFi. this , TestBluetooth. class );  
  62.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  63.                 finish();   
  64.                 startActivity(mIntent);  
  65.             }  
  66.         });  
  67.   
  68.         mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE);  
  69.         if  (mWifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLED)   
  70.         {  
  71.             mWifiState = 1 ;  
  72.             //將當前網絡設置爲首選網絡   
  73.             //connectivity = (ConnectivityManager)getSystemService(WIFI_SERVICE);   
  74.             //networkPreference  = connectivity .getNetworkPreference();   
  75.             //connectivity.setNetworkPreference(networkPreference);   
  76.             //mChangeState.setText(R.string.but_wifi_close);   
  77.             mChangeState.setText(R.string.test_wifi_mess_enter_wifisetting);  
  78.         }   
  79.         else   if  (mWifiManager.getWifiState() == WifiManager.WIFI_STATE_DISABLED)   
  80.         {  
  81.             mWifiState = 0 ;  
  82.             //mChangeState.setText(R.string.but_wifi_open);   
  83.             mChangeState.setText(R.string.test_wifi_mess_enter_wifisetting);  
  84.         }   
  85.         else    
  86.         {  
  87.             Log.e(TAG, "Wifi State = "  + mWifiManager.getWifiState());  
  88.         }  
  89.         mChangeState.setOnClickListener(new  View.OnClickListener()   
  90.         {  
  91.             public   void  onClick(View v)   
  92.             {  
  93.                 changeWifiState(mWifiState);  
  94.                 mWifiState ++;  
  95.             }  
  96.         });  
  97.     }  
  98.   
  99.     private   void  changeWifiState( int  state)   
  100.     {  
  101.         Log.e(TAG, "mWifiState = "  + state);  
  102.         Toast.makeText(this , R.string.test_wifi_mess_enter_wifisetting, Toast.LENGTH_LONG).show();  
  103.         //startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS)); //進入無線網絡配置界面   
  104.         startActivity(new  Intent(Settings.ACTION_WIFI_SETTINGS));  //直接進入wifi網絡設置界面   
  105.         switch  (state %  2 )   
  106.         {  
  107.         case   0 :   
  108.         {  
  109.             new  Thread()   
  110.             {  
  111.                 public   void  run()   
  112.                 {  
  113.                     Log.e(TAG, "setWifiEnabled(true)" );  
  114.                     mWifiManager.setWifiEnabled(true );  
  115.                 }  
  116.             }.start();  
  117. //          if(mIntent.getAction().equals(WifiManager.WIFI_STATE_CHANGED_ACTION))   
  118. //          {   
  119. //              Toast.makeText(this, R.string.test_wifi_mess_state_changed, Toast.LENGTH_LONG).show();   
  120. //          }   
  121.             while  ((mWifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLING) ||   
  122.                    (mWifiManager.getWifiState() == WifiManager.WIFI_STATE_ENABLED))   
  123.             {  
  124.                 Toast.makeText(this , R.string.test_wifi_mess_enable, Toast.LENGTH_LONG).show();  
  125.                 break ;  
  126.             }  
  127.             //獲取網絡列表並激活一個網絡連接   
  128.             //List<WifiConfiguration> configurations = mWifiManager.getConfiguredNetworks();   
  129.             //if(configurations.size() > 0)   
  130.             //{   
  131.             //  int netID = configurations.get(0).networkId;   
  132.             //  boolean disableAllOthers = true;   
  133.             //  mWifiManager.enableNetwork(netID, disableAllOthers);   
  134.             //}   
  135.             //mChangeState.setText(R.string.but_wifi_close);   
  136.             mChangeState.setText(R.string.test_wifi_mess_enter_wifisetting);  
  137.             break ;  
  138.         }  
  139.         case   1 :  
  140.         {  
  141.             new  Thread()   
  142.             {  
  143.                 public   void  run()   
  144.                 {  
  145.                     Log.e(TAG, "setWifiEnabled(false)" );  
  146.                     mWifiManager.setWifiEnabled(false );  
  147.                 }  
  148.             }.start();  
  149.             //mChangeState.setText(R.string.but_wifi_open);   
  150.             mChangeState.setText(R.string.test_wifi_mess_enter_wifisetting);  
  151. //          if(mIntent.getAction().equals(WifiManager.WIFI_STATE_CHANGED_ACTION))   
  152. //          {   
  153. //              Toast.makeText(this, R.string.test_wifi_mess_state_changed, Toast.LENGTH_LONG).show();   
  154. //          }   
  155.             while  ((mWifiManager.getWifiState() == WifiManager.WIFI_STATE_DISABLING) ||  
  156.                    (mWifiManager.getWifiState() == WifiManager.WIFI_STATE_DISABLED))  
  157.             {  
  158.                 Toast.makeText(this , R.string.test_wifi_mess_disable, Toast.LENGTH_LONG).show();  
  159.                 break ;  
  160.             }  
  161.             break ;  
  162.         }  
  163.         default :  
  164.             Log.e(TAG, "Wifi state error !" );  
  165.             Toast.makeText(this , R.string.test_wifi_mess_error, Toast.LENGTH_LONG).show();  
  166.             break ;  
  167.         }  
  168.     }  
  169. }  

Wifi測試XML:

  1. <?xml version= "1.0"  encoding= "utf-8" ?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
  3.     android:layout_width="fill_parent"   
  4.     android:layout_height="fill_parent"    
  5.     android:background="#383838"   
  6.     android:orientation="vertical"   
  7.     android:gravity="center"     >  
  8.         
  9.      <LinearLayout   
  10.         android:layout_width="fill_parent"    
  11.         android:layout_height="wrap_content"   
  12.         android:layout_weight="1"   
  13.         android:orientation="vertical"   
  14.         android:gravity="center"  >  
  15.           
  16.         <TextView  
  17.             android:layout_width="wrap_content"   
  18.             android:layout_height="wrap_content"   
  19.             android:textSize="20sp"   
  20.             android:text="@string/test_wifi_mess"  />  
  21.               
  22.     </LinearLayout>  
  23.       
  24.     <LinearLayout   
  25.         android:orientation="horizontal"   
  26.         android:layout_width="fill_parent"    
  27.         android:layout_height="wrap_content"   
  28.         android:layout_marginTop="5dp"   
  29.         android:gravity="center" >  
  30.           
  31.         <Button android:id="@+id/but_return"    
  32.             android:layout_width="200dp"   
  33.             android:layout_height="wrap_content"    
  34.             android:text="@string/but_return"  />  
  35.               
  36.         <Button android:id="@+id/but_changestate"    
  37.             android:layout_width="200dp"   
  38.             android:layout_height="wrap_content"    
  39.             android:text="@string/but_wifi_close"  />  
  40.               
  41.         <Button android:id="@+id/but_next"    
  42.             android:layout_width="200dp"   
  43.             android:layout_height="wrap_content"    
  44.             android:text="@string/but_next"  />  
  45.     </LinearLayout>  
  46. </LinearLayout>  

5.Bluetooth測試代碼:

  1. package com.android.factorytest;  
  2.   
  3. import android.app.Activity;  
  4. import android.bluetooth.BluetoothAdapter;  
  5. import android.content.BroadcastReceiver;  
  6. import android.content.Context;  
  7. import android.content.Intent;  
  8. import android.content.IntentFilter;  
  9. import android.graphics.Color;  
  10. import android.os.Bundle;  
  11. import android.provider.Settings;  
  12. import android.util.Log;  
  13. import android.view.View;  
  14. import android.widget.Button;  
  15. import android.widget.TextView;  
  16. import android.widget.Toast;  
  17.   
  18. public   class  TestBluetooth extends Activity  
  19. {  
  20.     private   static  final String TAG =  "TestBluetooth" ;  
  21.     private  TextView mBluetoothstate =  null ;  
  22.     private  Button mReturn =  null ;  
  23.     private  Button mChangeState =  null ;  
  24.     private  Button mNext =  null ;  
  25.     private  Intent mIntent =  null ;  
  26.     private  BluetoothAdapter mBluetooth =  null ;  
  27.     private   int  mBluetoothState = -1;  
  28.       
  29.     @Override  
  30.     protected   void  onCreate(Bundle savedInstanceState)   
  31.     {  
  32.         super.onCreate(savedInstanceState);  
  33.         setContentView(R.layout.test_bluetooth);  
  34.         initView();  
  35.     }  
  36.   
  37.     private   void  initView()   
  38.     {  
  39.         mReturn = (Button) findViewById(R.id.but_return);  
  40.         mNext = (Button) findViewById(R.id.but_next);  
  41.         mChangeState = (Button) findViewById(R.id.but_changestate);  
  42.         mBluetoothstate = (TextView)findViewById(R.id.bluetooth_state);  
  43.   
  44.         if  (mChangeState ==  null )  
  45.             Log.e(TAG, "mChangeState is null " );  
  46.   
  47.         mReturn.setOnClickListener(new  View.OnClickListener()   
  48.         {  
  49.             public   void  onClick(View v)   
  50.             {  
  51.                 mIntent = new  Intent(TestBluetooth. this , MainActivity. class );  
  52.                 startActivity(mIntent);  
  53.             }  
  54.         });  
  55.   
  56.         mNext.setOnClickListener(new  View.OnClickListener()   
  57.         {  
  58.             public   void  onClick(View v)   
  59.             {  
  60.                 mIntent = new  Intent(TestBluetooth. this , TestColor. class );  
  61.                 finish();   
  62.                 startActivity(mIntent);  
  63.             }  
  64.         });  
  65.   
  66.         mBluetooth = BluetoothAdapter.getDefaultAdapter();  
  67.         if ( null  == mBluetooth)  
  68.         {  
  69.             mBluetoothstate.setText("No Bluetooth Device" );  
  70.             mBluetoothstate.setTextColor(Color.RED);  
  71.         }  
  72.         if  (mBluetooth.isEnabled())   
  73.         {  
  74.             mBluetoothState = 1;  
  75.             mChangeState.setText(R.string .but_bluetooth_close);  
  76.         }   
  77.         else   if  (!mBluetooth.isEnabled())   
  78.         {  
  79.             mBluetoothState = 0;  
  80.             mChangeState.setText(R.string .but_bluetooth_open);  
  81.         }   
  82.         else    
  83.         {  
  84.             Log.e(TAG, "Bluetooth State = " );  
  85.         }  
  86.         mChangeState.setOnClickListener(new  View.OnClickListener()   
  87.         {  
  88.             public   void  onClick(View v)   
  89.             {  
  90.                 startActivity(new  Intent(Settings.ACTION_BLUETOOTH_SETTINGS)); //進入Bluetooth配置界面   
  91.                 changeBluetoothState(mBluetoothState);  
  92.                 mBluetoothState ++;  
  93.             }  
  94.         });  
  95.     }  
  96.   
  97.     private   void  changeBluetoothState( int  state)   
  98.     {  
  99.         Log.e(TAG, "mBluetoothState = "  + state);  
  100.         switch  (state % 2)   
  101.         {  
  102.             case  0:   
  103.             {  
  104.                 startBluetooth();  
  105.                 Toast.makeText(this , R. string .test_bluetooth_mess_state_changed, Toast.LENGTH_LONG).show();  
  106.                 mChangeState.setText(R.string .but_bluetooth_close);  
  107.                 break ;  
  108.             }  
  109.             case  1:  
  110.             {  
  111.                 stopBluetooth();  
  112.                 Toast.makeText(this , R. string .test_bluetooth_mess_state_changed, Toast.LENGTH_LONG).show();  
  113.                 mChangeState.setText(R.string .but_bluetooth_open);  
  114.                 break ;  
  115.             }  
  116.             default :  
  117.                 Log.e(TAG, "Wifi state error !" );  
  118.                 Toast.makeText(this , R. string .test_bluetooth_mess_error, Toast.LENGTH_LONG).show();  
  119.                 break ;  
  120.         }  
  121.     }  
  122.       
  123.     private   void  startBluetooth()  
  124.     {  
  125.         mBluetoothstate = (TextView)findViewById(R.id.bluetooth_state);  
  126.         mBluetooth = BluetoothAdapter.getDefaultAdapter();  
  127.         if ( null  == mBluetooth)  
  128.         {  
  129.             mBluetoothstate.setText("No Bluetooth Device" );  
  130.             mBluetoothstate.setTextColor(Color.RED);  
  131.         }  
  132.         BroadcastReceiver BluetoothState = new  BroadcastReceiver()  
  133.         {  
  134.   
  135.             @Override  
  136.             public   void  onReceive(Context context, Intent intent)   
  137.             {  
  138.                 //String prevStateExtra = BluetoothAdapter.EXTRA_PREVIOUS_STATE;   
  139.                 String stateExtra = BluetoothAdapter.EXTRA_STATE;  
  140.                 int  state = intent.getIntExtra(stateExtra, -1);  
  141.                 //int previousState = intent.getIntExtra(prevStateExtra, -1);   
  142.                 String tt = "" ;  
  143.                 switch (state)  
  144.                 {  
  145.                     case  (BluetoothAdapter.STATE_TURNING_ON):  
  146.                     {  
  147.                         tt = "Bluetooth turning on" ;  
  148.                         break ;  
  149.                     }  
  150.                     case  (BluetoothAdapter.STATE_ON):  
  151.                     {  
  152.                         tt = "Bluetooth on" ;  
  153.                         unregisterReceiver(this );  
  154.                         break ;  
  155.                     }  
  156.                     case  (BluetoothAdapter.STATE_TURNING_OFF):  
  157.                     {  
  158.                         tt = "Bluetooth turning off" ;  
  159.                         break ;  
  160.                     }  
  161.                     case  (BluetoothAdapter.STATE_OFF):  
  162.                     {  
  163.                         tt = "Bluetooth off" ;  
  164.                         break ;  
  165.                     }  
  166.                     default :  
  167.                         tt = "Unkown Bluetooth state!" ;  
  168.                         break ;  
  169.                 }  
  170.                 //Toast.makeText(this, tt, Toast.LENGTH_LONG).show();      
  171.                 mBluetoothstate.setText(tt);              
  172.             }  
  173.         };  
  174.         if (!mBluetooth.isEnabled())  
  175.         {  
  176.             String actionStateChanged = BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED;  
  177.             //String actionRequestEnable = BluetoothAdapter.ACTION_REQUEST_ENABLE;   
  178.             registerReceiver(BluetoothState, new  IntentFilter(actionStateChanged));  
  179.             //startActivityForResult(new Intent(actionRequestEnable),0);   
  180.             mBluetooth.enable();  
  181.         }  
  182.     }     
  183.     private   void  stopBluetooth()  
  184.     {  
  185.         mBluetoothstate = (TextView)findViewById(R.id.bluetooth_state);  
  186.         mBluetooth = BluetoothAdapter.getDefaultAdapter();  
  187.         if ( null  == mBluetooth)  
  188.         {  
  189.             mBluetoothstate.setText("No Bluetooth Device" );  
  190.             mBluetoothstate.setTextColor(Color.RED);  
  191.         }  
  192.         BroadcastReceiver BluetoothState = new  BroadcastReceiver()  
  193.         {  
  194.   
  195.             @Override  
  196.             public   void  onReceive(Context context, Intent intent)   
  197.             {  
  198.                 //String prevStateExtra = BluetoothAdapter.EXTRA_PREVIOUS_STATE;   
  199.                 String stateExtra = BluetoothAdapter.EXTRA_STATE;  
  200.                 int  state = intent.getIntExtra(stateExtra, -1);  
  201.                 //int previousState = intent.getIntExtra(prevStateExtra, -1);   
  202.                 String tt = "Unkown Bluetooth" ;  
  203.                 switch (state)  
  204.                 {  
  205.                     case  (BluetoothAdapter.STATE_TURNING_ON):  
  206.                     {  
  207.                         tt = "Bluetooth turning on" ;  
  208.                         break ;  
  209.                     }  
  210.                     case  (BluetoothAdapter.STATE_ON):  
  211.                     {  
  212.                         tt = "Bluetooth on" ;  
  213.                         unregisterReceiver(this );  
  214.                         break ;  
  215.                     }  
  216.                     case  (BluetoothAdapter.STATE_TURNING_OFF):  
  217.                     {  
  218.                         tt = "Bluetooth turning off" ;  
  219.                         break ;  
  220.                     }  
  221.                     case  (BluetoothAdapter.STATE_OFF):  
  222.                     {  
  223.                         tt = "Bluetooth off" ;  
  224.                         break ;  
  225.                     }  
  226.                     default :  
  227.                         tt = "Unkown Bluetooth state!" ;  
  228.                         break ;  
  229.                 }  
  230.                 //Toast.makeText(this, tt, Toast.LENGTH_LONG).show();      
  231.                 mBluetoothstate.setText(tt);  
  232.             }  
  233.         };  
  234.         if (mBluetooth.isEnabled())  
  235.         {  
  236.             String actionStateChanged = BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED;  
  237.             registerReceiver(BluetoothState, new  IntentFilter(actionStateChanged));  
  238.             mBluetooth.disable();             
  239.         }  
  240.           
  241.     }  
  242. }  

Bluetooth測試Xml:

  1. <?xml version= "1.0"  encoding= "utf-8" ?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
  3.     android:layout_width="fill_parent"   
  4.     android:layout_height="fill_parent"    
  5.     android:background="#383838"   
  6.     android:orientation="vertical"   
  7.     android:gravity="center"     >  
  8.         
  9.      <LinearLayout   
  10.         android:layout_width="fill_parent"    
  11.         android:layout_height="wrap_content"   
  12.         android:layout_weight="1"   
  13.         android:orientation="vertical"   
  14.         android:gravity="center"  >  
  15.           
  16.         <TextView  
  17.             android:layout_width="wrap_content"   
  18.             android:layout_height="wrap_content"   
  19.             android:textSize="20sp"   
  20.             android:text="@string/test_bluetooth_mess"  />  
  21.               
  22.         <TextView  
  23.             android:id="@+id/bluetooth_state"   
  24.             android:layout_width="wrap_content"   
  25.             android:layout_height="wrap_content"   
  26.             android:textSize="20sp" />  
  27.               
  28.     </LinearLayout>  
  29.       
  30.     <LinearLayout   
  31.         android:orientation="horizontal"   
  32.         android:layout_width="fill_parent"    
  33.         android:layout_height="wrap_content"   
  34.         android:layout_marginTop="5dp"   
  35.         android:gravity="center" >  
  36.           
  37.         <Button android:id="@+id/but_return"    
  38.             android:layout_width="200dp"   
  39.             android:layout_height="wrap_content"    
  40.             android:text="@string/but_return"  />  
  41.               
  42.         <Button android:id="@+id/but_changestate"    
  43.             android:layout_width="200dp"   
  44.             android:layout_height="wrap_content"    
  45.             android:text="@string/but_bluetooth_close"  />  
  46.               
  47.         <Button android:id="@+id/but_next"    
  48.             android:layout_width="200dp"   
  49.             android:layout_height="wrap_content"    
  50.             android:text="@string/but_next"  />  
  51.     </LinearLayout>  
  52. </LinearLayout>  

6.MainActivity代碼:

  1. package com.android.factorytest;  
  2.   
  3. import android.app.Activity;  
  4. import android.content.Intent;  
  5. import android.os.Bundle;  
  6. import android.view.View;  
  7. import android.widget.Button;  
  8.   
  9. public   class  MainActivity extends Activity   
  10. {  
  11.     private  Button mTestColor =  null ;  
  12.     private  Button mTestSd =  null ;  
  13.     private  Button mTestCamera =  null ;  
  14.     private  Button mTestWiFi =  null ;  
  15.     private  Button mTestBluetooth =  null ;  
  16.       
  17.     private  Intent mIntent =  null ;  
  18.     /** Called when the activity is first created. */   
  19.     @Override  
  20.     public   void  onCreate(Bundle savedInstanceState)   
  21.     {  
  22.         super.onCreate(savedInstanceState);  
  23.         setContentView(R.layout.main);  
  24.         initButton();  
  25.     }  
  26.   
  27.   
  28.     private   void  initButton()  
  29.     {  
  30.         mTestColor = (Button)findViewById(R.id.test_color);  
  31.         mTestSd = (Button)findViewById(R.id.test_sd);  
  32.         mTestCamera = (Button)findViewById(R.id.test_camera);  
  33.         mTestWiFi = (Button)findViewById(R.id.test_wifi);  
  34.         mTestBluetooth = (Button)findViewById(R.id.test_bluetooth);  
  35.           
  36.         mTestColor.setOnClickListener(new  View.OnClickListener()   
  37.         {         
  38.             @Override  
  39.             public   void  onClick(View v)   
  40.             {  
  41.                 mIntent =new  Intent(MainActivity. this ,TestColor. class );  
  42.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  43.                 finish();   
  44.                 startActivity(mIntent);  
  45.             }  
  46.         });  
  47.           
  48.         mTestSd.setOnClickListener(new  View.OnClickListener()   
  49.         {             
  50.             @Override  
  51.             public   void  onClick(View v)   
  52.             {  
  53.                 mIntent =new  Intent(MainActivity. this ,TestSd. class );  
  54.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  55.                 finish();   
  56.                 startActivity(mIntent);  
  57.             }  
  58.         });  
  59.         mTestCamera.setOnClickListener(new  View.OnClickListener()   
  60.         {             
  61.             @Override  
  62.             public   void  onClick(View v)   
  63.             {  
  64.                 mIntent =new  Intent(MainActivity. this ,TestCamera. class );  
  65.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  66.                 finish();   
  67.                 startActivity(mIntent);  
  68.             }  
  69.         });  
  70.         mTestWiFi.setOnClickListener(new  View.OnClickListener()   
  71.         {             
  72.             @Override  
  73.             public   void  onClick(View v)   
  74.             {  
  75.                 mIntent =new  Intent(MainActivity. this ,TestWiFi. class );  
  76.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  77.                 finish();   
  78.                 startActivity(mIntent);  
  79.             }  
  80.         });  
  81.         mTestBluetooth.setOnClickListener(new  View.OnClickListener()   
  82.         {             
  83.             @Override  
  84.             public   void  onClick(View v)   
  85.             {  
  86.                 mIntent =new  Intent(MainActivity. this ,TestBluetooth. class );  
  87.                 //mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);   
  88.                 finish();   
  89.                 startActivity(mIntent);  
  90.             }  
  91.         });  
  92.     }  
  93. }  

main XML:

  1. <?xml version= "1.0"  encoding= "utf-8" ?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   
  3.     android:orientation="vertical"   
  4.     android:layout_width="fill_parent"   
  5.     android:layout_height="fill_parent"   
  6.     android:background="#383838"   
  7.     android:gravity="center"   
  8.     >  
  9.     <TextView    
  10.         android:layout_width="wrap_content"    
  11.         android:layout_height="wrap_content"    
  12.         android:layout_marginTop="20dp"   
  13.         android:layout_marginBottom="30dp"   
  14.         android:textSize="25dp"   
  15.         android:text="@string/app_name"   
  16.     />  
  17.     <Button  
  18.         android:id="@+id/test_color"   
  19.         android:layout_width="400dp"   
  20.         android:layout_height="wrap_content"   
  21.         android:layout_marginBottom="20dp"   
  22.         android:text="@string/but_test_color"   
  23.     />  
  24.     <Button  
  25.         android:id="@+id/test_sd"   
  26.         android:layout_width="400dp"   
  27.         android:layout_height="wrap_content"   
  28.         android:layout_marginBottom="20dp"   
  29.         android:text="@string/but_test_sd"   
  30.     />  
  31.     <Button  
  32.         android:id="@+id/test_camera"   
  33.         android:layout_width="400dp"   
  34.         android:layout_height="wrap_content"   
  35.         android:layout_marginBottom="20dp"   
  36.         android:text="@string/but_test_camera"   
  37.     />  
  38.     <Button  
  39.         android:id="@+id/test_wifi"   
  40.         android:layout_width="400dp"   
  41.         android:layout_height="wrap_content"   
  42.         android:layout_marginBottom="20dp"   
  43.         android:text="@string/but_test_wifi"   
  44.     />  
  45.     <Button  
  46.         android:id="@+id/test_bluetooth"   
  47.         android:layout_width="400dp"   
  48.         android:layout_height="wrap_content"   
  49.         android:layout_marginBottom="20dp"   
  50.         android:text="@string/but_test_bluetooth"   
  51.     />  
  52. </LinearLayout>  

7.資源文件String.Xml:

  1. <?xml version= "1.0"  encoding= "utf-8" ?>  
  2. <resources>  
  3.     <string  name= "hello" >Hello World, MainActivity!</ string >  
  4.     <string  name= "app_name" >工廠測試</ string >  
  5.       
  6.     <string  name= "but_test_color" >LCD 測試</ string >  
  7.     <string  name= "but_test_sd" >SD卡測試</ string >  
  8.     <string  name= "but_test_camera" >Camera 測試</ string >  
  9.     <string  name= "but_test_wifi" >WiFi測試</ string >  
  10.     <string  name= "but_test_bluetooth" >Bluetooth 測試</ string >  
  11.           
  12.       
  13.     <string  name= "but_return" >返回菜單</ string >  
  14.     <string  name= "but_retest" > 重測本項</ string >  
  15.     <string  name= "but_changecolor" >改變顏色</ string >  
  16.     <string  name= "but_next" > 下一項測試</ string >  
  17.     <string  name= "but_exit" >退出</ string >  
  18.     <string  name= "but_camera_open" > 打開Camera</ string >  
  19.     <string  name= "but_camera_exit" >關閉Camera</ string >  
  20.     <string  name= "but_wifi_open" >打開WiFi</ string >  
  21.     <string  name= "but_wifi_close" >關閉WiFi</ string >  
  22.     <string  name= "but_bluetooth_open" >打開Bluetooth</ string >  
  23.     <string  name= "but_bluetooth_close" >關閉Bluetooth</ string >  
  24.       
  25.       
  26.   
  27.     <string  name= "test_sd_mess1" >SD 卡已經插入!</ string >  
  28.     <string  name= "test_sd_mess2" >SD卡已經拔出!</ string >  
  29.     <string  name= "test_sd_mess3" >在SD卡中創建文件成功!</ string >  
  30.     <string  name= "test_sd_mess4" >從SD卡中刪除文件成功!</ string >  
  31.     <string  name= "test_sd_mess5" >在SD卡中創建文件失敗!</ string >  
  32.     <string  name= "test_sd_mess6" >從SD卡中刪除文件失敗!</ string >  
  33.       
  34.     <string  name= "test_color_mess" > 請點擊“改變顏色”,顯示是否正常!</ string >  
  35.     <string  name= "test_camera_mess" >請點擊“打開Camera”,測試 Camera是否正常!</ string >  
  36.     <string  name= "test_wifi_mess" >請點擊“打開WiFi/關閉WiFi”,是否有正 確的WiFi信息!</ string >  
  37.     <string  name= "test_wifi_mess_enable" >WiFi打開成功!</ string >  
  38.     <string  name= "test_wifi_mess_disable" >WiFi關閉成功!</ string >  
  39.     <string  name= "test_wifi_mess_state_changed" >WiFi狀態改 變!</ string >  
  40.     <string  name= "test_wifi_mess_enter_wifisetting" >進入 WiFi設置界面</ string >  
  41.     <string  name= "test_wifi_mess_error" >未知的WiFi狀態!</ string >  
  42.     <string  name= "test_bluetooth_mess" >請點擊“打開Bluetooth/關閉 Bluetooth”,是否有正確的Bluetooth信息!</ string >  
  43.     <string  name= "test_bluetooth_mess_state_changed" >Bluetooth 狀態改變!</ string >  
  44.     <string  name= "test_bluetooth_mess_error" >未知的Bluetooth 狀態!</ string >  
  45.   
  46. </resources> 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章