????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);//?????