安卓计算器开发实验报告.docx

上传人:b****7 文档编号:9462945 上传时间:2023-02-04 格式:DOCX 页数:29 大小:129.47KB
下载 相关 举报
安卓计算器开发实验报告.docx_第1页
第1页 / 共29页
安卓计算器开发实验报告.docx_第2页
第2页 / 共29页
安卓计算器开发实验报告.docx_第3页
第3页 / 共29页
安卓计算器开发实验报告.docx_第4页
第4页 / 共29页
安卓计算器开发实验报告.docx_第5页
第5页 / 共29页
点击查看更多>>
下载资源
资源描述

安卓计算器开发实验报告.docx

《安卓计算器开发实验报告.docx》由会员分享,可在线阅读,更多相关《安卓计算器开发实验报告.docx(29页珍藏版)》请在冰豆网上搜索。

安卓计算器开发实验报告.docx

安卓计算器开发实验报告

电力学院

嵌入式WebOSZ用开发

实验报告

实验名称:

使用AndroidDeveloperSDK开发应用程序

专业:

姓名:

班级:

学号:

作品的运行环境及安卓SDKS础操作

SDKAndroidDeveloper是一款在windows系统上运行的针对

Android应用开发的谷歌官方软件(需要JAVAM境支持)

1、导入工程

UMVMTMrihaHWlariDwtavIMmi

ASnJ1①O■g

十Ad-IPlLamIw

0*114■:

MW■:

■一

f■mhfcHBuhm

<•***NMI*

SJtarr320MJW

C^sHv:

Mediurr1由I

—Sfile^jspWywMl司L

岛f仲Mt

SOLard:

1etov;»chdu

l\4Tiil:

nr仔心■三9€l

®g!

IIMt*

HhfeeM,.

Eiii"-1"土UMMHlfiAr

fage荷啊AMDh^ht^

旗』朗difaut

口w?

pfWH*d*h#

Lavht」ncHrjarMpuho^.

y广P-"「-.-F

K;U

卜可艮

在运行虚拟机是为保证机器的顺畅运行建议选择分辨率较低的

虚拟机,但是其RAM©好设为512MB因为部分程序如果调用资源过

大会导致虚拟机无法运行

3、虚拟机界面

 

二、作品介绍

结果

我的应用是一个计算器。

能实现包括小数的加减乘除运算,过大会白动用科学记数法表示,另外还有退格跟清屏功能键。

5h54:

SK

三、编程以及运行调试

(一)、在MyDesktop主界面中添加应用图标

1.首先在我的桌面上添加你应用的图标以及文字,双击图

标后就可以看见对应的代码,可直接在代码中进行修改图

片文字的大小颜色等等。

六讨。

W亩同B^rlcr讦司营响MK周

村、R国口J上,jj*空*。

BfrOQKQm'jKfcm

I司无原宜哽器

00drarw&bl骨*

』吕dr4w^ble->idpi

.“I.ihjiifiilnl„by_luiubtJ.D.png

eJchs?

frem_bg_!

neiHrflag.cwigi

“I.thjkfi!

仁ULuy.ipiv_iitrJ.5pi"g

%therkbok_bidsgreufldjcml

mi.th-.kLux_u1t_bi«-

•无rheckbor.or.backg*cijnd,ongclMdr_.^ng

通tlMrJ.piftghi,tlvdi_Zpng曜而5_ok,png见ic_Lduri-hcT^png12?

:

皿irrral.png述■iT^J.png性imcJ.png或im^i.pfig理irngS.png成img-6ipng理imgr.png.此:

dlll^Sipig如list_tBb_a4:

>nclist_tab.pr>g可li5t_tidc.prg

上眈:

iCdn.prtg

口哼Qh^anu*0v4f日.**Q笔旬iEWly♦

'匚fcIrd:

lTEty.|B.UBl^T]HLL&krto3HLjwi<

4

5raphkalILsfout—j-cim^.irsin.jcinl

BK

以下是对应图像图标的代码

CBPfiZfWi岫SY

官©■临.再g**q・q■.b-*

