Android开发新手学习-inote记事工具
2011-10-18 10:34
260 查看
Android开发新手学习
源码及APK下载:http://files.note.sdo.com/7pq1Y~jFlqbMLX0GA004jr (如果你有改进,不妨发我也学习下 xuchangyuhui@sohu.com)
这些天在学习Android开发,本着先上手的原则,尝试开发了一个简单的记事工具inote。开发过程收获不少,这里罗列一些作为新手学到的知识。希望对其他新手学习有益。
1. 新增、编辑和删除(仅支持文本;非彻底删除,可恢复)
2. 记事锁(一个主密码,适用所有记事)
3. 搜索(支持标题、内容)
4. 导出(导出txt文件至SD卡)
5. 分享
ActionBar、ContextMenu、ToolBar
ActionBar:3.0以上提供,3.0以下需要自行实现
(本人参考的是johannilsson-android-actionbar,https://github.com/johannilsson/android-actionbar)
Dashboard
OptionsMenu
其他控件可以在界面编辑的时候看到,种类很多,足够做一些基本应用了。
在界面设计时,可以参考http://www.androidpatterns.com/ ,提供了很多设计原则
This is androidpatterns.com, a set of interaction patterns that can help you design Android apps. An interaction pattern is a short hand summary of a design solution that has proven to work more than once. Please be inspired: use them as a guide, not
as a law.
1. 创建的Activity要添加到AndroidManifest.xml文件
2. 可以使用AlertDialog实现如下的弹出窗口(不设置Title和Icon)
3. 输入框的提示文字(没有内容时展现),设置EditText的android:hint="@string/content"属性。
4. 分享功能的实现。
5. SQLiteOpenHelper在系统目录创建数据库,如果要把数据库文件保存在SD卡,可通过SQLiteDatabase.openOrCreateDatabase自行实现。
6. SD卡的访问,需在AndroidManifest.xml添加权限。
7. 设置RadioButton组
8. 设置窗口,可以通过PreferenceScreen、PreferenceActivity实现。(inote这个版本未实现)
9. 指定EditBox只能输入数字(或其他),设置android:inputType="number"。
更多内容直接看代码吧,代码为新手学习,有什么问题可以给我回馈。(xuchangyuhui@sohu.com)
源码及APK下载:http://files.note.sdo.com/7pq1Y~jFlqbMLX0GA004jr
源码及APK下载:http://files.note.sdo.com/7pq1Y~jFlqbMLX0GA004jr (如果你有改进,不妨发我也学习下 xuchangyuhui@sohu.com)
这些天在学习Android开发,本着先上手的原则,尝试开发了一个简单的记事工具inote。开发过程收获不少,这里罗列一些作为新手学到的知识。希望对其他新手学习有益。
手机及开发环境
手机 | HTC Magic(G2) |
屏幕 | 320 × 480 |
Android版本 | 2.1-update1 |
Eclipse | GALILEO |
记事工具inote
功能
1. 新增、编辑和删除(仅支持文本;非彻底删除,可恢复)2. 记事锁(一个主密码,适用所有记事)
3. 搜索(支持标题、内容)
4. 导出(导出txt文件至SD卡)
5. 分享
截图
Android界面术语
ActionBar、ContextMenu、ToolBarActionBar:3.0以上提供,3.0以下需要自行实现
(本人参考的是johannilsson-android-actionbar,https://github.com/johannilsson/android-actionbar)
Dashboard
OptionsMenu
其他控件可以在界面编辑的时候看到,种类很多,足够做一些基本应用了。
在界面设计时,可以参考http://www.androidpatterns.com/ ,提供了很多设计原则
This is androidpatterns.com, a set of interaction patterns that can help you design Android apps. An interaction pattern is a short hand summary of a design solution that has proven to work more than once. Please be inspired: use them as a guide, not
as a law.
inote新手开发
1. 创建的Activity要添加到AndroidManifest.xml文件2. 可以使用AlertDialog实现如下的弹出窗口(不设置Title和Icon)
AlertDialog.Builder builder = new AlertDialog.Builder(this); View view = LayoutInflater.from(this).inflate(R.layout.search_pop, null); builder.setView(view); builder.show(); |
3. 输入框的提示文字(没有内容时展现),设置EditText的android:hint="@string/content"属性。
4. 分享功能的实现。
private void share() { final Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, note.title); intent.putExtra(Intent.EXTRA_TEXT, note.content); Intent.createChooser(intent, "Share"); startActivity(intent); } |
5. SQLiteOpenHelper在系统目录创建数据库,如果要把数据库文件保存在SD卡,可通过SQLiteDatabase.openOrCreateDatabase自行实现。
6. SD卡的访问,需在AndroidManifest.xml添加权限。
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> |
<RadioGroup android:id="@+id/searchRadioGroup" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <RadioButton android:layout_height="wrap_content" android:text="@string/title" android:layout_width="wrap_content" android:id="@+id/titleRadio" android:checked="true"/> <RadioButton android:layout_height="wrap_content" android:text="@string/content" android:layout_width="wrap_content" android:id="@+id/ContentRadio"/> <RadioButton android:layout_height="wrap_content" android:text="@string/all" android:layout_width="wrap_content" android:id="@+id/allRadio"/> </RadioGroup> |
9. 指定EditBox只能输入数字(或其他),设置android:inputType="number"。
更多内容直接看代码吧,代码为新手学习,有什么问题可以给我回馈。(xuchangyuhui@sohu.com)
源码及APK下载:http://files.note.sdo.com/7pq1Y~jFlqbMLX0GA004jr
相关文章推荐
- Android开发新手学习笔记(一)
- daliu_IT学习Android笔记第五篇--Android开发环境需要哪些工具?
- android学习1:android开发工具及配置
- Android开发人员必须掌握的10 个开发工具+应该深入学习的10个开源应用项目
- android学习1:android开发工具及配置
- Android开发学习之路--性能优化之常用工具
- Android开发学习之路--性能优化之常用工具
- Android开发学习笔记一选择架构工具
- Android 开发工具学习之 配置构建路径(configure build path)、更改系统库、添加引用的库(Java和Android)
- [置顶] Android新手学习思维导图,教你一步步学会Android开发
- (学习经验谈)Android开发不可或缺的十大网站及工具
- Android开发新手学习总结(六)——android开发目录结构【图文版】
- Android(java)学习笔记262:JNI之工具快速开发步骤
- Android Studio开发工具学习篇章一
- 开始Android APP开发学习旅程--Android开发编译环境和工具
- Android微信终端开发工具的新手使用教程
- android学习——使Android开发方便快捷的8个好工具
- Android学习总结之开发工具AndroidStudio的安装与配置
- Android群英传学习——第二章、Android开发工具新接触
- Android开发学习之路--性能优化之常用工具