udacity android 学习笔记: lesson 4 part a

udacity android 学习笔记: lesson 4 part a


作者:干货店打杂的 /titer1 /Archimedes
出处:https://code.csdn.net/titer1
联系:1307316一九六八
声明:本文采用以下协议进行授权: 自由转载-非商用-非衍生-保持署名|Creative Commons BY-NC-ND 3.0 ,转载请注明作者及出处。
tips:https://code.csdn.net/titer1/pat_aha/blob/master/Markdown/android/


sql lesson

4a-15课开始,之前主要是基础 activity life cycle

技术分享
sql表长得像这样
技术分享

  • select * from weather where data = blalla
  • select * from weather order by max DESC LIMIT 1 //have a try

  • more sql operation

    • delete rows
    • update rows
    • insert rows
    • add columns
  • more sql API in android
    得到类似urlbuilder的简单使用效果

    技术分享

  • more about data stroage

overview arch 反复

lesson 4a 18

技术分享

intro to weather contract

技术分享

又见solution weather table colums solutions

技术分享

inner join 2 tables

技术分享

休息时间

don 请新学者 深入学习下 foreign key 和joins的要点(in lesson 4a-23 )
技术分享

our weather contact

技术分享

实践..代码时间 weatherContract.java

技术分享
don详细展示了key/foreign key

define constants in contract

技术分享

locationEntry

技术分享

第二章节 sqllite open helper and sunshine database 反复

下一站 地图 开始移动啦

技术分享

weatherDbHelper 代码

技术分享
- 数据库名字
技术分享
- 数据库的相关语句
- create table
- 指定外键

数据库测试

技术分享
结果是没有通过。
大致原因是 只创建了 weather.db,还没有创建 locatin.db

next to modify

技术分享

下面就是来弥补剩下的一个 db了,

create sunshine location DB solution

技术分享

sqlite open helper on Upgrade

数据库升级啦
技术分享
- 必须手动改变数据库版本号?
- 数据库变化
- 行变化
- 列变化
- 整体结构变化

  • 什么时候执行?

第三章节 readwrite from a database

3.1 overview

技术分享

3.2 plan

技术分享

技术分享

技术分享

3.3 难点 query

技术分享
技术分享

技术分享

3.4 代码实践 反复

第三章节的代码 集中于此

关键就是执行之前的checklist,写出 testLocationTable.
技术分享

同样的原理用于测试 weathertable.ok ,let go

end

用了2小时,谢谢don的陪伴
- data storage diagram overview
- activity lifecycle ,旋转屏幕时的变化(pause..restart?)
- database test

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。