????42. ???????Android?г????????????FrameLayout(??????)??LinearLayout (???????)??AbsoluteLayout(????)??RelativeLayout(??????)??TableLayout(?????)

????43. ???????Android??????洢??????.SharedPreferences???

??????. ????洢???

????44. ???????ContentProvider???????????????????????????????????Content provider???????????????????????????Contentprovider?У????????????????????????д??Content provider??????

????45. ???????Service????????Service??Android?е?service??????windows?е?service??service????????????????棬???????????в???????????????

????????????????????????????

???????????

??????????????Service??

????public class SMSService extends Service { }

?????????????AndroidManifest.xml????е????????????????:

????????Context.startService()??Context.bindService

????????????????У???????????Context.startService()??Context.bindService()?????????????????????????

?????????Service?????????????ó????????????

????1.???startService()???????÷???????????????????й??????????????????????????????С?

???????bindService()???????÷??????????????????????????????????????????????

????2.????Context.startService()????????????????δ?????????????????÷????onCreate()??????

???????????onStart()?????????????startService()??????????????????????ε???startService()??????

???????????δ??????????????ε???onStart()??????

????????startService()??????????????????Context.stopService()?????????????????????????

????onDestroy()??????

????3.????Context.bindService()????????????????δ?????????????????÷????onCreate()??????

???????????onBind()???????????????????????????????????????????????÷????onUnbind()??????

?????????????onDestroy()?????????????bindService()????????????????????ε???bindService()??????????

?????????δ?????????(????onCreate()??onBind()????????????ε???)??????????????????????????

??????????????????unbindService()??????????÷?????????????÷????onUnbind()-->onDestroy()??????

????????Service??????????

????1.Service?????????????????????£?

????onCreate() ?÷???????????????????÷????????????Σ????????????startService()??bindService()??????

??????????????????Ρ? onDestroy()?÷???????????????á?

????2. Context.startService()???Service?й?????????????

????onStart() ??в???Context.startService()??????????????????÷??????÷???????????????????á?

??????ε???startService()????????????δ?????????onStart()????????ε??á?

????3. Context.bindService()???Service?й?????????????

????onBind()??в???Context.bindService()??????????????????÷??????÷????????????????????????

??????????????????????????ε???Context.bindService()????????????÷???????ε??á?

????onUnbind()??в???Context.bindService()??????????????????÷??????÷?????????????????????????á?

?????????

????1. ????startService()???????

????Intent intent =new Intent(DemoActivity.this?? DemoService.class);

????startService(intent);

????2.Context.bindService()???

????Intent intent =new Intent(DemoActivity.this?? DemoService.class);

????bindService(intent?? conn?? Context.BIND_AUTO_CREATE);

????//unbindService(conn);//?????