-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jmarkstar
authored and
jmarkstar
committed
Sep 21, 2017
1 parent
45a9d9e
commit 220984d
Showing
9 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
s3_adapters_sqlite/src/main/java/com/jmarkstar/s3/SqliteActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.jmarkstar.s3; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.database.Cursor; | ||
import android.database.sqlite.SQLiteDatabase; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
|
||
public class SqliteActivity extends AppCompatActivity { | ||
|
||
public static void start(Context context) { | ||
Intent starter = new Intent(context, SqliteActivity.class); | ||
context.startActivity(starter); | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_sqlite); | ||
getSQLiteVersion(); | ||
} | ||
|
||
|
||
private void getSQLiteVersion(){ | ||
String query = "select sqlite_version() AS sqlite_version"; | ||
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(":memory:", null); | ||
Cursor cursor = db.rawQuery(query, null); | ||
String sqliteVersion = ""; | ||
if (cursor.moveToNext()) { | ||
sqliteVersion = cursor.getString(0); | ||
Log.v("SqliteActivity", "sqliteVersion = "+sqliteVersion); | ||
} | ||
cursor.close(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
s3_adapters_sqlite/src/main/java/com/jmarkstar/s3/database/MySQLiteHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.jmarkstar.s3.database; | ||
|
||
import android.content.Context; | ||
import android.database.sqlite.SQLiteDatabase; | ||
import android.database.sqlite.SQLiteOpenHelper; | ||
|
||
/** | ||
* Created by jmarkstar on 9/20/17. | ||
*/ | ||
|
||
public class MySQLiteHelper extends SQLiteOpenHelper { | ||
|
||
private static final String DB_NAME = "mydb.db"; | ||
private static final int DB_VERSION = 1; | ||
|
||
public MySQLiteHelper(Context context) { | ||
super(context, DB_NAME, null, DB_VERSION); | ||
} | ||
|
||
@Override public void onCreate(SQLiteDatabase sqLiteDatabase) { | ||
|
||
} | ||
|
||
@Override public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context="com.jmarkstar.s3.SqliteActivity"> | ||
|
||
</android.support.constraint.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<dimen name="ancho_photo">12dp</dimen> | ||
</resources> |