<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Loki Le DEV</title>
    <description>The latest articles on DEV Community by Loki Le DEV (@loki).</description>
    <link>https://dev.to/loki</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F104860%2Fcf1909df-484a-498e-ae3d-1ea862d074ca.jpeg</url>
      <title>DEV Community: Loki Le DEV</title>
      <link>https://dev.to/loki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/loki"/>
    <language>en</language>
    <item>
      <title>How I published my first android app</title>
      <dc:creator>Loki Le DEV</dc:creator>
      <pubDate>Mon, 20 Apr 2020 22:05:19 +0000</pubDate>
      <link>https://dev.to/loki/how-i-published-my-first-android-app-1al8</link>
      <guid>https://dev.to/loki/how-i-published-my-first-android-app-1al8</guid>
      <description>&lt;p&gt;After learning android development from scratch, I'm proud to announce that I launched my first application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PiYC9Mbf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dghs7t93i6udkn82mfnc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PiYC9Mbf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dghs7t93i6udkn82mfnc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;
You can download it &lt;a href="https://play.google.com/store/apps/details?id=lokiledev.moneyman"&gt;here&lt;/a&gt;&lt;br&gt;
I also made a website for it: &lt;a href="//leboncalcul.fr"&gt;leboncalcul.fr&lt;/a&gt;&lt;br&gt;
Checkout &lt;a href="//lokile.dev"&gt;my other projects&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  But why?
&lt;/h1&gt;

&lt;p&gt;As you might not know, I'm an embedded software engineer (working on c++ code , low level libraries for an exoskeleton).&lt;br&gt;
So yes it's pretty far from mobile apps, so why make one?&lt;/p&gt;

&lt;p&gt;Well it actually started at work. We decided to make an android tablet application to allow users to configure the exoskeleton easily and wirelessly over bluetooth. &lt;/p&gt;

&lt;p&gt;Since no one in the company (a startup of ~70 people) knew how to make apps we decided to contract an agency to do it.&lt;/p&gt;

&lt;p&gt;I won't explain in details but that went very poorly, and I lost a looot of time trying to remote manage a bad developer into finishing the first version of the app without me being able to read the code..&lt;/p&gt;

&lt;p&gt;I lost so much time that I started thinking that I would probably have been able to learn how to make apps in the same time.&lt;/p&gt;

&lt;p&gt;I remember reading an article on this site about project ideas and I saw one that seemed manageable: creating an expense manager. It's like the hello world of apps (with the TODO app).&lt;/p&gt;

&lt;h1&gt;
  
  
  Learning new android with no priors
&lt;/h1&gt;

