Chrome Pointer

2020年4月23日 星期四

Constantly 意思


Constantly
Adverb

all the time or often
總是;經常地,不斷地


She has the TV on constantly.
她總是開著電視。

He's constantly changing his mind.
他的想法時常在變。

2020年4月20日 星期一

Android Studio 如何從assets 把資料庫匯到 data/data/工程包名/databases 裡面

因為每台手機的存取位址不一樣,所以我們不能直接寫死
//val DB_PATH = "/data/data/com.example.last_win/databases"  //在手机里存放数据库的位置
//val dbfile = "$DB_PATH/ingerdients.db"
像是上面那樣把路徑給寫死, 手機就會發生閃退的情況 !!

★getDatabasePath>>取得手機裡面有 ingerdients.db 檔案的路徑!!



val db = File(getDatabasePath("ingerdients.db").getPath()) //Get the file name of the databaseval dbdir: File = db.getParentFile()
if (!dbdir.exists()) {
    dbdir.mkdirs()
}
Toast.makeText(this, getDatabasePath("ingerdients.db").getPath(), LENGTH_LONG).show()

//执行数据库导入val myInput = applicationContext.assets.open("ingerdients.db") //assets.open("ingerdients.db") //欲导入的数据库val myOutput  = FileOutputStream(db)


val buffer = ByteArray(1024)
var length: Int = myInput.read(buffer)
while ((length) > 0) {
    myOutput.write(buffer, 0, length)
    length = myInput.read(buffer)
}
myOutput.flush()
myInput.close()
myOutput.close()

2020年4月18日 星期六

android studio SQLIte select like 為何不行呢?























val c = MyDB.rawQuery("select * from "+DB_TABLE+" where 樣品名稱 LIKE '%"+editText1.text.toString()+"%'", null )

記得 where 後面的 樣品名稱='apple' >>一定要加 '' 符號, like 也要加'%app%' 符號~
如果沒加就執行不出來!!

Compensation 意思


Compensation
Noun

compensation noun (MONEY)
money that is paid to someone in exchange for something that has been lost or damaged or for some problem
賠償金;補償金


She received £40,000 in compensation for a lost eye.
她得到四萬英鎊,作為對失去一隻眼睛的賠償。

You should claim/seek compensation.
你應該要求賠償。

a compensation claim
索賠要求



compensation noun (EXCHANGE)
something that makes you feel better when you have suffered something bad
補償(物);賠償(物)


I have to spend three months of the year away from home - but there are compensations like the chance to meet new people.
我一年必須有三個月的時間出門在外——但也有好處,比如有機會認識新朋友。

Free food was no compensation for a very boring evening.
免費食物並不能彌補晚會的乏味無聊。

Tom gave me a new knife as compensation for the one he lost.
湯姆給了我一把新刀,算是賠償那把被他丟失的刀。



compensation noun (JOB PAYMENT)
the combination of money and other benefits (= rewards) that an employee receives for doing their job
報酬(僱員獲得的金錢和其他福利的總和)


Annual compensation for our executives includes salary and bonus under our incentive plan.
我們的高級管理人員獲得的年度報酬包括工資以及按獎勵計劃發放的獎金。

The job is hard but the compensation is good.
這個工作很辛苦,但報酬是高的。

Wage 意思


Wage
Noun

particular amount of money that is paid, usually every week, to an employeeespecially one who does work that needs physical skills or strengthrather than a job needing a college education
(尤指支付給體力勞動者並通常按週計算的)工資,工錢,報酬


a very low/high wage
非常低/高的工資

按小時/日/週/年支付的工資

He gets/earns/is paid a good wage, because he works for a fair employer.
他的薪水很不錯,因為他的老闆獎懲公平。

The job pays very low wages.
這份工作薪水很低。




Wage
Verb

to fight a war or organize a series of activities in order to achieve something
發動(戰爭);組織,籌備(活動)


Doesn't the president need Congresspermission to wage war on another country?
想必總統須得到國會的許可才能對他國發動戰爭吧?

They've been waging a long campaign to change the law.
他們為修改這一法律已組織發起了一場持久的運動。

2020年4月16日 星期四

為何SQLIte 的資料庫 匯不進去 android studio裡面呢?


如果要讀取自己的SQLIte資料庫, 也就是.db檔案 ~
首先資料庫裡面一定 要有一個TABLE - android_metadata ~

那這個檔案是只要 你新增資料, 匯進資料庫時, 他就會自動產生的!!
也就是若你要讓android studio 能夠讀取你的資料的話,
首先一定要先新增資料>>才能讓資料庫裡產生一個TABLE - android_metadata的檔案~

當資料庫裡面有android_metadata的檔案後, 才可以正常讀取資料庫其他的資料表喔!!