0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
电子发烧友
开通电子发烧友VIP会员 尊享10大特权
海量资料免费下载
精品直播免费看
优质内容免费畅学
课程9折专享价
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

鴻蒙語言基礎(chǔ)類庫:ohos.data.storage 輕量級存儲(chǔ)

jf_46214456 ? 來源:jf_46214456 ? 作者:jf_46214456 ? 2024-07-15 18:21 ? 次閱讀

輕量級存儲(chǔ)

輕量級存儲(chǔ)為應(yīng)用提供key-value鍵值型的文件數(shù)據(jù)處理能力,支持應(yīng)用對數(shù)據(jù)進(jìn)行輕量級存儲(chǔ)及查詢。數(shù)據(jù)存儲(chǔ)形式為鍵值對,鍵的類型為字符串型,值的存儲(chǔ)數(shù)據(jù)類型包括數(shù)字型、字符型、布爾型。

說明:
開發(fā)前請熟悉鴻蒙開發(fā)指導(dǎo)文檔 :[gitee.com/li-shizhen-skin/harmony-os/blob/master/README.md]

  • 本模塊首批接口從API version 6開始支持。后續(xù)版本的新增接口,采用上角標(biāo)單獨(dú)標(biāo)記接口的起始版本。
  • 從API Version 9開始,該接口不再維護(hù),推薦使用新接口[@ohos.data.preferences]。

導(dǎo)入模塊

import data_storage from '@ohos.data.storage';

常量

系統(tǒng)能力: 以下各項(xiàng)對應(yīng)的系統(tǒng)能力均為SystemCapability.DistributedDataManager.Preferences.Core

名稱參數(shù)類型可讀可寫說明
MAX_KEY_LENGTHstringkey的最大長度限制,需小于80字節(jié)。
MAX_VALUE_LENGTHstringvalue的最大長度限制,需小于8192字節(jié)。

data_storage.getStorageSync

getStorageSync(path: string): Storage

讀取指定文件,將數(shù)據(jù)加載到Storage實(shí)例,用于數(shù)據(jù)操作。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。

返回值:

類型說明
[Storage]獲取到要操作的Storage實(shí)例,用于進(jìn)行數(shù)據(jù)存儲(chǔ)操作。

示例:

import data_storage from '@ohos.data.storage'

let path = '/data/storage/el2/database'
let storage = data_storage.getStorageSync(path + '/mystore')
storage.putSync('startup', 'auto')
storage.flushSync()

data_storage.getStorage

getStorage(path: string, callback: AsyncCallback): void

讀取指定文件,將數(shù)據(jù)加載到Storage實(shí)例,用于數(shù)據(jù)操作,使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。
callbackAsyncCallback<[Storage]>回調(diào)函數(shù)。

示例:

import data_storage from '@ohos.data.storage'

let path = '/data/storage/el2/database'
data_storage.getStorage(path + '/mystore', function (err, storage) {
    if (err) {
        console.info("Get the storage failed, path: " + path + '/mystore')
        return;
    }
    storage.putSync('startup', 'auto')
    storage.flushSync()
})

data_storage.getStorage

getStorage(path: string): Promise

讀取指定文件,將數(shù)據(jù)加載到Storage實(shí)例,用于數(shù)據(jù)操作,使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。

返回值:

類型說明
Promise<[Storage]>Promise實(shí)例,用于異步獲取結(jié)果。

示例:

import data_storage from '@ohos.data.storage'

let path = '/data/storage/el2/database'

let getPromise = data_storage.getStorage(path + '/mystore')
getPromise.then((storage) = > {
    storage.putSync('startup', 'auto')
    storage.flushSync()
}).catch((err) = > {
    console.info("Get the storage failed, path: " + path + '/mystore')
})

data_storage.deleteStorageSync

deleteStorageSync(path: string): void

從內(nèi)存中移除指定文件對應(yīng)的Storage單實(shí)例,并刪除指定文件及其備份文件、損壞文件。刪除指定文件時(shí),應(yīng)用不允許再使用該實(shí)例進(jìn)行數(shù)據(jù)操作,否則會(huì)出現(xiàn)數(shù)據(jù)一致性問題。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。

示例:

let path = '/data/storage/el2/database'
data_storage.deleteStorageSync(path + '/mystore')

data_storage.deleteStorage