&lt;p&gt;After reading some articles I discovered that Kotlin was actually the modern and proposed language for making android apps. That shattered my prejudiced view, I was thinking it was still java (and I'm not a huge fan of java).&lt;/p&gt;

&lt;p&gt;Kotlin has really interesting features from someone coming from c++ and python.&lt;br&gt;
The nullability checks and the extension functions for example are convenient. It also mixes functional programming with object oriented nicely. And allows to perform the same stuff with less code than in java.&lt;br&gt;
I was surprised to discover that it runs in the jvm and is compatible with java.&lt;/p&gt;

&lt;p&gt;I started by following this awesome tutorial from &lt;a href="https://classroom.udacity.com/courses/ud9012"&gt;udacity&lt;/a&gt;, I really recommend it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Android modern practices
&lt;/h1&gt;

&lt;p&gt;I think I arrived at the right moment, it looks like recent releases of android frameworks are awesome, there are a lot of cool features and architectural patterns.&lt;br&gt;
Since I never made android apps before, I was kind of lucky because I didn't had to learn all the legacy way.&lt;br&gt;
They released the &lt;a href="https://developer.android.com/topic/libraries/architecture"&gt;architecture components libraries&lt;/a&gt; which allows really clean and modular designs.&lt;/p&gt;

&lt;p&gt;Let's see together some android specific terms and patterns which I learned about and tried to use in my app. I won't explain too much here since it's explained in the tutorial I linked. I can make specific articles to go deeper if requested.&lt;/p&gt;

&lt;h2&gt;
  
  
  Application vs Activity vs Fragments
&lt;/h2&gt;

&lt;p&gt;Android has a lot of specific concepts. Apparently older apps where composed of many activities. But now the recommended way is to have a single activity composed of many reusable fragments. It works for a simple app but you can still have many activities for more complex applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Android application life cycle
&lt;/h2&gt;

&lt;p&gt;Android has it's &lt;a href="https://developer.android.com/guide/components/activities/activity-lifecycle"&gt;own way&lt;/a&gt; of managing the state of the activities and fragments and it's essential to understand it to make functional and optimized applications.&lt;br&gt;
It's much simpler now thanks to LiveData and ViewModels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigation
&lt;/h2&gt;

&lt;p&gt;You now have a graphical tool and an api for representing how to navigate in your application, between fragments and back and forth in the navigation stack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cZM-q7fS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xkmxmeslro401tpn6k06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cZM-q7fS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xkmxmeslro401tpn6k06.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  MVVM Pattern
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://developer.android.com/jetpack/docs/guide#recommended-app-arch"&gt;Model-View-ViewModel&lt;/a&gt; design pattern allows to separate the data from the view, I had a hard time understanding the difference with the classic MVC.&lt;/p&gt;

&lt;h2&gt;
  
  
  xml views and constraint layout
&lt;/h2&gt;

&lt;p&gt;I loved this, you can either design your pages by editing an xml file, or there is a graphical tool for drag and dropping views. Then you can&lt;br&gt;
define constraints for organizing the views with each other. I never saw that before and it's really clever.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H5UCa9ho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bfa3jo4k8r5f9sv5y4j2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H5UCa9ho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bfa3jo4k8r5f9sv5y4j2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  DataBinding
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;FindViewById()&lt;/code&gt; is useless now. You can work on a generated &lt;em&gt;binding&lt;/em&gt; object and access the views (like a text edit) directly as an attribute of the binding object!&lt;/p&gt;

&lt;p&gt;Moreover, you can directly &lt;em&gt;store&lt;/em&gt; objects from the code inside an xml layout!&lt;br&gt;
A common pattern is to store the &lt;em&gt;ViewModel&lt;/em&gt; instance. This combined with extension functions and binding expressions on the view allows to directly link the view to the model with almost no code, it's all generated at build time and when your data changes, the view updates naturally.&lt;/p&gt;

&lt;h2&gt;
  
  
  LiveData
&lt;/h2&gt;

&lt;p&gt;This feature is based on the Observer pattern, and aims at reducing the callback hell that was android before (apparently).&lt;br&gt;
Basically you can make your database produce &lt;em&gt;livedata&lt;/em&gt; of a certain type (a transaction for example), and tell the view to &lt;em&gt;observe&lt;/em&gt; this data. Whenever the database changes, the view automatically gets updated. It's pretty powerful, but I needed some time to understand the flow of data.&lt;br&gt;
And it's lifecycle aware.&lt;/p&gt;

&lt;h2&gt;
  
  
  RecyclerView
&lt;/h2&gt;

&lt;p&gt;The base of almost every application that must display a list of data, it has an interesting garbage collecting feature and you must define adapters between your data and a custom view to use it but it's powerful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Translations
&lt;/h2&gt;

&lt;p&gt;Android has a system for storing strings in an xml file, and you can produce it in several languages, there is a built-in tool for editing it.&lt;br&gt;
I made English and French versions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Publishing on the play store
&lt;/h1&gt;

&lt;p&gt;This has been a long learning journey, it really helped to have a goal and a concrete project to work on. Having real problems to solve is essential. I discovered many interesting concepts that I can also reapply in other contexts. I understand better how native android apps are made now.&lt;br&gt;
These new android features (especially in kotlin) are less documented and I often found answers for my problems in java or with older sdks so it slowed me more.&lt;/p&gt;

&lt;p&gt;But I'm happy to have made it to the end and released my app.&lt;br&gt;
I would love some feedback on it.&lt;br&gt;
You can download it &lt;a href="https://play.google.com/store/apps/details?id=lokiledev.moneyman"&gt;here&lt;/a&gt; It is free and no adds.&lt;br&gt;
I also made a website for it: &lt;a href="//leboncalcul.fr"&gt;leboncalcul.fr&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can checkout my &lt;a href="//lokile.dev"&gt;portfolio&lt;/a&gt;, I updated it with this project and other ones and added videos now :)&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Steps
&lt;/h1&gt;

