Skip to content

Commit

Permalink
First version commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kyawhtut-cu committed Apr 7, 2020
0 parents commit 0d28876
Show file tree
Hide file tree
Showing 66 changed files with 1,977 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
122 changes: 122 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@

# Sheet2Json

Application backend အသုံးမပြုပဲ Google sheet မှ Data များကို Api အနေဖြင့် အသုံးပြုရန်အတွက် Parser ဖြစ်ပါသည်။

Google sheet မှ data များကို Json အနေဖြင့် သုံးလိုသူများအတွက် အလွယ်တကူ အသုံးပြုရပါသည်။

အခု Library သည် [GSX2JSON - Google Spreadsheet to JSON API service.](http://gsx2json.com/) ကို အခြေခံပြီး Android library ရေးသားထားခြင်းဖြစ်ပါသည်။

ထို Site သည် Open source ပေးထားပြီး [heroku](https://www.heroku.com/) တွင် Host လုပ်ထားခြင်းဖြစ်သည့် အတွက် Request limitation, bandwidth limitation ရှိသည့် အတွက် Sheet api ကို Client တွင် တိုက်ရိုက်ခေါ်ပြီး Json ပြောင်းထားခြင်းဖြစ်ပါသည်။

ယခု Version တွင် Response သည် Json ဖြစ်ပြီး။​ Response ရမှသာ Gson converter ဖြစ်ဖြစ် ကြိုက်နှစ်သက်ရာ Converter တစ်ခုခုကို အသုံးပြုပြီး Object ပြန်ပြောင်းရမှာဖြစ်ပါတယ်။

How to add to your project
--------------

1. Add jitpack.io to your root build.gradle file:

```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
2. Add library to your app build.gradle file then sync
Release version - [![Download](https://raw.githubusercontent.com/kyawhtut-cu/Sheet2Json/master/screenshoot/download.svg?sanitize=true)](https://github.com/kyawhtut-cu/Sheet2Json/releases/)
```groovy
dependencies {
...
implementation 'com.github.kyawhtut-cu:Sheet2Json:<version-release>'
}
```

Usage
--------------

/* *
*
* Sheet2Json initialized in Activity onCreate() only one time initialized.
*
* */
Sheet2Json.init()

/* *
*
* Request api
* sheetID = "1bA0N-e5n-kLnMGE3isMMOv6lAOKDRBELF6YWJBxxxxx" // you can get from doc sheet url
* sheetNumber = 1 // this is optional you want to read sheet number, default is one
* query = "" // this is optional you want to filter, default is empty
*
* */
Sheet2Json.get(sheetID, sheetNumber, query) // return is Single<String>

/* *
*
* Complete code
*
* */
Sheet2Json.get("1bA0N-e5n-kLnMGE3isMMOv6lAOKDRBELF6YWJBlZmbQ")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{
val data: List<People> = Gson().fromJson<List<People>>(
it,
object : TypeToken<List<People>>() {}.type
)
},
{
it.printStackTrace()
}
)
.isDisposed

/* *
*
* Add internet permission in AndroidManifest.xml
*
* */
<uses-permission android:name="android.permission.INTERNET" />

Screenshoot
--------
<img alt="English Unicdoe Choose" src="https://raw.githubusercontent.com/kyawhtut-cu/Sheet2Json/master/screenshoot/mobile-screen-shoot.jpg" width="250"/>

<img alt="English Zawgyi Choose" src="https://raw.githubusercontent.com/kyawhtut-cu/Sheet2Json/master/screenshoot/sheet-screen-shoot.png" width="250"/>

Reference
--------

GSX2JSON - Google Spreadsheet to JSON API service.(https://github.com/55sketch/gsx2json)

License
--------

Copyright 2019 kyawhtut-cu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
62 changes: 62 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.kyawhtut.sheet2json"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'io.reactivex.rxjava2:rxjava:2.2.11'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

implementation 'com.google.code.gson:gson:2.8.6'

// tableview https://github.com/evrencoskun/TableView
implementation 'com.evrencoskun.library:tableview:0.8.8'

implementation project(path: ':sheet2json')
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Loading

0 comments on commit 0d28876

Please sign in to comment.