Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
<!-- adding the drawable here -->
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- selected. This style will be applied when the view is selected -->
<item android:state_selected="true">
<shape>
<corners android:radius="12dp" />
<solid android:color="@android:color/black" />
</shape>
</item>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/remotecall1"
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.arcane.coldstoragecache.callback.OnOperationSuccessfulCallback
import com.arcane.coldstorageexamples.remotecall.MakeRemoteCall
//WHAT IS THIS ???????????
import com.arcane.generated.GeneratedCacheLayer
class MainActivity : AppCompatActivity(), OnOperationSuccessfulCallback<String?> {
import com.arcane.coldstorageannotation.Refrigerate
import java.net.URL
class MakeRemoteCall {
/**
* A method that makes a call to the "https://httpbin.org/get"
* endpoint. This endpoint simply returns the arguments that were passed to it.
* For the caching logic the parameter passed to the endpoint will act as
* the key of the cache.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraintlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
package com.arcane.coldstoragecache.converter.impl
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.util.Base64
import android.util.Log
import com.arcane.coldstoragecache.converter.IConverter
/**
* An example converter that will convert the stored string
package com.arcane.coldstorage
import android.graphics.Bitmap
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.widget.Button
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import com.arcane.coldstorage.cache.ImageCache
package com.arcane.coldstorage.cache
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.util.Base64
import android.util.Log
import com.arcane.coldstoragecache.cache.Cache
import java.io.ByteArrayOutputStream
import java.net.URL
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name=".application.Application">
...... your activities go here