&lt;p&gt;Now I would love to see some people using it, I already collected some UI/UX feedback and made some mistakes. I limited the minimum sdk version for no reason, so the app is only available for 10% of devices...&lt;br&gt;
I will make corrections soon.&lt;/p&gt;

&lt;p&gt;Thank you for reading this and feel free to ask questions.&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>showdev</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>I made my first website!</title>
      <dc:creator>Loki Le DEV</dc:creator>
      <pubDate>Wed, 04 Mar 2020 22:47:25 +0000</pubDate>
      <link>https://dev.to/loki/i-made-my-first-website-1g97</link>
      <guid>https://dev.to/loki/i-made-my-first-website-1g97</guid>
      <description>&lt;p&gt;This week-end I was at the in-laws and had some free time, It's been a while since I wanted to create my personal portfolio site, so I decided to give it a try.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TL;DR&lt;/em&gt;&lt;br&gt;
I used &lt;a href="https://gohugo.io/"&gt;hugo&lt;/a&gt; to create my portfolio: &lt;a href="https://lokile.dev/"&gt;https://lokile.dev/&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Step 1: choice of the domain name.
&lt;/h1&gt;

&lt;p&gt;I'm lucky because I can abbreviate my name "Loik Le Devehat" to "Loik Le Dev" which in French means I'm a developer!&lt;br&gt;
Also my nickname is &lt;em&gt;Loki&lt;/em&gt;. I wanted to use &lt;strong&gt;loki.dev&lt;/strong&gt; which would have been super convenient but it was already taken recently by some German guy.&lt;/p&gt;

&lt;p&gt;Hence I chose &lt;em&gt;lokile.dev&lt;/em&gt; which I'm not entirely satisfied of, but that's ok I can change it later.&lt;/p&gt;
&lt;h1&gt;
  
  
  Step 2: Static site generation
&lt;/h1&gt;

&lt;p&gt;I consider myself an experienced developer (in embedded systems) but I never learned html/css/js or how to make a website. Through reading articles on dev.to I learned about static site generation. I started looking at &lt;a href="https://www.staticgen.com/"&gt;the list of generators&lt;/a&gt;, only to discover that there are thousands of them in many different languages, which started to scare me.&lt;br&gt;
Seeing that the blog at &lt;em&gt;loki.dev&lt;/em&gt; used hugo, I looked at the theme gallery and I was amazed at how cool the templates are!&lt;/p&gt;

&lt;p&gt;My choice went to the &lt;a href="https://themes.gohugo.io/creative/"&gt;creative theme&lt;/a&gt; because it's a beautiful one pager with a cool modal grid for the portfolio which is enough for my first site, you know: Keep It Simple.&lt;/p&gt;
&lt;h1&gt;
  
  
  Step 3: Wasting time
&lt;/h1&gt;

&lt;p&gt;After reading the getting started guide and testing the theme, I wanted to write the different contents for the projects I wanted to show on the site.&lt;/p&gt;

&lt;p&gt;The guide said that you generally write contents in markdown in the &lt;code&gt;contents&lt;/code&gt; folder, but the theme only allows editing &lt;code&gt;yaml&lt;/code&gt; files in the data folder.&lt;/p&gt;

&lt;p&gt;That's not all, the &lt;code&gt;description&lt;/code&gt; field is a one line string. And I thought I could edit rich markdown with new lines etc.&lt;br&gt;
And also, really? You have to write markdown text in a yaml file which is parsed into an html template with some js and css to make it pretty, without forgetting that the project config file is &lt;code&gt;config.toml&lt;/code&gt;...&lt;br&gt;
That's a crazy number of languages for a simple website!&lt;/p&gt;

&lt;p&gt;Please pick one markup language and stick to it, why the need of 3 different syntax ??&lt;/p&gt;

&lt;p&gt;So here started the hurdle of trying to do what I wanted. I don't give up easily though.&lt;/p&gt;
&lt;h2&gt;
  
  
  Markdown in yaml
&lt;/h2&gt;

