Embedded Android Workshop

  • 1,241 views
Uploaded on

Karim Yaghmour's "Embedded Android Workshop" from the Embedded Linux Conference 2012

Karim Yaghmour's "Embedded Android Workshop" from the Embedded Linux Conference 2012

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,241
On Slideshare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
40
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. ABCA DEFA B A B F A D B F A
  • 2. A BC DBA BEB BF A CB C B E DD ) E C A B A! C D4 AF BC CD BC C !! C B E DD C"! !F B! ! CF C # C D B AD $ %& ( ) A D C DB B B * A + ,$ E C " BC C B " - A " " , . " C CA D D B C F / 01C " B B 2 .(& DD A B A C B " C B A F / C" / C B C CB 3 BC C 0) E C A B A! C D4 AF 2 B C" B 3 BC 51(67)8 C D " A B 0 F 2 A B C B* , C" $1 C A C B AF 9BC D 3B" D C1C " B B /// C D! DD !A
  • 3. F C7 C A A& : CB ;;;1C " B A A B AC B * C !C B , CB "$ D ) E$ "$
  • 4. F AC A= "5B D E " B <
  • 5. !A !BA !A AB6B= C D& "B CBD / C%B CD B A BCA/BC C # C D) E D >
  • 6. 6B5 B C.@ ?
  • 7. 5 B C B CBD / C BF " C B AC B D D)B E E C B DB D4 A CD F A E7 "CB A FC / C FB A C B F9 "1 D 4 A "CB / C AF B D ) "CB FCBC - ) "CB FB A 1 C& B * BCA/BC B CB B, D& C C C A AB B CB"E AB C C DD B A $ E A $B A DB" CDB *E%C<$ = ?<$E% $ $ E($ F%C$ %8C$ C75,C E * BCA/BC A A ,6 $ )C$ C$ B A B 5 * BCA/BC A A , BD CB$ C% $ D B $B AB C D C * BCA/BC A A ,( A E D EC D A "BA E D B C$ C A F "" "$D D C B A C CDB C "$ B A B " C 7) A
  • 8. .@6C / C%8 C 0B 2EB =1E ( = 6 9 E8. D A B / C B B ! BDB " G
  • 9. & B D( E + !B"B! &% D( & B D( E + E + & B D( &#A ( &% D( E + E + E + #A $% D ;
  • 10. 8 " C *8 DB *, HIHI,. B A / C . : %7! DB DB/B%C B AB / F A B CB A DA E CD A B CA ".7 A CD A B A C D B 0FCB 2 BC B A$ E C6 BE C C A B A /D D C A
  • 11. = C C" 6C B A &BCC %B" BC A " A DBC A DBC "CB " / F$ 7E$ DB $ A /B DBA F )B " C $ A AF A ( F * 1,6C !%B" D ( F B B CA B "BE A J A E DC " /B A B BC " A <) / "$ A /B J DB "K)B " C F BCA A A A C B ( F( F C AK BC A AC A BC A " CLC B 1 D F B A B CD > FC F " F C " C A A D , A 8 E DF C1 =B A B B AB "/ AC A
  • 12. G AC A C B A ; 5 F AC A ; C AC A >! B ; AC A ?!) ; 1 AC A ! ! BC EB AC A ! 5C ) AC A ! C " CFC BA FB AC A != DF M BF D4 A M EB AC A M. 6 C M8 E AC A < !7 C BD B A/ M D C"C " CFC BA B A = DF
  • 13. D> B EB C AB> B *E > C N B C ,! / DBC A .
  • 14. B N B "I& BA " 7% C " D A C DB B C C (E$ 7 $ 5C B $ 7$ D B DD$ 8L7)7 $=B A DB B C C E C B$ BD "$ = $ &C$ C $BF DB B C C E C B$ BD "$ C $ )&&$ . $ B C A E 8 $F 6B DDB A % B CD$ C AC A EBC $ DB4 C $L $ 6O8 8119 $ <
  • 15. 1 =B A B0 B "C G " B A D F D B / BE D " CB CB EB D F B A C D C BC C$ : E $B AF C D F : C " C / BE A E A AC AP$ C D $ $B A C D F B CD 2. BC / B 1= A C/ B F $ B $ D DF C A C E8 B C"B 4B / F BCA D DF C $ B $ Q B 0 B 2C " N AC A BD BC BA B F A " A" A E$ B B" B "1= BC" B E ! BF D C A E F 1 CB C C $ E F $ L AB $8 ) D $ =B A EB B C C = $E C B$ &C$ BD "$ C $ D A C D B (E$ 5C B $7 $ 8L7)7 $ D B DD$ 7$ /BC D B C " $ DD C B 4B D B >
  • 16. < & "B 5CBD / C A B A6CB A "C " N / AC A C B E C1CB E C " ?
  • 17. < A%BC 9 C AC A 1 C %C Q * 1 %,9 C A BE B B AE C RS C%& C # C D C " DB B A C B B AC A " C C" 1 % A AC E C ?D 1 B 1 % FCB B B AC A " C C" EB B" A F 0C 2 $B E CB 0" 2= DF * , A C # C B " C " / B N C A AD A C C D " F BC )9 B A " = DF B C A E $ A " 6O8N 8 A
  • 18. < A &9 C C8. C CB % F & *B B C%&, 1 % E B & *B B &, =BE " C%& C C B /B B A " " B / C%& B A &C%& BC DB 6 T B A )6. D D 6 ) 6 B A F : 0 : C B !2 A C C B B D : A FB" $ C%&EB F A CBF BAA C%&!&C%& D 6 6 : F ! " F !" F G
  • 19. < 6CB A " .AC A ( FL C D & : "AC A & " * 8 ) ( 1 7 ) /! B , B F AAC A D B B F AAC A 1 B 8BD A C C 0 C AC A2E C C # C B C EBAC A E B" " / A / AF B" C 0 AC A B 2D B C " ))! E E A 0B C EB 2 ;
  • 20. << C " N / AC A 1 %B AC A EBC 3 F EB B A 8BE "B CDB L EB( # C ! )) D B " A B"C D /! C "7 # C B AC A BC C U" " D
  • 21. <> C B E 0 C 2 C BC B C BA F AC A EBC DB4 C L 6O8 81198 " C A " C D BE " C /
  • 22. < ? 1CB E C "5 A "%B C " D ?$ >$<<A- ?$ ; $<A?- >$;??$A - A$< ?$A - ( G$ <- ?$; $ >- B A ?$ ? $> C" C " D AC A A B 1CB FBEB FCBC C FLE B C A AC A C B =BCD B A )B E BA7 1 F C $ 76E B =BCD Q / C1CB N 1 F)9$ BE " C Q CB B C B A7 EB $ Q A" CA C BD C D B A C C BCC C C D AC A G
  • 23. > %B CD B A =BCA/BC C # C D 7 C AC A C & : C C C & :$ B C AC A 9 / BE F DBA / C (E :G? E7% C= % B C A E BB C $ D C /BE E $ BC D $
  • 24. > D B ) ) D /BC E. CD 1 % B %B B" " D B F C 0B 2E D AB D B F A A C $ A C $C CA "$) E C D B F BAF$ AAD $ E=BCA/BC D B F ) B B A CCB 7 ) E )B B E BD CB E D C B A CB" . 6% C CDB D B F C E A D B F /BC D B F ". AB BF /BC E. A D B D AB <
  • 25. > D B F >
  • 26. ? ) E D( # C D A E B AC C A F "" " ?
  • 27. ? ( # C D A E D B A A F "" " B A / ! EB ! & :/ C B F)9 /! ) " =" C DD A A C B A E *),%B CD A E D C8. C A E B F C A F "" C D C B C A
  • 28. ? A E B AC C )9 B AC A M DB B" L) B A )9 D B F A CM C B " B B B" A: M E C " QBC A : BAF M A F " FC A"D B C M DE. FB A (E D B C . 9LE C :G? BA8)9 C8. B C B E F BC) D B A E C B AC A D G
  • 29. ;
  • 30. ? A F "" "BAFAADD C CCB E / " B "CB * ) " ,
  • 31. A !E ! E AC A ; )B E 5CBD / C 7 C F87 8B E ) E D D CE C< 1E CB C C B " CE> D BC E EB B" C? & :9 C <6 A CA =BCA/BC C > 1 %G 8B E . C B
  • 32. AC A D7 DEB%C B A C BA( D C A C B
  • 33. D R8 D B D CB B C BC B DB" B BC A / E CB BC A AC" 8 C $ H $ B A HDB *, D E CE 6C BA B ( E C %C E A C <
  • 34. 77 RB C D B" /! C /!A " B A BC"& B D C . : " B$F /!C # C A BC"7 0 B BA2 A 7 1FQ7 5 C A EB >
  • 35. D DB DB" B BC ! ! C C DF BE C C A B A /D D C D C "" C & B FB /C EBC" E DB B" D & D D BC D C D :DB B" B C ?
  • 36. A
  • 37. < EB7 CD D BF B J D@E& CDB /B B A AC AEB :D E R VB E S B CE RV CE S B6C BA B ( E C B R VC E CS ) BD R : C " C( E C*, %C E A C R V C E A CS B G
  • 38. > %C B A C BA%C ) B B B FB B B D BC A DB C C BA VB E SWV CE SWVC SWV C E A CS BE C B CF E CC A A B ) 81 C CD F "! " CB DB C C BA B/ C BA BA %C CD B !C BC B DJ A C C C E DB B" D & C BA C B " C " BC FBEB C BA 1FQ AC A %7 C E A C BA C B & C CC "BD B" / B C BA =B A C C C "D B" =B A C C BA C " B C BA / B D B" ;
  • 39. ? ( D C A C B AC A (% R6 A CD B D8 L 7% A C C C B B"6 A C B / E B $ AB7 BA D A CB "7 CB) &B " B" *7)&,7)& A BA " CB FBEB CBA <
  • 40. 5CBD / C 7 C A.7)B B CB" C !% CD B AD D C CCB A B A LA & B B A EB 6 85 <
  • 41. .7E C " FB A CBC L / B AL /CC *B ,) BC A @E& C A BD B C " FBEB.7 D B A" E B A C E )B " 8 B <
  • 42. )B B CB" BC A C C %C EB CD E B C EB7 C B CB" %C EB AB B A E D D C: C B CB" % F AB B BC A : C B A E * ), D& )6 %C EB )68 / C B F FB A CB" *( , <
  • 43. C !% CDE C C AB C E .7)$ C7)% CD C C C % C C CB % C .(7 B B BC B AF : A CD C # C A 0 : 2 B AF :) "CB B FB A C B . C C D CD D F A BC A B B <<
  • 44. 8B E A E DB B B B A B AC "B A B " 8)9. " 8)97D D " B E B <>
  • 45. B B B B A B A. C % C " : "F A A AC A ) E " D4 A B E B $ B C "BD "%C E A B AF A " CB B E A FCBC C D ! XX BB DF A B E F B BF * C/BCA D B F , B E F ) D B $ BD B A CB BF B " B E A C D FBEB " F87 7D D " B E B * ,) N B / D CBA B & :!. : B B <?
  • 46. C "B A B " 8)9B BJ 8)9I ) E D BF B E %7 D BA C ) D B 7E%1( 8 BDC " 8)9 !!A E C B AC A D! A ! A ! A : D%C C # B A / $ EB C& : D )9 DB *C8.J , B A B/ 5 CB A / $ "/ A C " C8)9 EB C C C # BC B A ) / BA B A B 8)9 <A
  • 47. . " 8)9 %B B E A A CV C Q S!Q ! C B V C Q S!Q ! AC A D A CF B E A 8)9 1 B C B V C Q S!Q ! B D C A CF "/ B E C BC C # C A F B<6 A B E A AV C Q S V A S! A F A> D B / )9 8B E A / F BC A F B <G
  • 48. < 7D D " B E B AC A B A8B E DB B" D C / : A A B A )B E LE B F87 B FBEB&D A %7 E DB B" D 7 E B A C B A / DB B" D )C B BEB C CB E B A 0B AC A B 8B E E 2 <;
  • 49. < 1E CB C C & >
  • 50. < 1E CB C C AC A >
  • 51. > D BC6 BA C9 C7T " D CE C E EB B" C&B C *= D , >
  • 52. > 6 BA CB !F BF !F BA C DF BA C C AC A . 6 FB A 7D D 0B F 2 C C AEB0B F 2B !F BF !C E C .7 FB AC E C F C "CBD A C " DB" # B F . B DB B C C EBC B >
  • 53. 5B B 0x000003860000-0x000003900000 : "misc" 0x000003900000-0x000003e00000 : "recovery" 0x000003e00000-0x000004300000 : "boot" 9 C 0x000004300000-0x00000c300000 : "system" ! D 0x00000c300000-0x0000183c0000 : "userdata" !AB B 0x0000183c0000-0x00001dd20000 : "cache" ! B 0x00001dd20000-0x00001df20000 : "kpanic" 0x00001df20000-0x00001df60000 : "dinfo" 0x00001df60000-0x00001dfc0000 : "setupdata" 0x00001dfc0000-0x00001e040000 : "splash1" 0x000000300000-0x000001680000 : "modem" 5C D C&# A ><
  • 54. > 9 CBC BC A E C BCA/BC A A7 B 4 EC D C C " AF D BC C A A BC Y C *,7 B 4 " E C F DE C D BC C >>
  • 55. > AC A 71 $ BC $B AC ! C C B D B AD D D CD 11E BAQ D C C BC AB D BAFA CE DB B" C *F A C : DB B" C, E A A C A B Y C @4 " *T " , D A B CE C >?
  • 56. >< T " $7 B Y C @4 " *T " ,CBD / C !FB ! DA !B Y C !B YDB C D BC *0 D B AC A C B T " 2$CBD / C !FB ! C !Q ! AC A( D BC LE*, B T " N DB *,CBD / C !FB ! C !QBEB! D!B AC A! C B! !T" 7 QBEB >A
  • 57. C BA B *, BC D CE C*, DB" B D CE CN C *, CBD / C !FB ! CE !QBEB! D!B AC A! CE C! D CE C QBEB BC D CE !DB B" C BC E EB B" C A7 C1(3Y=1E &B C >G
  • 58. ? & :9 C >;
  • 59. ? AC A DBB /D D B A C6 A CB D DM D BC A E D C( E& "" C ?
  • 60. A =BCA/BC C6 6 T C " ) 6. 7% * BE A C%& BD B D ,C% EB B C C C E A A F"B / BY B) B A CBD F C AC E C *!A E! F ,9 DB B A 9 F BCA A E *!A E! E ,&" EB B C C C E A A F " 6B " 9 F BCA 6 6B C 8 B A EB B C C C E A A FB A * A & A C B B B B CB A C C "" A , BD CB EB B C C C E A A F BD CB * A L<& C AC E C A C B B CB A C "" A ,% / C EB B" D 0BB 2 C B C EB B C C C EA A F C C D C EB" 5 A 1C B C C &" %C C D CB C %C : D(BA &B C 7 C B EB B C C C E A A FC V D B BD S V(7& E C S ?
  • 61. G 8B E . C BEB !AB B RS . C AB B ! D RS D D A !A E ! C ! ! F !D ! B ?
  • 62. &F 6 $ D& $ &$ 1 C&Z $ 8 % : D A % C BA C$ L 7% F :)B D CE DB B" C$ E A$ C A$ A$ BAFA$ ?
  • 63. ; )B E FBEB R FBEB B " B" X FLE X F)9 F AC A FBEB R FBEB B " B" X )B E X B =BCDBC" / %. ( B E /( E 1 / /B B 6B C / C A8 / B F7 ?<
  • 64. ; )B E N A :FLE D 0 B 2)B E D 0 A :2A : R B C A F 0A:2. D C A A :R >[. D C A QBC ?>
  • 65. F87 M FBEB 8B E 7 CB B "B C C B " B" $ B $ XX# EB 8 N E. B" A B A B B E A C D R 8)9 BD A A AB CDEFD D E C BEB BF %)5 ??
  • 66. D CE C C CE ) E % A CE% / C EB B" C B 6BC = BA 1F CE C E EB B" C F BCA CE ) 1F CE C ( " C 7 E A CE .7 E A EB B" C CE%B B" EB B" C 8 B CE 6B CE EB B" C 8 / C EB B" D CE B A" CE EB B" C E CE ( " CE D %C E A C C CE DB E6B C CE F EB B" C ) B CE&" CE E CE )6 " 1F CE CL FCB C CE 8 B EB B" C BCD EB B" C ) E CB" E C7 BB A " & B EB B" C C CE BC CEB A / EB B" C )C 6 : CE6 CE BB B C CE ?A
  • 67. B " D CE. " D CE: 8 B EB B" C 1FQ C C C " R : 81 757 718Y (L7 - 8 B EB B" C D8 B EB B" C R *8 B EB B" C, " D CE * ,-%C BC C B FQ D8 B EB B" C *=&&1Y7)$ B ,- ?G
  • 68. E EB B" C BC / E $ CE5 %C E A C7 FC BA B "11E BAQ DB B B 8 ( A "% CD B DB B" D& DB B" D ?;
  • 69. : BC " /B C D &B C *&B C, BC E * E QBEB, D E EB B" C CE BC L BT " *%C QBEB, E T " A
  • 70. < 6 A C 1(6 ! 1E 7%)B B C " 0 BC 2 0 CB B 29 C C AD B D!A E!F A C ! C !F A C![B AC A [ %7 A D CE C C " F A C A
  • 71. A
  • 72. > 1 %! B B" !B ! B B" ! C EA C ! B B" ! D A A " &B C B %C E A C &B 7E BCD ED B ABC%C E A C 1 B6 E B %C E A C % 7E6C / C %B B" 7 B C ) / BA%C E A C B B C %C )CD%C E A C B ABC %C E C " B %C E A C BD CB D BC 6 : E A B%C E A C C7 B C " %C E A C B A( CA C . C) BC %C E A C) ( CA CDBCB C L )B C= E&L / C A
  • 73. AB * )A + A, ! B A B6 A "6 A D AA " /B B7DB". " BAF A<
  • 74. B A B& B !!B AC A " C C"!C 0C 2 K C !!A " " D!A !" " C !" C !C S ]!F !C K D A BX: ]!F !C5 1 % EB C B B"" A C B C " CFC BA KC !!B AC A " " C D! B CD!DB F B AC A AYC KC A>
  • 75. F FCBC C B DF BF ( C F BA CF A 6 A D D B FAB E )B E LEA E D ) E DA E ) E B A D : C B : C B C Q AF 1 %CBD / C D CE $ B AC A [$ AC A C B A DA $ BCA/BC =BCA/BC C F F C B =BCD A 8)9 B B" AC A B $ C EA C $ C F %C F F BC A )9 D / C A B BC C DF AA A : B CD B BC AC A A?
  • 76. 6 A "( # C ?< F .F <%B B" C # C A K A B " B F A B F ?A E S B F F 4 F : " C " C S "XX F ? A E G? F4 A E F: A E S F A XX? F C > F C >A E S "XX D F% F : B / DF K A ! C! F ! F A XX ? ! C! F ! F A XX K A ! C! F ! F4 ! C! F ! F4 AA
  • 77. F A EC D K - F A! E K&B F A B A " /B " N "BD K DB Q " A C C B FC BF B D B C/ N A K D B CO AG
  • 78. D C F A! E C DDB A) B * D C B ,K : C . Y =R. 0 2 C D 1 %C E EBC 3 N A B D FB B C B A /B C B D B C C D 1 %CK F A! EKK D B C A;
  • 79. < 6 A D8 ( C E0E A 2F A C A B A AC A D G
  • 80. > AA " /B B AA B B ^B _! B B" !B B C B B E C C Q B B" !B AA B B C CB AC A D C Q AA C Q %(1). Y% 9 C^B _!F A! BC" ! C A ! C D G
  • 81. ? 7DB" B AF A ^B _! !7DB" B ^B _! ! BC" ! C A !" C ! CBDA D" D D" CAB B # D D"9 C C F !B AC A BCD! C ! C # DD B C E CC A C CA G
  • 82. A . " BAF B C ! CB /! C " 1 %$ A " D B C = K BAF BC" +) D " " K BAF " B " ! C D BC" K BAF !AB B! B K BAF ! C ! " "4 G
  • 83. ) !BAC " !!B AC A " C C"!LB B !!/// C C" C /B NC C / A AC A C B C 8 C " A! EB B C B B AC A D G<
  • 84. . !B" AB /E 0)5 D B6 F :78B E AB D% / C G>
  • 85. 5 D B!B RS C CC D *) D B ! "C :,! B RS B B BC!A RS D ! ! C !A F "!AB B RS AC AN 0!AB B2 D!A E RS ) E A! RS D ! D!!D RS D CBC D! C RS C!C RS A! F RS E A B A BAFA! A BCA RS ) BCA D! RS! D RS AC AN 0! D2 D!E A C RS D ! D!E A C G?
  • 86. ! D!B RS B B A!F RS 8B E F BC B A AB D! RS " CB! RS 5! CBD / C RS AC A CBD / C QBC! F RS 8B E FCBC! C RS E B C 0! C2!:F RS 1 B !: CB F BC GA
  • 87. !AB B!B C RS 8( CB!B RS B B!B C EB RS %C AB!FB RS 5 C 6B EB B" C!AB E B RS )B E )@ B!AB B RS AB B!A B RS &B B * X C BA , C 0A D B 2! B RS /C BF B!D RS E AB B */ $ E $ F $ ,! C C RS % C D C C * C $ B "$ ,! C RS C AC A AB B BEB BF! D RS D AB B GG
  • 88. 67 B !F7 D ! D! F%C E A F FD FA F AXX F C BAYAF C G;
  • 89. F :7 B ! D! C ! F :7 D ! D!F ! F :%C E A B BCD AB " E D A DE / CA C A DA AA " C D A B AC BA C E CD A E BC D B A B CDA C D D AA A D AC / YD A C CDD A ED B / AD " " C BA C B F C C /B C D : "D C F C / ;
  • 90. < 77 B ! D! C !7 D !( ! C ! ^F BCA_ C ! E AC ! E A ^F BCA_ C ! D! ! ^F BCA_ ;
  • 91. > 8B E AB D CE DB B" CE AC A ABAFA B A ;
  • 92. > CE DB B" C7 B ! CBD / C !FB ! DA ! CE DB B" C!7 D ! D!F !%C E A : DB B" D CF A C CE A : C C D ;
  • 93. > E A7 B ! D!E A!7 D ! D!F !%C E A L D D C D CDB D AA E ;<
  • 94. > C A7 B ! BCA/BC !C !D C !7 D ! D!F !%C E A 0(BA 7 CB &B C2 BCA/BC ;>
  • 95. >< A7 B ! D! A!7 D ! D!F !%C E A EB B" D B / C " 7 CB / 8 / C EB B" D CE ;?
  • 96. > > BAFA7 B ! D! C !BAF!7 D ! F%C E A 7 CB / 0BAF2 DDB A ( D A F "" " B BF %B B" B ! B 0BAF 2 C A B ;A
  • 97. >? B A7 B ! CBD / C !FB ! DA ! B A7 D ! D!F !%C E A %B B" B ! B B B AE C B 7 CB / %B B" EB B" C CE ;G
  • 98. ? % / CA D BA D CE " B ;;
  • 99. ) E! ) " CE C F D CE C1F CE " D CE C B " D CE7 A B / D CE C B " C / D CE
  • 100. CE C F D CE C C CE ) E % A CE% / C EB B" C B 6BC = BA 1F CE C E EB B" C F BCA CE ) 1F CE C ( " C 7 E A CE .7 E A EB B" C CE%B B" EB B" C 8 B CE 6B CE EB B" C 8 / C EB B" D CE B A" CE EB B" C E CE ( " CE D %C E A C C CE DB E6B C CE F EB B" C ) B CE&" CE E CE )6 " 1F CE CL FCB C CE 8 B EB B" C BCD EB B" C ) E CB" E C7 BB A " & B EB B" C C CE BC CEB A / EB B" C )C 6 : CE6 CE BB B C CE
  • 101. D B CBD / C !FB ! CE !QBEB! D!B AC A! CE C >E ] G> E DB B" C ; 9 X
  • 102. 1F CE " D CE C& " BA D
  • 103. " B 5 A D CE CN %7) K BAF Z "C DY CE C D ? ? >< G BA A G DY CE C & C K BAF " B Z "C 0? ,2)!% / CEB B" C CE * ? , F D A7! ( " C * ? , CE B D AC A AC A ? .E7! ( " C * ? , )B B B R )B B E % F RB C B R C B 8BD R / C R7! BC EB B" C CE * ? , 6 A " BC BF B E7!B CE * ? , B CE C " 8 D / A / C C7! E EB B" C* ? , " B " A ` B R D R ! ? R Y. R R ! ! BER !7! ( " C * ? , E B" BB " B " A B7! ( " C * ? , B 5 C/BCA " B " A B7! ( " C * ? , )B B B R )B B E % F RC C B R D&7! ( " C * ? , )B B B R )B B E % F RC C B R D&)! C "* ? , EB C7 B B C E B" / B R7! E EB B" C* ? , BC C B AC A C D A B C FC BA B D B AC A C E A C A / BA ! ) / BA( E C AR AR " A R` >$ $ a7!( E C D* ? , 8 C E C "B!B A /EB B" C* ? , C 4 D : C A <
  • 104. A D CC C " CE CB 5 " C B F B B E B BCD B / A" B A FB / / A /).E% 15 (L7 CB 5 " CX &B C : ;?F; 4R $ R* $ ,$ 4 R* <G $ G ,$ A 6 A "R $ A ) C "R $ EB AB _ BD R D B AC A B C! D B AC A B C &B C R : ; <G$ A R? ^ BAR $ BEB BF R $ # AR _ C B EB R $ . R $ A R?$ B R CDB R $ ^<G :G <G _ ^<G :G <G _$ C 4 & R : $ A# # D R> A>? >
  • 105. B " D CE. " D CE: 8 B EB B" C 1FQ C C C " R : 81 757 718Y (L7 - 8 B EB B" C D8 B EB B" C R *8 B EB B" C, " D CE * ,-%C BC C B FQ D8 B EB B" C *=&&1Y7)$ B ,- ?
  • 106. < 7 A B / D CEC 1 % C $C 7D C B A B D A . C E C " C " 7DB" : (B B &B :6 B $ N A D AB / C A
  • 107. < E EB B" C BC / E $ CE5 %C E A C7 FC BA B "11E BAQ DB B B 8 ( A "% CD B DB B" D& DB B" D G
  • 108. : BC " /B C D &B C *&B C, BC E * E QBEB, D E EB B" C CE BC L BT " *%C QBEB, E T " ;
  • 109. < %B B" EB B" C<> 97 B B ! C D EB% CD7 C *B 7 ( E C QBEB, B AF E EB B" C
  • 110. < B A / EB B" CEB C BAB A / DB BBB B C B A "1C B5&B C "7 E DB B" D
  • 111. << 8 B EB B" C B8 B A B FB * 8 B %B C QBEB,
  • 112. < > % / C EB B" CBB6C "&
  • 113. < ? 8 / C EB B" D CE B 0 A2 ! D! A7 CB " CB C ")8 <
  • 114. <A E CEE !. D5 CDB. 6 DB CB"166 >
  • 115. <G & B EB B" CEB B" B C EA C" 6 %C E A C*,%C : D B C&B / B ?
  • 116. <; B 6BC EB B" C: B A ! B7 E F( E B B FB B FB C B DB B" C A
  • 117. < 6B EB B" C BF ! A BF CB C DB B" DFB 8 /*, G
  • 118. > C B " C / D CE AA C ACBD / C !FB ! CE !QBEB! D!B AC A! CE C!=BE D CE C QBEB XC " C CE) BCA/BC %7 CB: C " CBD / C !FB ! C !QBEB!B AC A! !^ CE C_ B A B B E 0AC E C2 A C " F877D D C B C CB AC E C C B B B B B CEEB A C B / )9 ;
  • 119. > 1 C CE QBEBpackage com.android.server;import android.content.Context;import android.os.Handler;import android.os.IOpersysService;import android.os.Looper;import android.os.Message;import android.os.Process;import android.util.Log;public class OpersysService extends IOpersysService.Stub { private static final String TAG = "OpersysService"; private OpersysWorkerThread mWorker; private OpersysWorkerHandler mHandler; private Context mContext; public OpersysService(Context context) { super(); mContext = context; mWorker = new OpersysWorkerThread("OpersysServiceWorker"); mWorker.start(); Log.i(TAG, "Spawned worker thread"); } public void setValue(int val) { Log.i(TAG, "setValue " + val); Message msg = Message.obtain(); msg.what = OpersysWorkerHandler.MESSAGE_SET; msg.arg1 = val; mHandler.sendMessage(msg); }
  • 120. private class OpersysWorkerThread extends Thread{ public OpersysWorkerThread(String name) { super(name); } public void run() { Looper.prepare(); mHandler = new OpersysWorkerHandler(); Looper.loop(); } } private class OpersysWorkerHandler extends Handler { private static final int MESSAGE_SET = 0; @Override public void handleMessage(Message msg) { try { if (msg.what == MESSAGE_SET) { Log.i(TAG, "set message received: " + msg.arg1); } } catch (Exception e) { // Log, dont crash! Log.e(TAG, "Exception in OpersysWorkerHandler.handleMessage:", e); } } }}
  • 121. > 71 C CE BApackage android.os;interface IOpersysService {/*** {@hide}*/void setValue(int val);}
  • 122. > CBD / C !FB ! AC A D C !QBEB!B AC A! !7% / CEB B" C B A C !QBEB!B AC A! !71 C CE BA C !QBEB!B AC A! !7( D B FB B A
  • 123. >< D CE C QBEB A E B F : 1%( 3 Y (L7 try { Slog.i(TAG, "Opersys Service"); ServiceManager.addService(“opersys”, new OpersysService(context)); } catch (Throwable e) { Slog.e(TAG, "Failure starting OpersysService Service", e); }... <
  • 124. >> = CE C QBEBpackage com.opersys.helloserver;import android.app.Activity;import android.os.Bundle;import android.os.ServiceManager;import android.os.IOpersysService;import android.util.Log;public class HelloServer extends Activity { private static final String DTAG = "HelloServer"; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); IOpersysService om =IOpersysService.Stub.asInterface(ServiceManager.getService("opersys")); try { Log.d(DTAG, "Going to call service"); om.setValue(20); Log.d(DTAG, "Service called succesfully"); } catch (Exception e) { Log.d(DTAG, "FAILED to call service"); e.printStackTrace(); } } >}
  • 125. # 1 E! !BA ! CBD / C !FB ! C ! ! CBD / C !FB ! CE !QBEB! 1 % C EA A & ! CBD / C !FB ! CE !Q ! ! BCA/BC ! F BCA/BC ! !A E !^E 8.5 _!^)L7 _EB C EA A ! A ! D B C!EB 9 C CD AEB C EA A C! ?
  • 126. ^B _! BCA/BC ! F BCA/BC ! A ! BCA/BC " " C^B _! BCA/BC !C ! A ! ! C:BD ^B _!A E ! BD "! C ! FB A F BD CB F " F C. " F87 B A
  • 127. B F87public class HelloJni extends Activity{ /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* Create a TextView and set its content. * the text is retrieved by calling a native * function. */ TextView tv = new TextView(this); tv.setText( stringFromJNI() + " " + pid() ); setContentView(tv); } /* A native method that is implemented by the * hello-jni native library, which is packaged * with this application. */ public native String stringFromJNI();... /* this is used to load the hello-jni library on application * startup. The library has already been unpacked into * /data/data/com.example.HelloJni/lib/libhello-jni.so at * installation time by the package manager. */ static { System.loadLibrary("hello-jni"); }} G
  • 128. F87jstringJava_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, jobject thiz ){ return (*env)->NewStringUTF(env, "Hello from JNI !");} ;
  • 129. AB 2 1A D& B B A DB AC A [ D 4B
  • 130. & B B A D^B _! CBD / C !FB ! DA RS B E DA B A AB D ! C RS B AC A [ B A D B AC A [ !AB B RS 5 B A A !"CB RS ) O ( A C C ! A RS 0 2 A ! C RS C C ! F RS 0 2 FCBC ! B RS & B C EA C !D A B RS B" C " $ A $ ! B E RS 8B E A C D CBD / C D ! F : RS 6 F : ! " RS C& FCBC B A QBEB A ! B B" RS / C B B" * B 6BC, ! CE RS D CE C ! RS % C B A B ! RS / C *BB $ B A $ , !E RS ( % O 7% CB !E RS L%8 B !/ RS B DB B" C$ D C$
  • 131. B AC A [accessibilityservice content hardware pim speechaccounts database inputmethodservice preference testannotation ddm net provider textapp debug nfc security utilappwidget emoji os server viewbluetooth gesture service webkit widget
  • 132. D 4B: A " %76 C B FBC8 / C%C BA A B6C / CF DBCDB C EA C D 4B D
  • 133. : A " %7 M D CECBD / C !FB ! C !QBEB!B AC A! B ! : 7D QBEB ! : QBEB !1 C EB B" C QBEB <
  • 134. B ! : 7D QBEB...import android.os.IOpersysService;import android.os.OpersysManager;... private DownloadManager mDownloadManager = null; private NfcManager mNfcManager = null; private OpersysManager mOpersysManager = null;... return getDownloadManager(); } else if (NFC_SERVICE.equals(name)) { return getNfcManager(); } else if (OPERSYS_SERVICE.equals(name)) { return getOpersysManager(); }... >
  • 135. private OpersysManager getOpersysManager() { synchronized (mSync) { if (mOpersysManager == null) { IBinder b = ServiceManager.getService(OPERSYS_SERVICE); IOpersysService service = IOpersysService.Stub.asInterface(b); mOpersysManager = new OpersysManager(service); } } return mOpersysManager;} ?
  • 136. ! : QBEB... /** * Use with {@link #getSystemService} to retrieve a * {@link android.nfc.NfcManager} for using NFC. * * @see #getSystemService */ public static final String NFC_SERVICE = "nfc"; /** The Opersys service **/ public static final String OPERSYS_SERVICE = "opersys";... A
  • 137. !1 C EB B" C QBEBpackage android.os;import android.os.IOpersysServicepublic class OpersysManager{ public void setValue(int value) { try { mService.setValue(value); } catch (RemoteException e) { } } public OpersysManager(IOpersysService service) { mService = service; } IOpersysService mService;} G
  • 138. 6 C C B :<G DB"7 B DB" DB" K A B " B DB" DB" E C DB" C CDB K E C C Q " C C E C DB" >?> CDB K C"F >?> V C CS C >?>BC DB" B K B F B B C >?> ;
  • 139. B FBC& B CBD / C !FB ! B B" ! D.7! C ! D!B AC A! D ! B FBC& C D CE 7 * ,) BF / D CE 7 L F *0^7 18Y8 E_b$ B ,- <
  • 140. < 8 / C& B C FB B CBD / C !FB ! C !C !C !:D !B :D ) E B %(1). Y 1%3Y57& RE A C!B D ! !B :D D! !B :D ) BD D! !B :D5 CDB VB BCC CRb E F . b D Rb b D Rb ? b B Rb /B E C BD Db CRb b CE CRb[b B / CARb b C : Rb ? >> ?> > b C RbG G b DD Rb !! ? >> A< G<! CE !DD b !S <
  • 141. > %C BA A B F A! BC" ! C A%(1). Y% 9 C R F B D B AC A B C EA C D B AC A B C E A C :D C C Q C B Y YAD CB AB E ED A :A <
  • 142. ? 6C / CF DBC B B" !B !6C / C!C !EB ! C " :DVH 6 DBC SV C " BCCB BD RbF DBC bS V DSC " V! DS V DS !!/// " " D!V! DS V DS3B HV! DS V DS !!/// B D!V! DS V DSE 8V! DS V DS !!/// D D!V! DS V DSE B V! DS V DS !!/// D B D!V! DS <
  • 143. A DB C EA C D 4B B B" !B !DB !C !:D ! C E A C :DVH CDB EBC B S V C E A C ARb"DB b BF RbCDB b A DB Rb"DB DbS V D " C Rb DB X X !! DB "DB Db C BD RbK DB b!S V " " C Rb D X X !! D "DB Db C BD RbK DB b!S V! C E A CS V C E A C ARb" " DB b BF RbC " EB b A DB Rb" " DB DbS V D " C Rb DB X X !! DB " " DB Db C BD RbK DB b!S V " " C Rb D X X !! D " " DB Db C BD RbK DB b!S V! C E A CS VH DD . C EA C S V C E A C ARbB Db BF Rb 7Eb A DB RbB D DbS V D " C Rb DB !! DB B D Db BF Rb7E %b C BD RbK DB b!S V " " C Rb D !! D B D D >GAb C BD RbK DB b!S V! C E A CS V C E A C ARbB b BF Rb 1&b A DB RbB DbS V D " C Rb DB !! DB B Db BF Rb7E %b C BD RbK DB b!S V " " C Rb D !! D B D >GAb C BD RbK DB b!S V! C E A CS <<
  • 144. G DCBD / C !FB ! C !C !C !EB ! :D <>
  • 145. E!A 3AA F B E 4 " B!E(B B )9 " CB8)9 " CB C B "B C A E B <?
  • 146. (B B)9 %C E A " C C B BD C : C B A E C B C D A A! D AC A %78)9 BD B )9 CB B D C A E B CA BE A BE " B F BC B C D BC C F A BCBD C A C B B : F BA " F <A
  • 147. )9 " CB6 A " )9 K F A! E K A " K DB A7 %7 D A A$ A F C DB K DB AB B& B ^B _! ! ! : :G?! A !. "B D )9 SB A / S%C C S AC A S2 )9 & B 2 SB A / Sb AC A )9 B A L) EB B" Cb Sb7 B A %B B" b Sb. AB b <G
  • 148. 8)9 " CB6 AK A A !F A!K : C 8)(17)Y8)9Y(11 R^B _! AK !DB C BK !DB C B7E%1( 8 B (878C HH C A " CB B 8)9 C B B B" C D CB C / " B CD : :G? C @ (E&3 &18C B A DB B L( & =1.( BA B CDB 7 B A B $ B C BA A !)L&1%E8 @ B C EA C / A B D C B C C /B A B ^ !8_ <;
  • 149. < C B "B C A E B AEE!AA0 C C EB BF B !! D C B" C"! C Q ! C) / BA $ B $F A $ B $ D C 5E " FB A C F $" F B A " F C (E$ 6 B $ E7% $ % / C% $ =$ c5B C / DB B A >
  • 150. E DB C / " BC B A.F CA C C " "B/ : B DB F E F C >A E. 0 A B " B 2 " >
  • 151. ) / BA B A : CB K`%(F(11 a!F A " C C$ cd crosstool-ng-1.10.0/$ ./configure6 AB A B C "$ make$ make install " C C$ cd ${PRJROOT}/build-tools$ ct-ng menuconfig >
  • 152. Options: %B S%C :AC C K`%(57@a!K` Y (C a BC" SBC C / C 1 S BC" 1 : FCBC S FCBC " F FCBC S: CB B" .Y51( 753Y 1.( ) F " B "AF O CB6 A B$ ct-ng build >
  • 153. A !B BB! 3 E! ) B! AC A D B F %C "CBD C A AC A B D B F ) ) D * )), M % D B F * ,ME B DB AC A E C B / )) O %BC 1 % ( C D ". 6 E C B B AA E 6B A F. ( EBC B BC" ( )6 %C E A C C F F B B 4 A B A! C FB C " ><
  • 154. >>
  • 155. ( C 4 B " @E& B A C UB AC A D6 A " K F A! E K DB&B " K A ! ! : :G?!F ! K ! K Y S K Y S >?
  • 156. . "K Y S B& B *G B, " B C(LE% C CDB C AC AFBEBK ! BC B >A
  • 157. C B E C A " B C%B CD %7)B E LE%B CD )B B E A%B CD 7%B CD % CD%B CD ( C >G
  • 158. BBC D B" D CU C D >;
  • 159. / A" D D " C B A B C DC " N AC A 0) E C A 2 B A E C B AC A DA CF A A C B ?