https://kotlinlang.org logo
#android
Title
# android
d

dylan

04/09/2018, 2:45 PM
anyone know where the code for data classes annotated with
@Parcelize
gets generated to? Can't seem to find them in the build folder
g

gildor

04/09/2018, 2:47 PM
Parcelize doesn’t generate source code, but generates byte code directly
just check
.class
file bytecode or use decompiler
d

dylan

04/09/2018, 2:52 PM
where can I find those
.class
files? in
build/intermediates/classes/
I cant find the data class files
g

gildor

04/09/2018, 2:53 PM
Not sure, try to build project and use grep by project dir
but
build/intermediates/classes
looks good actually. Make sure that
build
is build dir of your target module,
d

dylan

04/09/2018, 3:16 PM
just used the Analyze APK to inspect the bytecode
👍 1
g

gildor

04/09/2018, 3:17 PM
Good point, forgot that Analyze APK also allows you to do that
d

dylan

04/09/2018, 3:38 PM
Stupid instant run make it annoying to analyze the bytecode
do you perhaps know if there is a example somewhere for
@Parcelize
with custom typeParcelers? since Date is serialized instead of having a custom parceler for which makes it slow
g

gildor

04/09/2018, 3:42 PM
Actually there is a problem with docs for Parcelize (at least last time when I checked them) There is proposal document not sure that it’s up to date but there are some examples: https://github.com/Kotlin/KEEP/blob/master/proposals/extensions/android-parcelable.md
Do you really have such big performance penalty when use Serializable Date?
d

dylan

04/09/2018, 4:00 PM
might also be because if multiple List<T extends Parcelable> classes
those are the only 2 thing in the objects that might be more complex there are just
String/Float/Int/T extends Parcelable
classes.