&lt;p&gt;To avoid writing a big single line in the &lt;code&gt;description&lt;/code&gt; field, I discovered the syntax for "Literal Block Scalar".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
   &lt;span class="s"&gt;# This is a markdown title&lt;/span&gt;
   &lt;span class="s"&gt;**and also some bold text**&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So yeah problem one solved!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Icons and font-awesome
&lt;/h2&gt;

&lt;p&gt;After that I wanted to change the default icons used for the &lt;code&gt;services&lt;/code&gt; section. Normally you just replace the icon field in the project &lt;code&gt;config.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[[params.services.list]]&lt;/span&gt;
    &lt;span class="py"&gt;icon&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fa-mortar-board"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I chose a new icon on font-awesome site, but it didn't show up on the generated site.&lt;/p&gt;

&lt;p&gt;After some digging in the code of the theme I realized that it uses fontawesome &lt;strong&gt;v4.7&lt;/strong&gt;  whereas the &lt;a href="https://fontawesome.com/icons?d=gallery"&gt;current version&lt;/a&gt; is &lt;strong&gt;v5.12&lt;/strong&gt;. I tried to update the font of the theme by downloading the css, the .ttf files etc and editing &lt;code&gt;head.html&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{ "&lt;/span&gt;&lt;span class="na"&gt;font-awesome&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;css&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;font-awesome.min.css&lt;/span&gt;&lt;span class="err"&gt;"&lt;/span&gt; &lt;span class="err"&gt;|&lt;/span&gt; &lt;span class="na"&gt;absURL&lt;/span&gt; &lt;span class="err"&gt;}}"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;but without success.&lt;/p&gt;

&lt;p&gt;Finally I just picked icons from the working version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Gifs
&lt;/h2&gt;

&lt;p&gt;Ok the theme is cool, it's responsive, there are modals and all, but it lacked some spice, so I decided to make gifs!&lt;br&gt;
I spent really too much time trying to make the perfect gifs from videos. I needed to find the proper tool for the job.&lt;br&gt;
Did you know you can use blender as a video sequence editor and the &lt;a href="https://github.com/doakey3/Bligify"&gt;Bligify plugin&lt;/a&gt; to export them as gifs?&lt;/p&gt;

&lt;p&gt;They were too heavy so I tried to make them smaller and changed the theme to display a picture in the popups instead of the gif.&lt;br&gt;
The site is still slow to load, if anyone has suggestions that would be appreciated! &lt;/p&gt;

&lt;h1&gt;
  
  
  Step 5: Polish and upload
&lt;/h1&gt;

&lt;p&gt;The text on the &lt;em&gt;hero&lt;/em&gt; section was too thin and transparent, so I dug in the &lt;code&gt;creative.css&lt;/code&gt; file to find the correct section to edit.&lt;/p&gt;

&lt;p&gt;Then it was just a matter of &lt;code&gt;hugo -D&lt;/code&gt; to generate the &lt;code&gt;public&lt;/code&gt; folder and upload it to my hosting service.&lt;/p&gt;

&lt;p&gt;Big shout out to &lt;a href="//gohugo.io"&gt;hugo&lt;/a&gt; makers for creating such a powerful and simple to use tool!&lt;/p&gt;

&lt;h1&gt;
  
  
  What I learned
&lt;/h1&gt;

&lt;p&gt;The lesson here is that even though I don't know these languages I wasn't afraid of reading the html and css files, try to understand a bit the structure and find where I needed to edit to obtain the desired behavior.&lt;/p&gt;

&lt;p&gt;Don't be afraid to break things! I mean it's OK to edit the code and see the result through trial and errors. It was refreshing for me, it's less pressure to have a display bug in html than when you have a computation error in an exoskeleton which might harm the user!&lt;/p&gt;

&lt;h1&gt;
  
  
  What next?
&lt;/h1&gt;

&lt;p&gt;Now I want to do more to improve the site, add more portfolio articles, try to embed youtube videos.&lt;br&gt;
You probably noticed that the site is only in French for now, it would be nice to have an English translation. Probably add some blog section, the possibilities are endless! But another more complete theme might be required.&lt;/p&gt;

&lt;p&gt;What to you think of the result? Are the gifs too much?&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>portfolio</category>
    </item>
  </channel>
</rss>
