Parcelable

Zero boilerplate compile time code generation for Android serialization

License

License

MIT
GroupId

GroupId

io.taig.android
ArtifactId

ArtifactId

parcelable_2.11
Last Version

Last Version

3.0.0-BETA1
Release Date

Release Date

Type

Type

aar
Description

Description

Parcelable
Zero boilerplate compile time code generation for Android serialization
Project URL

Project URL

https://github.com/taig/parcelable
Project Organization

Project Organization

io.taig.android
Source Code Management

Source Code Management

https://github.com/taig/parcelable

Download parcelable_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/io.taig.android/parcelable_2.11/ -->
<dependency>
    <groupId>io.taig.android</groupId>
    <artifactId>parcelable_2.11</artifactId>
    <version>3.0.0-BETA1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.taig.android/parcelable_2.11/
implementation 'io.taig.android:parcelable_2.11:3.0.0-BETA1'
// https://jarcasting.com/artifacts/io.taig.android/parcelable_2.11/
implementation ("io.taig.android:parcelable_2.11:3.0.0-BETA1")
'io.taig.android:parcelable_2.11:aar:3.0.0-BETA1'
<dependency org="io.taig.android" name="parcelable_2.11" rev="3.0.0-BETA1">
  <artifact name="parcelable_2.11" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.taig.android', module='parcelable_2.11', version='3.0.0-BETA1')
)
libraryDependencies += "io.taig.android" % "parcelable_2.11" % "3.0.0-BETA1"
[io.taig.android/parcelable_2.11 "3.0.0-BETA1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.7
com.chuusai : shapeless_2.11 jar 2.2.5
org.julienrf : enum_2.11 jar 2.1
org.scala-lang : scala-reflect jar 2.11.7

provided (2)

Group / Artifact Type Version
org.scoverage : scalac-scoverage-runtime_2.11 jar 1.1.1
org.scoverage : scalac-scoverage-plugin_2.11 jar 1.1.1

test (2)

Group / Artifact Type Version
com.geteit : robotest_2.11 jar 0.12
org.scalatest : scalatest_2.11 jar 2.2.6

Project Modules

There are no modules declared in this project.

Soap

Scala on Android Parcelable with circe

Circle CI codecov Maven License

Introduction

As of version 4.0.0, Soap is no more than a simple wrapper around circe (a Scala JSON library). It allows to easily read/write from/to Bundle, Intent and SharedPreference as long as the appropriate circe codecs are in scope.

In previous versions of Soap, the library provided its own codec generation framework. As I spent more and more time working with circe, I realised how superior its codec derivation is and that I will not be able to provide and maintain anything nearly as good. I therefore decided to migrate Soap to circe. It might not be the fastest or memory optimized way of solving inter-process-communication (IPC), but it does provide the greatest development experience.

Warning
You can only use Soap to read data, if it has also been written with Soap. Reading form external Bundles (e.g. from a Notification) does not work, because the format differs.

Installation

libraryDependencies += "io.taig.android" %% "soap" % "4.1.0"

Quickstart

import io.taig.android.soap.implicits._

import io.taig.android.soap.Bundle

val bundle = Bundle( 2 )
    .write( "foo", 42 )
    .write( "bar", "foobar" )

bunlde.read[Int]( "foo" )           // Some( 42 )
bunlde.read[String]( "bar" )        // Some( "foobar" )
bunlde.read[Int]( "bar" )           // None
bunlde.read[String]( "foobar" )     // None

import android.content.Intent

val intent = new Intent()
    .write( "foo", 42 )
    .write( "bar", "foobar" )

intent.read[Int]( "foo" )           // Some( 42 )

import android.preference.PreferenceManager

val preferences = PreferenceManager.getDefaultSharedPreferences( ??? )
    .write( "foo", 42 )
    .write( "bar", "foobar" )

preferences.read[Int]( "foo" )      // Some( 42 )

See the circe documentation to find out more about codec generation.

Versions

Version
3.0.0-BETA1
2.4.1
2.4.0
2.3.0
2.2.0
2.1.1
2.1.0
2.0.0
1.2.6
1.2.5
1.2.4