SlideShare une entreprise Scribd logo
1  sur  16
ANDROID 세미나
FOR BEGINNER (2)
     PoolC 홍철주
     2012. 4. 18
RESOURCE -> SOURCE CODE
  <?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" >

      <TextView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="@string/hello" />

      <Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Button" />

  </LinearLayout>
RESOURCE -> SOURCE CODE
RESOURCE -> SOURCE CODE

  public class TestActivity extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);

          Button mButton = (Button)findViewById(R.id.button1);
      }
  }
RESOURCE -> SOURCE CODE
  public final class R {
      public static final class attr {
      }
      public static final class drawable {
          public static final int ic_launcher=0x7f020000;
      }
      public static final class id {
          public static final int button1=0x7f050000;
      }
      public static final class layout {
          public static final int main=0x7f030000;
      }
      public static final class string {
          public static final int app_name=0x7f040001;
          public static final int hello=0x7f040000;
      }
  }
RESOURCE -> SOURCE CODE


 {ResourceType} {Varible} = (ResourceType)findViewById(ResourceAddress);
RESOURCE -> SOURCE CODE
        Button mButton = (Button)findViewById(R.id.button1);

        // Button Listener : onClick -> call a function
        mButton.setOnClickListener(new Button.OnClickListener(){

 	 	 	 public void onClick(View v) {
 	 	 	 	 // TODO Auto-generated method stub
 	 	 	 	 Toast.makeText(getApplicationContext(), "Hello, World",
 Toast.LENGTH_SHORT).show();
 	 	 	 }
         });
ACTIVITY


• 일단은   보이는 화면이라고 생각

• 당신은   화면 위에다가 터치도 하고 이것 저것한다

 • 입력도   받고 출력도 받고

• 액티비티   주기를 볼 필요가 있긴 한데...
INTENT


• 안드로이드에서의       의사표현 수단

• 어떤   component를 부른다!

• 그리고   무엇을 해달라고 요청!
CONTEXT


• 어플리케이션    환경의 전역 정보에 접근하기 위한 인터
페이스

• 시스템   정보 접근, API 호출

• 액티비티간    리소스 공유 등..
INTENT -> NEW ACTIVITY!


	   Intent mIntent = new Intent(TestActivity.this, SecondActivity.class);
	   	 	 	 startActivity(mIntent);
	   	 	

                 Intent 의 생성자는 여러가지.
                        이는 그 중 하나.
SIMPLE CALCULATOR


                op1
opr
                op2


                result
SIMPLE CALCULATOR


   	   EditText op1, op2;
   	   TextView opr, result;
   	   Button plus, minus, mul, div;
SIMPLE CALCULATOR
               public void onCreate(Bundle savedInstanceState) {
                      super.onCreate(savedInstanceState);
                      setContentView(R.layout.main);

                      op1 = (EditText)findViewById(R.id.op1);
                      op2 = (EditText)findViewById(R.id.op2);
                      opr = (TextView)findViewById(R.id.opr);
                      result = (TextView)findViewById(R.id.result);

                      plus = (Button)findViewById(R.id.plus);
                      plus.setOnClickListener(this);
                      minus = (Button)findViewById(R.id.minus);
                      minus.setOnClickListener(this);
                      mul = (Button)findViewById(R.id.mul);
                      mul.setOnClickListener(this);
                      div = (Button)findViewById(R.id.div);
                      div.setOnClickListener(this);

                  }
                                      this? -> activity
public class TestActivity extends Activity implements View.OnClickListener
SIMPLE CALCULATOR
  public   void onClick(View v) {
  	 	      // TODO Auto-generated method stub
  	 	      switch(v.getId()) {
  	 	      case R.id.plus:
  	 	      	 process(Operator.plus);
  	 	      	 break;
  	 	      case R.id.minus:
  	 	      	 process(Operator.minus);
  	 	      	 break;
  	 	      case R.id.mul:
  	 	      	 process(Operator.mul);
  	 	      	 break;
  	 	      case R.id.div:
  	 	      	 process(Operator.div);
  	 	      	 break;
  	 	      }
  	 }
