android 学习笔记

 

standard  0  The default mode, which will usually create a new instance of the activity when it is started, though this behavior may change with the introduction of other options such as Intent.FLAG_ACTIVITY_NEW_TASK.

singleTop 1  If, when starting the activity, there is already an instance of the same activity class in the foreground that is interacting with the user, then re-use that instance. This existing instance will receive a call to Activity.onNewIntent() with the new Intent that is being started.

singleTask 2 If, when starting the activity, there is already a task running that starts with this activity, then instead of starting a new instance the current task is brought to the front. The existing instance will receive a call to Activity.onNewIntent() with the new Intent that is being started, and with the Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT flag set. This is a superset of the singleTop mode, where if there is already an instance of the activity being started at the top of the stack, it will receive the Intent as described there (without the FLAG_ACTIVITY_BROUGHT_TO_FRONT flag set). See the Tasks and Back Stack document for more details about tasks.

singleInstance 3 Only allow one instance of this activity to ever be running. This activity gets a unique task with only itself running in it; if it is ever launched again with the same Intent, then that task will be brought forward and its Activity.onNewIntent() method called. If this activity tries to start a new activity, that new activity will be launched in a separate task. See the Tasks and Back Stack document for more details about tasks.

Widget其实可以很炫

http://407827531.iteye.com/blog/605736

 

很多开发者可能下载后编译的Android SDK是Linxu下使用的,如何编译Windows下的Android SDK呢? 这里Android123总结如下:

  1. 首先必须在Linux下执行完源码下载,就是reop sync后,首先做一次完整编译,执行make,然后编译Linux下的SDK,执行make sdk即可,在这之前的操作,可以参考 Android源码编译相关问题汇总

  2. 这时候在生成out目录下的内容考回到Windows下,如果你用虚拟机这一步只需要拖动操作即可,比较简单。

  3. 下载Cygwin,Android开发网提示安装时记住选择Unix/binary而不是DOS/text国内的很多文章均写错了,不然无法正确编译,这在Android官方的howto_build_SDK.txt中写的很详细,具体为When installing Cygwin, set Default Text File Type to Unix/binary, not DOS/text.  This is really important, otherwise you will get errors when trying to  checkout code using git

  4. 安装Cygwin需要下载的包有 autoconf, bison, curl, flex, gcc, g++, git, gnupg, make, mingw-zlib, python, zip, unzip,建议安装 diffutils, emacs, openssh, rsync, vim, wget ,不要安装readline。

  5. 然后在Windows下将从Linux从预编译生成的zip一般名为android-sdk_eng.[你电脑的名称]_linux-x86.zip文件找出来,这是Linux下的SDK。

  6. 按照howto_build_SDK.txt的步骤,其中最后一步为development/build/tools/make_windows_sdk.sh /path/to/macos/or/linux/sdk.zip ~/mysdk、

  最后Android123提示大家,make_windows_sdk.sh是你在Linux下development/build/tools/才有的。附上 howto_build_SDK.txt 文件

 

<?xml version="1.0" encoding="utf-8"?>

<resources>
    <dimen name="tab_height">68px</dimen>
    <dimen name="button_layout_width">240px</dimen>
    <drawable name="keyWorldBG">#000</drawable>
    <drawable name="keyWorldBG_Selected">#FFFF00</drawable>
</resources>

^./x{09}

 

Api Level 3:(SDK 1.5)

