This file contains 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
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import java.io.ByteArrayOutputStream; | |
/** | |
* Sketch Project Studio | |
* Created by Angga on 12/04/2016 14.27. | |
*/ | |
public class AppHelper { |
This file contains 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
{ | |
"id": 54, | |
"data": { | |
"name": "Aditya", | |
"url": "https://adityawidayanto.com/", | |
"modified": "2019-06-24T18:17:53", | |
"modified_gmt": "2019-06-24T11:17:53" | |
} | |
} |
This file contains 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
import com.google.gson.JsonObject; | |
import com.google.gson.JsonParser; | |
JsonObject jobject = new JsonParser().parse(sampleWordpressJson).getAsJsonObject(); | |
JsonObject data = jobject.getAsJsonObject("data"); |
This file contains 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
import com.google.gson.JsonObject; | |
import com.google.gson.JsonParser; | |
JsonObject jobject = new JsonParser().parse(sampleWordpressJson).getAsJsonObject(); | |
JsonObject data = jobject.getAsJsonObject("data"); | |
// tanpa pengecekan memungkinkan munculnya error nullpointerexception | |
String name = data.get("name"); | |
// pengecekan apakah terdapat key "url" atau tidak |
This file contains 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
dependencies { | |
////UI//// | |
implementation "androidx.paging:paging-runtime-ktx:3.0.0" | |
////DATABASE//// | |
implementation "androidx.room:room-ktx:2.3.0" | |
implementation "androidx.room:room-runtime:2.3.0" | |
kapt "androidx.room:room-compiler:2.3.0" | |
} |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<androidx.recyclerview.widget.RecyclerView |
This file contains 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
/** | |
Class Entity | |
*/ | |
@Parcelize | |
@Entity(tableName = "popular_movies") | |
data class Movie( | |
@PrimaryKey | |
@SerializedName("id") | |
val id: Int, | |
@SerializedName("overview") |
OlderNewer