This file contains hidden or 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
| kotlin { | |
| targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> { | |
| binaries.withType<org.jetbrains.kotlin.gradle.plugin.mpp.Framework> { | |
| isStatic = false | |
| } | |
| } |
This file contains hidden or 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
| CoroutineScope(IO).launch { | |
| try { | |
| //do your work in background | |
| withContext(Main) { | |
| //do your work in main thread when background task complete | |
| } | |
| }catch (e:HttpException){ | |
| Log.v("Exception",e.toString()) | |
| } | |
| } |
This file contains hidden or 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
| val (request, response, result) = Fuel.post(Url) | |
| .body(Json) | |
| .header(mapOf("Content-Type" to "application/json","Authorization" to "Bearer $Bearer" )) | |
| .response() | |
| when (result) { | |
| is Result.Failure -> { | |
| val ex = result.getException().exception | |
| var exm=result.getException().exception.localizedMessage | |
| return listOf(ex.toString(),"fail") |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| <p>Click the button to get your coordinates.</p> | |
| <button onclick="getLocation()">Try It</button> | |
| <p id="demo"></p> |
This file contains hidden or 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
| compile "org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.4" | |
| compile 'org.jetbrains.exposed:exposed:0.8.5' | |
| compile group: 'mysql', name: 'mysql-connector-java', version: '6.0.6' | |
| compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25' | |
| compile group: 'com.google.code.gson', name: 'gson', version: '2.8.1' | |
| testCompile group: 'junit', name: 'junit', version: '4.12' |
This file contains hidden or 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
| CREATE DATABASE IF NOT EXISTS mytestdb; | |
| USE mytestdb; | |
| create table user(id int,name varchar(50),email varchar(50)); | |
| INSERT INTO `user` (`uid`, `name`, `email`) VALUES ('1', 'anuj', 'anuj@gmail.com') | |
| INSERT INTO `user` (`uid`, `name`, `email`) VALUES ('2', 'anuj', 'anuj@gmail.com') |
This file contains hidden or 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
| fun main() { | |
| var nm=test1() | |
| nm.name="hello" | |
| print(nm.name) | |
| } | |
| class test1(){ | |
| var name:String = ""; | |
| } |
This file contains hidden or 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
| fun main() { | |
| var a:Int=10 | |
| var b = sum(22,"anuj") | |
| print("sum is ${b.num}") | |
| } | |
| class sum(age: Int,name:String){ |
This file contains hidden or 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
| fun main() { | |
| println("Hello World") | |
| } |
This file contains hidden or 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
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:layout_width="fill_parent" | |
| android:layout_height="fill_parent" | |
| android:background="@color/white" | |
| android:gravity="center" | |
| android:orientation="vertical" | |
| android:padding="16dp"> | |
| <TextView |
NewerOlder