deleteStorage(path: string, callback: AsyncCallback): void

從內(nèi)存中移除指定文件對應(yīng)的Storage單實(shí)例,并刪除指定文件及其備份文件、損壞文件。刪除指定文件時(shí),應(yīng)用不允許再使用該實(shí)例進(jìn)行數(shù)據(jù)操作,否則會(huì)出現(xiàn)數(shù)據(jù)一致性問題,使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。
callbackAsyncCallback回調(diào)函數(shù)。

示例:

let path = '/data/storage/el2/database'
data_storage.deleteStorage(path + '/mystore', function (err) {
    if (err) {
        console.info("Deleted failed with err: " + err)
        return
    }
    console.info("Deleted successfully.")
})

data_storage.deleteStorage

deleteStorage(path: string): Promise

從內(nèi)存中移除指定文件對應(yīng)的Storage單實(shí)例,并刪除指定文件及其備份文件、損壞文件。刪除指定文件時(shí),應(yīng)用不允許再使用該實(shí)例進(jìn)行數(shù)據(jù)操作,否則會(huì)出現(xiàn)數(shù)據(jù)一致性問題,使用promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。

返回值:

類型說明
PromisePromise實(shí)例,用于異步獲取結(jié)果。

示例:

let path = '/data/storage/el2/database'
let promisedelSt = data_storage.deleteStorage(path + '/mystore')
promisedelSt.then(() = > {
    console.info("Deleted successfully.")
}).catch((err) = > {
    console.info("Deleted failed with err: " + err)
})

data_storage.removeStorageFromCacheSync

removeStorageFromCacheSync(path: string): void

從內(nèi)存中移除指定文件對應(yīng)的Storage單實(shí)例。移除Storage單實(shí)例時(shí),應(yīng)用不允許再使用該實(shí)例進(jìn)行數(shù)據(jù)操作,否則會(huì)出現(xiàn)數(shù)據(jù)一致性問題。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。

示例:

let path = '/data/storage/el2/database'
data_storage.removeStorageFromCacheSync(path + '/mystore')

data_storage.removeStorageFromCache

removeStorageFromCache(path: string, callback: AsyncCallback): void

從內(nèi)存中移除指定文件對應(yīng)的Storage單實(shí)例。移除Storage單實(shí)例時(shí),應(yīng)用不允許再使用該實(shí)例進(jìn)行數(shù)據(jù)操作,否則會(huì)出現(xiàn)數(shù)據(jù)一致性問題。使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。
callbackAsyncCallback回調(diào)函數(shù)。

示例:

let path = '/data/storage/el2/database'
data_storage.removeStorageFromCache(path + '/mystore', function (err) {
    if (err) {
        console.info("Removed storage from cache failed with err: " + err)
        return
    }
    console.info("Removed storage from cache successfully.")
})

data_storage.removeStorageFromCache

removeStorageFromCache(path: string): Promise

從內(nèi)存中移除指定文件對應(yīng)的Storage單實(shí)例。移除Storage單實(shí)例時(shí),應(yīng)用不允許再使用該實(shí)例進(jìn)行數(shù)據(jù)操作,否則會(huì)出現(xiàn)數(shù)據(jù)一致性問題。使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
pathstring應(yīng)用程序內(nèi)部數(shù)據(jù)存儲(chǔ)路徑。

返回值:

類型說明
PromisePromise實(shí)例,用于異步獲取結(jié)果。

示例:

let path = '/data/storage/el2/database'
let promiserevSt = data_storage.removeStorageFromCache(path + '/mystore')
promiserevSt.then(() = > {
    console.info("Removed storage from cache successfully.")
}).catch((err) = > {
    console.info("Removed storage from cache failed with err: " + err)
})

Storage

提供獲取和修改存儲(chǔ)數(shù)據(jù)的接口。

getSync

getSync(key: string, defValue: ValueType): ValueType

獲取鍵對應(yīng)的值,如果值為null或者非默認(rèn)值類型,返回默認(rèn)數(shù)據(jù)。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱,不能為空。
defValue[ValueType]給定key的存儲(chǔ)不存在,則要返回的默認(rèn)值。支持number、string、boolean。

返回值:

類型說明
ValueType鍵對應(yīng)的值,如果值為null或者非默認(rèn)值類型,返回默認(rèn)數(shù)據(jù)。

