Programa 14

151 visualizações

Publicada em

Programa 14 de Eclipse Android "Número Binario & Número Decimal"

Publicada em: Tecnologia
0 comentários
0 gostaram
Estatísticas
Notas
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

Sem downloads
Visualizações
Visualizações totais
151
No SlideShare
0
A partir de incorporações
0
Número de incorporações
10
Ações
Compartilhamentos
0
Downloads
1
Comentários
0
Gostaram
0
Incorporações 0
Nenhuma incorporação

Nenhuma nota no slide

Programa 14

  1. 1. aí: :mz:
  2. 2. CÉTÍS M39 ! N11 T TD T A ñ -~ @Ms @ram alma ; mm p» Gregorio Hernandez Ana Ruth ÃTÉ ñTTfi TTINTTTGTTXFÚ TJTTG Tlffffl' Gr y g 1P “AM” ÃTQRÂ TJTÀT Materia. Dlllla êplicaciornes Móvilles TRT! ! ? BT TG! T ÔÍDCQT T ETT! ? TTRQBTÂTTBD 'ATA A TTBO stras . z aríuta Romero Alvar TATGINOÍTQÍ¡ TÀTQT TfQ 'IIñTTTñTñ TJTAQTQIÍA ãspecialidads Progion. ¡ z BÓTQTTÍÍCVOI T TIN COTTTQQATÂTT'
  3. 3. 'tlawADl ' ' ' : »L › -. ~~ Edt Run Sat: : ? dador Nmgate Saríh Pmjm ? J-nécw Help Ne: - Lkoihñvll 5 Jmhqm ¡ . v . . E : Ijmtcggm cpm. . L maaswiaucnvmjm 'J Prom- o_ É? ? 1d= $@ abre el prograima _ ZZ? ” de Eelipse, el eaal se emeueaíitra em la earpeta W ; s l ele eseriterioo j 253m File dar elie em. la u_- cm- k opeióm de Nevm $J= EH@ em la Siglíiâíílüê ; Frcttens 7- mada: ;rmãcmm Í' d ' ' V #m1 Verrtema KAJZHCÍLÚÍCÍ Aplimtiom Projects; H H!
  4. 4. ig» New Android Application New Android Application a The prefix 'com. examp| e.' is meant as a placeholder and should not be used Application Name: Ã' Button Toggle Project Namec) ButtonToggle Package Name: = comexamplebuttontoggle m. :Tha/ roxa lui] @ea 0"» Í' d v; e7,= x*/ % ao” Jr 'uma @l a a am , NM É §7 't7 o Luwmuupà , «ram/ mesma ; x g c/ &J; v; t7 @gil gm/ ñãgymmrpn ma, 0:5; ~c74~_7' ifêK'/ &jçaggxxur>rgúk&'Q-j , Àx o a A , @f&fjm , em . Nr. "7 ãxwçw] m vg &V/ ::Àz/ a.; .e. “wc/ aguia (E) p n: t. )ic›: ›|AP1s: Android 22 (Froyo) v] PKJFÉlAPI 17: Android 4.2 (Jelly Bean) Vl lhzül APl17: Android 4.2 (Jelly Bean) v heõl Holo Light with Dark Action Bar v-l lame is shown in the Play Store, as well as in the Manage Application list in Settings. Cancel
  5. 5. jMainActivityJava 1 activity_main. xm| 77 Palette _ , , 1_ palma v 'i Vl [j NexusOne Vl Id Vl AppTheme Vl G MainActivity Vl Vl 17 v Fomwidsets H II l vi Im: léàIEiéi Large Medium v c 'gdlb¡illhuàlloianta: dll'la'. 'l Êlllgillllulil-l¡¡Wlãlqilllqhil 'gin; ;ruralnm-ggiuhuit-¡nl Button Small ou v/ Checkíiox a Radnosunon lneckedTexlvn-w crr or? CU Oh' Spinner ' “ ' w' n v Iiuruerqbuiaüsr, , _ , numero decim al Text Fields l layouts prncesar 1 Composite ~ Images 8( Media Time 8a Date Transitions ~ Advanced « Other I Custom 81 Library Views
  6. 6. lb MainActivity/ .java 4 Palette '. - Palette Form Widgets rw- -~ Large MEllIUlTl Burton Small on J charme¡ o RndroBurmn Checkedlexivrrn Spinner Text Fields layouts Composite Images à Media Time 81 Date , Transitions Advanced Other Custom 8: library Views ' activity_main. xml É ' Gll 0h' CN' @umerçbilldü ' 'iulmero decim- j Graphical layout : '71 activity_marn. xml procesar OIT 1m Irwin textviewl - "numero bi lfrb. textViewl rir textViewi textviewtl buttonl r Hint Text Color Text App. . ? android: a. Text Size Content- l"-l -' TextView [l Text numero Hint
  7. 7. ÍJ MainActivityJava l activity_main. xm 4 Palette L- Palette v 1 v fonnWrdgets B E] n. v n Large Medrum a ^ Buuon : nun w w/ Checksox t Radroñurzcn Cneckedlexlvrew Spinner m. r , Images 81 Media ' Time BL Date ~ « Íransitions J Mvanced ' Other ' Custom 8( library Views j Graphical Layout É actrvity_mam. xml DH' 0!' D" numerqbmarvtr numero deem¡ prmesar 'EtadVeWB lí; textView4 [n buttonl- ~ 4 V" › ; Pn : f: a¡ _+ _ ld @id/ text í/ l * + layout P. .. í] . Hint resultado Text Color -- Text App. .. ? android: a Íext Size _ Content . .. '- TextView I] Text F Hint resultado E! v
  8. 8. LL MainActivity/ .java ' activity_main. xm| 4 Paiette A V '. - Palette v Form Widgets H 1 i rw- -~ Large MEfiIUm r ^ Button sumir on J cherkBcx o Rndiobutrun Checkedfexrvien Spinner Text Fields layouts Composite Images à Media Time 81 Date , Transitions Advanced Other Custom 8: library Views j Graphical Layout : '71 activity_marn. xml GW 0h' CN' furneiébiud": 'numero defun- procesar jvurzuwvcw¡ 7 'rvwrrvsvvvrr ifib. textViewl ifTb textView3 textviewd buttonl r Hint Text Color Text App. . ? android: a. Text Size Content- Ími -' TextVíew [l Text numero Hint
  9. 9. mi/ lainitdívityjava . a * 4 z Pagu : õ Paiette v ñ FormW-Isers iipiifimiíílii - › Tmtln LargeMediun 50ml A › __ › j» MJ i iFLLitiiui-»irr um n¡ u: 146mm¡ Ç Mutum E c¡ “ma, "Lj an' - numeroc VeM Spinner Em l , , . _ mu”, E buttonl- procesar - . 4 yu ' t 'Tartñdrls gpn§| ylz a @É i mu” #ÍQÍÍQ/ ÍW: : ' ü ' art-yum'. n _ter r y meu É** , Eli . f. _ jextgbr_ __ iranianas * rmnpk2anau›¡ea. ..[g31 Í Advanced Tm sã' , j Iori: : a Í ürstomü llnyViews 4 ã Graphical Layout activity_main. xm|
  10. 10. toggieButtonl am a @vi @Em agita: : «5.- *E1 nw toggwüoü 7 ileButtonti 'iewl v 'iew2 liew3~ CU. orry : cry orr_ new; on1-"procesar" numero binanzi numerodecrmwi “r v " ' ' '" l ÀP” liaz “E ' “'°“”°“': Si a a i id @+¡d, ~'buu. ..i§ » '+' layout P. .. [i . Style androidzbw Hint ! E Content. .. -TextView [i Text procesar p; Hint TextC. .. : Ííàandroidx n_xm|
  11. 11. ,_ um íL 7Ç= gêl®©©i©líâf le, i3 Packagíplorer E a . ButtonTogEe E5¡ Android 4.2 El¡ Android Dependencies 4 E* sr: a EB comgxamplebuttontoggle l] MaínActivityjzva É? gen [LÍ-erverateri lua Fist! É assets à bin E3 Iibs 4 res [j- drawable-hdpi L3 drawable-Idpi E drawabie-mdpi B- drawabie-xhdpí g- drawable-xxhdpi 4 L3 layout 11 activity_main. xml L3 menu Q values L3 values-sviñOOdp E- vaiua-smülüdpdand 5 values-vn L3 values-VM g AndroidManííestarml a: icJauncher-wehpng proguard-projechm Lgj projectpmpertíes _of Câ1“p@Éâ«SE o v M” J le. @poíóm : :ConíloezzamíiloleoíEleito mfTcogglezzg ; por ílüiizmo selecciozieíf le: @poiózi 4:17I, / ;. DixCÊÍÂVKÃÊyoJÉLV ; É o r R1 u! ! iãyParckage Explorer 4 ButtonToggle E2¡ Android 4.2 gi Android Dependencies A E¡ src a $ comexamplebuttontoggle [j] MaínActivityjava 93 gen [Éãnerrej ia a me: : assets bin 1». tibs a res Q drawable-hdpi E- drawabIe-Idpi E- drawable-mdpi E drawable-xhdpi L3 drawable-xxhdpi 4 _g3 layout 1.1 activity_maín. xml a menu E valus Q- VaIues-sMOOdp B- values-sw7mdp4and Q- values-VII L3 values-VM x1 AndroidManifstacml LF ¡glauncher-wehpng ' proguard-pmjectxxt [à projectpropertís
  12. 12. pllrlic Boolean onCrenteoprtionslienuülenu Ilerlu) ( / / Inflate the menu; this adds itens to the action bir if it is present. getnenuInflater-Q. infIateUL-emunain, menu); return true; 1 public void procesar (View Via0( ToggleButton t1=(Togg1eButton) f i ndViewById ( R . id . toggleõuttonl ) ¡ ToggleButton t2-(Togg1eButton) f indVievlById ( R. id . toggLeButtoniP) _: Toggleautton tB-(Toggleautton) f indViewById (R. id . toggLesuttons) ; Togglenutton t4=(To5g1eButton) f indViewById ( R . :ld . toggLeButtoM) ; Textview rbin= (TextView) findVieuById( R . id . textl/ ieuz) , ' Textview rdec- (Textvieu) f indViewById ( R. id . textView-Ç) ; String so1=""; int posfor=0,posand=0,res=0; if(t1. ischecked( )--true) so1+= ' 1 ' ; else so1+= 'O ' ; 1170:: . ischecked( )= true) so1+= ' 1 ' ; else so1+= 'O' ; if(t3 . istheclced ( )-= true) so1+= ' 1 ' ; else so1+= 'O ' ; if(t4 . isChecked ( )--'true) so1+= '1' ; else so1+= 'O' ; rbin . setText ( sol) ; for(posand= so1 . length ( ) -1; posand›=0; posand- - )( if(sol. chaI-At(posand)n-' 1 ' )( res+=1*l1ath . pou(2, posfor ) ; i posfor-t-H gde: . setText (String. vaLueDf( res) ) ; 1 8.-Al cargar. debemos de escribir los siguientes códigos en la ventana.
  13. 13. @J Java - PraCtiCaA/ src/ corn/ examplelpracticali/ MainActivityjava - ADT File Edit Run Source Navigate Search Project Refactor Window Help i1' F15 *' a' #'0'Q. ' tiíC-i' 1'14"' › lã íckaqe Explorer : EWÕ activ' i New l Go Into nc Open in New Window Open Type Hierarchy F4 Show In A| h$hÍft+W b '- Copy CtrlçC Copy Qualmed Name Paste CtrI+V X Delete Delete . z f' Build Patti › Source AIt+Shift+S › Refactor Alt+5híft+T i Import. .. Export. .. E» E* Refresh FS Close Project Assign Working Sets. .. Run As › l 71:' Debug As › Profile As › Validate Í Team › Compare Wrth › Restore from Local History. .. Android Tools › Properties A| t+ Enter mainxml m MainActiíityjava ? É return true; void calcular (View vino( EditText d1=(EditText) findViewById EditText d2=(EditText: ) findViewById r= (TextView) findViewById ( RadioButton r0:(RadioButtcin) findvie RadioButton r1=(RadioButtorr) firidVie double n1-0oub1e. parseDoubLe(d1.get1 double n2=0oub1e. parseDoubLe(d2.get'I double suuamesta; if(r0. isChecked ( ) = =true)f suma= n1+n2; r . setText (String. voLue0f(surIa) ); i else if(r1 . ischecked( ) --true)( resta= n1-n2; r' . setText (String. volueof( resta) ); l Android Application 2 Android JUnit Test 3 Java Applet Alhshifhx, A 4 Java Application AIt+Shift+X, J 5 JUnit Tat Alt+Shift+x T Run Configurations. .. t. . _ âeâeieccicm com rim click @Íereciic @rpciózi @E “'41 ill. @É ÇKCQLLÊÍO©ZÉÉLÍÍLÊHÊAÊÊ Í *inicnítcggllex 9 eiegir : i3: í; 14.3.3329 Se : me iY7©ii§iiÉL1El9 de clic; @Íebezmco s? @SÊ/ @gê '“ J. zéiiiicírcicí : O 'i . ÉÍÊ; ÍLÉLZI, CÉJÉÍQLÍLEZ .
  14. 14. U w ' v ' W¡ ' E¡ U ' Lt: UíMVI www¡ ; '31 'attivity_main. xm| [L *MainActivity ' MEE Outline 2:3 : - x32 x5 o x* ” E ãn brotected void onCreate(B gdmmmsouustom › 1 à: com-acampleprogramaã supev-. oncreatqsavedl _ E¡ impondgdaraüons setContentView(R. layo LL. _O_ activity_maín. xml [Programú/ res/ Iayout/ activityp l e MánAmvw i LC m MainActivityjava [Programü/ srclcom/ arample/ pr( _ A oncmtdgundk) _EM O. onCreate0ptionsMenu(Menu) : Em: cãaan @Ovrüde -; › (alcular(V¡ew): void ÍA public boolean oncreateop 4 “ Inflate the vamu; t getMenuInflater(). inf s return true; W í ; a public void calcular ( ' 9 @l O c) = 1 : E Edith” “dim”, _ 5:! o @â @CQÍQLÍCÉLA u] Textview i= (Textview) ° o p É? ? ia sawmviw 151 ©p©1©m1 m, w L7 xx ~ a 1/ o double su= Ooub1e. pars I _ñ v_ double is= su'0.16; ' double st= su-is; i. setText(Stríng. vaLu l sa. setText(String. vaL l y v NfProblemsj (.47 Javadoc[Êâmdaratíorjijnãottsole DDMs mamã' 3m' HDMÉnnd-rrlnfninif
  15. 15. 4 1». 'L 4 4 J f j Cl lv j C . ; . . , .. _n q¡ 1 › n ›- numyL-L " mu [H 1D ¡ w! 'j › 'wunw~uulvxmnnv DIJÚO , k" t f , . . , Tí _ c r n , x 'v M» w a! n MUILVYU dmünw u¡ [l " ° _ , r~. --, ›---~ p* 142m; d' “ P' q' Iáw¡ n¡ ff D ' 'É w A . v w. numew b-nanc- II 51 Ilumcwo (ÍrCIWWJ N, pra-ce : a:
  16. 16. El progama Eclipse, nos da muchas ventajas. ya que en el podemos apreciar una estructura cuyo propósito es percibir la numeración en la o o ión de número binarios o bien núme u Con este progama podemos hacer de un cálculo -r- matemáticas plasmarlo en un programa de eclipse de una manera mas sencilla e interactiva para poder manejar mas opciones dentro del progama eclipse y tener un mejor u anejo del progama.

×