- The girl ： Shanghai station is here ？
The boy ： The one of ？ To the world ~
- The girl ：Intent Core technology and data storage technology ？
The boy ： Yes , Let's talk about this today ~
Intent It's used to communicate between components ,Intent The translation of “ Intention ” It means , It's the core object of transmitting data , It can open a activity, You can also send broadcast messages and turn on Service service , For them, it's through intent To call each other and coordinate their work .
Turn on activity：
adopt Intent Object delivery startActivity() and startActivityForResult() And onActivityResult() Method on activity.
Turn on Service：
startService() Method , To start a Service. And through bindService() Method to establish a link between the calling component and the service .
Pass on Broadcast：
The transmission of radio sendBroadcast(),sendOrderedBroadcast() or sendStickyBroadcast() Method .
Intent Object properties
Data storage technology
stay Android There are three ways of storage in ：
File File store
SQLite Database storage
ContentProvider Implement data sharing
SharedPregerences It's a lightweight way to store data , It's usually used to store some simple data , Such as the configuration information of the application . Its essence is based on key-value Key value pairs are stored in , The storage type is int,long,String,float and boolean.
data SharedPreferences File storage directory ：/data/data//shared_prefs/. Realization SharedPreferences Storage steps ： call getSharedPreferences() Method , There are two parameters in getting this method ：
getSharedPreferences(String name, int mode)
Personal data interface module and SQLite Use of database
Learning goals ：
master SQLite Use of database , It can save user's information with database ;
Learn to use personal data well , And the modification of personal data ;
Personal data includes user name , nickname , Gender , Signature ,QQ Number or personal social account records, etc .
Data class inheritance extends SQLiteOpenHelper
Android Set and change the password , Set up a secret guard , And find the code ：
Master the development of password modification function , And realize the modification of user password ;
Master the function development of setting security , Through security, we can retrieve the user's password , To ensure the safety of users .
The specific layout will not be shown , Only the realization of some function modules is explained .
For a project , It will be used many times in the project sharedPreferences Shared parameters , To store the user's login status or clear the login status ,“ I ” The interface also requires the method of reading user's name , So let's just throw all three methods to AnalysisUtils Inside .
stay Utils Create a new one in the package Java class , be known as AnalysisUtils.
File File store
Java A set of IO Flow system ,Android Write and read files in the same way , Provide FileOutputStream Class openFileOutput And to provide FileInputStream Class openFileInput() Method . This is internal storage , So external storage is ？ External storage it uses Environment Class getExternalStorageDirectory() Method to read and write data .
Local data storage
Here's an introduction to Shared Preferences, Mainly with key-value stored .( Support boolean,int,float,long,string);Internal Storage High data security , Space is limited ;External Storage And Internal Storage contrary .
SharedPreferences It's a light data storage , be based on xml Key value pair storage of , Store some simple information .
SharedPreferences Only data can be obtained, not stored and modified , But it can pass. Editor Implement storage modification .
obtain SharedPreferences object
Editor Of putXXX Methods
SQLite It's a lightweight system database , It's essentially binary , The so-called relational type , It's a relationship model , Here is the two-dimensional table structure pattern .
In a relational database , Columns in a two-dimensional table are properties , Called fields ; Behavior record , As an object ; Properties of the （ Field ） The range of values is called the field .
Here we're going to learn about databases , Such as DDL,DML etc. , Data definition language and data operation language , Create forms and add, delete, modify and query .
stay SQLite We need to understand SQLiteOpenHelper and SQLiteDatabase, And learn to use . And two ways rawQuery()： For queries and execSQL()： Used for adding, deleting, modifying and querying .
stay Android Provides SQLiteDatabase Create objects , The use does not need to write the database syntax encapsulation good API class . Use them separately query(),insert(),delete(),update() Express .
Here we are ok 了 , Next, I will continue to learn from higher places , Let's explore it slowly ~
Take a walk with the little gift or give the thumbs-up
- Spring Boot Unveiling and actual combat （ Two ） Data storage - Declarative transaction management
List of articles 1. Declarative transactions 2. Spring Boot Default integration transaction 3. Practical drill 4. Source code 3.1. Entity object 3.2. DAO relevant 3.3. Service relevant 3.4. test , test this paper ...
- Spring Boot Unveiling and actual combat （ Two ） Data storage - ElasticSearch
List of articles 1. Version notes 2. Environment depends on 3. data source 3.1. Scheme 1 Use Spring Boot The default configuration 3.2. Option two Manually create 4. Business operations 5. summary 4.1. Entity object 4.2. D ...
- Spring Boot Unveiling and actual combat （ Two ） Data storage - MongoDB
List of articles 1. Environment depends on 2. data source 2.1. Scheme 1 Use Spring Boot The default configuration 2.2. Option two Manually create 3. Use mongoTemplate operation 4. summary 3.1. Entity object 3 ...
- Spring Boot Unveiling and actual combat （ Two ） Data storage - Redis
List of articles 1. Environment depends on 2. data source 2.1. Scheme 1 Use Spring Boot The default configuration 2.2. Option two Manually create 3. Use redisTemplate operation 4. summary 3.1. Tool class ...
- Spring Boot Unveiling and actual combat （ Two ） Data storage - JPA Integrate
List of articles 1. Environment depends on 2. data source 3. Script initialization 4. JPA Integration plan 1 By inheritance JpaRepository Interface 4.1. Entity object 4.2. DAO relevant 4.3. Service relevant ...
- Spring Boot Unveiling and actual combat （ Two ） Data storage - MyBatis Integrate
List of articles 1. Environment depends on 2. data source 3. Script initialization 2.1. Scheme 1 Use Spring Boot The default configuration 2.2. Option two Manually create 4. MyBatis Integrate 5. summary 4.1. Scheme 1 adopt ...
- Spring Boot Unveiling and actual combat （ Two ） Data storage - Data access and multi data source configuration
List of articles 1. Environment depends on 2. data source 3. unit testing 4. Source code In some cases , We may need to rely on and access multiple data sources in one application , For example, for MySQL The sub database scene of . therefore , We need to configure multiple data sources . ...
- Spring Boot Unveiling and actual combat （ Two ） Data storage - MySQL
List of articles 1. Environment depends on 2. data source 3. Script initialization 2.1. Scheme 1 Use Spring Boot The default configuration 2.2. Option two Manually create 4. Use JdbcTemplate operation 5. summary 4.1. ...
- Spring Boot Dry series ：（ 8、 ... and ） Data storage -SQL Relational database JdbcTemplate Use
Spring Boot Dry series :( 8、 ... and ) Data storage -SQL Relational database JdbcTemplate Use original 2017-04-13 toot toot MD DUYE java Supernatural school Preface The previous chapters cover some of the basics , But it's all quiet ...
- Android-- The multithreading Handler
Preface Android The message passing mechanism of is another form “ Event handling ”, The main purpose of this mechanism is to solve Android Multithreading in applications , stay Android You are not allowed to Activity The newly started thread accesses the Activity Inside U ...
- NY 269 VF
subject seek 1—1000000000 Number between , The sum of its numbers is s. dp[i][j] Express i digit , The sum of its numbers is j Total number of . Let's assume that number two i Position as k, Before i - 1 The sum of bits should be j - k ...
- jQuery EasyUI datagrid How to achieve local paging
- About linux Memory usage
From the perspective of operating system : System physical memory 7.5g It has been used at present 7.4g( contain 14m Of buffer and 1.6g Of cache) Remaining available memory 128m From an application perspective : It has been used at present 5.8g Remaining available memory 1.7g( because ...
- C Language —— Selection sort
--- Resume content start --- Algorithmic thought : n The direct selection and sorting of records can go through n-1 The direct selection and sorting of passes get ordered results : ① The initial state : The disorder area is R[1..n], The ordered area is empty . ② The first 1 Trip to sort In the disordered zone R[1..n] Selected from ...
- kubernetes Installation notes
One . Installation environment Alibaba cloud :centos 7.3 master node : Extranet IP(18.104.22.168). Intranet IP(172.16.223.200) node node : Extranet IP(22.214.171.124). ...
- Cannot load php5apache2_4.dll into server
To configure PHP When developing the environment , When it comes to Apache Of httpd.conf File configuration loading PHP The following error has occurred while using the module httpd: Syntax error on line 185 of D:/wamp/Ap ...
- use curl Simulated entrainment cookie Of http request
1. First, log in to the website you want to log in to , launch http request , obtain cookie 2. Get the real path of the request , Now the front end is like vue They all map back-end paths with custom paths , For example vue One of the requests in is caojiangjiang/t ...
- Java Basic knowledge of _ Bi Xiangdong _Java Basic video tutorial notes (5-10 object-oriented )
06 God -05- object-oriented ( Help document making javadoc):java Document generation command :javadoc -d filepatn demo.java -author -version( Optional ) By default, a class has a ...
- mktime and TZ
mktime Bottom use __tz_convert, It may be slower http://blog.csdn.net/aquester/article/details/54669264 http://blog.csd ...