1
Project Calculator
รปเลมรายงาน วชา อลกอรทม(Algorithm)
2
รายงาน
เรอง โปรแกรมเครองคดเลข ( Calculator )
วชา อลกอรทม ( Algorithm ) การเขยนโปรแกรมเบองตน
สมาชกกลม
1.) นาย กฤษฎา กาวาด รหส 56181550101 2.) นาย นนฑวฒน ธมาชย รหส 56181550122 3.) นาย สมชาย มณฑา รหส 56181550135
น าเสนอ
อาจารย ดร.ปราโมทย พรหมขนธ
รายวชา อลกอรทมและการเขยนโปรแกรมเบองตน
รหสรายวชา 4121304
นกศกษาชนปท 1 ภาคเรยนท 2/2556
มหาวทยาลยราชภฏล าปาง
Project Calculator 1
ค าน า
โครงงานเลมนเปนสวนหนงของวชา อลกอรทม (Algorithm) การเขยนโปรแกรมเบองตน ในโครงงานเลมนไดกลาวถงการออกแบบโปรแกรมวเคราะหปญหาเกยวกบโปรแกรม เครองคดเลข ( Calculator ) มขนตอนในการท างานของโปรแกรม สวนนาขอมลเขา (Input) สวนการประมวลผล (Processing) สวนผลลพธ (Output) การก าหนดตวแปร ( Variable ) ในการท างานและหาคาค านวณในเครองคดเลข รวมทงรปแบบแผนงาน Flowchart ในการท างานของโปรแกรมเพองายในการท าความเขาใจพรอมทงม ซโดโคด ( Pseudo Code ) พรอมกบตรวจสอบโปรแกรม และ ในการออกแบบโปรแกรมแลวขนตอนการค านวณคาและการน าเขาค านวณขอมลตวเลขตางๆเพอการปรบปรงแกไขออกแบบโปรแกรมใหดขนในการออกแบบโปรแกรมท เปน Open Source คอ ซอฟตแวรทอนญาตใหผใชมอสระในการใชงาน เผยแพร และแกไขตวโปรแกรมโดยเปดเผยรหส ( Source Code ) ของตวโปรแกรมใหกบผสนใจเพอการพฒนาโปรแกรมตอไป และไดมการบอกถงวธการตดตงโปรแกรม ทส าคญในการออกแบบและพฒนาโปรแกรมคอ โปรแกรม Eclipse Development Tools and Java Development Kit (JDK) : ADT (Android Development Tools Plugin for eclipse) : Android SDK : Android Virtual Device Manager (Emulator) เพองายตอความเขาใจและในการพฒนาโปรแกรมตอไป คณะผจดท า
Project Calculator 1
สารบญ
เรอง หนา การวเคราะหปญหา 1
- สวนขอมลน าเขา 1 - สวนการประมวลผล 1 - สวนผลลพธ 1 - การก าหนดตวแปร 1
อลกอรทม - ผงงาน Flowchart 1
การเขยนโปรแกรม 2 - Main Activity.java 2 - Activity_Main.Xml 6
การทดสอบโปรแกรม - ตรวจสอบขอผดผลาด ( Bug ) 10 - ไอคอน ( Icon ) และหนาตางโปรแกรม 11
การจดท าเอกสารประกอบ - ขอก าหนดโปรแกรม 12 - ขนตอนการท างานของโปรแกรม 12 - การใชโปรแกรม 12
วธการตดตง Software เพอการพฒนาโปรแกรม 12 - การตดตง Ecilpse 13 - การตดตง JDK ( Java Development Kit ) 14 - ท าการ Path JDK( Java Development Kit ) 17 - การตดตงโปรแกรม ADT 19
( Android Development Tools in for Eclipse ) - วธ Download And Setup Android SDK 23
วธสราง Application Calculator 31 แหลงอางอง 38
Project Calculator 1
การวเคราะหปญหา สวนขอมลน าเขา (Input) โดยการตรวจจบการคลกปมตางๆๆ case R.id.ButtonNumber01: text1.append("1"); ก าหนดตามแตละปมแตละหมายเลขทตองการค านวณ
สวนการประมวลผล (Processing)
ตรวจสอบล าดบของเครองหมาย * / + - โดยใชค าสง public static int getPriority (char chaOperator ในแตละสญญาลกษณ
สวนผลลพธ (Output) น าคาทค านวณไดกลบไปใสใน text2 text2.setText(Float.toString(intValue)); break; การก าหนดตวแปร (Variable) เรมโปรแกรม public void ButtonClickHandler ( View v ) ตรวจจบการคลกปมตวเลขแตละปม Button Number ตรวจสอบล าดบของเครองหมาย * / + - public static int getPriority จากนนกก าหนดใหโปรแกรมมการค านวณตอไปโดยค าสง return result; อลกอรทม (Algorithms) ผงงาน ( Flowchart )
Project Calculator 2
package com.LookHin.StackCalculator; import java.util.Stack; import java.util.StringTokenizer; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.EditText; public class MainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }
// ตรวจจบการคลกป มตางๆ
public void ButtonClickHandler(View v){ EditText text1 = (EditText) findViewById(R.id.EditText01); EditText text2 = (EditText) findViewById(R.id.EditText02); switch(v.getId()){ case R.id.ButtonNumber00: text1.append("0"); break; case R.id.ButtonNumber01: text1.append("1"); break; case R.id.ButtonNumber02: text1.append("2"); break; case R.id.ButtonNumber03: text1.append("3"); break; case R.id.ButtonNumber04: text1.append("4"); break; case R.id.ButtonNumber05: text1.append("5"); break; case R.id.ButtonNumber06: text1.append("6"); break; case R.id.ButtonNumber07: text1.append("7"); break; case R.id.ButtonNumber08: text1.append("8"); break; case R.id.ButtonNumber09: text1.append("9"); break; case R.id.ButtonSymbolDot: text1.append("."); break;
MainActivity.java การเขยนโปรแกรม
Project Calculator 3
case R.id.ButtonSymbolBracketLeft: text1.append("("); break; case R.id.ButtonSymbolBracketRight: text1.append(")"); break; case R.id.ButtonSymbolDivide: text1.append("/"); break; case R.id.ButtonSymbolMultiply: text1.append("*"); break; case R.id.ButtonSymbolSubtract: text1.append("-"); break; case R.id.ButtonSymbolAdd: text1.append("+"); break; case R.id.ButtonSymbolDel: if(text1.getText().toString().length() > 0){ String strText1Tmp = text1.getText().toString().substring(0, text1.getText().toString().length()-1); text1.setText(""); text1.append(strText1Tmp); } break; case R.id.ButtonSymbolClear: text1.setText(""); text2.setText(""); break; case R.id.ButtonSymbolExe:
// เรมค านวน
String strStack = toPostfix(text1.getText().toString()); float intValue = Calculator(strStack);
// น าคาทค านวนไดกลบไปใสใน text2
text2.setText(Float.toString(intValue)); break; } }
// ตรวจสอบล าดบของเครองหมาย * / + - public static int getPriority(char chaOperator){ if(chaOperator == '+' || chaOperator == '-'){ return 1; }else if(chaOperator == '*' || chaOperator == '/'){ return 2; } return 0; }
Project Calculator 4
// ทบทวนความรสมยเรยนกนกอน แปลงจาก infix เปน postfix
public static String toPostfix(String strInfix){ String strExpression; String strPostfix = " "; strInfix = strInfix.replaceAll("\\+|\\(|\\)|-|\\*|/", " $0 "); StringTokenizer strToken = new StringTokenizer(strInfix); Stack<Character> operatorStack = new Stack<Character>(); while(strToken.hasMoreTokens()){ strExpression = strToken.nextToken(); if(Character.isDigit(strExpression.charAt(0))){ strPostfix = strPostfix + " " + Float.parseFloat(strExpression); }else if(strExpression.equals("(")){ Character operator = new Character('('); operatorStack.push(operator); }else if (strExpression.equals(")")){ while(((Character) operatorStack.peek()).charValue() != '('){ strPostfix = strPostfix + " " + operatorStack.pop(); } operatorStack.pop(); }else{ while(!operatorStack.isEmpty() && !(operatorStack.peek()).equals("(") && getPriority(strExpression.charAt(0)) <= getPriority(((Character) operatorStack.peek()).charValue())){ strPostfix = strPostfix + " " + operatorStack.pop(); } Character operator = new Character(strExpression.charAt(0)); operatorStack.push(operator); } } while(!operatorStack.isEmpty()){ strPostfix = strPostfix + " " + operatorStack.pop(); } return strPostfix; }
Project Calculator 5
// ท าการค านวน + - * / จาก postfix
public static float Calculator(String strPostfix) {
float a;
float b;
float result = 0;
String[] arrPostfix = strPostfix.split(" ");
Stack<Float> CalStack = new Stack<Float>();
for(int i = 0; i < arrPostfix.length; i++){
String ch = arrPostfix[i];
if(isFloat(ch)){
CalStack.push(Float.parseFloat(ch));
}else{
if(ch.equals("+")){
a = CalStack.pop();
b = CalStack.pop();
result = a + b;
CalStack.push(result);
}else if(ch.equals("-")){
a = CalStack.pop();
b = CalStack.pop();
result = b - a;
CalStack.push(result);
}else if(ch.equals("*")){
a = CalStack.pop();
b = CalStack.pop();
result = a * b;
CalStack.push(result);
}else if(ch.equals("/")){
a = CalStack.pop();
b = CalStack.pop();
result = b / a;
CalStack.push(result);
}
}
}
return result;
}
}
Project Calculator 6
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<EditText android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:editable="false" />
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<EditText android:id="@+id/EditText02"
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:editable="false" />
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout03"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<Button android:id="@+id/ButtonNumber07" android:text="7"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:layout_width="fill_parent"
android:layout_weight="1" android:text="8"
android:id="@+id/ButtonNumber08"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
activity_main.Xml
Project Calculator 7
<Button android:layout_width="fill_parent"
android:layout_weight="1" android:text="9"
android:id="@+id/ButtonNumber09"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:id="@+id/ButtonSymbolDivide" android:text="/"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout04"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<Button android:id="@+id/ButtonNumber04" android:text="4"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:id="@+id/ButtonNumber05" android:text="5"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:id="@+id/ButtonNumber06" android:text="6"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:text="*" android:layout_width="fill_parent"
android:layout_weight="1"
android:id="@+id/ButtonSymbolMultiply"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
Project Calculator 8
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout05"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<Button android:id="@+id/ButtonNumber01" android:text="1"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:text="2" android:layout_width="fill_parent"
android:layout_weight="1" android:id="@+id/ButtonNumber02"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:id="@+id/ButtonNumber03" android:text="3"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:layout_weight="1" android:layout_width="fill_parent"
android:text="-" android:id="@+id/ButtonSymbolSubtract"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout06"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<Button android:id="@+id/ButtonNumber00" android:text="0"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
Project Calculator 9
<Button android:layout_width="fill_parent"
android:layout_weight="1" android:text="("
android:id="@+id/ButtonSymbolBracketLeft"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:text=")" android:layout_width="fill_parent"
android:layout_weight="1"
android:id="@+id/ButtonSymbolBracketRight"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:id="@+id/ButtonSymbolAdd" android:text="+"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout07"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<Button android:text="." android:id="@+id/ButtonSymbolDot"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" android:layout_weight="1" />
<Button android:id="@+id/ButtonSymbolDel" android:text="Del"
android:layout_width="fill_parent" android:layout_weight="1"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler" />
<Button android:text="Clear" android:id="@+id/ButtonSymbolClear"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1" android:onClick="ButtonClickHandler"
/><Button android:text="=" android:id="@+id/ButtonSymbolExe"
android:layout_height="fill_parent"
android:onClick="ButtonClickHandler"
android:layout_width="fill_parent" android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
Project Calculator 10
การทดสอบโปรแกรม
โปรแกรมจะท าการตรวจสอบ Bug Automatic วาตด Bug ตรงไหน
Project Calculator 11
หนาจอของอปกรณ Android
หนาตางของโปรแกรม
หนาจอแสดงผล
Icon โปรแกรม
ปมตวเลขและสญลกษณ
Project Calculator 12
การจดท าเอกสารประกอบโปรแกรม
ขอก าหนดของโปรแกรม
สามารถตดตงกบอปกรณ Android Version 2.2 Froyo ขนไป
ขนตอนการท างานของโปรแกรม
รบคาตวเลขและสญลกษณจาดการกดปมตรวจสอบล าดบของเครองหมายตรวจสอบตวเลขแลวท าการค านวณออกมา
การใชงานโปรแกรม
ตดตงโปรแกรมกบอปกรณทรองรบทท างานบน OS Android ตงแต Versions 2.2 ขนไป วธการตดตงโปรแกรมเพอการพฒนาโปรแกรม
สงทตองมในการเขยนโปรแกรม Android 1.) Eclipse Development Tools and Java Development Kit (JDK) 2.) ADT (Android Development Tools Plugin for eclipse) 3.) Android SDK 4.) Android Virtual Device Manager ( Emulator )
ขนท 1 Eclipse Development Tools and Java Development Kit JDK ส าหรบโปรแกรม Eclipse ปกตแลวจะนยมไวส าหรบเขยนโปรแกรม JAVA แตทงนเรา
สามารถตดตง Plug in เพอส าหรบเขยนโปรแกรมบน Android ไดเชนเดยวกนการตดตง Eclipse จะตองตดตง Java Development SDK ดวย
Project Calculator 13
รปโปรแกรม Eclipse
การตดตง Eclipse โปรแกรม Eclipse ถอเปนโปรแกรมขนาดเลกโดยมขนาดประมาณ 200-300 MB และสามารถดาวน
โหลดไฟลทเปน zip มาใชไดเลยโดยไมตองท าการตดตงสามารถดาวนโหลด Eclipseไดท http://www.eclipse.org/downloads/ เลอกท Eclipse Downloads
หนาจอดาวนโหลดโปรแกรม Eclipse
เลอก Version ทเปน Eclipse Classic หลงจากไดไฟลมาแลวกไมตองท าการตดตงแตใหแตกไฟลไวท C:\eclipse
Project Calculator 14
เมอเกดการผดพลาดในการตดตงโปรแกรม Eclipse กรณท Error
A Java Runtime Environment (JRE) or Java Development Kit (JDK)...
แสดงวายงไมไดท าการตดตง Java Development JDK Kit (JDK) สามารถดาวนโหลดไดท http://www.oracle.com/technetwork/java/javase/downloads/index.html
ดาวนโหลดโปรแกรม Java Development Kit (JDK)
เลอกดาวนโหลดทเปน JDK
เลอกเวอรชน OS ทถกตอง กดเลอก Accept
ท าการตดตงโปรแกรม
Project Calculator 15
ขนตอนการตดตงโปรแกรม Java Development Kit คลกเลอกท Next
คลกเลอกท Next
รอจนกวาการตดตงจะเสรจ
Project Calculator 16
เมอตดตง JDK เสรจ กจะพบหนาตางเรมตดตง JRE (Java Runtime) กด Next
โปรแกรมกจะเรมการตดตง
สนสดการตดตง กดปม continue
Project Calculator 17
ตอมาใหไปท C:\Program Files\Java\jdk1.7.0_03\bin ท าการ copy path ไว
คลกขวาท computer เลอก properties เลอก Advanced System Settings
เลอกเมนดงน กด Edit
Project Calculator 18
ตงคาเสรจสนทงหมดแลวกด OK เรอย ๆ จนหมดทกหนาจอสดทายเปด Command Line ลองพมพ java แลวกด enter
เตม ; ลงไปดานทายสด และตามดวย C:\Program Files\Java\jdk1.7.0_03\bin และกด OK
สรางตวแปร CLASSPATH = . โดยการกด New และปอนไปดงน
สรางตวแปร JAVA_HOME ดงน สรางตวแปร JRE_HOME ดงน
Project Calculator 19
และลองพมพ javac กด enter จะไดดงน ถาโชวแบบนแปลวา ส าเรจ ADT (Android Development Tools Plug in for eclipse)
ตดตง ADT (Android Development Tools Plug in for eclipse) ซงเปน Plug in ไวส าหรบ ตดตงบน Eclipse เพอรองรบการเขยนโปรแกรมบน Android โดย Plug in ADT มหนาทในการ ปรบสภาพแวดลอมของโปรแกรม Eclipse IDE ปรงแตง environment ตาง ๆ เพอเพมประสทธภาพ ในการเขยน Android ส าหรบการตดตง ADT จะตองตดตงผานโปรแกรม Eclipse โดยขนแรกใหไป ท URL http://developer.android.com/tools/sdk/eclipse-adt.html คลกท Installing the Eclipse Plug in ดงภาพ แลวปฏบตตามขนตอนน
Project Calculator 20
Download the ADT Plug in 1.) Start Eclipse, then select Help > Install New Software.... 2.) Click Add, in the top-right corner. 3.) In the Add Repository dialog that appears, enter "ADT Plug in" for the Name and the followingURL for the Location: https://dl-ssl.google.com/android/eclipse/ 4.) Click OK 5.) In the Available Software dialog, select the checkbox next to Developer Tools and click Next 6.) In the next window, you'll see a list of the tools to be downloaded. Click Next. 7.) Read and accept the license agreements, then click Finish. 8.) When the installation completes, restart Eclipse หรอจะปฏบตตามขนตอนน
เปดโปรแกรม Eclipse เลอกเมน Help -> Install New Software คลกท Add ดงภาพ
Project Calculator 21
ตรง Name ใหใส ADT Plug in และ https://dl-ssl.google.com/android/eclipse/ ตามล าดบ
คลกเลอก Developer Tools และ Next
คลกเลอก Next
Project Calculator 22
คลกเลอก I accept.... และ Next ตามล าดบ การดาวนโหลดซงจะใชเวลาไมนาน กรณทม Warning ใหเลอก OK
Project Calculator 23
หลงจากเสรจสนใหปดโปรแกรม Eclipse แลวเปดขนมาใหมอก เปดโปรแกรม Eclipse ขนมาใหม การก าหนด workspace จากนนกจะเขาสโปรแกรม Eclipse เปนอนเสรจสนการตดตง
การ Download Android SDK
คลกท Download the SDK for Windows ดงภาพ ไฟลทได อาจจะใชเวลาดาวนโหลด 5-10 นาท ขนอยกบความเรวของ Internet ใหดบเบลคลกเพอ
ตดตง คลกท Next
Project Calculator 24
คลกท Next เลอก Install just for me และ Next ก าหนด Path ไวท C:\Android\android-sdk\ (Path นน าไปใชอยางอนดวย)
Project Calculator 25
คลก Install ก าลงตดตง คลกท Next
Project Calculator 26
คลกเลอกท Start SDK Manager (to download system images, etc) และ Finish (กรณทลมสามารถเปดไดจากโฟลเดอร C:\Android\android-sdk\) คลกเลอกรายการเหมอนในภาพ เชน Tools และ Android วาจะเลอกเวอรชนไหนบาง ในทนผม เลอกทงหมดเลย และก Install Packages เลอก Accept และ Install
Project Calculator 27
ก าลงตดตงซงจะใชเวลา 20-60 นาท หรอมากกวานนขนอยกบความเรวของ Internet แสดง Process และรายการทถกตดตง
Project Calculator 28
ถาเสรจสนจะขนค าวา Done loading packages จากนนกปด Close หนาจอนไปเลย ใหไปทเมน Windows -> Preferences ตรงทเปน SDK Location ใหก าหนด Path ทเราไดตดตง Android ซงในทนคอ C:\Android\android-sdk\
หนาจอของ Android Virtual Device Manager ใหคลกท New เพอสราง Emulator ขนมาใหม
Project Calculator 29
ในชองแรกใหก าหนดรนของ AVD และใน ชองทสองจะเปน Version หรอรนของ Android OS และก าหนดคาอน ๆ ดงภาพ จากนนกใหคลกท Create AVD จะได AVD หรอ Emulator ของ Android ขนมาดงภาพ ใหทดสอบโดยคลกท Start
Project Calculator 30
คลกท Launch ก าลงโหลด Emulator for AVD
หนาจอ AVD Emulator ของ Android อนนก าลงโหลด OS อย
Project Calculator 31
หลงจากโหลดเสรจสน กจะปรากฏหนาจอดงรป สามารถท าการคลกเพอทดสอบอน ๆ ได อนนจะ ลองเปด Browser ด
เมอตดตงเสรจเรยบรอยแลวใหเปดโปรแกรม eclipse
Project Calculator 32
เลอกทเกบขอมล แนะน า ท C:\workspace
หนาตางของโปรแกรมทจะใชเขยนโปรแกรม Android ในรปแบบภาษา Java
วธการจ าลองอปกรณ Android | Android Virtual Devices เพองายตอท าการทดสอบโปรแกรม
คลกเลอก
Project Calculator 33
1. New
2.ก าหนดคาของอปกรณ Android
4. Launch
3. Start
5. หนาตางอปกรณ Androidจ าลอง
Project Calculator 34
วธการสรางไฟล โปรแกรม Calculator
คลก File > New > Android Application Project
ตงชอโปรแกรม StacCalculator > Next
คลกเลอก Next
Project Calculator 35
คลก Browre... > เลอก Icon ทจะตง > Next
ตวอยาง Icon > Next
เลอกรปแบบ > Finish
Project Calculator 36
หนาตางทใหเขยนโคด activity_main.Xml : MainActivity.java
รปแบบตวอยางของโปรแกรม Calculator
Project Calculator 37
เรมทดสอบโปรแกรมโดยการคลกขวาท Folder File StacCalculator > Rus As
> 1.Android Application
โปรแกรมตดตงลงใน Android Virtual Devices เปดโปรแกรมทดสอบการค านวณ และ สามารถน าไปตดตง กบอปกรณ Android ได
Android
หนาจอแสดงผล
Icon โปรแกรม
ปมตวเลขและ
สญลกษณ
Project Calculator 38
แหลงอางอง
Project Calculator 39
แหลงอางอง - http://www.unzeen.com/article/1059/ - เอกสารพฒนาโปรแกรมบนมอถอแอนดรอยด
เบองตน โดย อ.ปรมนทร วงษค ำสงห - http://programming-android-phone.blogspot.com/ - http://www.youtube.com/watch?v=1lPLT9dkH_E
Project Calculator 40
Top Related