[Android] 基础笔记

更多精彩:guozeyiblog.cn

Android 数据库


SQLite

初始化:openOrCreateDatabase(String path,null)


SQLiteOpenHelper

==>oncreate()//建表时调用
Called when the database is created for the first time. This is where the creation of tables and the initial population of the tables should happen.



==>onUpgrade()//更新时调用
Called when the database needs to be upgraded. The implementation should use this method to drop tables, add tables, or do anything else it needs to upgrade to the new schema version.


Activity  三种状态 => 运行 暂停  停止

          七个过程 =>


Activity间的交互 1 发送端 =>Intent i.putExtra("键","值")
                   接受端 =>getIntent().getStringExtra("键");
                 2 发送端 =>Bundle data= new Bundle();
                            data.putXXX("键","值")
                            Intent i.putExtra(data);

                   接收端 =>XXX a = Bundle data=getIntent().getExtras().getString();  

                   反向传值:
                   主文件: 以StartActivityForResult(Intent)打开 重写回调函数onactivityResult()

                   附文件:setResult(int,Intent);

Server
启动 startServer(Intent(MainActivity.this,server.class));
终止 stopServer(Intent)

server.java 继承自server 需要重写Oncreate() ondestory();

bindServer()
unbindServer()

利用startServer开启的服务在Activity终止后服务不会停
bindserver绑定的服务会终止
                    
广播:sendBoradcast()  registerReceiver() unregisterReceiver()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值