SIMPLE CALCULATOR
void process(Operator op)
	   {
	   	  int op1Num = Integer.parseInt(op1.getText().toString());
	   	  int op2Num = Integer.parseInt(op2.getText().toString());
	   	  double resultNum = 0;
	   	
	   	  switch(op)
	   	  {
	   	  case plus:
	   	  	   resultNum = op1Num + op2Num;
	   	  	   opr.setText("+");
	   	  	   break;
	   	  case minus:
	   	  	   resultNum = op1Num - op2Num;
	   	  	   opr.setText("-");
	   	  	   break;
	   	  case mul:
	   	  	   resultNum = op1Num * op2Num;
	   	  	   opr.setText("*");
	   	  	   break;
	   	  case div:
	   	  	   resultNum = (double)op1Num / op2Num;
	   	  	   opr.setText("/");
	   	  	   break;
	   	  }
	   	
	   	  result.setText(Double.toString(resultNum));

Contenu connexe

Tendances

VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEDarwin Durand
 
Understanding Functions and "this" in the World of ES2017+
Understanding Functions and "this" in the World of ES2017+Understanding Functions and "this" in the World of ES2017+
Understanding Functions and "this" in the World of ES2017+Bryan Hughes
 
Business Rules with Brick
Business Rules with BrickBusiness Rules with Brick
Business Rules with Brickbrian d foy
 
VPN Access Runbook
VPN Access RunbookVPN Access Runbook
VPN Access RunbookTaha Shakeel
 
Strategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux ApplicaitonsStrategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux Applicaitonsgarbles
 
Zend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionZend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionAbdul Malik Ikhsan
 
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Eyal Vardi
 
Intro to Advanced JavaScript
Intro to Advanced JavaScriptIntro to Advanced JavaScript
Intro to Advanced JavaScriptryanstout
 
What is the difference between a good and a bad repository? (Forum PHP 2018)
What is the difference between a good and a bad repository? (Forum PHP 2018)What is the difference between a good and a bad repository? (Forum PHP 2018)
What is the difference between a good and a bad repository? (Forum PHP 2018)Arnaud Langlade
 
Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012Rafael Felix da Silva
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax pluginsInbal Geffen
 
Authentication Functions
Authentication FunctionsAuthentication Functions
Authentication FunctionsValerie Rickert
 

Tendances (16)

VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
 
Understanding Functions and "this" in the World of ES2017+
Understanding Functions and "this" in the World of ES2017+Understanding Functions and "this" in the World of ES2017+
Understanding Functions and "this" in the World of ES2017+
 
Business Rules with Brick
Business Rules with BrickBusiness Rules with Brick
Business Rules with Brick
 
VPN Access Runbook
VPN Access RunbookVPN Access Runbook
VPN Access Runbook
 
5. CodeIgniter copy1
5. CodeIgniter copy15. CodeIgniter copy1
5. CodeIgniter copy1
 
Strategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux ApplicaitonsStrategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux Applicaitons
 
Zend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionZend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency Injection
 
Javascript - Beyond-jQuery
Javascript - Beyond-jQueryJavascript - Beyond-jQuery
Javascript - Beyond-jQuery
 
My Development Story
My Development StoryMy Development Story
My Development Story
 
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
 
Intro to Advanced JavaScript
Intro to Advanced JavaScriptIntro to Advanced JavaScript
Intro to Advanced JavaScript
 
What is the difference between a good and a bad repository? (Forum PHP 2018)
What is the difference between a good and a bad repository? (Forum PHP 2018)What is the difference between a good and a bad repository? (Forum PHP 2018)
What is the difference between a good and a bad repository? (Forum PHP 2018)
 
Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012
 
culadora cientifica en java
culadora cientifica en javaculadora cientifica en java
culadora cientifica en java
 
Jqeury ajax plugins
Jqeury ajax pluginsJqeury ajax plugins
Jqeury ajax plugins
 
Authentication Functions
Authentication FunctionsAuthentication Functions
Authentication Functions
 

En vedette

リーンスタートアップ2012‐2
リーンスタートアップ2012‐2リーンスタートアップ2012‐2
リーンスタートアップ2012‐2Masaki Yoshida
 
Using Facebook For Your Business
Using Facebook For Your BusinessUsing Facebook For Your Business
Using Facebook For Your BusinessOCG PR
 
Are Your Ready for Your Next Formulary Win?
Are Your Ready for Your Next Formulary Win?Are Your Ready for Your Next Formulary Win?
Are Your Ready for Your Next Formulary Win?PaulLukas
 
Toplanti yonetimi-ozel-dersi
Toplanti yonetimi-ozel-dersiToplanti yonetimi-ozel-dersi
Toplanti yonetimi-ozel-dersizeynep_zyn85
 
Truzim meslek-lisesi
Truzim meslek-lisesiTruzim meslek-lisesi
Truzim meslek-lisesizeynep_zyn85
 
دراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنية
دراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنيةدراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنية
دراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنية engmohamed_architect
 

En vedette (11)

Figurative language
Figurative languageFigurative language
Figurative language
 
Tours in Mexico
Tours in MexicoTours in Mexico
Tours in Mexico
 
リーンスタートアップ2012‐2
リーンスタートアップ2012‐2リーンスタートアップ2012‐2
リーンスタートアップ2012‐2
 
Using Facebook For Your Business
Using Facebook For Your BusinessUsing Facebook For Your Business
Using Facebook For Your Business
 
Presentation1
Presentation1Presentation1
Presentation1
 
Contaminación
ContaminaciónContaminación
Contaminación
 
Are Your Ready for Your Next Formulary Win?
Are Your Ready for Your Next Formulary Win?Are Your Ready for Your Next Formulary Win?
Are Your Ready for Your Next Formulary Win?
 
Toplanti yonetimi-ozel-dersi
Toplanti yonetimi-ozel-dersiToplanti yonetimi-ozel-dersi
Toplanti yonetimi-ozel-dersi
 
Truzim meslek-lisesi
Truzim meslek-lisesiTruzim meslek-lisesi
Truzim meslek-lisesi
 
Trakya edu
Trakya eduTrakya edu
Trakya edu
 
دراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنية
دراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنيةدراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنية
دراسة الخصائص التصميمية للفراغات العمرانية الخاصة بالاحياء السكنية
 

Similaire à 안드로이드 세미나 2

Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intentadmin220812
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android DevelopmentJussi Pohjolainen
 
Android Location-based應用開發分享
Android Location-based應用開發分享Android Location-based應用開發分享
Android Location-based應用開發分享koji lin
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversUtkarsh Mankad
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your appsJuan C Catalan
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projectsIgnacio Martín
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Eric Hogue
 
Android development - Activities, Views & Intents
Android development - Activities, Views & IntentsAndroid development - Activities, Views & Intents
Android development - Activities, Views & IntentsLope Emano
 
Saindo da zona de conforto… resolvi aprender android
Saindo da zona de conforto… resolvi aprender androidSaindo da zona de conforto… resolvi aprender android
Saindo da zona de conforto… resolvi aprender androidDaniel Baccin
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)Jose Manuel Pereira Garcia
 

