Skip to content

Commit

Permalink
Release v0.0.1-beta01
Browse files Browse the repository at this point in the history
  • Loading branch information
amirisback committed Feb 27, 2022
1 parent dda44d7 commit 6c93529
Show file tree
Hide file tree
Showing 27 changed files with 193 additions and 159 deletions.
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
![ScreenShoot Apps](docs/image/ss_banner.png?raw=true)

## About This Project
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-frogo--android--sdk-brightgreen.svg?style=flat-square)](https://android-arsenal.com/details/1/8317)
[![](https://jitpack.io/v/frogobox/frogo-android-sdk.svg?style=flat-square)](https://jitpack.io/#frogobox/frogo-android-sdk) <br>
## About This Project (release-and-work-in-progress 👷🔧️👷‍♀️⛏)
SDK for anything your problem to make easier developing android apps

## Version Release
This Is Latest Release

$version_release = 2.0.8
~ Beta Release
$version_release = 0.0.1-beta01

What's New??

* Update build gradle kts version library *
* SDK Android and Desktop *
* Beta Release *

## Download this project

Expand Down Expand Up @@ -48,34 +48,44 @@ allprojects {

dependencies {
// library frogo-sdk
implementation 'com.github.frogobox:frogo-android-sdk:2.0.8'
implementation 'com.github.frogobox:frogo-sdk:0.0.1-beta01'
}

#### <Option 2> Kotlin DSL Gradle

dependencies {
// library frogo-sdk
implementation("com.github.frogobox:frogo-android-sdk:2.0.8")
implementation("com.github.frogobox:frogo-sdk:0.0.1-beta01")
}

### Step 3. Function from this SDK

#### All Class SDK
#### All Class SDK (android)
```kotlin
FrogoActivity
FrogoApiCallback
FrogoApiClient
FrogoApiModel
FrogoApplication
FrogoComposeActivity
FrogoConstant
FrogoDate
FrogoFragment
FrogoFunc
FrogoLiveEvent
FrogoLocalCallback
FrogoMusic
FrogoMutableLiveData
FrogoNavigation
FrogoPagerHelper
FrogoPreference
FrogoViewModel
```

### All Class SDK (desktop & android)
```kotlin
FrogoApiModel
FrogoApiObserver
FrogoConstant
FrogoCoreApiClient
FrogoDataResponse
FrogoLocalObserver
FrogoStateResponse
```

#### FrogoActivity
Expand Down Expand Up @@ -217,11 +227,6 @@ fun convertTargetDate(string: String?): String
fun diffTime(timeStart: String, timeEnd: String): Long
```

#### FrogoComposeActivity

In Progress Development


## Colaborator
Very open to anyone, I'll write your name under this, please contribute by sending an email to me

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/frogobox/appsdk/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
override fun setupViewModel() {
}

override fun setupUI(savedInstanceState: Bundle?) {
override fun setupOnCreate(savedInstanceState: Bundle?) {
binding.apply {
tv.text = "Frogo Android SDK"
tv.setOnClickListener {
Expand Down
25 changes: 16 additions & 9 deletions buildSrc/src/main/kotlin/ProjectSetting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,34 @@
*/

object ProjectSetting {
// project settings

const val NAME_APP = "Frogo SDK"

const val APP_DOMAIN = "com"
const val APP_PLAY_CONSOLE = "frogobox"
const val APP_NAME = "appsdk"

const val LIBRARY_NAME_SDK = "sdk"
const val LIBRARY_NAME_CORE_SDK = "coresdk"

const val MODULE_NAME_SDK = "frogosdk"
const val MODULE_NAME_CORE_SDK = "frogocoresdk"

// ---------------------------------------------------------------------------------------------

const val VERSION_MAJOR = 1
const val VERSION_MINOR = 0
const val VERSION_PATCH = 0

const val PROJECT_COMPILE_SDK = 31
// ---------------------------------------------------------------------------------------------

const val PROJECT_MIN_SDK = 21
const val PROJECT_COMPILE_SDK = 31
const val PROJECT_TARGET_SDK = PROJECT_COMPILE_SDK

const val BASE_PACAKGE_NAME = "$APP_DOMAIN.$APP_PLAY_CONSOLE"

const val LIBRARY_NAME_SDK = "sdk"
const val LIBRARY_NAME_CORE_SDK = "coresdk"
// ---------------------------------------------------------------------------------------------

const val MODULE_NAME_SDK = "frogosdk"
const val MODULE_NAME_CORE_SDK = "frogocoresdk"
const val BASE_PACAKGE_NAME = "$APP_DOMAIN.$APP_PLAY_CONSOLE"

const val PROJECT_APP_ID = "$BASE_PACAKGE_NAME.$APP_NAME"
const val PROJECT_LIB_ID_SDK = "$BASE_PACAKGE_NAME.$LIBRARY_NAME_SDK"
Expand All @@ -47,7 +53,8 @@ object ProjectSetting {
val NAME_DB = NAME_APP.toLowerCase().replace(" ", "_")
val DB = "\"$NAME_DB.db\""

// Key Store
// ---------------------------------------------------------------------------------------------

const val PLAYSTORE_STORE_FILE = "frogoboxmedia.jks"
const val PLAYSTORE_STORE_PASSWORD = "amirisback"
const val PLAYSTORE_KEY_ALIAS = "frogoisback"
Expand Down
Binary file modified docs/image/ss_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.sdk
package com.frogobox.coresdk

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.sdk
package com.frogobox.coresdk

import io.reactivex.Observer
import io.reactivex.disposables.Disposable
Expand All @@ -18,12 +18,14 @@ import java.net.UnknownHostException
* All rights reserved
*
*/
abstract class FrogoApiCallback<M> : Observer<M> {
abstract class FrogoApiObserver<M> : Observer<M> {

abstract fun onSuccess(data: M)

abstract fun onFailure(code: Int, errorMessage: String)

// ---------------------------------------------------------------------------------------------

override fun onComplete() {
}

Expand All @@ -37,18 +39,7 @@ abstract class FrogoApiCallback<M> : Observer<M> {
override fun onError(e: Throwable) {
e.printStackTrace()
when (e) {
is HttpException -> {

var baseDao: M? = null
try {
val body = e.response()?.errorBody()
} catch (exception: Exception) {
onFailure(504, exception.message!!)
}

onFailure(504, "Error Response")
}

is HttpException -> onFailure(504, "Error response with ${e.message}")
is UnknownHostException -> onFailure(
-1,
"Telah terjadi kesalahan ketika koneksi ke server: ${e.message}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package com.frogobox.sdk

import android.os.Environment
package com.frogobox.coresdk

/*
* Created by faisalamir on 26/07/21
Expand All @@ -16,7 +14,7 @@ import android.os.Environment
*/
object FrogoConstant {

val TAG = FrogoConstant::class.java.simpleName
val TAG: String = FrogoConstant::class.java.simpleName

const val OPTION_GET = "OPTION_GET"
const val OPTION_DELETE = "OPTION_DELETE"
Expand All @@ -39,8 +37,6 @@ object FrogoConstant {

const val TAG_FROM_ACTIVITY = 801
const val TAG_FROM_FRAGMENT = 800

const val TAG_CAMERA_VIDEO = "Camera2VideoFragment"
}

object Ext {
Expand All @@ -49,12 +45,4 @@ object FrogoConstant {
const val CSV = ".csv"
}

object Dir {
private const val BASE_FILE_NAME = "SPEECH_"
private const val BASE_DIR_NAME = "BaseMusicPlayer"

val DIR_NAME = "${Environment.DIRECTORY_PICTURES}/$BASE_DIR_NAME"
val VIDEO_FILE_NAME = "$BASE_FILE_NAME${System.currentTimeMillis()}${Ext.MP4}"
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.frogobox.coresdk

import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit

/*
* Created by faisalamir on 26/07/21
* FrogoSDK
* -----------------------------------------
* Name : Muhammad Faisal Amir
* E-mail : [email protected]
* Github : github.com/amirisback
* -----------------------------------------
* Copyright (C) 2021 FrogoBox Inc.
* All rights reserved
*
*/

object FrogoCoreApiClient {

val TAG: String = FrogoCoreApiClient::class.java.simpleName

inline fun <reified T> create(url: String): T {
return Retrofit.Builder()
.baseUrl(url)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build().create(T::class.java)
}

inline fun <reified T> create(url: String, chuckInterceptor: Interceptor): T {
val mLoggingInterceptor = HttpLoggingInterceptor()
mLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY

val mClient = OkHttpClient.Builder()
.addInterceptor(mLoggingInterceptor)
.addInterceptor(chuckInterceptor)
.readTimeout(30, TimeUnit.SECONDS)
.connectTimeout(30, TimeUnit.SECONDS)
.build()

return Retrofit.Builder()
.baseUrl(url)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.client(mClient)
.build().create(T::class.java)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.frogobox.coresdk

/*
* Created by faisalamir on 26/07/21
* FrogoSDK
* -----------------------------------------
* Name : Muhammad Faisal Amir
* E-mail : [email protected]
* Github : github.com/amirisback
* -----------------------------------------
* Copyright (C) 2021 FrogoBox Inc.
* All rights reserved
*
*/

interface FrogoDataResponse<T> {

fun onSuccess(data: T)
fun onFailed(statusCode: Int, errorMessage: String? = "")
fun onShowProgress()
fun onHideProgress()

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.frogobox.sdk
package com.frogobox.coresdk

import com.google.gson.Gson
import io.reactivex.SingleObserver
Expand All @@ -19,7 +19,7 @@ import java.net.UnknownHostException
* All rights reserved
*
*/
abstract class FrogoLocalCallback<M> : SingleObserver<M> {
abstract class FrogoLocalObserver<M> : SingleObserver<M> {

abstract fun onCallbackSucces(data: M)
abstract fun onCallbackError(code: Int, errorMessage: String)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.frogobox.coresdk


/*
* Created by faisalamir on 27/02/22
* FrogoSDK
* -----------------------------------------
* Name : Muhammad Faisal Amir
* E-mail : [email protected]
* Github : github.com/amirisback
* -----------------------------------------
* Copyright (C) 2022 Frogobox Media Inc.
* All rights reserved
*
*/

interface FrogoStateResponse {
fun onSuccess()
fun onFailed(statusCode: Int, errorMessage: String? = "")
fun onShowProgress()
fun onHideProgress()
}
4 changes: 0 additions & 4 deletions frogocoresdk/src/main/java/com/frogobox/coresdk/MyClass.kt

This file was deleted.

2 changes: 2 additions & 0 deletions frogosdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ android {

dependencies {

implementation(project(":frogocoresdk"))

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Dependency.KOTLIN_VERSION}")

implementation("androidx.appcompat:appcompat:1.4.1")
Expand Down
Loading

0 comments on commit 6c93529

Please sign in to comment.