android项目之小闹钟之准备篇
来源:互联网 发布:淘宝手机降价通知 编辑:程序博客网 时间:2024/06/08 03:15
今天我向大家介绍一个android的简单的小项目,在我们的生活中,闹钟也是我们的生活小助手,在这里我们做一个小闹钟,仅限于学习与开发使用,不足之处,希望大家多多提出宝贵意见.
首先我们来准备一下我们的UI,但是我的UI非常之简陋,(没办法,本人没有艺术细胞),好啦,这都不重要,关键是我们要学到东西.
废话不多说,直接上xml:
<?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" android:background="@drawable/back"android:gravity="center_horizontal"><TimePicker android:id="@+id/time" android:layout_width="fill_parent"android:layout_height="wrap_content" /><TextView android:id="@+id/msg" android:layout_width="fill_parent"android:layout_height="wrap_content" android:text="当前没有设置闹钟" /><Button android:id="@+id/set" android:layout_width="fill_parent"android:layout_height="wrap_content" android:text="设置闹钟" /><ListView android:id="@+id/listView" android:layout_width="match_parent" android:layout_height="wrap_content"></ListView></LinearLayout>
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/work"> </LinearLayout>
2.我为大家谈一下我的架构,
我们通过一个TimePicker来设置时间,然后我们会将你设置的时间显示在ListView上,
在这里,如何的动态刷新便成为了难点,因为你不自动刷新,通过listview自己识别是非常慢的,会造成卡顿现象
我们还可以在我们的listView上长按删除我们设置的闹钟
闹钟响起后,会有声音,会弹出一个对话框,紧接着,客户会受到一个通知(Notification),
用户点击这个通知后回跳转到一个界面(这个项目只是一个简单地框架,大家可以自己往上面添加新的功能,比如备忘录等)
3.用到的知识点;
BroadReceiver
PendingIntent
Intent
activity跳转
Notification
MediaPlayer
AlarmManger
timePicker
主要的知识点就是这么多,其实大家还可以考虑一下服务(Service)
最后,界面的大致效果如下:
2 0
- android项目之小闹钟之准备篇
- Android项目之小闹钟代码
- Android之实现简单小闹钟
- android示例之闹钟
- Android之设置闹钟
- Android之手机闹钟
- Android之手机闹钟
- Android之闹钟
- android之闹钟
- Android之实现闹钟
- Android之设置闹钟
- 安卓小项目之自定义闹钟
- android 模块之桌面闹钟
- 自学Android之设置闹钟
- 项目开发之准备
- Android小项目之计算器
- cocos2d-x之闹钟篇
- Android小闹钟
- java 四舍五入
- poj 1442 Black Boxes(treap)求第k大数的treap模板
- 线段树+dfs HDU
- 转一波收藏吧
- platform_driver_probe与platform_driver_register
- android项目之小闹钟之准备篇
- 相关链接
- 基于Deep Learning的跟踪算法总结(二)
- Android状态栏微技巧,动态控制状态栏显示和隐藏
- Jdbc
- HDU 3336 Count the string(KMP+求给定字符串含前缀的数量)
- springcloud 的eureka服务注册demo
- STM32之中断与事件---中断与事件的区别
- matlab添加工具箱(2014b版)