Skip to content

Commit 0aeed36

Browse files
committed
Init commit
1 parent f1ef1a9 commit 0aeed36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1448
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild

.idea/codeStyles/Project.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 28
5+
defaultConfig {
6+
applicationId "com.dujiajun.courseblock"
7+
minSdkVersion 21
8+
targetSdkVersion 28
9+
versionCode 1
10+
versionName "1.0"
11+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
compileOptions {
20+
sourceCompatibility JavaVersion.VERSION_1_8
21+
targetCompatibility JavaVersion.VERSION_1_8
22+
}
23+
}
24+
25+
dependencies {
26+
implementation fileTree(dir: 'libs', include: ['*.jar'])
27+
implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
28+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
29+
implementation 'com.google.android.material:material:1.0.0-rc02'
30+
implementation 'org.jsoup:jsoup:1.11.3'
31+
implementation 'com.squareup.okhttp3:okhttp:3.14.0'
32+
//implementation 'com.google.code.gson:gson:2.8.5'
33+
//implementation 'com.eclipsesource.j2v8:j2v8:4.5.0@aar'
34+
implementation 'com.github.bumptech.glide:glide:4.9.0'
35+
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
36+
implementation 'com.github.zfman:TimetableView:v2.0.7'
37+
//implementation 'org.apache.httpcomponents:httpclient:4.5.7'
38+
testImplementation 'junit:junit:4.12'
39+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
40+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
41+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.dujiajun.courseblock;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.InstrumentationRegistry;
6+
import androidx.test.runner.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getTargetContext();
24+
25+
assertEquals("com.dujiajun.courseblock", appContext.getPackageName());
26+
}
27+
}

app/src/main/AndroidManifest.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.dujiajun.courseblock">
5+
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
8+
<application
9+
android:allowBackup="true"
10+
android:icon="@mipmap/ic_launcher"
11+
android:label="@string/app_name"
12+
android:networkSecurityConfig="@xml/network_security_config"
13+
android:roundIcon="@mipmap/ic_launcher_round"
14+
android:supportsRtl="true"
15+
android:theme="@style/AppTheme"
16+
tools:ignore="GoogleAppIndexingWarning"
17+
tools:targetApi="n">
18+
<activity
19+
android:name=".LoginActivity"
20+
android:label="@string/label_login"
21+
android:theme="@style/AppTheme.NoActionBar"/>
22+
<activity
23+
android:name=".MainActivity"
24+
android:label="@string/app_name"
25+
android:theme="@style/AppTheme.NoActionBar">
26+
<intent-filter>
27+
<action android:name="android.intent.action.MAIN" />
28+
29+
<category android:name="android.intent.category.LAUNCHER" />
30+
</intent-filter>
31+
</activity>
32+
</application>
33+
34+
</manifest>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.dujiajun.courseblock;
2+
3+
import android.content.Context;
4+
import android.database.sqlite.SQLiteDatabase;
5+
import android.database.sqlite.SQLiteOpenHelper;
6+
import android.widget.Toast;
7+
8+
import androidx.annotation.Nullable;
9+
10+
public class CourseDBHelper extends SQLiteOpenHelper {
11+
12+
public static final String CREATE_COURSE_TABLE = "CREATE TABLE course(" +
13+
"id integer primary key autoincrement," +
14+
"cno integer not null," +
15+
"cname text not null," +
16+
"start_week integer," +
17+
"end_week integer," +
18+
"teacher text," +
19+
"location text," +
20+
"day_in_week integer," +
21+
"class_in_day integer)";
22+
23+
private Context mContext;
24+
public CourseDBHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
25+
super(context, name, factory, version);
26+
mContext = context;
27+
}
28+
29+
@Override
30+
public void onCreate(SQLiteDatabase db) {
31+
db.execSQL(CREATE_COURSE_TABLE);
32+
Toast.makeText(mContext, "CREATED DATABASE", Toast.LENGTH_SHORT).show();
33+
}
34+
35+
@Override
36+
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
37+
38+
}
39+
}

0 commit comments

Comments
 (0)