示例:

let value = storage.getSync('startup', 'default')
console.info("The value of startup is " + value)

get

get(key: string, defValue: ValueType, callback: AsyncCallback): void

獲取鍵對應(yīng)的值,如果值為null或者非默認(rèn)值類型,返回默認(rèn)數(shù)據(jù)。使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱,不能為空。
defValue[ValueType]默認(rèn)返回值。支持number、string、boolean。
callbackAsyncCallback回調(diào)函數(shù)。

示例:

storage.get('startup', 'default', function(err, value) {
    if (err) {
        console.info("Get the value of startup failed with err: " + err)
        return
    }
    console.info("The value of startup is " + value)
})

get

get(key: string, defValue: ValueType): Promise

獲取鍵對應(yīng)的值,如果值為null或者非默認(rèn)值類型,返默認(rèn)數(shù)據(jù)。使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱,不能為空。
defValue[ValueType]默認(rèn)返回值。支持number、string、boolean。

返回值:

類型說明
PromisePromise實(shí)例,用于異步獲取結(jié)果。

示例:

let promiseget = storage.get('startup', 'default')
promiseget.then((value) = > {
    console.info("The value of startup is " + value)
}).catch((err) = > {
    console.info("Get the value of startup failed with err: " + err)
})

putSync

putSync(key: string, value: ValueType): void

首先獲取指定文件對應(yīng)的Storage實(shí)例,然后借助Storage API將數(shù)據(jù)寫入Storage實(shí)例,通過flush或者flushSync將Storage實(shí)例持久化。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要修改的存儲(chǔ)的key,不能為空。
value[ValueType]存儲(chǔ)的新值。支持number、string、boolean。

示例:

storage.putSync('startup', 'auto')

put

put(key: string, value: ValueType, callback: AsyncCallback): void

首先獲取指定文件對應(yīng)的Storage實(shí)例,然后借助Storage API將數(shù)據(jù)寫入Storage實(shí)例,通過flush或者flushSync將Storage實(shí)例持久化。使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要修改的存儲(chǔ)的key,不能為空。
value[ValueType]存儲(chǔ)的新值。支持number、string、boolean。
callbackAsyncCallback回調(diào)函數(shù)。

示例:

storage.put('startup', 'auto', function (err) {
    if (err) {
        console.info("Put the value of startup failed with err: " + err)
        return
    }
    console.info("Put the value of startup successfully.")
})

put

put(key: string, value: ValueType): Promise

首先獲取指定文件對應(yīng)的Storage實(shí)例,然后借助Storage API將數(shù)據(jù)寫入Storage實(shí)例,通過flush或者flushSync將Storage實(shí)例持久化。使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要修改的存儲(chǔ)的key,不能為空。
value[ValueType]存儲(chǔ)的新值。支持number、string、boolean。

返回值:

類型說明
PromisePromise實(shí)例,用于異步處理。

示例:

let promiseput = storage.put('startup', 'auto')
promiseput.then(() = > {
    console.info("Put the value of startup successfully.")
}).catch((err) = > {
    console.info("Put the value of startup failed with err: " + err)
})

hasSync

hasSync(key: string): boolean

檢查存儲(chǔ)對象是否包含名為給定key的存儲(chǔ)。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱,不能為空。

返回值:

類型說明
booleantrue 表示存在,false表示不存在。

示例:

let isExist = storage.hasSync('startup')
if (isExist) {
    console.info("The key of startup is contained.")
}

has

has(key: string, callback: AsyncCallback): boolean

檢查存儲(chǔ)對象是否包含名為給定key的存儲(chǔ)。使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱,不能為空。
callbackAsyncCallback回調(diào)函數(shù)。

返回值:

類型說明
booleantrue表示存在,false表示不存在。

示例:

storage.has('startup', function (err, isExist) {
    if (err) {
        console.info("Check the key of startup failed with err: " + err)
        return
    }
    if (isExist) {
        console.info("The key of startup is contained.")
    }
})

has

has(key: string): Promise

檢查存儲(chǔ)對象是否包含名為給定key的存儲(chǔ)。使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱,不能為空。

返回值:

類型說明
PromisePromise實(shí)例,用于異步處理。

示例:

let promisehas = storage.has('startup')
promisehas.then((isExist) = > {
    if (isExist) {
        console.info("The key of startup is contained.")
    }
}).catch((err) = > {
    console.info("Check the key of startup failed with err: " + err)
})

