<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arda Ilgaz on Medium]]></title>
        <description><![CDATA[Stories by Arda Ilgaz on Medium]]></description>
        <link>https://medium.com/@ardailgaz?source=rss-db28f0cab89------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_Fr-Y7ORSYj4su6I.</url>
            <title>Stories by Arda Ilgaz on Medium</title>
            <link>https://medium.com/@ardailgaz?source=rss-db28f0cab89------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:16:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ardailgaz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Shhh! You need to get your app ready for 64 Bit Requirement]]></title>
            <link>https://medium.com/@ardailgaz/shhh-you-need-to-get-your-app-ready-for-64-bit-requirement-9bb7b313438f?source=rss-db28f0cab89------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bb7b313438f</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[64-bit]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Arda Ilgaz]]></dc:creator>
            <pubDate>Thu, 25 Jul 2019 09:12:42 GMT</pubDate>
            <atom:updated>2019-07-25T09:12:42.611Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F5364591&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fbutthurt-gif-5364591&amp;image=https%3A%2F%2Fmedia.tenor.com%2Fimages%2F3b5a9f709d6ddbedbd1f214afbeadc59%2Fraw&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f3403c7772c59ba13268c157a5d144b/href">https://medium.com/media/0f3403c7772c59ba13268c157a5d144b/href</a></iframe><h3>Shhh! You need to get your app ready for 64 Bit Requirement</h3><p>Starting August 1, 2019, apps published on Google Play will need to support 64-bit architectures.</p><p>This means for developers, that we must take some steps to ensure that our 32 Bit application is ready to support 64 Bit Android Devices, if we want to update an app or submit a new app after this deadline.</p><p>React Native integrated the support for 64 Bit from version 0.59 on, and previous React Native versions only ship with 32 Bit native modules. However what if we simply do not want to upgrade our React Native version? Continue reading.</p><p>Updating the app for 64 Bit Devices do have some quirks, dependant on whether native modules (ndk) are used or not and if 64 Bit versions of those libraries are available or not.</p><p>We will start editing our android/app/build.gradle file. Change abiFilters on android.splits.abi to the line below to add build-support for arm64-v8a and/or x86_64 architectures.</p><pre>abiFilters “armeabi-v7a”, “x86”, “arm64-v8a”, “x86_64&quot;</pre><p>so it looks like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/debadccb27b113a4f6d01e4db343f836/href">https://medium.com/media/debadccb27b113a4f6d01e4db343f836/href</a></iframe><p>Find your android.applicationVariants entry as well. It should look sth like below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9638788ceb691ebddeb56df366689650/href">https://medium.com/media/9638788ceb691ebddeb56df366689650/href</a></iframe><p>Check also if the order of the architectures are the same as abiFilters above.</p><p>To find out if any further configuration will be required or not, we will need to analyze the apk. Get a release with cd android &amp;&amp; ./gradlew assembleRelease. Then drag this APK into the Editor window of Android Studio and see list of files. Expand the lib folder and under that you will see supported native libraries for all architectures.</p><p>All of these different architecture folders should contain same native libraries. If you have the same .so libraries under each architecture, you are ready for 64 Bit Support Requirement.</p><p><strong>What if they are not same</strong></p><p>If you are using any external SDKs or libraries, it is pretty likely you will not find the same files. In this case, you do have two options. <a href="https://developer.android.com/distribute/best-practices/develop/64-bit">Android</a> team suggested and proper way is:</p><blockquote>Reach out to the SDK or library owner if a 64-bit version is not available and take this into account when planning your support for 64-bit devices.</blockquote><p>so you can build and package those artifacts in your APK.</p><p>If you do not implement a workaround and package in this state, app should still work on 32 devices but will crash on 64 bit ones as the 64 bit libraries will be missing. However, 64 Bit Devices are actually falling down to use 32 bit versions of these native libraries if it is configured. To do this, you will need to list missing 64 bit ndk modules and add them to defaultConfig.</p><p>Add a packagingOptions entry if it is not there and exclude libraries found when analyzing the apk.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/edb25c0bee05eacb61b83de4e238b5c3/href">https://medium.com/media/edb25c0bee05eacb61b83de4e238b5c3/href</a></iframe><p>The first entry is to exclude all the libraries. If you want to exclude just the missing libraries, so you can later edit this entry and remove when library authors provide 64 bit versions, go with the second approach.</p><p>Feel free to comment if you have a question or remark.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bb7b313438f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Containerised mobile app delivery]]></title>
            <link>https://medium.com/@ardailgaz/containerised-mobile-app-delivery-c0d6aac058df?source=rss-db28f0cab89------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0d6aac058df</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[circleci]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Arda Ilgaz]]></dc:creator>
            <pubDate>Sun, 16 Jun 2019 17:57:46 GMT</pubDate>
            <atom:updated>2019-06-16T18:00:34.826Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*hClfljxq29JkJrgiwR_v5g.png" /><figcaption>I know, you can’t resist Moby Dock</figcaption></figure><p><em>This is initial story for a react native focused automatisation series.</em></p><p>To date, as of 16 June 2019, <a href="https://github.com/facebook/react-native">230.869</a> public repository on Github is dependant on React Native.</p><p>Some of us really love to work with it, but pretty much all of us CAN play with it, whether you are on mac, windows, or linux. RN has substantially removed entry barriers to mobile app development.</p><p>But let us admit it. There are some quirks. Packager caches, native environment configurations, waiting times, not to mention the undesirable experience of running Node.JS on windows. Not all of us start with high-end Mac’s.</p><p>However, various technologies offers the chance to delegate some of your development workflow into integration tools and improve development experience a lot.</p><h3>What is this series about</h3><p>I would like to focus automising React Native development on various parts. Ultimate target is releasing to Google Play Store and Apple Appstore from your command line with just one line code, with the least steps necessary to take, while trying to avoid usage of external tools as much as possible so we will do implement a free but customisable and full integration.</p><p>With lots of changes happening, especially on Google side about how you should bundle, the requirement to provide 64 bit native modules, multiple options for app presence update like Fastlane or <a href="https://developers.google.com/android-publisher/api-ref/">android-publisher</a> from Google Play Developer Api, there are some consideration to be made along this journey, and I would like to experiment in some parts with different options.</p><p>Although there are lots of resources online explaining parts of this integration, I was unable to find an exact up-to-date implementation example, and it led to the idea of making one for reference, so I hope this will be useful for some when we finish.</p><p>But, I do not think that I will be able to prepare and post about every necessary step, so BEWARE that in the future I may skip some steps fast.</p><h3>Some overview</h3><p>I will not explain or make a comparison of the continuous integration tools. Final code at the end of this story is hosted on <a href="https://github.com/nomoreboredom/react-native-ci">Github</a>, so feel free to have a look. We will use Docker to create our containers and publish them on public docker registry, and then use Circle CI to run our tests, build, and get the package.</p><p>For releasing to stores, I want to explore both Fastlane and android-publisher options.</p><p>Android will be running on a linux system, however for IOS part, either having a dedicated macOS or usage of online services will be required. Therefore, for simplicity, I am starting with android part.</p><h3>Starting with Docker Container</h3><p>Docker provides the options to configure your container to emulate an operating system. This means, we will need to configure an /-or multiple environment/-s where we can run Android and IOS.</p><p>Go to <a href="https://hub.docker.com/">hub.docker.com</a> and create repository. You can use a name like react-native-automatisation-android. We will use this repo to push our image after we build it on our local.</p><p>Create a .circleci folder on the root of your project folder, and add an empty Dockerfile to this folder.</p><p>We will use this Dockerfile to configure our system to run react native for android on a linux machine:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/919204ada99e483decffa2b696c5e86a/href">https://medium.com/media/919204ada99e483decffa2b696c5e86a/href</a></iframe><p>The file itself is pretty self explanatory. React Native ships on current version with the following buildscript for Android:</p><pre>buildToolsVersion = &quot;28.0.3&quot;<br>minSdkVersion = 16<br>compileSdkVersion = 28<br>targetSdkVersion = 28<br>supportLibVersion = &quot;28.0.0&quot;</pre><p>so we are configuring Dockerfile to install these dependencies, in addition to generic Google dependencies, Node.JS, react-native-cli etc. Depending on your native modules, you may need to add one or two but this should pretty much cover most of the projects.</p><p>Copy the configuration into Dockerfile and run this on terminal:</p><pre>docker login <br>cd ./circleci<br>docker build -t YOURUSERNAME/react-native-automatisation-android:0.0.1<br>docker push YOURUSERNAME/react-native-automatisation-android:0.0.1</pre><p>And build your Docker image. This will take a while, so be patient.</p><p>After your repo on Docker registry receives this commit we can start using this linux image on Circle CI.</p><h3>Circle CI setup</h3><p>You will only need to complete the step below on <a href="https://circleci.com/add-projects">https://circleci.com/</a>.</p><ul><li>Sign In with your Github account and navigate too Add Project, then click on Set Up Project for the project you want to use.</li></ul><p>After this is completed, Circle CI will follow your repo to run the integration every time you commit to your github repo.</p><p>Circle CI checks for the config.yml file under ./circleci to define which docker image to use. Create an empty config.yml file and add this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c76fca1643d96445c53cedd284e65203/href">https://medium.com/media/c76fca1643d96445c53cedd284e65203/href</a></iframe><p>We will define our own executor and use the docker image we have prepared. Let us call it android-executor and configure image for your repo on Docker registry.</p><p>There are 4 jobs defined here, namely build, test, compile, and deploy . All jobs are executed sequentially as they are dependant on previous jobs (or files generated on previous job). This also explains why cache is used for node_modules on the configuration, for now just node_modules are carried between stages but we will add more files there later.</p><p>If you encounter the error below on your integration, you may need to enable pipelines at the bottom of the Advanced section of Settings page for your project in the CircleCI app. Keep in mind pipeline do require 2.1 configuration.</p><pre>* &quot;android-executor&quot; is not a supported executor type. The supported executor types are &quot;docker&quot;, &quot;macos&quot;, &quot;machine&quot;</pre><h3><strong>Creating Android release and managing key</strong></h3><p>I will skip the steps for creating signing key. You can refer to this <a href="https://facebook.github.io/react-native/docs/signed-apk-android">link</a> for this step. Create your keystore file (I sticked with the name rnci-upload-key, so change relevant parts accordingly) and configure your project.</p><p>We obviously do not want to check in sensitive info to our repo, so to create a release on Circle CI in a safe way, we will need to add sensitive info as environment variables to Circle CI and use from there while bundling.</p><p>First, locate your keystore file and encode base64 with:</p><pre>base64 rnci-upload-key.keystore //CHANGE FILENAME TO YOUR KEY</pre><p>Copy the result and add a KEYSTORE environment variable to our project on Circle CI. Additionally, we also need to add passwords for store and key.</p><p>Add them as MYAPP_UPLOAD_STORE_PASSWORD and MYAPP_UPLOAD_KEY_PASSWORD.(If you used different passwords, otherwise just add one variable for both.)</p><p>Last step to make this work will be editing signingConfigs on android/app/build.gradle. Replace release entry with:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/319bf8f3754e2de180e3c7d97e23be00/href">https://medium.com/media/319bf8f3754e2de180e3c7d97e23be00/href</a></iframe><p>Notice now we are reading store and key passwords from Circle CI System environment if they are available.</p><p>And finally compile job will look like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/404e43f685ebe581aa6ca00f1200d6c6/href">https://medium.com/media/404e43f685ebe581aa6ca00f1200d6c6/href</a></iframe><p>This is pretty much all of the steps needed to get a release on CI for Android. Exporting the Apk is missing as it isn’t necessary for the sake of this series but check the <a href="https://circleci.com/docs/2.0/artifacts/">official documentation</a> if you need it.</p><p>It takes a while to configure all but result is satisfying at the end. Feel free to comment if you have any question or feedback. You can find the repo for final code <a href="https://github.com/nomoreboredom/react-native-ci">here</a>.</p><p>Next post, I will pick it up from here to continue with deployment to Google App Store.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0d6aac058df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wanna some Node.JS core modules on mobile?]]></title>
            <link>https://medium.com/@ardailgaz/wanna-some-node-js-core-modules-on-mobile-3e047511b915?source=rss-db28f0cab89------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e047511b915</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[iphone]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Arda Ilgaz]]></dc:creator>
            <pubDate>Fri, 07 Jun 2019 19:50:39 GMT</pubDate>
            <atom:updated>2019-06-09T09:12:23.792Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LD82M6c-fw5mU_WgZNopyg.png" /></figure><h3>Wanna some node.js core modules on mobile?</h3><p>Programming tools are dynamic. It changes a lot, and rapidly. It is gonna be write once ANYTHING, then run ANYWHERE, just a question of when.</p><p>Perhaps we are decades behind but you can already ease your development cycle already. If you want to use core node.js modules like buffer to handle binary data or vm to compile Javascript code in a virtual machine on mobile, keep on reading.</p><p>This article will cover react native integration for now. It is a rather quirky thing, so I wanted to quickly explain what is the issue here and show a simple example.</p><h3><strong>But why </strong>node.js<strong> on mobile?</strong></h3><p>Because we can, and probably have to.</p><p>Working with React Native in a blockchain focused company, <a href="https://slock.it/">Slock.it</a>, swimming near Ethereum shores, I was provided with a Javascript library dependant on core node.js modules. Ethereum Foundation provides web3 library to interact with Ethereum JSON RPC. Although it is possible to write custom RPC calls to interact with Ethereum Nodes and avoid usage of web3, it will be time consuming and obviously increase entry barrier to Blockchain. Alike, decentralised apps ecosystem is hugely dominated by JS applications.</p><p>Considering mobile use offerings of Blockchain Technology, most practical approach looks like this as of now, not to mention the possibility to integrate tons of node.js applications without hassle.</p><h3><strong>Some background info</strong></h3><p>Node.js runtime environment is built on Javascript V8 Engine, which is also used in chrome browsers, and runs in windows, macOS, and linux systems. Being google’s own baby, Android is shipped with V8. However, Apple forbids just-in-time compilation and therefore it can not run V8, but supplies IOS with JavaScriptCore Framework which is running in WebKit, and used in safari.</p><h3><strong>How it works</strong></h3><p><em>The final code of this story is to be found on </em><a href="https://github.com/nomoreboredom/rn-node-js"><em>https://github.com/nomoreboredom/rn-node-js</em></a></p><p>Simply, the idea is using browser versions of core node libraries like events, stream, path, url, assert, buffer, util etc. instead original ones. Additionally, the configuration will involve hacking react native node modules to provide mappings with browserfy-ied (and react-native-ied) modules. This way, the application will be served with mapped modules, instead of original modules.</p><p>Luckily, Tradle.io provides <a href="https://github.com/tradle/rn-nodeify">rn-nodeify</a> to automate this process.</p><p>First, start with adding &quot;rn-nodeify&quot;: &quot;github:tradle/rn-nodeify&quot; to your package.json under devDependencies and run npm install.</p><p>Second step will be installing wanted core node.js modules. If you application is large or if you don’t want to waste time with finding out which modules are exactly used, you can go ahead and run:</p><pre>./node_modules/.bin/rn-nodeify --install --hack</pre><p>and install <a href="https://github.com/tradle/rn-nodeify/blob/master/shims.js">ALL</a> core node.js modules.</p><p>However, <a href="https://github.com/tradle/rn-nodeify">rn-nodeify</a> provides also an option to install individual packages. In this case just add as an option:</p><pre>./node_modules/.bin/rn-nodeify - install &#39;util, buffer, etc.&#39; - hack</pre><p>This will create shim.js in your root directory, add react-native and browser fields to your package.json. If you installed all modules, on your dependencies in package.json, you should see these dependencies added:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f102a101f88371e9e1e311bc6232c68/href">https://medium.com/media/3f102a101f88371e9e1e311bc6232c68/href</a></iframe><p>Note the dependencies starting with react-native like react-native-crypto. You will need to link those modules running react-native link, as they are native modules. Also worth to note, check shims.js if require(‘crypto’) is uncommented in case you installed crypto module.</p><p>Finally, we will import shims to top of our entry file, index.js</p><pre>import &#39;./shim.js&#39;</pre><p>After this, you will be able to import any module and use within your react native app. See below for an example usage from react side:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f5257a37394b40faceec42f1fdac359/href">https://medium.com/media/9f5257a37394b40faceec42f1fdac359/href</a></iframe><h3>Couple of Quirks</h3><p>The mappings do get messed up after single npm package installation, so you may encounter unresolved modules. In that case you need to trigger ./node_modules/.bin/rn-nodeify --install --hack again. Based on my experience the best is adding this as postinstall script on package.json, and after any npm package installation, just removing node_modules and reinstalling.</p><p>Also, cleaning react-native caches helps a lot, putting below for reference:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/803031ab4a3df6d97b8e3964292d2701/href">https://medium.com/media/803031ab4a3df6d97b8e3964292d2701/href</a></iframe><p>Feel free to comment and check issues on <a href="https://github.com/tradle/rn-nodeify">rn-nodeify</a> github repo if you encounter any problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e047511b915" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>