Similaire à 안드로이드 세미나 2 (20)

Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intent
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
 
Day 5
Day 5Day 5
Day 5
 
Android Location-based應用開發分享
Android Location-based應用開發分享Android Location-based應用開發分享
Android Location-based應用開發分享
 
20 Codigos
20 Codigos20 Codigos
20 Codigos
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Android 3
Android 3Android 3
Android 3
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your apps
 
Practical
PracticalPractical
Practical
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Minicurso Android
Minicurso AndroidMinicurso Android
Minicurso Android
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Integrating React.js with PHP projects
Integrating React.js with PHP projectsIntegrating React.js with PHP projects
Integrating React.js with PHP projects
 
Action bar
Action barAction bar
Action bar
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014
 
Android development - Activities, Views & Intents
Android development - Activities, Views & IntentsAndroid development - Activities, Views & Intents
Android development - Activities, Views & Intents
 
Saindo da zona de conforto… resolvi aprender android
Saindo da zona de conforto… resolvi aprender androidSaindo da zona de conforto… resolvi aprender android
Saindo da zona de conforto… resolvi aprender android
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 
HNUH
HNUHHNUH
HNUH
 
20 codigos
20 codigos20 codigos
20 codigos
 

Dernier

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Dernier (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

안드로이드 세미나 2

  • 1. ANDROID 세미나 FOR BEGINNER (2) PoolC 홍철주 2012. 4. 18
  • 2. RESOURCE -> SOURCE CODE <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /> </LinearLayout>
  • 4. RESOURCE -> SOURCE CODE public class TestActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button mButton = (Button)findViewById(R.id.button1); } }
  • 5. RESOURCE -> SOURCE CODE public final class R { public static final class attr { } public static final class drawable { public static final int ic_launcher=0x7f020000; } public static final class id { public static final int button1=0x7f050000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; } }
  • 6. RESOURCE -> SOURCE CODE {ResourceType} {Varible} = (ResourceType)findViewById(ResourceAddress);
  • 7. RESOURCE -> SOURCE CODE Button mButton = (Button)findViewById(R.id.button1); // Button Listener : onClick -> call a function mButton.setOnClickListener(new Button.OnClickListener(){ public void onClick(View v) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(), "Hello, World", Toast.LENGTH_SHORT).show(); } });
  • 8. ACTIVITY • 일단은 보이는 화면이라고 생각 • 당신은 화면 위에다가 터치도 하고 이것 저것한다 • 입력도 받고 출력도 받고 • 액티비티 주기를 볼 필요가 있긴 한데...
  • 9. INTENT • 안드로이드에서의 의사표현 수단 • 어떤 component를 부른다! • 그리고 무엇을 해달라고 요청!
  • 10. CONTEXT • 어플리케이션 환경의 전역 정보에 접근하기 위한 인터 페이스 • 시스템 정보 접근, API 호출 • 액티비티간 리소스 공유 등..
  • 11. INTENT -> NEW ACTIVITY! Intent mIntent = new Intent(TestActivity.this, SecondActivity.class); startActivity(mIntent); Intent 의 생성자는 여러가지. 이는 그 중 하나.
  • 12. SIMPLE CALCULATOR op1 opr op2 result
  • 13. SIMPLE CALCULATOR EditText op1, op2; TextView opr, result; Button plus, minus, mul, div;
  • 14. SIMPLE CALCULATOR public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); op1 = (EditText)findViewById(R.id.op1); op2 = (EditText)findViewById(R.id.op2); opr = (TextView)findViewById(R.id.opr); result = (TextView)findViewById(R.id.result); plus = (Button)findViewById(R.id.plus); plus.setOnClickListener(this); minus = (Button)findViewById(R.id.minus); minus.setOnClickListener(this); mul = (Button)findViewById(R.id.mul); mul.setOnClickListener(this); div = (Button)findViewById(R.id.div); div.setOnClickListener(this); } this? -> activity public class TestActivity extends Activity implements View.OnClickListener
  • 15. SIMPLE CALCULATOR public void onClick(View v) { // TODO Auto-generated method stub switch(v.getId()) { case R.id.plus: process(Operator.plus); break; case R.id.minus: process(Operator.minus); break; case R.id.mul: process(Operator.mul); break; case R.id.div: process(Operator.div); break; } }
  • 16. SIMPLE CALCULATOR void process(Operator op) { int op1Num = Integer.parseInt(op1.getText().toString()); int op2Num = Integer.parseInt(op2.getText().toString()); double resultNum = 0; switch(op) { case plus: resultNum = op1Num + op2Num; opr.setText("+"); break; case minus: resultNum = op1Num - op2Num; opr.setText("-"); break; case mul: resultNum = op1Num * op2Num; opr.setText("*"); break; case div: resultNum = (double)op1Num / op2Num; opr.setText("/"); break; } result.setText(Double.toString(resultNum));

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n