{"id":1025,"date":"2020-06-19T12:00:10","date_gmt":"2020-06-19T19:00:10","guid":{"rendered":"http:\/\/www.jacksonleung.com\/blog\/?p=1025"},"modified":"2020-08-11T13:49:30","modified_gmt":"2020-08-11T20:49:30","slug":"my-first-react-native-app","status":"publish","type":"post","link":"http:\/\/www.jacksonleung.com\/blog\/my-first-react-native-app\/","title":{"rendered":"My first React Native App"},"content":{"rendered":"\n<p>Why did I write a React Native app? I&#8217;ve always been language agnostic, there&#8217;s no single language that rules them all. Each language has its feel, syntax, purpose, and style. There are languages that prefer a functional programming style, others that prefer objects. There are stateless and stateful paradigms. While the time involve was brief, there are still a lot of significant hurdles I had to overcome in order to write this app.<\/p>\n\n\n\n<p>The first hurdle, myself. I prefer to build applications that serve a purpose, and the more purposeful the app, the more enthusiastic I am about coding it. I do see my foray into React Native as an investment towards building something more complicated in the future. You can&#8217;t even imagine how many things I&#8217;ve built that I don&#8217;t feel comfortable sharing, things I feel comfortable sharing is but a small subset.<\/p>\n\n\n\n<p>Without further ado, here&#8217;s a preview of my Reactive Native App that I compiled for Android.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"1024\" src=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-111301_One-UI-Home-498x1024.jpg\" alt=\"\" class=\"wp-image-1026\" srcset=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-111301_One-UI-Home-498x1024.jpg 498w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-111301_One-UI-Home-146x300.jpg 146w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-111301_One-UI-Home-768x1579.jpg 768w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-111301_One-UI-Home.jpg 1440w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n\n<p>I have a weird sense of humor. &#8220;Meet Jackson&#8217;s Random App&#8221;. I do enjoy those Mensa puzzles.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"1024\" src=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-114539_Jacksons-Random-498x1024.jpg\" alt=\"\" class=\"wp-image-1027\" srcset=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-114539_Jacksons-Random-498x1024.jpg 498w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-114539_Jacksons-Random-146x300.jpg 146w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-114539_Jacksons-Random-768x1579.jpg 768w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200619-114539_Jacksons-Random.jpg 1440w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n\n<p>Why a coin flipper? Sometimes, you&#8217;re 50\/50 on something, and you just need a coin flip, with everything so digital now and days, you&#8217;ll be surprised how often I find myself without cash and coins. Thus, a digital coin. Then you might ask, why a random number generator? Again, a random number between 1-100 might just be the most unbiased way to decide who gets the say in a group orientated activity.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"1024\" src=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150537_Jacksons-Random-498x1024.jpg\" alt=\"\" class=\"wp-image-1028\" srcset=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150537_Jacksons-Random-498x1024.jpg 498w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150537_Jacksons-Random-146x300.jpg 146w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150537_Jacksons-Random-768x1579.jpg 768w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150537_Jacksons-Random.jpg 1440w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n\n<p>My first version was just a coin flip and the result. It was to the point, but then I realized, after pressing the button, I don&#8217;t know whether or not it&#8217;s my second HEAD result or if my app did nothing, so, I added a delay and a &#8220;flipping&#8221; screen. Yes, it hurts, but I, purposely made my code SLOWER.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"1024\" src=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150536_Jacksons-Random-498x1024.jpg\" alt=\"\" class=\"wp-image-1029\" srcset=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150536_Jacksons-Random-498x1024.jpg 498w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150536_Jacksons-Random-146x300.jpg 146w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150536_Jacksons-Random-768x1579.jpg 768w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150536_Jacksons-Random.jpg 1440w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n\n<p>I also did the same for my random number generator.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"1024\" src=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150541_Jacksons-Random-498x1024.jpg\" alt=\"\" class=\"wp-image-1030\" srcset=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150541_Jacksons-Random-498x1024.jpg 498w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150541_Jacksons-Random-146x300.jpg 146w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150541_Jacksons-Random-768x1579.jpg 768w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150541_Jacksons-Random.jpg 1440w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"1024\" src=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150543_Jacksons-Random-498x1024.jpg\" alt=\"\" class=\"wp-image-1031\" srcset=\"http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150543_Jacksons-Random-498x1024.jpg 498w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150543_Jacksons-Random-146x300.jpg 146w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150543_Jacksons-Random-768x1579.jpg 768w, http:\/\/www.jacksonleung.com\/blog\/wp-content\/uploads\/2020\/06\/Screenshot_20200617-150543_Jacksons-Random.jpg 1440w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\n\n\n\n<p>I&#8217;ve spent about a day on it, a good chunk of it was simply ramping up my dev environment. I had to configure a windows machine, as my development environment, and I had to ensure that all the piping between my OS and the phone was kosher.<\/p>\n\n\n\n<p>Below is a link to the source code, pretty boilerplate stuff for the most part, and if you trust me enough, the compiled APK is also in the repo, if not, you can compile the Reactive Native code yourself and go from there:<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/jackfucius\/randomReactNativeApp\">https:\/\/github.com\/jackfucius\/randomReactNativeApp<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why did I write a React Native app? I&#8217;ve always been language agnostic, there&#8217;s no single language that rules them all. Each language has its feel, syntax, purpose, and style. There are languages that prefer a functional programming style, others that prefer objects. There are stateless and stateful paradigms. While the time involve was brief, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.jacksonleung.com\/blog\/my-first-react-native-app\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;My first React Native App&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1025","post","type-post","status-publish","format-standard","hentry","category-programming","entry"],"_links":{"self":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts\/1025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/comments?post=1025"}],"version-history":[{"count":3,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts\/1025\/revisions"}],"predecessor-version":[{"id":1044,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/posts\/1025\/revisions\/1044"}],"wp:attachment":[{"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/media?parent=1025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/categories?post=1025"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jacksonleung.com\/blog\/wp-json\/wp\/v2\/tags?post=1025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}