tag:blogger.com,1999:blog-56162934385070352572024-03-13T20:08:39.976-04:00alxr.ru:boch.vladimirhttp://www.blogger.com/profile/11070172973854025713noreply@blogger.comBlogger54125tag:blogger.com,1999:blog-5616293438507035257.post-33431020709274073312025-02-01T07:32:00.003-05:002021-12-27T10:27:18.383-05:00Aleksandr Koscheev<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMFGysv2j51lS8bF2Qh8DfKW8L5gYEEbjCxJHfkGyAh7XV7uGLImjliw3mIej32tdyTZ2hONVlhaRNRjkWBYmGsY9cAfQew54XYS4bMFWKrbamgWmtKkDBvJJxI20Y7_SC4eRxVW7XfYg/s1600/Alexandr.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMFGysv2j51lS8bF2Qh8DfKW8L5gYEEbjCxJHfkGyAh7XV7uGLImjliw3mIej32tdyTZ2hONVlhaRNRjkWBYmGsY9cAfQew54XYS4bMFWKrbamgWmtKkDBvJJxI20Y7_SC4eRxVW7XfYg/s320/Alexandr.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<h3 style="text-align: center;"><br /></h3>
<div style="text-align: center;">
<h4>
Phone<i>:</i><i> (+521) 998 424 8890</i></h4>
<h4>
Email <a href="mailto:aleksandr.koscheev@gmail.com" style="font-style: italic;">aleksandr.koscheev@gmail.com</a></h4>
<div>
<i><a href="mailto:aleksandr.koscheev@gmail.com"><br /></a></i></div>
<div>
<b>Telegram </b>@mx_alxr</div>
<h4>
LinkedIn profile: <span face=""helvetica" , "freesans" , "liberation sans" , "helmet" , "arial" , sans-serif" style="background-color: #f6f6f6; line-height: 17px;"></span><a href="https://www.linkedin.com/in/aleksandr-alex-koscheev-b7260062/">https://www.linkedin.com/in/aleksandr-alex-koscheev-b7260062/</a></h4>
<div>
<a href="https://goo.gl/aCiriR"><b>Resume</b></a></div>
</div>
<div style="text-align: center;">
<div style="-webkit-text-stroke-width: 0px; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; widows: 1;">
<div style="color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; margin: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<i></i></div>
<div style="text-align: center;">
<div style="color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; margin: 0px; text-align: right; text-transform: none; white-space: normal; word-spacing: 0px;">
<i><i><i><a href="skype:tech_support_jetpc?call" target="_blank"><br /></a></i></i></i></div><div style="margin: 0px; text-align: left; widows: 2;"><div style="text-align: right;"><span style="font-size: 14px; white-space: pre-line;">I am living in Guadalajara, Jalisco and I have a permanent residency.</span></div><span style="font-size: 14px; white-space: pre-line;"><div style="text-align: right;"> If you're about to offer a job, here are my reqirements:</div><div style="text-align: right;"> - hire type: independent contractor</div><div style="text-align: right;"> - minimal rate: 55 USD/hr.</div><div style="text-align: right;"> - hours per month - 168.</div><div style="text-align: right;"> - minimal contract duration: 1 year.</div><div style="text-align: right;"> - no relocation.</div></span></div><div style="color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px;"><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: rgba(0, 0, 0, 0.08); font-size: 14px; text-align: left; white-space: pre-line; widows: 2;"><br /></span></div>
</div>
<div style="color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; margin: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<i></i></div>
</div>
</div>
</div>
Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-50780875730058708192020-01-03T17:37:00.003-05:002020-01-03T17:37:38.714-05:00Set application default locale<a href="https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758">https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com1tag:blogger.com,1999:blog-5616293438507035257.post-4490870923153731322019-05-27T06:16:00.001-04:002019-05-27T06:16:28.191-04:00LITHO<a href="https://fblitho.com/">https://fblitho.com/</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-46085743738385440722019-04-25T16:44:00.001-04:002019-04-25T16:44:20.832-04:00airbnb <a href="https://github.com/airbnb/lottie-android">https://github.com/airbnb/lottie-android</a><br />
<br />
<br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-9410663672861783142019-04-20T08:18:00.002-04:002019-05-22T11:24:41.813-04:00MovieDatabaseDemo<h4>
<span style="font-weight: normal;"><span style="font-family: "arial" , "helvetica" , sans-serif;">This is </span><span style="background-color: white;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Application page for my demo application performed as </span><span style="font-family: "arial" , "helvetica" , sans-serif; font-style: italic;">code challenge</span><span style="font-family: "source sans pro" , "arial" , sans-serif;"><i> </i>within </span></span></span><span style="font-family: "source sans pro" , "arial" , sans-serif;"><span style="font-weight: 400;">recruitment process in some company (or companies).</span></span></h4>
<div>
<span style="font-weight: normal;"><span style="background-color: white;"><span style="font-family: "source sans pro" , "arial" , sans-serif;">Sources page will be added later...</span></span></span><br />
<span style="font-weight: normal;"><span style="background-color: white;"><span style="font-family: "source sans pro" , "arial" , sans-serif;"><br /></span></span></span>
<span style="font-weight: normal;"><span style="background-color: white;"><span style="font-family: "source sans pro" , "arial" , sans-serif;"><br /></span></span></span>
<span style="font-weight: normal;"><span style="background-color: white;"><span style="font-family: "source sans pro" , "arial" , sans-serif;"><br /></span></span></span>
<span style="font-family: source sans pro, arial, sans-serif;"><span style="background-color: white;">Update:</span></span><br />
<span style="font-family: source sans pro, arial, sans-serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: source sans pro, arial, sans-serif;"><span style="background-color: white;">code <a href="https://github.com/ru-alxr/Android_native_exercise">https://github.com/ru-alxr/Android_native_exercise</a></span></span><br />
<span style="background-color: white; font-family: "source sans pro", arial, sans-serif;">apk : </span><a href="https://drive.google.com/open?id=1s0ZPd8ehYYKDWXoWvp_IgtzYODq5R__c" style="font-family: "source sans pro", arial, sans-serif;">https://drive.google.com/open?id=1s0ZPd8ehYYKDWXoWvp_IgtzYODq5R__c</a><br />
<span style="font-family: source sans pro, arial, sans-serif;"><span style="background-color: white;"><br /></span></span></div>
<div>
<span style="font-weight: normal;"><span style="background-color: white;"><span style="font-family: "source sans pro" , "arial" , sans-serif;"><br /></span></span></span></div>
<div>
<span style="font-weight: normal;"><span style="background-color: white;"><span style="font-family: "source sans pro" , "arial" , sans-serif;"><br /></span></span></span></div>
Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com2tag:blogger.com,1999:blog-5616293438507035257.post-60023779912178049622019-04-13T04:46:00.000-04:002019-04-13T04:46:06.029-04:00Regarding splitting Firebase project<a href="https://firebase.googleblog.com/2016/08/organizing-your-firebase-enabled-android-app-builds.html">https://firebase.googleblog.com/2016/08/organizing-your-firebase-enabled-android-app-builds.html</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-39865996929533796822019-03-28T05:21:00.000-04:002019-03-28T05:21:02.419-04:00Github: fork your own repo<a href="http://deanmalone.net/post/how-to-fork-your-own-repo-on-github/">http://deanmalone.net/post/how-to-fork-your-own-repo-on-github/</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-54420262566724640962019-01-17T14:04:00.002-05:002019-01-17T14:04:35.186-05:00ButterKnife toolTo generate ButterKnife injections:<br />
<a href="https://github.com/avast/android-butterknife-zelezny">https://github.com/avast/android-butterknife-zelezny</a><br />
<br />
<br />
<br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-33502756330095481762018-11-16T20:22:00.002-05:002018-11-16T20:22:14.339-05:00RxJava and UndeliverableExceptionYou think you wrote onError and you're safe? Hehehe... Bad news: you can crash with UndeliverableException.<br />
To fix set callback<br />
<br />
<script src="https://gist.github.com/ru-alxr/04db9030dcf306cbb65cbdb87c3a72db.js"></script>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-276433026366616842018-08-31T12:54:00.000-04:002018-08-31T12:54:13.986-04:00Trick about layouts directory<a href="https://medium.com/@shishir_13/layouts-in-different-folders-in-android-app-98468bd507c7">Layouts in different folders in Android App</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-26052516530023915782018-08-26T03:20:00.002-04:002018-08-26T03:20:54.081-04:00Key hash for Android-Facebook app<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Trick from <a href="https://stackoverflow.com/questions/4388992/key-hash-for-android-facebook-app">stackoverflow</a></div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
The instructions currently in <a href="http://developers.facebook.com/docs/guides/mobile/android/" style="border: 0px; box-sizing: inherit; color: #005999; cursor: pointer; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Facebook's Android Tutorial</a> do not work well under <strong style="border: 0px; box-sizing: inherit; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Windows</strong>. Their example shows how to pipe the keytool output to openssl but if you try this under Windows the output is not valid for some reason.</div>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Start by downloading <a href="http://code.google.com/p/openssl-for-windows/" style="border: 0px; box-sizing: inherit; color: #005999; cursor: pointer; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">openssl for Windows</a> from Google.</div>
<pre class="default prettyprint prettyprinted" style="background-color: #eff0f1; border: 0px; box-sizing: inherit; color: #393318; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; box-sizing: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">C</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">\Users\Me</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">></span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">keytool </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">exportcert </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">alias</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> my_key </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">keystore </span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">my</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">keystore </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">storepass PASSWORD </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">></span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> mycert</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin
C</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">\Users\Me</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">></span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">openssl sha1 </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">binary mycert</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">></span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> sha1</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin
C</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">:</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">\Users\Me</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">></span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">openssl base64 </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">in</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> sha1</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">bin </span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="kwd" style="border: 0px; box-sizing: inherit; color: #101094; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">out</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> base64</span><span class="pun" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; box-sizing: inherit; color: #303336; font-family: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">txt</span></code></pre>
<div style="background-color: white; border: 0px; box-sizing: inherit; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
After running these commands the valid hash is stored in the file base64.txt. Copy and paste this to your app settings on Facebook.</div>
Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-60267056105428068712018-08-21T02:17:00.002-04:002018-11-12T17:01:27.671-05:00RecyclerView inside LinearLayout with weightSumIf you use following layout (simplified):<br />
<script src="https://gist.github.com/ru-alxr/9f4ea7ce0e885ad47fc909788cdc4937.js"></script>
<br />
then you can face with strange bug:<br />
adapter of the second RecyclerView binds all items at the same time!<br />
It causes unpredictable slowing of UI and frustration of developer.<br />
The only solution is to avoid this layout, for example - use RelativeLayout and set RV's<br />
width programmatically.<br />
Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-33019808633898692632018-08-18T19:55:00.003-04:002018-08-18T19:56:35.871-04:00Sometimes nothing helps<h2 style="text-align: center;">
<br /></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxCk2xI-72Ws-j_Sv6qarp9HyWuWkxZsjErZkTIGGxAbfeXda50AExhdkOEvY7e0ENCf9rPEf1qK_PqpuLD51I6Vz4wkP45VdDMS5oHfrNjq7Rw29cfd63mKF_FiGuy1kz1GRDfx_5Vtw/s1600/when_something_goes_wrong.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="701" data-original-width="500" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxCk2xI-72Ws-j_Sv6qarp9HyWuWkxZsjErZkTIGGxAbfeXda50AExhdkOEvY7e0ENCf9rPEf1qK_PqpuLD51I6Vz4wkP45VdDMS5oHfrNjq7Rw29cfd63mKF_FiGuy1kz1GRDfx_5Vtw/s1600/when_something_goes_wrong.jpg" /></a></div>
<br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com1tag:blogger.com,1999:blog-5616293438507035257.post-72879404828285809292018-08-03T16:41:00.000-04:002018-11-12T17:17:47.019-05:00Final solution for leaking context with InputMethodManager <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjCFQyVy_pZGvuv3M1sr6G1xAc4pQOTTAeZnah62dIU0Q3odBJbcRbXeiqOew0UFHonRweVXXoVBO4nNM47yaS2Dd18xyLr4_wu70PadwmwnljPEl7ukAq1uIhVKenTouYO8hEjSU-3r4/s1600/2018-08-03_15-34-26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="651" data-original-width="394" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjCFQyVy_pZGvuv3M1sr6G1xAc4pQOTTAeZnah62dIU0Q3odBJbcRbXeiqOew0UFHonRweVXXoVBO4nNM47yaS2Dd18xyLr4_wu70PadwmwnljPEl7ukAq1uIhVKenTouYO8hEjSU-3r4/s640/2018-08-03_15-34-26.png" width="385" /></a></div>
<br />
Pretty annoying, right?<br />
I've tried already solution with transparent DummyActivity but it has some negative effects.<br />
Here is <a href="https://gist.github.com/pyricau/4df64341cc978a7de414">solution</a> provided via leakcanary and code with minor modifications:<br />
<br />
<script src="https://gist.github.com/ru-alxr/09e8db1c4de3f0466b455d115c83254c.js"></script>
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><br /></span>
<span style="font-family: inherit; font-size: xx-small;">and helper class</span><span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"> </span><br />
<script src="https://gist.github.com/ru-alxr/f8d8b674564a6cc2d9be29a743c27bc8.js"></script>
<br />
And then add line into onCreate method of your application:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZEoEqvOJwUf88LBxZmqMYN4PLeFXSBu5-nYlzAFlxXboGNTqU2EO1ubrAQJdCPspJZgamyaL6U9Fqtr8omB1aJ4FZDFTVmjaFByFX72Xy6BuyGM4TRgqVuOWduiMJV2fGozFMvjBsCbM/s1600/2018-11-12_17-12-41.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="29" data-original-width="452" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZEoEqvOJwUf88LBxZmqMYN4PLeFXSBu5-nYlzAFlxXboGNTqU2EO1ubrAQJdCPspJZgamyaL6U9Fqtr8omB1aJ4FZDFTVmjaFByFX72Xy6BuyGM4TRgqVuOWduiMJV2fGozFMvjBsCbM/s1600/2018-11-12_17-12-41.png" /></a></div>
<br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-32758028538827741372018-06-01T08:35:00.001-04:002018-06-01T08:35:52.023-04:00<a href="https://medium.com/@anitaa_1990/android-interview-questions-cheat-sheet-96ea01c88def">Android Interview Questions Cheat Sheet</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-74848162493793945402018-05-14T13:44:00.003-04:002018-05-14T13:44:52.753-04:00<a href="https://github.com/facebook/shimmer-android">Shimmer effect</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvGVGUxart-kkx4NoP7XvWulLpwiFW9VTtevzRauiSy0fgplugG3dWB5LVnEn5_PRMCBH3DrlHPD2pE2JYrKyffRHAq6ETEG6I5xJ0hbgq8GIMe7YdVMN-xBPOlqQwa3A9PTxp-p9XYCA/s1600/shimmer.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="370" data-original-width="540" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvGVGUxart-kkx4NoP7XvWulLpwiFW9VTtevzRauiSy0fgplugG3dWB5LVnEn5_PRMCBH3DrlHPD2pE2JYrKyffRHAq6ETEG6I5xJ0hbgq8GIMe7YdVMN-xBPOlqQwa3A9PTxp-p9XYCA/s320/shimmer.gif" width="320" /></a></div>
<br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-39646688084294122312018-03-16T10:26:00.002-04:002018-03-16T10:26:53.872-04:00Note: check this - Android Drawable ImporterAleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-9813211997944977492018-03-06T16:04:00.001-05:002018-03-09T03:11:45.403-05:00API coverage<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnPU5uvQaJFDWl7AHokNuS2CLV-ZGaEFcC8hqotby3uuPRb-IWtJSgvsGlf98M1O-Y4y-A8DTPbmjxK-rY9Zw5NuvIX-1od0hSX2ZpWQDyRqBSUGSll2OKFM4fDNXBLXae-Rh9M7Bv9nE/s1600/2018-03-06_16-03-11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="589" data-original-width="1007" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnPU5uvQaJFDWl7AHokNuS2CLV-ZGaEFcC8hqotby3uuPRb-IWtJSgvsGlf98M1O-Y4y-A8DTPbmjxK-rY9Zw5NuvIX-1od0hSX2ZpWQDyRqBSUGSll2OKFM4fDNXBLXae-Rh9M7Bv9nE/s400/2018-03-06_16-03-11.jpg" width="400" /></a></div>
<br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-37495835653641873582018-02-20T13:15:00.002-05:002018-02-20T13:15:46.908-05:00Realm and threadsJust created objects could be touched in any thread, framework does not mind.<br />
<br />
<pre style="background-color: white; font-family: "Courier New";"><span style="font-size: x-small;"><span style="color: navy; font-weight: bold;">new </span>AsyncTask<Void, Void, Dummy>() {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected </span>Dummy doInBackground(Void... voids) {
Dummy dummy = <span style="color: navy; font-weight: bold;">new </span>Dummy(<span style="color: green; font-weight: bold;">"a"</span>, <span style="color: green; font-weight: bold;">"b"</span>);
Realm realm = Realm.<span style="font-style: italic;">getDefaultInstance</span>();
realm.beginTransaction();
realm.insertOrUpdate(dummy);
realm.commitTransaction();
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
dummy.getKey(),
dummy.getValue()
)
.log();
<span style="color: navy; font-weight: bold;">new </span>Thread(<span style="color: navy; font-weight: bold;">new </span>Runnable() {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public void </span>run() {
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
<span style="color: #660e7a;">dummy</span>.getKey(),
<span style="color: #660e7a;">dummy</span>.getValue()
)
.log();
<span style="color: #660e7a;">dummy</span>.setValue(<span style="color: green; font-weight: bold;">"c"</span>);
Realm realm = Realm.<span style="font-style: italic;">getDefaultInstance</span>();
realm.beginTransaction();
realm.insertOrUpdate(<span style="color: #660e7a;">dummy</span>);
realm.commitTransaction();
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"UPDATED : THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
<span style="color: #660e7a;">dummy</span>.getKey(),
<span style="color: #660e7a;">dummy</span>.getValue()
)
.log();
}
}).start();
<span style="color: navy; font-weight: bold;">return </span>dummy;
}
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected void </span>onPostExecute(Dummy dummy) {
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
dummy.getKey(),
dummy.getValue()
)
.log();
}
}.execute();</span></pre>
<pre style="background-color: white; font-family: "Courier New";"><span style="font-size: x-small;">
</span></pre>
<pre style="background-color: white; font-family: "Courier New";"><b>Output is</b></pre>
<pre style="background-color: white;"><span style="font-size: x-small;"><span style="font-family: Courier New;">THREAD AsyncTask #1 b - a
THREAD main b - a
THREAD Thread-6 b - a
UPDATED : THREAD Thread-6 b - c
</span></span></pre>
<pre style="background-color: white;"><span style="font-size: x-small;"><span style="font-family: Courier New;">
</span></span></pre>
<pre style="background-color: white;"><span style="font-size: x-small;"><span style="font-family: Courier New;">Well, let's try to read the database.</span></span></pre>
<pre style="background-color: white;"><span style="font-size: x-small;"><span style="font-family: Courier New;">
</span></span></pre>
<pre style="background-color: white;"><pre style="font-family: "Courier New";"><span style="font-size: x-small;"><span style="color: navy; font-weight: bold;">new </span>AsyncTask<Void, Void, Dummy>() {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected </span>Dummy doInBackground(Void... voids) {
Realm realm = Realm.<span style="font-style: italic;">getDefaultInstance</span>();
RealmQuery<Dummy> query = realm.where(Dummy.<span style="color: navy; font-weight: bold;">class</span>);
List<Dummy> list = query.findAll();
Dummy result = <span style="color: navy; font-weight: bold;">null</span>;
<span style="color: navy; font-weight: bold;">for </span>(Dummy dummy : list){
result = dummy;
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
dummy.getKey(),
dummy.getValue()
)
.log();
<span style="color: navy; font-weight: bold;">new </span>Thread(<span style="color: navy; font-weight: bold;">new </span>Runnable() {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public void </span>run() {
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
<span style="color: #660e7a;">dummy</span>.getKey(),
<span style="color: #660e7a;">dummy</span>.getValue()
)
.log();
<span style="color: #660e7a;">dummy</span>.setValue(<span style="color: green; font-weight: bold;">"c"</span>);
Realm realm = Realm.<span style="font-style: italic;">getDefaultInstance</span>();
realm.beginTransaction();
realm.insertOrUpdate(<span style="color: #660e7a;">dummy</span>);
realm.commitTransaction();
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"UPDATED : THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
<span style="color: #660e7a;">dummy</span>.getKey(),
<span style="color: #660e7a;">dummy</span>.getValue()
)
.log();
}
}).start();
<span style="color: navy; font-weight: bold;">if </span>(result != <span style="color: navy; font-weight: bold;">null</span>) <span style="color: navy; font-weight: bold;">break</span>;
}
<span style="color: navy; font-weight: bold;">return </span>result;
}
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected void </span>onPostExecute(Dummy dummy) {
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
dummy.getKey(),
dummy.getValue()
)
.log();
}
}.execute();</span></pre>
</pre>
<div>
<span style="font-size: x-small;"><br /></span></div>
<div>
<pre style="background-color: white; font-family: "Courier New";"><b>Output is</b></pre>
<pre style="background-color: white;"><span style="font-family: Courier New; font-size: x-small;"><b>THREAD AsyncTask #1 b - c</b></span></pre>
<pre style="background-color: white;"><span style="color: red; font-family: Courier New; font-size: x-small;"><b>java.lang.IllegalStateException: Realm access from incorrect thread. </b></span></pre>
<pre style="background-color: white;"><span style="color: red; font-family: Courier New; font-size: x-small;"><b>Realm objects can only be accessed on the thread they were created.</b></span></pre>
<pre style="background-color: white;"><span style="color: red; font-family: Courier New; font-size: x-small;"><b>
</b></span></pre>
<pre style="background-color: white;">OK, lets block onPostExecute.</pre>
<pre style="background-color: white;">
</pre>
<pre style="background-color: white;">All the same:</pre>
<pre style="background-color: white;">THREAD AsyncTask #1 b - c
<span style="color: red;">java.lang.IllegalStateException: Realm access from incorrect thread.</span></pre>
<pre style="background-color: white;"><span style="color: red;">Realm objects can only be accessed on the thread they were created.</span></pre>
<pre style="background-color: white;"><span style="color: red;">
</span></pre>
<pre style="background-color: white;"><pre>OK, I can see, that you cannot touch RealmObject from different thread. </pre>
<pre>Docs are right)))</pre>
<pre>
</pre>
<pre>What to do?</pre>
<pre>Realm offers <a href="https://github.com/google/auto">AutoValue</a></pre>
<pre>
</pre>
<pre>Let's try.</pre>
<pre>Installation:</pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiljD6i0VXNytUIuvHHnySeTDOyshBJt68tbsBeMJg83O6hsxqtStoe-C_J8pJpikp_JfdtKI4_VG4Hnrsf75nc7ajSFBPPknv3d6lqUAbXEdh5gVpDxhCWHgBXqSN4-Ut_6dzWjMDXwaY/s1600/2018-02-20_12-40-41.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="563" data-original-width="1201" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiljD6i0VXNytUIuvHHnySeTDOyshBJt68tbsBeMJg83O6hsxqtStoe-C_J8pJpikp_JfdtKI4_VG4Hnrsf75nc7ajSFBPPknv3d6lqUAbXEdh5gVpDxhCWHgBXqSN4-Ut_6dzWjMDXwaY/s400/2018-02-20_12-40-41.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN2EljH9G11Upa0kEGho4adfXpZPjHtZKzsehtZoLpuayTf2guuQwbq2OGiolO1DTtTzPlgmxnA-eXRDgMqoaJQyPIJ7nwvgWD9nvpip_QnaXYUQltmHQV_r2B9kyV1JKq3elAQIX5u9c/s1600/2018-02-20_12-58-04.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="231" data-original-width="895" height="102" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN2EljH9G11Upa0kEGho4adfXpZPjHtZKzsehtZoLpuayTf2guuQwbq2OGiolO1DTtTzPlgmxnA-eXRDgMqoaJQyPIJ7nwvgWD9nvpip_QnaXYUQltmHQV_r2B9kyV1JKq3elAQIX5u9c/s400/2018-02-20_12-58-04.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
Here is abstract DummyNotARealmObject class:<br />
<pre style="font-family: "Courier New";"><span style="font-size: x-small;"><span style="background-color: #e4e4ff; color: navy; font-weight: bold;">import</span><span style="color: navy; font-weight: bold;"> </span>com.google.auto.value.<span style="color: olive;">AutoValue</span>;
<span style="color: olive;">@AutoValue</span><span style="color: navy; font-weight: bold;">public abstract class </span>DummyNotARealmObject{
<span style="color: navy; font-weight: bold;">public static </span>DummyNotARealmObject create(String key, String value) {
<span style="color: navy; font-weight: bold;">return new </span>AutoValue_DummyNotARealmObject(key, value);
}
<span style="color: navy; font-weight: bold;">public abstract </span>String getKey();
<span style="color: navy; font-weight: bold;">public abstract </span>String getValue();
}</span></pre>
<pre style="font-family: "Courier New";"><span style="font-size: x-small;">
</span></pre>
<pre style="font-family: "Courier New";"><span style="font-size: x-small;">... and modified asyncTask:</span></pre>
<pre style="font-family: "Courier New";"><span style="font-size: x-small;">
</span></pre>
<div class="separator" style="clear: both; text-align: center;">
</div>
<pre><pre style="font-family: "Courier New";"><span style="font-size: x-small;"><span style="color: navy; font-weight: bold;">new </span>AsyncTask<Void, Void, DummyNotARealmObject>() {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected </span>DummyNotARealmObject doInBackground(Void... voids) {
Realm realm = Realm.<span style="font-style: italic;">getDefaultInstance</span>();
RealmQuery<Dummy> query = realm.where(Dummy.<span style="color: navy; font-weight: bold;">class</span>);
List<Dummy> list = query.findAll();
<span style="color: navy; font-weight: bold;">final </span>DummyNotARealmObject result;
<span style="color: navy; font-weight: bold;">for </span>(Dummy dummy : list){
result = DummyNotARealmObject.<span style="font-style: italic;">create</span>(
dummy.getKey(),
dummy.getValue()
);
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
dummy.getKey(),
dummy.getValue()
)
.log();
<span style="color: navy; font-weight: bold;">new </span>Thread(<span style="color: navy; font-weight: bold;">new </span>Runnable() {
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">public void </span>run() {
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
<span style="color: #660e7a;">result</span>.getKey(),
<span style="color: #660e7a;">result</span>.getValue()
)
.log();
}
}).start();
<span style="color: navy; font-weight: bold;">return </span>result;
}
<span style="color: navy; font-weight: bold;">return null</span>;
}
<span style="color: olive;">@Override</span><span style="color: olive;"> </span><span style="color: navy; font-weight: bold;">protected void </span>onPostExecute(DummyNotARealmObject dummy) {
Debug
.<span style="font-style: italic;">get</span>()
.with(
<span style="color: navy; font-weight: bold;">this</span>,
<span style="color: green; font-weight: bold;">"THREAD %s %s - %s"</span>,
Thread.<span style="font-style: italic;">currentThread</span>().getName(),
dummy.getKey(),
dummy.getValue()
)
.log();
}
}.execute();</span></pre>
</pre>
<pre>
</pre>
<pre>Output:</pre>
<pre>THREAD AsyncTask #1 b - c
THREAD main b - c
THREAD Thread-6 b - c
</pre>
<div>
</div>
<div>
As you can see, now we can easily get access to our Dummy-object's fields from another thread.</div>
<div>
All we need is to create abstract class and declare constructor and getters. </div>
<pre>This is not as simple as when we use SQLite but I guess Realm is worth it.</pre>
</pre>
</div>
Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-85583156052008307452018-02-16T00:41:00.003-05:002018-02-16T00:43:00.087-05:00Tip: Use lambdasThe reason is that lambda does not hold strong reference and will not cause memory leak.<br />
To use lambda just add following block :<br />
<pre class="prettyprint notranslate" style="-webkit-font-smoothing: subpixel-antialiased; background: rgb(247, 247, 247); border: 1px solid rgb(221, 221, 221); color: #006600; font-family: Consolas, "Liberation Mono", Menlo, Monaco, Courier, monospace; font-size: 13px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: 18px; margin-bottom: 1em; overflow: auto; padding: 1em;" translate="no"><code style="-webkit-font-smoothing: subpixel-antialiased; font-family: Consolas, "Liberation Mono", Menlo, Monaco, Courier, monospace; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: 18px;"><span class="pln" style="color: black;">compileOptions </span><span class="pun" style="color: #666600;">{</span><span class="pln" style="color: black;">
sourceCompatibility </span><span class="typ" style="color: #660066;">JavaVersion</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">VERSION_1_8
targetCompatibility </span><span class="typ" style="color: #660066;">JavaVersion</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">VERSION_1_8
</span><span class="pun" style="color: #666600;">}</span></code></pre>
inside <b>android {...} </b>block of app level of your <b>build.gradle</b> file <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv5eQvoKq2H6jtn6e_DtLOZnTuUqBrvPXaLKU8KbbX77d_qHKFW-ugBHbqrvuphboel0L9-JkErh5x_WiY1y72_tRLdSystjJpCT02pHk-lQJHbrN5Iu3oxTZty822sntUxBkthDyp6cw/s1600/2018-02-16_00-40-03.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="401" data-original-width="684" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv5eQvoKq2H6jtn6e_DtLOZnTuUqBrvPXaLKU8KbbX77d_qHKFW-ugBHbqrvuphboel0L9-JkErh5x_WiY1y72_tRLdSystjJpCT02pHk-lQJHbrN5Iu3oxTZty822sntUxBkthDyp6cw/s400/2018-02-16_00-40-03.jpg" width="400" /></a></div>
<span id="goog_371237626"></span><span id="goog_371237627"></span><br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com1tag:blogger.com,1999:blog-5616293438507035257.post-62087227555691766472018-02-14T23:40:00.001-05:002018-02-14T23:40:43.281-05:00Another one navigation libraryAnother one not a Cicerone ))<br />
<br />
<a href="https://github.com/aartikov/Alligator">https://github.com/aartikov/Alligator</a><br />
<br />
<div style="box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px;">
Alligator is a modern Android navigation library that will help to organize your navigation code in clean and testable way.</div>
<h2 style="border-bottom: 1px solid rgb(234, 236, 239); box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; padding-bottom: 0.3em;">
<a aria-hidden="true" class="anchor" href="https://github.com/aartikov/Alligator#features" id="user-content-features" style="box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Features</h2>
<ul style="box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Screens based on activities, fragments and dialog fragments.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Simple yet powerful navigation methods.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Independence from activity lifecycle (navigation is available even when an application is in background).</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Passing screen arguments without boilerplate code.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Handling screen result in object oriented style.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Screen switching with nested navigation.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Flexible animation configuring.</li>
</ul>
Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-8310190584580125452018-01-14T04:20:00.002-05:002018-01-14T04:20:54.004-05:00Useful link about Rx<a href="https://medium.com/@mohitsharma_16765/rxsubjects-cold-and-hot-observables-connectableobservable-6ab0f3020876">Hot and cold observables</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-54960811885329247882017-10-06T16:55:00.001-04:002017-10-06T16:55:39.689-04:00Drag and Swipe with RecyclerViewHere is good tutorial.<br />
<br />
<a href="https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-b9456d2b1aaf">Drag and Swipe with RecyclerView</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-24080403163908368152017-08-08T16:46:00.002-04:002017-08-08T16:46:48.738-04:00Working with imagesIf you're working with images (as background for example) you could face with big sizes of files.<br />
Something like JPEG file 1280X1920px could take about 0.5 - 1.0M depending of content.<br />
And it increases APK size!<br />
Very nice solution I found is WebP.<br />
You can download one of converters here: <a href="http://www.xnview.com/en/xnconvert/">xnconvert</a><br />
<br />
In my case I have following result: 789kb -> 96 kb (80% quality)<br />
<br />
<br />Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com0tag:blogger.com,1999:blog-5616293438507035257.post-35134827397763218152017-07-13T13:32:00.001-04:002017-07-13T13:32:19.864-04:00TODO: Implement Realm<a href="https://realm.io/">realm.io</a>Aleksandr Koscheevhttp://www.blogger.com/profile/17373812133892492281noreply@blogger.com2