deleteSync

deleteSync(key: string): void

從存儲(chǔ)對象中刪除名為給定key的存儲(chǔ)。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱。它不能為空。

示例:

storage.deleteSync('startup')

delete

delete(key: string, callback: AsyncCallback): void

從存儲(chǔ)對象中刪除名為給定key的存儲(chǔ)。使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱,不能為空。
callbackAsyncCallback回調(diào)函數(shù)。

示例:

storage.delete('startup', function (err) {
    if (err) {
        console.info("Delete startup key failed with err: " + err)
        return
    }
    console.info("Deleted startup key successfully.")
})

delete

delete(key: string): Promise

從存儲(chǔ)對象刪除名為給定key的存儲(chǔ)。使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
keystring要獲取的存儲(chǔ)key名稱。

返回值:

類型說明
PromisePromise實(shí)例,用于異步處理。

示例:

let promisedel = storage.delete('startup')
promisedel.then(() = > {
    console.info("Deleted startup key successfully.")
}).catch((err) = > {
    console.info("Delete startup key failed with err: " + err)
})

flushSync

flushSync(): void

將當(dāng)前storage對象中的修改保存到當(dāng)前的storage,并同步存儲(chǔ)到文件中。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

示例:

storage.flushSync()

flush

flush(callback: AsyncCallback): void

將當(dāng)前storage對象中的修改保存到當(dāng)前的storage,并異步存儲(chǔ)到文件中。使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
callbackAsyncCallback回調(diào)函數(shù)。

示例:

storage.flush(function (err) {
    if (err) {
        console.info("Flush to file failed with err: " + err)
        return
    }
    console.info("Flushed to file successfully.")
})

flush

flush(): Promise

將當(dāng)前storage對象中的修改保存到當(dāng)前的storage,并異步存儲(chǔ)到文件中。使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

返回值:

類型說明
PromisePromise實(shí)例,用于異步處理。

示例:

let promiseflush = storage.flush()
promiseflush.then(() = > {
    console.info("Flushed to file successfully.")
}).catch((err) = > {
    console.info("Flush to file failed with err: " + err)
})

clearSync

clearSync(): void

清除此存儲(chǔ)對象中的所有存儲(chǔ)。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

示例:

storage.clearSync()

clear

clear(callback: AsyncCallback): void

清除此存儲(chǔ)對象中的所有存儲(chǔ)。使用callback方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型必填說明
callbackAsyncCallback回調(diào)函數(shù)。

示例:

storage.clear(function (err) {
    if (err) {
        console.info("Clear to file failed with err: " + err)
        return
    }
    console.info("Cleared to file successfully.")
})

clear

clear(): Promise

清除此存儲(chǔ)對象中的所有存儲(chǔ)。使用Promise方式返回結(jié)果,此方法為異步方法。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

返回值:

類型說明
PromisePromise實(shí)例,用于異步處理。

示例:

let promiseclear = storage.clear()
promiseclear.then(() = > {
    console.info("Cleared to file successfully.")
}).catch((err) = > {
    console.info("Clear to file failed with err: " + err)
})

on('change')

on(type: 'change', callback: Callback): void

訂閱數(shù)據(jù)變更者類需要實(shí)現(xiàn)StorageObserver接口,訂閱的key的值發(fā)生變更后,在執(zhí)行flush/flushSync方法后,callback方法會(huì)被回調(diào)。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型說明
typestring事件類型,固定值'change',表示數(shù)據(jù)變更。
callbackCallback<[StorageObserver]>回調(diào)對象實(shí)例。

示例:

var observer = function (key) {
    console.info("The key of " + key + " changed.")
}
storage.on('change', observer)
storage.putSync('startup', 'auto')
storage.flushSync()  // observer will be called.

off('change')

off(type: 'change', callback: Callback): void

當(dāng)不再進(jìn)行訂閱數(shù)據(jù)變更時(shí),使用此接口取消訂閱。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

參數(shù):

參數(shù)名類型說明
typestring事件類型,固定值'change',表示數(shù)據(jù)變更。
callbackCallback<[StorageObserver]>需要取消的回調(diào)對象實(shí)例。

示例:

var observer = function (key) {
    console.info("The key of " + key + " changed.")
}
storage.off('change', observer)