j.hfFfKHhityje^4p;虹静砒泗寸顷,|^*#jti.¥ily.fff峪1T^xKElp.giiiinT圈

tnUfOMgyo^LE快砌W戏也&翊a口

zz.i3r.D±±iIsgau:

it™f二4C-dfc-~

Anar-Old:

1j^ouD_r=棉上』

•*

wdsudi罪白1^=辱尸":

ei;Tffjr_vaxTi=・E拿合忌=*=_■=•,ssbzjL-

日「.;3了「1屈;l日>4E=阳(?

wf.£iewArip.

3iZ.S=D±±IM=Jf-CsL二L”*£+虫■二F,

i^tSromit^i?

t5i£es/>

《虱码口n

z=.[3=d±±i±±«r■+□.a/£±ji_rri♦

udfOLdiui/tHic._viacn«*fiw^ji

wdrox-l11ayci'nc.&ci.aftx-^f4*"

mr:

9ri3M!

layouc»az-51nlci|2=f,,-^dp,1

3i±a=iiai1■■的

android11侦

wd^&iai&flGttfrcs^iS-zroc^urs«ipc:

n>

CwtzTLf

■:

n—lH11^3fjfAia/TBXTVl*V6x*

uCJRiaiMyg

ar.dz^iljd.!

1ajiouiz土郭上eentant*

■£dl«±d.:

L・YGu球_亶,化心=■

.r-1^1s-i[1A.«.!

flnirnr;w"JPi"^|n*

^1GfaphietfLa^ew足曲品m*加

图片可以在左侧的选

项中自行进行挑选;

也可以添加白己的图片,

只要将图片放到对应的

文件夹之下在刷新就可

以,但不建议放分辨率

过高图片可能会出现超

 

出界面的等错误。

(二)、在res/layout目录下新建.xml文件,由于计算器的按钮很多,要在xml界面中添加排版:

xml代码首末的</AbsoluteLayout>格式较为白由可以直接在界面中

拖动图标位置以及修改大小,而其他layout则更会白动排列,各有优劣。

(三)、在src/weibo.test.ui目录下新建.java文件,计算器的按钮

算法等都在此实现。

la

jmh1h-B!

-ETiJ^me_**yx^nJ^^*fFFafl

CN

n^BEVep-tts-Q_5(htf-rlA-ri若bec-h^™#^aD£DV%xInwIHaoIBfMNs-wioa--『■§■344L*1>0&.A耳■sTasrlBfn-,CM客—*1UF1-4wIHn—w'a吕一舍S3、IK■4*E>gBIires=f^r#T「5*J直---Ifi益JlaslB•『・•—a-国M-1_£sI.s旨冶a-4ee**hmrAHr^TIE』IJ»l:

v-pllHfY£■・xh-a4SEFD・JJuaqEHJ-a-B-IlauFa』l»-driIJml匕口OWU'EY£9-ci■--Me-VHchc-_vJEwi«U0TWV

Ufl3c^v-«A=33-dc?

?

f5QHJ-uJ-*icll.ldqTTftlTXEHB-&F-Wui4e-^-s"f-uL$E:

-O4S0S

■WT£IJ¥¥*

eRtirlKW

AHSTHViluMllMv

AhtL'rilHMlhcn.ll'iJHv®AMlrfeF^J^t'nidT.IIu-KVBil.。

..-fl~4Rn-c»亍为女3蜀8%・^”弟£-D^^fc^nGSHRBS

AHalr-lEMlIJLIali-ltlE/>

esMH■舀%挣VV#=•33.lalFfea-4J-JM<.x.・K*l目I-sflTDMP目fr上+>--I映HllIJMiKrt・H:

1・虹5"*ll-l->-告dp-TITlnMUQV

AhlULZKPw1招m・-3BR罢•±—><=¥n,J>『工§・七点

AS4aidaa.,pa4bid叫

E-P4ITLT.J*号Sox!

1fAAIiLl]hw:

:

uf3£中?

■--巾..-

.II

MqfA-1I一q

3CUE由q-E.4.^-£s^l^a«—E&I

-

-EW^_J田E.ui上"Aiifn.p!

El.E.—wd.tR^*

■-

一UMuddwi.MJMWql.d'a-qp^I

JngJ&■

老El-fyt-Jpmpri

iw业ql^fpVA

qJI

鼻一ciaJo

.wr4),lWMUii—£¥fl

—Qn-Uy-"■=■£」

着il.dn曳m

■cr^mM_」.!

..'

KawiJwM

4PHFM4IM・EpTi」p#H

nr>mLl,EznEw普E

0田itfko*费y.0;码疆”1咨*ETrwlr瑚NEmIIJ甚收;?

w苴页12原西月=,■¥is5,p(

_EX.W皇ue|/\|p一。

」pu<担眼点加(吝股鄂11出11)*>旺邕粗

的骥HSK,(111)

已nNn-noql中-pm户&H-u-pTL»£li;¥erLg_iAlInppnEn叩pffim.:

!

□naHnsl崩0AW3en•rn陌E亲C>H』&KapUHcq口#flA■J.AE35勘VZAFSUel-ITVHESMASEn'aqswtia

3e>;Ao-n^HJffl-

sdAldsLrn+JJJn^u^qr.g-lLL,t4n4Jl'MBquin-pp-pm

eclMn-J.g.由H用富』

HoRnaDa申plnHAd

*>qlT£>dau

■(pA&aJHp?

Lc^9-4dp1V3-a&oxpifl由

V.■■■口口uq

hhw?

二-nsvv—UA

WEs■■iupFIAHEIJJq:

;>|§匕E—sw二§,luA

GFPIJJU那Jq£lluqgj-a崩L'qXis占£气s

ELii_5GETT5-T?

LEk』jj$f*ux«imzj例iuTTiG牛H■I」3TMWJ.8:

-『

§

1

1

i

A

■"3

k

1

4,n1

E%

Vif

W4||4闵1

■hq有■-

1rf

 

Apxm-versionIL-1b=encodingIL-uff&=2V

CL-nearLayou«—I-xm-ns-andro一dH=schemas.and「o.dJapkkesfandro.CTandroid--ayouf—w-dfhll-f=lpa「enf=andro-d--ayouflhe-gh«—I-n=fj=lpa「enr-andro-dor-en莒onll

CTab-eLayoull—I-

andro-d_.dIL±d>abCDLayouM=

android--ayouf—w-dfhn=mafchlpa「enf=andro-d--ayouflhe-gh«—I-ll-w「aplconCDnr-andro-doo=apseco-umns11-4=V

ATab-eROW

andrQd_.dn-±d>ab-eROWer-

android二ayouf—widfhandroid二ayouf—heighf

n=f=_lparen『

ll-fi=lparenr-V

CEd-Texf

andrQd_.dn-±dfef=android二ayouf—w巨hll-f=lparenf=andrQd二ayouflheigh«—I-ll-fj-lparenr-

 

android:

layout_span="4"

android:

focusable="false"

android:

gravity="right"android:

inputType="text"android:

singleLine="true">

android:

id="+id/tableRow1”

android:

layout_width="fill_parent"

android:

layout_height="fill_parent

android:

id="+id/bt_7"

android:

layoutwidth="80px”

android:

layoutheight="80px”

android:

text="7"/>

android:

id="+id/bt_8"

android:

layoutwidth="80px"

android:

layoutheight="80px"

android:

text="8"/>

android:

id="+id/bt_9"

android:

layout_width="1px"

android:

layoutheight="80px"

android:

text="9"/>

android:

id="+id/bt_back"

android:

layoutwidth="80px"

android:

layoutheight="80px"

android:

text="back"/>

android:

id="+id/tableRow2"

android:

layout_width="fill_parent"

android:

layout_height="fill_parent

android:

id="+id/bt_4"

android:

layoutwidth="80px"

android:

layoutheight="80px”

android:

text="4"/>

android:

id="+id/bt_5"

android:

layoutwidth="80px”

android:

layoutheight="80px”

android:

text="5"/>

android:

id="+id/bt_6"

android:

layoutwidth="80px”

android:

layoutheight="80px"

android:

text="6"/>

android:

id="+id/bt_divide"

android:

layoutwidth="80px"

android:

layoutheight="80px"

android:

text="/"/>

android:

id="+id/tableRow3"

android:

layout_width="fill_parent"

android:

layout_height="fill_parent

android:

id="+id/bt_1"

android:

layoutwidth="80px"

android:

layoutheight="80px"

android:

text="1"/>

android:

id="+id/bt_2"

android:

layoutwidth="80px"

android:

layoutheight="80px"

android:

text="2"/>

android:

id="+id/bt_3"

android:

layoutwidth="80px"

android:

layoutheight="80px”

android:

text="3"/>

android:

id="+id/bt_multiply"

android:

layoutwidth="80px”

android:

layoutheight="80px"

android:

text="*"/>

android:

id="+id/tableRow4”

android:

layout_width="fill_parent"

android:

layout_height="fill_parent">

android:

id="+id/bt_0"

android:

layoutwidth="50px”

android:

layoutheight="80px”

android:

text="0"/>

android:

id="+id/bt_point"

android:

layoutwidth="50px”

android:

layoutheight="80px"

android:

text="."/>

android:

id="+id/bt_add"

android:

layoutwidth="50px”

android:

layoutheight="80px”

android:

text="+"/>

android:

id="+id/bt_sub”

android:

layoutwidth="50px”

android:

layoutheight="80px”

android:

text="-"/>

android:

id="+id/tableRow4”

android:

layout_width="fill_parent"

android:

layout_height="fill_parent">

android:

id="+id/bt_equal"

android:

layout_width="fill_parent"

android:

layout_height="fill_parent

android:

layout_span="3"

android:

text="="/>

android:

id="+id/bt_clear”

android:

layoutwidth="50px”

android:

layoutheight="80px”

android:

text="clear"/>

(二)、.java功能代码

packageweibo.test.ui;

importjava.util.ArrayList;

importjava.util.List;

importandroid.app.Activity;

importandroid.os.Bundle;

importandroid.view.View;

importandroid.view.View.OnClickListener;

importandroid.widget.Button;

importandroid.widget.EditText;

importandroid.widget.Toast;

importweibo.lixiaodaoaaa.ui.R;

importandroid.app.Activity;

importandroid.content.Intent;

importandroid.content.pm.PackageManager;

importandroid.os.Bundle;

importandroid.view.KeyEvent;

importandroid.view.View;

importandroid.view.View.OnClickListener;

importandroid.widget.Button;

importandroid.widget.ListView;

import.zsy.flipper.AppInfUtil;

import.zsy.flipper.AppInfo;

publicclassfffActivityextendsActivity

privateButtonbt_1;

privateButtonbt_2;

privateButtonbt_3;

privateButtonbt_4;

privateButtonbt_5;

privateButtonbt_6;

privateButtonbt_7;

privateButtonbt_8;

privateButtonbt_9;

privateButtonbt_0;

privateButtonbt_add;

privateButtonbt_sub;//减

privateButtonbt_multiply;//乘

privateButtonbt_divide;//除

privateButtonbt_back;

privateButtonbt_equal;//等于

privateButtonbt_point;//点

privateButtonbt_clear;//清除

privateEditTextet_play;//显示

privateStringstr_oper="+";//运算符

privateStringBufferstr_display=newStringBuffer();;//显示

privateStringstr_result;//结果显示

privatedoublenum1;

privatedoublenum2;

privatebooleanflag=true;//小数点个数开关控制;

privatebooleanb_sub,b_mul,b_div;//运算符开关控制

Override

publicvoidonCreate(BundlesavedInstanceState)

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_fff);

bt_0=(Button)findViewById(R.id.bt_0);

bt_1=(Button)findViewById(R.id.bt_1);

bt_2=(Button)findViewById(R.id.bt_2);

bt_3=(Button)

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 党团工作 > 入党转正申请

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1