Xml代码

      1. android.bluetooth.a2dp.intent.action.SINK_STATE_CHANGED 
      2. android.bluetooth.intent.action.BLUETOOTH_STATE_CHANGED 
      3. android.bluetooth.intent.action.BOND_STATE_CHANGED_ACTION 
      4. android.bluetooth.intent.action.DISCOVERY_COMPLETED 
      5. android.bluetooth.intent.action.DISCOVERY_STARTED 
      6. android.bluetooth.intent.action.HEADSET_ADUIO_STATE_CHANGED 
      7. android.bluetooth.intent.action.HEADSET_STATE_CHANGED 
      8. android.bluetooth.intent.action.NAME_CHANGED 
      9. android.bluetooth.intent.action.PAIRING_CANCEL 
      10. android.bluetooth.intent.action.PAIRING_REQUEST 
      11. android.bluetooth.intent.action.REMOTE_DEVICE_CONNECTED 
      12. android.bluetooth.intent.action.REMOTE_DEVICE_DISAPPEARED 
      13. android.bluetooth.intent.action.REMOTE_DEVICE_DISAPPEARED 
      14. android.bluetooth.intent.action.REMOTE_DEVICE_DISCONNECTED 
      15. android.bluetooth.intent.action.REMOTE_DEVICE_DISCONNECT_REQUESTED 
      16. android.bluetooth.intent.action.REMOTE_DEVICE_FOUND 
      17. android.bluetooth.intent.action.REMOTE_NAME_FAILED 
      18. android.bluetooth.intent.action.REMOTE_NAME_UPDATED 
      19. android.bluetooth.intent.action.SCAN_MODE_CHANGED 
      20. android.intent.action.AIRPLANE_MODE 
      21. android.intent.action.BATTERY_CHANGED 
      22. android.intent.action.BATTERY_LOW 
      23. android.intent.action.BOOT_COMPLETED 
      24. android.intent.action.CAMERA_BUTTON 
      25. android.intent.action.CONFIGURATION_CHANGED 
      26. android.intent.action.DATA_SMS_RECEIVED 
      27. android.intent.action.DATE_CHANGED 
      28. android.intent.action.DEVICE_STORAGE_LOW 
      29. android.intent.action.DEVICE_STORAGE_OK 
      30. android.intent.action.GTALK_CONNECTED 
      31. android.intent.action.GTALK_DISCONNECTED 
      32. android.intent.action.HEADSET_PLUG 
      33. android.intent.action.INPUT_METHOD_CHANGED 
      34. android.intent.action.MANAGE_PACKAGE_STORAGE 
      35. android.intent.action.MEDIA_BAD_REMOVAL 
      36. android.intent.action.MEDIA_BUTTON 
      37. android.intent.action.MEDIA_CHECKING 
      38. android.intent.action.MEDIA_EJECT 
      39. android.intent.action.MEDIA_MOUNTED 
      40. android.intent.action.MEDIA_NOFS 
      41. android.intent.action.MEDIA_REMOVED 
      42. android.intent.action.MEDIA_SCANNER_FINISHED 
      43. android.intent.action.MEDIA_SCANNER_SCAN_FILE 
      44. android.intent.action.MEDIA_SCANNER_STARTED 
      45. android.intent.action.MEDIA_SHARED 
      46. android.intent.action.MEDIA_UNMOUNTABLE 
      47. android.intent.action.MEDIA_UNMOUNTED 
      48. android.intent.action.NEW_OUTGOING_CALL 
      49. android.intent.action.PACKAGE_ADDED 
      50. android.intent.action.PACKAGE_CHANGED 
      51. android.intent.action.PACKAGE_DATA_CLEARED 
      52. android.intent.action.PACKAGE_INSTALL 
      53. android.intent.action.PACKAGE_REMOVED 
      54. android.intent.action.PACKAGE_REPLACED 
      55. android.intent.action.PACKAGE_RESTARTED 
      56. android.intent.action.PHONE_STATE 
      57. android.intent.action.PROVIDER_CHANGED 
      58. android.intent.action.REBOOT 
      59. android.intent.action.SCREEN_OFF 
      60. android.intent.action.SCREEN_ON 
      61. android.intent.action.TIMEZONE_CHANGED 
      62. android.intent.action.TIME_SET 
      63. android.intent.action.TIME_TICK 
      64. android.intent.action.UID_REMOVED 
      65. android.intent.action.UMS_CONNECTED 
      66. android.intent.action.UMS_DISCONNECTED 
      67. android.intent.action.USER_PRESENT 
      68. android.intent.action.WALLPAPER_CHANGED 
      69. android.media.AUDIO_BECOMING_NOISY 
      70. android.media.RINGER_MODE_CHANGED 
      71. android.media.VIBRATE_SETTING_CHANGED 
      72. android.net.conn.BACKGROUND_DATA_SETTING_CHANGED 
      73. android.net.wifi.NETWORK_IDS_CHANGED 
      74. android.net.wifi.RSSI_CHANGED 
      75. android.net.wifi.SCAN_RESULTS 
      76. android.net.wifi.STATE_CHANGE 
      77. android.net.wifi.WIFI_STATE_CHANGED 
      78. android.net.wifi.supplicant.CONNECTION_CHANGE 
      79. android.net.wifi.supplicant.STATE_CHANGE 
      80. android.provider.Telephony.SIM_FULL 
      81. android.provider.Telephony.SMS_RECEIVED 
      82. android.provider.Telephony.WAP_PUSH_RECEIVED 
      83. com.google.gservices.intent.action.GSERVICES_CHANGED 