StorageObserver

系統(tǒng)能力: 以下各項(xiàng)對應(yīng)的系統(tǒng)能力均為SystemCapability.DistributedDataManager.Preferences.Core

名稱參數(shù)類型必填說明HarmonyOSOpenHarmony鴻蒙文檔籽料:mau123789是v直接拿
keystring變更的數(shù)據(jù)內(nèi)容。

ValueType

用于表示允許的數(shù)據(jù)字段類型。

系統(tǒng)能力: SystemCapability.DistributedDataManager.Preferences.Core

名稱說明
number表示值類型為數(shù)字。
string表示值類型為字符。
boolean表示值類型為布爾值。

審核編輯 黃宇

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報(bào)投訴
  • 存儲(chǔ)
    +關(guān)注

    關(guān)注

    13

    文章

    4478

    瀏覽量

    86965
  • 鴻蒙
    +關(guān)注

    關(guān)注

    57

    文章

    2474

    瀏覽量

    43685
收藏 0人收藏

    評論

    相關(guān)推薦
    熱點(diǎn)推薦

    輕量級的ui框架如何去制作

    原創(chuàng)分享:自制輕量級單片機(jī)UI框架框架元素用戶接口代碼開源平時(shí)常看csdn,但是從來沒有自己寫過。正好這幾天需要用單片機(jī)做一個(gè)簡易的ui界面,于是自己寫了一個(gè)輕量級的ui框架。發(fā)個(gè)csdn分享給大家
    發(fā)表于 07-14 07:39

    木棉花:輕量級偏好數(shù)據(jù)學(xué)習(xí)筆記--沈泳鑫

    本帖最后由 jf_62992433 于 2021-9-5 10:33 編輯 前言 為了更好地熟練掌握鴻蒙手機(jī)應(yīng)用開發(fā),深圳大學(xué)木棉花今天就帶來輕量級偏好數(shù)據(jù)的學(xué)習(xí)筆記,供大家更好的學(xué)習(xí)
    發(fā)表于 09-04 14:30

    基于輕量級偏好數(shù)據(jù),實(shí)現(xiàn)存儲(chǔ)在本地應(yīng)用數(shù)據(jù)的訪問及操作

    1. 介紹輕量級偏好數(shù)據(jù)輕量級存儲(chǔ),主要用于保存應(yīng)用的一些常用配置。它是使用鍵值對的形式來存儲(chǔ)數(shù)據(jù)的,保存數(shù)據(jù)時(shí),需要給這條數(shù)據(jù)提供一個(gè)
    發(fā)表于 10-09 14:43

    一種超輕量級的flashKV數(shù)據(jù)存儲(chǔ)方案分享

    tinyFlash一種超輕量級的flash KV數(shù)據(jù)存儲(chǔ)方案Github 地址:https://github.com/ospanic/tinyFlash設(shè)計(jì)原理本方案采用兩個(gè)扇區(qū)輪流使用的方法存儲(chǔ)
    發(fā)表于 12-20 06:08

    深度剖析OpenHarmony輕量級數(shù)據(jù)存儲(chǔ)

    一、輕量級數(shù)據(jù)存儲(chǔ)的版本openharmony的輕量級數(shù)據(jù)存儲(chǔ)現(xiàn)有兩個(gè)版本,但是harmonyOS的官網(wǎng)上只有一個(gè)輕量級數(shù)據(jù)
    發(fā)表于 03-31 14:45

    HarmonyOS應(yīng)用API-輕量級數(shù)據(jù)庫開發(fā)

    調(diào)用相關(guān)的接口import dataStorage from '@ohos.data.storage';import featureAbility from
    發(fā)表于 10-15 15:44

    用于openharmony的輕量級、簡單的結(jié)構(gòu)化NoSQL數(shù)據(jù)

    用于openharmony的輕量級、簡單的結(jié)構(gòu)化 NoSQL 數(shù)據(jù)。 下載 依賴項(xiàng){ 實(shí)現(xiàn)“io.openharmony.tpc.thirdlib:ohos-NoSql:1.0.0” } 將數(shù)據(jù)
    發(fā)表于 04-13 10:05 ?2次下載

    一款適合初學(xué)者超輕量級C語言網(wǎng)絡(luò)—Dyad

    Dyad 是一個(gè)基于 C 語言的異步網(wǎng)絡(luò),旨在輕量級、可移植和易用。它既可用于創(chuàng)建小型獨(dú)立服務(wù)器,也可用于為現(xiàn)有的項(xiàng)目提供網(wǎng)絡(luò)支持。
    的頭像 發(fā)表于 10-10 14:33 ?2354次閱讀
    一款適合初學(xué)者超<b class='flag-5'>輕量級</b>C<b class='flag-5'>語言</b>網(wǎng)絡(luò)<b class='flag-5'>庫</b>—Dyad

    TinyDB輕量級數(shù)據(jù)庫有哪些特點(diǎn)呢

    TinyDB 是一個(gè)純 Python 編寫的輕量級數(shù)據(jù)庫,一共只有1800行代碼,沒有外部依賴項(xiàng)。
    的頭像 發(fā)表于 10-28 14:07 ?1752次閱讀

    PSoC NeoPixel Easy輕量級

    電子發(fā)燒友網(wǎng)站提供《PSoC NeoPixel Easy輕量級.zip》資料免費(fèi)下載
    發(fā)表于 11-17 09:48 ?0次下載
    PSoC NeoPixel Easy<b class='flag-5'>輕量級</b><b class='flag-5'>庫</b>

    LSI存儲(chǔ)機(jī)構(gòu)輕量級監(jiān)視器用戶指南

    電子發(fā)燒友網(wǎng)站提供《LSI存儲(chǔ)機(jī)構(gòu)輕量級監(jiān)視器用戶指南.pdf》資料免費(fèi)下載
    發(fā)表于 08-24 14:25 ?0次下載
    LSI<b class='flag-5'>存儲(chǔ)</b>機(jī)構(gòu)<b class='flag-5'>輕量級</b>監(jiān)視器用戶指南

    輕量級數(shù)據(jù)庫有哪些

    輕量級數(shù)據(jù)庫有哪些 隨著互聯(lián)網(wǎng)和物聯(lián)網(wǎng)等新一代信息技術(shù)的廣泛應(yīng)用,數(shù)據(jù)系統(tǒng)也變得越來越重要。人們對于數(shù)據(jù)數(shù)據(jù)的可靠性、安全性和性能等要求也越來越高。與傳統(tǒng)的關(guān)系型數(shù)據(jù)
    的頭像 發(fā)表于 08-28 16:41 ?6307次閱讀

    輕量級數(shù)據(jù)庫有哪些類型

    關(guān)系型數(shù)據(jù)是目前最常見的數(shù)據(jù)類型,它將數(shù)據(jù)以表的形式存儲(chǔ),并使用SQL語言進(jìn)行數(shù)據(jù)的管理和查詢。雖然關(guān)系型數(shù)據(jù)通常較為龐大和復(fù)雜,但
    的頭像 發(fā)表于 12-20 11:29 ?1600次閱讀

    鴻蒙OpenHarmony大合集:【語言基礎(chǔ)

    本示例集合語言基礎(chǔ)的各個(gè)子模塊,展示了各個(gè)模塊的基礎(chǔ)功能
    的頭像 發(fā)表于 04-29 16:38 ?800次閱讀
    <b class='flag-5'>鴻蒙</b>OpenHarmony大合集:【<b class='flag-5'>語言</b>基礎(chǔ)<b class='flag-5'>類</b><b class='flag-5'>庫</b>】

    EEPROM輕量級的簡易文件的數(shù)據(jù)讀寫:EEPROMFS

    小。 這里就給大家分享一款EEPROM輕量級的簡易文件的數(shù)據(jù)讀寫:EEPROMFS 1 關(guān)于EEPROMFS EEPROMFS,基于EEPROM的簡易文件的數(shù)據(jù)讀寫
    的頭像 發(fā)表于 11-15 16:31 ?951次閱讀
    EEPROM<b class='flag-5'>輕量級</b>的簡易<b class='flag-5'>類</b>文件的數(shù)據(jù)讀寫<b class='flag-5'>庫</b>:EEPROMFS

    電子發(fā)燒友

    中國電子工程師最喜歡的網(wǎng)站

    • 2931785位工程師會(huì)員交流學(xué)習(xí)
    • 獲取您個(gè)性化的科技前沿技術(shù)信息
    • 參加活動(dòng)獲取豐厚的禮品