Hello everybody
- By droopy1702
- Introductions
- 6 Replies
Hello everybody,
I am 64 and retired, love computer, travel, wine, good food and blues
I am 64 and retired, love computer, travel, wine, good food and blues
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
KEY_RECORD KEY_FILE KEY_TIME KEY_TEMP KEY_CONC
KEY_RECORD KEY_FILE KEY_TIME KEY_TEMP KEY_CONC
0001 1
0001 2
...
0001 7
0002 1
0002 2
....
private static final String TABLE_CREATE = "CREATE TABLE " + TABLE_RECORDS + "(" + KEY_ID + " INTEGER PRIMARY KEY," + KEY_RECORD + " TEXT," + KEY_FILE + " TEXT," + KEY_TIME + " TEXT," + KEY_TEMP + " TEXT," + KEY_CONC + " TEXT" + " )";
...
@Override
public void onCreate (SQLiteDatabase db)
{
db.execSQL(TABLE_CREATE);
db.close();
}
private static final String TABLE_CREATE = "CREATE TABLE " + TABLE_RECORDS + "(... + " TEXT UNIQUE," + KEY_FILE + ..." + " )"
if (getUserVisibleHint()) {
GetTrainingVideosMySql getTrainingVideosMySql = new GetTrainingVideosMySql();
getTrainingVideosMySql.execute("");
}
btnFetch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
fileUrl = "";
GetVideoUrlMySql getVideoUrl = new GetVideoUrlMySql();
getVideoUrl.execute("");
vw.setVideoPath(fileUrl);
vw.start();
}
});
private class GetVideoUrlMySql extends AsyncTask<String, Void, String> {
String fileLocation = "";
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url, user, pass);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT url FROM training.training_videos WHERE id = 1");
ResultSetMetaData rsmd = rs.getMetaData();
while (rs.next()) {
fileLocation = rs.getString(1).toString() + "\n";
}
} catch (Exception e) {
e.printStackTrace();
}
return fileLocation;
}
@Override
protected void onPostExecute(String result) {
fileUrl = fileLocation;
}