Api Level 4增加的:(SDK 1.6)

Xml代码

  1. android.intent.action.ACTION_POWER_CONNECTED 
  2. android.intent.action.ACTION_POWER_DISCONNECTED 
  3. android.intent.action.ACTION_SHUTDOWN 
  4. android.intent.action.BATTERY_OKAY 
  5. android.speech.tts.TTS_QUEUE_PROCESSING_COMPLETED 
  6. android.speech.tts.engine.TTS_DATA_INSTALLED 
  7. com.google.gservices.intent.action.GSERVICES_OVERRIDE 

Api Level 5(SDK 2.0)蓝牙部分全部修改,修改后的

Xml代码

  1. android.bluetooth.a2dp.action.SINK_STATE_CHANGED 
  2. android.bluetooth.adapter.action.DISCOVERY_FINISHED 
  3. android.bluetooth.adapter.action.DISCOVERY_STARTED 
  4. android.bluetooth.adapter.action.LOCAL_NAME_CHANGED 
  5. android.bluetooth.adapter.action.SCAN_MODE_CHANGED 
  6. android.bluetooth.adapter.action.STATE_CHANGED 
  7. android.bluetooth.device.action.ACL_CONNECTED 
  8. android.bluetooth.device.action.ACL_DISCONNECTED 
  9. android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED 
  10. android.bluetooth.device.action.BOND_STATE_CHANGED 
  11. android.bluetooth.device.action.CLASS_CHANGED 
  12. android.bluetooth.device.action.FOUND 
  13. android.bluetooth.device.action.NAME_CHANGED 
  14. android.bluetooth.devicepicker.action.DEVICE_SELECTED 
  15. android.bluetooth.devicepicker.action.LAUNCH 
  16. android.bluetooth.headset.action.AUDIO_STATE_CHANGED 
  17. android.bluetooth.headset.action.STATE_CHANGED 

然后增加的有

Xml代码

  1. android.intent.action.DOCK_EVENT 
  2. android.provider.Telephony.SMS_REJECTED 

Api Level 6(SDK 2.0.1)没有改变。

Api Level 7(SDK 2.1)增加的:

Xml代码

  1. android.intent.action.LOCALE_CHANGED 

Api Level 8(SDK 2.2)增加的:

Xml代码

  1. android.app.action.ACTION_PASSWORD_CHANGED 
  2. android.app.action.ACTION_PASSWORD_FAILED 
  3. android.app.action.ACTION_PASSWORD_SUCCEEDED 
  4. android.app.action.DEVICE_ADMIN_DISABLED 
  5. android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED 
  6. android.app.action.DEVICE_ADMIN_ENABLED 
  7. android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE 
  8. android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE 
  9. android.media.SCO_AUDIO_STATE_CHANGED

 

Timer 的使用:

 private final Handler mHandler = new Handler() {
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case 0:
				RelativeLayout tmp_home_back = (RelativeLayout) findViewById(R.id.home_back);
				if (tmp_home_back.getVisibility() == View.VISIBLE) 
					tmp_home_back.setVisibility(View.INVISIBLE);
				
				break;	
			}
		}
    };
				TimerTask task = new TimerTask() {
					public void run() {
						Message message = new Message();
						message.what = 0;
						mHandler.sendMessage(message);
					}
				};
				Timer timer = new Timer(true);
				timer.schedule(task, 4000);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值