基于android平台的手机应用软件设计与实现毕业设计(编辑修改稿)内容摘要:

VA课程设计 \n\n+姓名:吕鹏 \n\n+学号: 202003010042\n+ \n班级: 11计科信息 )。 //设置显示信息 ()。 (18)。 TextView textView1=new TextView(this)。 ( 10秒钟等待 .......)。 ()。 (20)。 ImageView imageView=new ImageView(this)。 ()。 //加载图片 (imageView)。 (name)。 (textView1)。 (tableRow1)。 (tableRow2)。 new Handler().postDelayed(new Runnable() { @Override public void run() { // TODO Autogenerated method stub Intent mianIntent=new Intent (, )。 //实现窗口之间的调用 (mianIntent)。 //开启下一个 Activity ()。 //关闭当前的 Activity } }, SPLASH_DISPLAY_LENGHT)。 } 系统主界面模块设计 主界面 XML 布局设计 主界面的 XML 布局非常的简单,只需添加几个 ImageButton 即可。 在工程目录下的 layout 文件夹下,新建 文件,在可视 化的布局界面,添加 5 个 ImageButton 按钮,并加载与功能相关的图片。 相关代码如下: RelativeLayout xmlns:android= xmlns:tools= android:layout_width=match_parent android:layout_height=match_parent ImageButton android:id=@+id/call android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignBaseline=@+id/message android:layout_alignBottom=@+id/message android:layout_marginLeft=18dp android:layout_toRightOf=@+id/message android:src=@drawable/th_phone / ImageButton android:id=@+id/message android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentLeft=true android:layout_alignParentTop=true android:layout_marginLeft=18dp android:layout_marginTop=86dp android:src=@drawable/th_message / ImageButton android:id=@+id/ android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignBaseline=@+id/call android:layout_alignBottom=@+id/call android:layout_marginLeft=26dp android:layout_toRightOf=@+id/call android:src=@drawable/tb_intent / ImageButton android:id=@+id/calculator android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@+id/message android:layout_marginTop=26dp android:layout_toLeftOf=@+id/call android:src=@drawable/th_calculator / ImageButton android:id=@+id/music android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignLeft=@+id/call android:layout_alignTop=@+id/calculator android:src=@drawable/th_music / /RelativeLayout 主界面背景图片设计 添加手机界面的背景图片,可 以提高的欣赏性。 下面简单介绍添加背景图片的简单步骤。 首先,打开 values 文件下的 ,添加如下代码: style name=Main_activity item name=android:windowBackground@drawable/mianactivity/item /style 其次,打开工程目录下的 文件,加载上面的图片。 新建一个新的 Activity 时,都需要在此文件声明,其 加载图片代码和声明窗口代码如下: style name=Main_activity item name=android:windowBackground@drawable/mianactivity/item /style 主界面功能实现设计 此部分采用 JAVA 语言实现,创建 文件,首先获取 XML文件中的各个按钮的 id,为每个按钮添加事件监听器,并且添加事件处理程序,当点击按钮时,就会创建 Intent 对象,跳 转到相应的界面。 运行效果如图 24 所示。 文件的主要代码如所示: public class MainActivity extends Activity { private ImageButton bt_message。 private ImageButton bt_tell。 private ImageButton bt_。 private ImageButton bt_calculator。 private ImageButton bt_music。 @Override protected void onCreate(Bundle savedInstanceState) { (savedInstanceState)。 setContentView()。 //加载界面 // 获取按钮的 id bt_message=(ImageButton)findViewById()。 bt_tell=(ImageButton)findViewById()。 bt_=(ImageButton)findViewById()。 bt_calculator=(ImageButton)findViewById(r)。 bt_music=(ImageButton)findViewById()。 (new OnClickListener() { @Override public void onClick(View v) { // TODO Autogenerated method stub Intent intent=new Intent(, )。 startActivity(intent)。 //跳转到下一个界面 } })。 /** * 调用发短息的界面 */ (new OnClickListener() { @Override public vo。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。