Skip to content

Commit 50ea51b

Browse files
Initial Commit
Initial Commit - working demostration done
1 parent c5e95d4 commit 50ea51b

Some content is hidden

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

53 files changed

+1222
-0
lines changed

.idea/.name

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

.idea/caches/build_file_checksums.ser

591 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

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

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 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: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 10 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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apply plugin: 'com.android.application'
2+
3+
apply plugin: 'kotlin-android'
4+
5+
apply plugin: 'kotlin-android-extensions'
6+
7+
android {
8+
compileSdkVersion 29
9+
buildToolsVersion "29.0.2"
10+
defaultConfig {
11+
applicationId "com.github.dhl.sample"
12+
minSdkVersion 19
13+
targetSdkVersion 29
14+
versionCode 1
15+
versionName "1.0"
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
}
25+
26+
dependencies {
27+
implementation project(":linkablelog")
28+
implementation fileTree(dir: 'libs', include: ['*.jar'])
29+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
30+
implementation 'androidx.appcompat:appcompat:1.1.0'
31+
implementation 'androidx.core:core-ktx:1.1.0'
32+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
33+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
34+
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
35+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
36+
testImplementation 'junit:junit:4.12'
37+
androidTestImplementation 'androidx.test:runner:1.2.0'
38+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
39+
}

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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.github.dhl.sample
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.github.dhl.sample", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.github.dhl.sample">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<service
13+
android:name=".SampleService"
14+
android:enabled="true"
15+
android:exported="true" />
16+
17+
<activity android:name=".MainActivity">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
<action android:name="android.intent.action.VIEW" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
26+
</application>
27+
28+
</manifest>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.github.dhl.sample
2+
3+
import android.content.Intent
4+
import android.os.Bundle
5+
import android.view.View
6+
import androidx.appcompat.app.AppCompatActivity
7+
import com.github.dhl.linkablelog.Log
8+
9+
class MainActivity : AppCompatActivity() {
10+
11+
override fun onCreate(savedInstanceState: Bundle?) {
12+
super.onCreate(savedInstanceState)
13+
setContentView(R.layout.activity_main)
14+
15+
Log.i("OnCreate", "Call from Main Activity")
16+
Log.i("OnCreate", "Call from Main Activity")
17+
Log.w("OnCreate", "Call from Main Activity")
18+
Log.d("OnCreate", "Call from Main Activity")
19+
Log.w("OnCreate", "Call from Main Activity")
20+
21+
print()
22+
}
23+
24+
fun dummyPrint(){
25+
print()
26+
}
27+
28+
fun print(){
29+
Log.v("OnCreate ", "Main Activity")
30+
}
31+
32+
fun printLog(view: View) {
33+
dummyPrint()
34+
35+
Log.e("Hitesh", "Hello Main Activity")
36+
startService(Intent(MainActivity@ this, SampleService::class.java))
37+
}
38+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.github.dhl.sample
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.fragment.app.Fragment
8+
import androidx.lifecycle.ViewModelProviders
9+
import com.github.dhl.linkablelog.Log
10+
import kotlinx.android.synthetic.main.sample_fragment.view.*
11+
12+
13+
class SampleFragment : Fragment() {
14+
15+
companion object {
16+
fun newInstance() = SampleFragment()
17+
}
18+
19+
private lateinit var viewModel: SampleViewModel
20+
21+
override fun onCreateView(
22+
inflater: LayoutInflater, container: ViewGroup?,
23+
savedInstanceState: Bundle?
24+
): View? {
25+
val mRootView = inflater.inflate(R.layout.sample_fragment, container, false)
26+
val response =
27+
"{\"glossary\":{\"title\":\"example glossary\",\"GlossDiv\":{\"title\":\"S\",\"GlossList\":{\"GlossEntry\":{\"ID\":\"SGML\",\"SortAs\":\"SGML\",\"GlossTerm\":\"Standard Generalized Markup Language\",\"Acronym\":\"SGML\",\"Abbrev\":\"ISO 8879:1986\",\"GlossDef\":{\"para\":\"A meta-markup language, used to create markup languages such as DocBook.\",\"GlossSeeAlso\":[\"GML\",\"XML\"]},\"GlossSee\":\"markup\"}}}}}"
28+
mRootView.btnFragmentLog.setOnClickListener {
29+
Log.e("Fragment", "Fragment Button Click")
30+
31+
32+
Log.w("Response", response)
33+
}
34+
return mRootView
35+
}
36+
37+
override fun onActivityCreated(savedInstanceState: Bundle?) {
38+
super.onActivityCreated(savedInstanceState)
39+
viewModel = ViewModelProviders.of(this).get(SampleViewModel::class.java)
40+
// TODO: Use the ViewModel
41+
}
42+
43+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.github.dhl.sample
2+
3+
import android.app.Service
4+
import android.content.Intent
5+
import android.os.IBinder
6+
import com.github.dhl.linkablelog.Log
7+
8+
class SampleService : Service() {
9+
override fun onBind(p0: Intent?): IBinder? {
10+
return null
11+
}
12+
13+
override fun onCreate() {
14+
super.onCreate()
15+
Log.e("Service", "Log in service")
16+
}
17+
}

0 commit comments

Comments
 (0)