fix: 完善程序启动提示
This commit is contained in:
parent
5a5242db17
commit
a567923ebc
@ -26,3 +26,6 @@ export const FileHelpTag = '[FileHelp]';
|
|||||||
|
|
||||||
//request tag
|
//request tag
|
||||||
export const RequestTag = '[Request]';
|
export const RequestTag = '[Request]';
|
||||||
|
|
||||||
|
//entry tag
|
||||||
|
export const EntryTag = '[Entry]';
|
||||||
@ -9,10 +9,11 @@ import DB from '../utils/DbSql';
|
|||||||
import { DrivingDataStorage } from '../utils/business/DrivingDataStorage';
|
import { DrivingDataStorage } from '../utils/business/DrivingDataStorage';
|
||||||
import { InitTable } from '../utils/table/Operation';
|
import { InitTable } from '../utils/table/Operation';
|
||||||
import FileUtils from '../utils/FileUtils';
|
import FileUtils from '../utils/FileUtils';
|
||||||
|
import { EntryTag } from '../config';
|
||||||
|
|
||||||
export default class EntryAbility extends UIAbility {
|
export default class EntryAbility extends UIAbility {
|
||||||
async onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
|
async onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
|
||||||
console.log("多伦鸿蒙车载程序启动")
|
console.log(EntryTag, "多伦鸿蒙车载程序启动")
|
||||||
try {
|
try {
|
||||||
await DB.init(this.context)
|
await DB.init(this.context)
|
||||||
await InitTable()
|
await InitTable()
|
||||||
@ -26,9 +27,9 @@ export default class EntryAbility extends UIAbility {
|
|||||||
AppStorage.setOrCreate<string>("host", host)
|
AppStorage.setOrCreate<string>("host", host)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('sql first error', e)
|
console.error(EntryTag, 'sql first error', e)
|
||||||
}
|
}
|
||||||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
|
console.log(EntryTag, "onCreate", "加载完成")
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
@ -36,11 +37,11 @@ export default class EntryAbility extends UIAbility {
|
|||||||
// TODO UDP缺失
|
// TODO UDP缺失
|
||||||
// lightUDPClient.sendMsg(new Uint8Array(arrClose).buffer)
|
// lightUDPClient.sendMsg(new Uint8Array(arrClose).buffer)
|
||||||
DrivingDataStorage.close()
|
DrivingDataStorage.close()
|
||||||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
|
console.log(EntryTag, "onDestroy", "销毁完成")
|
||||||
}
|
}
|
||||||
|
|
||||||
async onWindowStageCreate(windowStage: window.WindowStage) {
|
async onWindowStageCreate(windowStage: window.WindowStage) {
|
||||||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
|
console.log(EntryTag, "onWindowStageCreate", "窗口创建完成")
|
||||||
const windowClass = await windowStage.getMainWindow();
|
const windowClass = await windowStage.getMainWindow();
|
||||||
let rect = windowClass.getWindowProperties().windowRect
|
let rect = windowClass.getWindowProperties().windowRect
|
||||||
let width = rect.width
|
let width = rect.width
|
||||||
@ -79,19 +80,20 @@ export default class EntryAbility extends UIAbility {
|
|||||||
|
|
||||||
onWindowStageDestroy() {
|
onWindowStageDestroy() {
|
||||||
// Main window is destroyed, release UI related resources
|
// Main window is destroyed, release UI related resources
|
||||||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
|
console.log(EntryTag, "onWindowStageDestroy", "窗口销毁完成")
|
||||||
}
|
}
|
||||||
|
|
||||||
onForeground() {
|
onForeground() {
|
||||||
// Ability has brought to foreground
|
// Ability has brought to foreground
|
||||||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
|
console.log(EntryTag, "onForeground", "当应用从后台转到前台时触发")
|
||||||
}
|
}
|
||||||
|
|
||||||
onBackground() {
|
onBackground() {
|
||||||
// Ability has back to background
|
// Ability has back to background
|
||||||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
|
console.log(EntryTag, "onBackground", "当应用从前台转到后台时触发")
|
||||||
}
|
}
|
||||||
|
|
||||||
createFiles() {
|
createFiles() {
|
||||||
|
console.log(EntryTag, "createFiles", "创建文件")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user