<?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 Dzikri Robbi, S.Tp, M.Kom on Medium]]></title>
        <description><![CDATA[Stories by Dzikri Robbi, S.Tp, M.Kom on Medium]]></description>
        <link>https://medium.com/@dzkrrbb?source=rss-eb66f7e13389------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MeyENplYDm-N70d03hYAsQ@2x.jpeg</url>
            <title>Stories by Dzikri Robbi, S.Tp, M.Kom on Medium</title>
            <link>https://medium.com/@dzkrrbb?source=rss-eb66f7e13389------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:06:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dzkrrbb/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[Switching to Zsh: How to Replace Bash on Debian-Based Systems]]></title>
            <link>https://dzkrrbb.medium.com/switching-to-zsh-how-to-replace-bash-on-debian-based-systems-8a4de093198d?source=rss-eb66f7e13389------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a4de093198d</guid>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Dzikri Robbi, S.Tp, M.Kom]]></dc:creator>
            <pubDate>Fri, 13 Jun 2025 16:16:41 GMT</pubDate>
            <atom:updated>2025-06-13T16:23:11.616Z</atom:updated>
            <content:encoded><![CDATA[<h4>Enhance your terminal experience with Zsh, Oh My Zsh, powerful plugins, and modern themes.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glAHKfJDxHW4KyEqFv9Ndg.png" /><figcaption>Step-by-step instructions to migrate from Bash to Zsh and supercharge your Linux command line</figcaption></figure><p><strong>Zsh (Z shell)</strong> is a powerful alternative to Bash that offers superior features like better autocomplete, command correction, enhanced scripting capabilities, and rich plugin/theme support — especially when paired with frameworks like <strong>Oh My Zsh</strong>.</p><p>Developed in 1990 by Paul Falstad, Zsh was designed to be a more interactive and programmable shell by combining the best features of Bash, <em>ksh</em>, and <em>tcsh</em>. Over time, it gained popularity among developers and power users for its flexibility, extensibility, and user-friendly experience. Zsh has gained mainstream adoption, becoming the default shell in macOS since Catalina (2019) and in Linux distributions such as Kali Linux starting in 2020. With the support of active open-source communities, Zsh has evolved into a modern shell that can significantly boost productivity and transform your terminal experience.</p><p>In this article, we’ll walk through how to install, setting it as the default shell, enhancing it with Oh My Zsh and plugins, to customizing the look and feel with themes like Powerlevel10k. Whether you’re new to Zsh or looking to optimize your terminal workflow, this guide will help you get up and running quickly.</p><h4>1. Install Zsh</h4><p>Run the following command to install Zsh:</p><pre>sudo apt update &amp;&amp; sudo apt install zsh -y</pre><h4>2. Set Zsh as Your Default Shell</h4><p>To make Zsh your default shell, use:</p><pre>chsh -s $(which zsh)</pre><p>Then <strong>log out and log back in</strong>, or reboot for the change to take effect. To confirm Zsh is now your default shell, run:</p><pre>echo $SHELL</pre><p>It should output something like:</p><pre>/usr/bin/zsh</pre><h4>4. Install Oh my ZSH</h4><p><a href="https://ohmyz.sh/"><strong><em>Oh My Zsh</em></strong></a> is a popular Zsh framework that simplifies customization with themes and plugins. It provides a robust structure for managing your Zsh configuration, making it easier to add features and maintain consistency. With over 300 plugins and 100+ themes readily available, Oh My Zsh enhances productivity by enabling powerful tools like Git integration, autosuggestions, syntax highlighting, and more — without needing to configure everything manually. For both beginners and advanced users, it offers a smoother, smarter, and more visually appealing terminal experience.</p><p>To install it, run:</p><pre>sh -c &quot;$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)&quot;</pre><p>After installation, either restart the terminal or apply changes with:</p><pre>source ~/.zshrc</pre><h4>5. Install Useful Plugins</h4><p>Here are some popular productivity-enhancing plugins:</p><p><strong>a. </strong><a href="https://github.com/zsh-users/zsh-autosuggestions"><strong>zsh-autosuggestions</strong></a></p><p>Provides interactive suggestions based on command history.</p><pre>git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions</pre><p><strong>b. </strong><a href="https://github.com/zsh-users/zsh-syntax-highlighting"><strong>zsh-syntax-highlighting</strong></a></p><p>Highlights commands as you type for easier readability.</p><pre>git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting</pre><p><strong>c. </strong><a href="https://github.com/zdharma/fast-syntax-highlighting"><strong>zsh-fast-syntax-highlighting</strong></a></p><p>A faster alternative for syntax highlighting.</p><pre>git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting</pre><p><strong>d. </strong><a href="https://github.com/marlonrichert/zsh-autocomplete"><strong>zsh-autocomplete</strong></a></p><p>Offers real-time and context-aware command-line autocompletion.</p><pre>git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete</pre><p><strong>Enable plugins by adding them to .zshrc</strong></p><p>Open your.zshrcconfiguration file:</p><pre>sudo nano ~/.zshrc</pre><p>Find the line:</p><pre>plugins=(git)</pre><p>Replace it with:</p><pre>plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)</pre><p>Then reload the config:</p><pre>source ~/.zshrc</pre><h4>6. Install Powerlevel10k Theme</h4><p><a href="https://github.com/romkatv/powerlevel10k">Powerlevel10k</a> is a modern, fast, and highly customizable Zsh theme. To install it, run:</p><pre>git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k</pre><p>Then you need to enable it, change the value of ZSH_THEME to following in ~/.zshrc file :</p><pre>ZSH_THEME=&quot;powerlevel10k/powerlevel10k&quot;</pre><p>Apply the changes:</p><pre>source ~/.zshrc</pre><p>To begin the interactive setup, run:</p><pre>p10k configure</pre><p>Follow the guided wizard to choose your preferred appearance.</p><h4>Conclusion</h4><p>Switching to Zsh, especially with <strong>Oh My Zsh</strong>, <strong>plugins</strong>, and <strong>Powerlevel10k</strong>, gives you a powerful, beautiful, and efficient terminal experience. Whether you’re coding, managing servers, or just navigating your system, this setup helps you work smarter and faster.</p><p>Happy hacking! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a4de093198d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work with REST API Service in Angular — TypeScript]]></title>
            <link>https://dzkrrbb.medium.com/work-with-rest-api-service-in-angular-typescript-267d0fc61e6f?source=rss-eb66f7e13389------2</link>
            <guid isPermaLink="false">https://medium.com/p/267d0fc61e6f</guid>
            <dc:creator><![CDATA[Dzikri Robbi, S.Tp, M.Kom]]></dc:creator>
            <pubDate>Mon, 14 Nov 2022 06:46:22 GMT</pubDate>
            <atom:updated>2022-11-14T06:53:24.625Z</atom:updated>
            <content:encoded><![CDATA[<h3>Work with REST API Service in Angular — TypeScript</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*ckAgL1RlSHOxLymJ_cPukw.png" /><figcaption>Work with REST API Service in Angular — TypeScript</figcaption></figure><p>Today, front-end applications use the <strong>A</strong>pplication <strong>P</strong>rogramming <strong>I</strong>nterface (API) to communicate with back-end services with a <strong>RE</strong>presentational <strong>S</strong>tate <strong>T</strong>ransfer (REST) based on HTTP protocol architecture. In Angular, we can use HttpClient module to make it happen. So, let’s try!</p><h4>Create New Angular Project</h4><p><a href="https://angular.io/"><strong>Angular</strong></a> provides a Progressive Web App architecture, which means that an application made in Angular gives us an modern web app experience with high performance. Angular has Command Line tools (CLI) to build and deploy Apps faster than ever before. To use this CLI, we need to install <a href="https://nodejs.org/">Node.js</a> first and then install Angular CLI with this command :</p><pre>npm install -g @angular/cli</pre><p>Now, you can create new Angular project with zero-step installation with their CLI like this :</p><pre>ng new AngularAPI</pre><p>Open new Angular project folder :</p><pre>cd AngularAPI</pre><p>Angular can be rendered in Node.js servers by giving the output in HTML-CSS format using this command :</p><pre>ng serve</pre><p>You can view your Angular App with any browser on localhost:4200 like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umRD-DPFdXferoEDdK4vew.png" /><figcaption>Angular App on localhost:4200</figcaption></figure><h4>Create New API Service</h4><p>Now, we need to create new service for our API to remote HTTP servers via HttpClient module of Angular by sending HTTP requests. To create new service you can type this command :</p><pre>ng generate service services/api  </pre><p>This command will give you new folder of your service in src/app directory like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/247/1*UE2K1B4DM8SBmmMOrqM68A.png" /><figcaption>API Service Directory</figcaption></figure><p>Import HttpClientModule to <strong>app.module.ts</strong> :</p><pre>import { NgModule } from &#39;@angular/core&#39;;<br>import { BrowserModule } from &#39;@angular/platform-browser&#39;;<br>import { HttpClientModule } from &#39;@angular/common/http&#39;;<br><br>import { AppRoutingModule } from &#39;./app-routing.module&#39;;<br>import { AppComponent } from &#39;./app.component&#39;;<br><br>@NgModule({<br>  declarations: [<br>    AppComponent<br>  ],<br>  imports: [<br>    BrowserModule,<br>    HttpClientModule,<br>    AppRoutingModule,<br>  ],<br>  providers: [],<br>  bootstrap: [AppComponent]<br>})<br>export class AppModule { }</pre><p>Open <strong>api.service.ts</strong> file and import HttpClient and HttpHeaders module in this service class.</p><pre>import { Injectable } from &#39;@angular/core&#39;;<br>import { HttpClient,HttpHeaders } from &#39;@angular/common/http&#39;;<br><br>@Injectable({<br>  providedIn: &#39;root&#39;<br>})<br>export class ApiService {<br><br>  constructor(<br>    private http:HttpClient,<br>  ) { }<br>}</pre><p>The HTTP methods commonly used in REST API are:</p><h4>1. GET Method</h4><p>This method usually used to read resources from the REST server. To use GET method, create new function call <strong>get</strong> on ApiService class :</p><pre>import { Injectable } from &#39;@angular/core&#39;;<br>import { HttpClient,HttpHeaders } from &#39;@angular/common/http&#39;;<br><br>@Injectable({<br>  providedIn: &#39;root&#39;<br>})<br>export class ApiService {<br><br>  constructor(<br>    private http:HttpClient,<br>  ) { }<br><br>  public get(url:any): Promise&lt;any&gt; {<br>    return new Promise&lt;any&gt;((resolve, reject) =&gt; {<br>      const header = {<br>        headers: new HttpHeaders()<br>          .set(&#39;Content-Type&#39;, &#39;application/x-www-form-urlencoded&#39;)<br>      };<br>      this.http.get(url, header).subscribe((data) =&gt; {<br>        resolve(data);<br>      }, error =&gt; {<br>        resolve(error);<br>      });<br>    });<br>  }<br>}</pre><p>Now, open <strong>app.component.ts</strong> and import ApiService class :</p><pre>import { Component, OnInit } from &#39;@angular/core&#39;;<br>import { ApiService } from &#39;src/app/services/api.service&#39;;<br><br>@Component({<br>  selector: &#39;app-root&#39;,<br>  templateUrl: &#39;./app.component.html&#39;,<br>  styleUrls: [&#39;./app.component.css&#39;]<br>})<br>export class AppComponent implements OnInit {<br><br>  constructor(<br>    public api: ApiService,<br>  ) { }<br><br>  ngOnInit(): void {<br>  }<br>}</pre><p>Create get function on <strong>app.component.ts</strong> and use get function from ApiService class :</p><pre>import { Component, OnInit } from &#39;@angular/core&#39;;<br>import { ApiService } from &#39;src/app/services/api.service&#39;;<br><br>@Component({<br>  selector: &#39;app-root&#39;,<br>  templateUrl: &#39;./app.component.html&#39;,<br>  styleUrls: [&#39;./app.component.css&#39;]<br>})<br>export class AppComponent implements OnInit {<br>  datas : any;<br>  constructor(<br>    public api: ApiService,<br>  ) { }<br><br>  ngOnInit(): void {<br>    this.get();<br>  }<br><br>  get() {<br>    this.api.get(&#39;https://dzkrrbb.com/tutorial/php-restapi/get_city.php&#39;).then((data: any) =&gt; {<br>      if (data) {<br>        console.log(data);<br>      } else {<br>        console.log(&#39;Not Found&#39;);<br>      }<br>    });<br>  }<br>}</pre><p>We use API server from this tutorial : <a href="https://dzkrrbb.medium.com/rest-api-with-php-get-post-put-delete-8365fe092618">https://dzkrrbb.medium.com/rest-api-with-php-get-post-put-delete-8365fe092618</a>. You can change URL of API server with yours and you can see response of data from console like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*k-g16M2rha-FMYTivDVjIQ.png" /><figcaption>Response of Data</figcaption></figure><p>This response contain list of city with id and name value. To show this data in your web app you need to store this data and bind it.</p><pre>import { Component, OnInit } from &#39;@angular/core&#39;;<br>import { ApiService } from &#39;src/app/services/api.service&#39;;<br><br>@Component({<br>  selector: &#39;app-root&#39;,<br>  templateUrl: &#39;./app.component.html&#39;,<br>  styleUrls: [&#39;./app.component.css&#39;]<br>})<br>export class AppComponent implements OnInit {<br>  datas : any;<br>  constructor(<br>    public api: ApiService,<br>  ) { }<br><br>  ngOnInit(): void {<br>    this.get();<br>  }<br><br>  get() {<br>    this.api.get(&#39;https://dzkrrbb.com/tutorial/php-restapi/get_city.php&#39;).then((data: any) =&gt; {<br>      if (data) {<br>        this.datas = data.city;<br>        console.log(data);<br>      } else {<br>        console.log(&#39;Not Found&#39;);<br>      }<br>    });<br>  }<br>}</pre><p>Open <strong>app.component.html</strong> file and modify like this :</p><pre>&lt;p&gt;Response data :&lt;/p&gt;<br>&lt;ul&gt;<br>  &lt;li *ngFor=&quot;let item of datas&quot;&gt;{{item.name}}&lt;/li&gt;<br>&lt;/ul&gt;<br>&lt;router-outlet&gt;&lt;/router-outlet&gt;</pre><p>Now, you can see your data bind on your HTML</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/1*QlxXiVizQ8C6sOLMNwMYaA.png" /><figcaption>Data Binding</figcaption></figure><h4>2. POST Method</h4><p>This method usually used to create new resources on the REST server. To use POST method, create new function call <strong>post</strong> on ApiService class :</p><pre>import { Injectable } from &#39;@angular/core&#39;;<br>import { HttpClient,HttpHeaders } from &#39;@angular/common/http&#39;;<br><br>@Injectable({<br>  providedIn: &#39;root&#39;<br>})<br>export class ApiService {<br><br>  constructor(<br>    private http:HttpClient,<br>  ) { }<br><br>  public get(url:any): Promise&lt;any&gt; {<br>    return new Promise&lt;any&gt;((resolve, reject) =&gt; {<br>      const header = {<br>        headers: new HttpHeaders()<br>          .set(&#39;Content-Type&#39;, &#39;application/x-www-form-urlencoded&#39;)<br>      };<br>      this.http.get(url, header).subscribe((data) =&gt; {<br>        resolve(data);<br>      }, error =&gt; {<br>        reject(error);<br>      });<br>    });<br>  }<br><br>  public post(url:any, param:any): Promise&lt;any&gt; {<br>    return new Promise&lt;any&gt;((resolve, reject) =&gt; {<br>      const header = {<br>        headers: new HttpHeaders()<br>          .set(&#39;Content-Type&#39;, &#39;application/x-www-form-urlencoded&#39;)<br>      };<br>      this.http.post(url, param, header).subscribe((data) =&gt; {<br>        resolve(data);<br>      }, error =&gt; {<br>        resolve(error);<br>      });<br>    });<br>  }<br>}</pre><p>To store new data to API server create new post function on <strong>app.component.ts</strong></p><pre>import { Component, OnInit } from &#39;@angular/core&#39;;<br>import { ApiService } from &#39;src/app/services/api.service&#39;;<br><br>@Component({<br>  selector: &#39;app-root&#39;,<br>  templateUrl: &#39;./app.component.html&#39;,<br>  styleUrls: [&#39;./app.component.css&#39;]<br>})<br>export class AppComponent implements OnInit {<br>  datas : any;<br>  id : any;<br>  name : any;<br>  constructor(<br>    public api: ApiService,<br>  ) { }<br><br>  ngOnInit(): void {<br>    this.get();<br>  }<br><br>  get() {<br>    this.api.get(&#39;https://dzkrrbb.com/tutorial/php-restapi/get_city.php&#39;).then((data: any) =&gt; {<br>      if (data) {<br>        this.datas = data.city;<br>        console.log(data);<br>      } else {<br>        console.log(&#39;Not Found&#39;);<br>      }<br>    });<br>  }<br><br>  post() { <br>    if (this.id === &#39;&#39; || this.name === &#39;&#39;) {<br>      alert(&#39;All Fields are required&#39;);<br>    }<br><br>    const param = &#39;id=&#39;+this.id+&#39;&amp;name=&#39;+this.name;<br>    this.api.post(&#39;https://dzkrrbb.com/tutorial/php-restapi/post_city.php&#39;, param).then((data: any) =&gt; {<br>      if (data) {<br>        this.datas = data.city;<br>        console.log(data);<br>      } else {<br>        console.log(&#39;Not Found&#39;);<br><br>      }<br>    });<br>  }<br>}</pre><p>We use API server from this tutorial : <a href="https://dzkrrbb.medium.com/rest-api-with-php-get-post-put-delete-8365fe092618">https://dzkrrbb.medium.com/rest-api-with-php-get-post-put-delete-8365fe092618</a>. You can change URL and param of API server with yours and for store new data you can create form, but to do this you must import FormsModule to <strong>app.module.ts</strong> :</p><pre>import { NgModule } from &#39;@angular/core&#39;;<br>import { BrowserModule } from &#39;@angular/platform-browser&#39;;<br>import { HttpClientModule } from &#39;@angular/common/http&#39;;<br>import { FormsModule } from &#39;@angular/forms&#39;;<br><br>import { AppRoutingModule } from &#39;./app-routing.module&#39;;<br>import { AppComponent } from &#39;./app.component&#39;;<br><br>@NgModule({<br>  declarations: [<br>    AppComponent<br>  ],<br>  imports: [<br>    BrowserModule,<br>    HttpClientModule,<br>    AppRoutingModule,<br>    FormsModule<br>  ],<br>  providers: [],<br>  bootstrap: [AppComponent]<br>})<br>export class AppModule { }</pre><p>And then open <strong>app.component.html</strong> file and create form with post function like this :</p><pre>&lt;p&gt;Response data :&lt;/p&gt;<br>&lt;ul&gt;<br>  &lt;li *ngFor=&quot;let item of datas&quot;&gt;{{item.name}}&lt;/li&gt;<br>&lt;/ul&gt;<br>&lt;hr/&gt;<br>&lt;p&gt;Post New data :&lt;/p&gt;<br>&lt;table&gt;<br>  &lt;tr&gt;<br>    &lt;td&gt;ID&lt;/td&gt;<br>    &lt;td&gt;<br>      &lt;input class=&quot;form-control&quot; type=&quot;text&quot; [(ngModel)]=&quot;id&quot; [ngModelOptions]=&quot;{standalone: true}&quot; placeholder=&quot;Data ID&quot;&gt;<br>    &lt;/td&gt;<br>  &lt;/tr&gt;<br>  &lt;tr&gt;<br>    &lt;td&gt;Name&lt;/td&gt;<br>    &lt;td&gt;<br>      &lt;input class=&quot;form-control&quot; type=&quot;text&quot; [(ngModel)]=&quot;name&quot; [ngModelOptions]=&quot;{standalone: true}&quot; placeholder=&quot;Data ID&quot;&gt;<br>    &lt;/td&gt;<br>  &lt;/tr&gt;<br>  &lt;tr&gt;<br>    &lt;td colspan=&quot;2&quot;&gt;<br>      &lt;button type=&quot;button&quot; (click)=&quot;post()&quot;&gt;Submit&lt;/button&gt;<br>    &lt;/td&gt;<br>  &lt;/tr&gt;<br>&lt;/table&gt;<br><br>&lt;router-outlet&gt;&lt;/router-outlet&gt;</pre><p>Your form should be like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*A6JxQzdkYarCbbZ3AiNBLQ.png" /><figcaption>Form for Post API Data</figcaption></figure><p>And if you sent new data for example ID = 4 and Name = New York, your API server will receive this data and send back again to your app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*694oQR-fAiRFWQ-y0sk-7Q.png" /><figcaption>New Response of Data</figcaption></figure><h3>Conclusion</h3><p>Congratulation, now you can work with REST API in Angular. You can clone this tutorial from <a href="https://github.com/dzkrrbb/AngularAPI">https://github.com/dzkrrbb/AngularAPI</a></p><p>If you have any suggestions for the next article please leave a comment :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=267d0fc61e6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Android App Bundle (.aab) for Cordova Apps Using Gradle]]></title>
            <link>https://dzkrrbb.medium.com/using-gradle-to-build-android-app-bundle-aab-for-cordova-apps-7419dd0a2cb3?source=rss-eb66f7e13389------2</link>
            <guid isPermaLink="false">https://medium.com/p/7419dd0a2cb3</guid>
            <category><![CDATA[android-app-bundle]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[cordova]]></category>
            <dc:creator><![CDATA[Dzikri Robbi, S.Tp, M.Kom]]></dc:creator>
            <pubDate>Tue, 25 Oct 2022 08:26:15 GMT</pubDate>
            <atom:updated>2022-10-26T02:29:27.825Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*jNX8uiO-OZc3oO6PTfC_rw.png" /><figcaption>Using Gradle to build Android App Bundle (.aab) for Cordova Apps</figcaption></figure><p>Currently, Google recommends Android app developers to use the Android App Bundle (.aab) instead of using APKs. In this tutorial, we will try to create an Android App Bundle from an application that was created using Cordova.</p><h4>Introduction</h4><p>Cordova is an open-source framework that can be used to build web-based applications using HTML5, CSS3 and JavaScript that can be compiled into Android and iOS-based applications. Therefore, Cordova is included in the multi-platform hybrid script.</p><p>To use this framework, we first have to install <a href="https://nodejs.org/en/">Node.Js</a> and NPM as the basis for using the command-line. After we finish installing Node.Js and NPM, then we install Cordova with the command below :</p><pre>npm install -g cordova</pre><p>Don’t forget to check again whether Cordova is installed on our system or not with the command below :</p><pre>cordova --version</pre><h4>Creating Android Apps Using Cordova</h4><p>First of all, create a folder for the Android application.</p><pre>cordova create AppAndroid</pre><p>After the application folder is successfully created, go into the folder.</p><pre>cd AppAndroid</pre><p>In this folder you can start customizing the needs of the Android application you want. Don’t forget to put the Android platform into the folder, so that later you can compile the application into an Android App Bundle.</p><pre>cordova platform add android</pre><h4>Set Environment</h4><p>First make sure you have installed and registered the location of the Java Environment and Android SDK into the system Path.</p><pre>export ANDROID_HOME={path_to}/Android/sdk<br>export PATH=${PATH}:${ANDROID_HOME}/tools<br>export PATH=${PATH}:${ANDROID_HOME}/platform-tools<br>export ANDROID_SDK_ROOT={path_to}/Android/sdk</pre><p>We also need to download and install <a href="https://gradle.org/install/">Gradle</a> before build Android application.</p><h4>Create Android App Bundle Using Gradle</h4><p>After you do the environment settings, build your Android application with Cordova CLI.</p><pre>cordova build android</pre><p>Then open the <strong>platforms/android</strong> folder.</p><pre>cd platforms/android</pre><p>In this folder, you will find the <strong>gradlew</strong> file which we can then run to create the .aab file for your Android application using the following command :</p><pre>gradlew bundle</pre><p><strong>Note:</strong> For those of you Linux or Mac users, you must run it with the following command :</p><pre>./gradlew bundle</pre><p>After that, wait a while until the process of creating the .aab file for your Android app is complete. You can view the .aab files for your Android apps in the <strong>platforms/android/app/build/outputs/bundle/release</strong> directory.</p><h4>Create a signed Android App Bundle</h4><p>Next we need to create a keystore for the Android App Bundle that we have created with the following steps.</p><pre>keytool -genkey -v -keystore &lt;keystoreName&gt;.keystore -alias &lt;Keystore AliasName&gt; -keyalg &lt;Key algorithm&gt; -keysize &lt;Key size&gt; -validity &lt;Key Validity in Days&gt;</pre><p>Then the keystore has been generated with name as &lt;keystoreName&gt;.keystore. Please save the keystore, alias name and password to sign your Android application.</p><p>To sign the unsigned Android App Bundle, run the jarsigner tool which is also included in the JDK :</p><pre>jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore &lt;keystorename&gt; &lt;Unsigned AAB file&gt; &lt;Keystore Alias name&gt;</pre><p>To optimize your Android App Bundle file before distributing it to end-users you need to use zipalign to ensures that all uncompressed files in the archive are aligned relative to the start of the file. You will find zipAlign in the android build tools then use it like so :</p><pre>&#39;{path_to_android_build_tools}/zipalign&#39; -v 4 &lt;unzip_aab_file&gt;.aab &lt;new_zip_aab_file&gt;.aab</pre><p>Congratulation, your Android App Bundle is already to publish on PlayStore!</p><p>If you have any suggestions for the next article please leave a comment :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7419dd0a2cb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[REST API with PHP (GET, POST, PUT & DELETE)]]></title>
            <link>https://dzkrrbb.medium.com/rest-api-with-php-get-post-put-delete-8365fe092618?source=rss-eb66f7e13389------2</link>
            <guid isPermaLink="false">https://medium.com/p/8365fe092618</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[rest-api-testing]]></category>
            <dc:creator><![CDATA[Dzikri Robbi, S.Tp, M.Kom]]></dc:creator>
            <pubDate>Mon, 29 Mar 2021 12:30:30 GMT</pubDate>
            <atom:updated>2021-03-29T12:31:41.823Z</atom:updated>
            <content:encoded><![CDATA[<h3>REST API using PHP (Basic GET, POST, PUT &amp; DELETE)</h3><p><strong>RE</strong>presantional <strong>S</strong>tate <strong>T</strong>ransfer (<strong>REST</strong>) is an architectural standar that uses the HTTP protocol to communicate data base on Web Service. So, with REST, users can access data/resources by a global ID or URIs.</p><p>The HTTP methods commonly used in REST API are:</p><ul><li>GET, usually used to read resources from the REST server</li><li>POST, usually used to create new resources on the REST server</li><li>PUT, usually used to update resources on the REST server</li><li>DELETE, usually used to delete resources from the REST server</li><li>OPTIONS, used to get supported operations on resources from the REST server</li></ul><p>The data provided by the REST server can be in text, JSON or XML format. The most popular in use today is the JSON format.</p><p>This post’s objective is to demonstrate how to create and run REST API using PHP and execute common REST method (GET, POST, PUT &amp; DELETE) using <a href="https://www.postman.com/">Postman</a>.</p><h3>1. REST API — GET Method</h3><p>This method usually used to read resources from the REST server.</p><p>First thing first, we create file <strong>get_city.php </strong>and define the header like this :</p><pre>header(&quot;Access-Control-Allow-Origin: *&quot;);<br>header(&quot;Content-Type: application/json; charset=UTF-8&quot;);<br>header(&quot;Access-Control-Allow-Methods: <strong>GET</strong>&quot;);<br>header(&quot;Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With&quot;);</pre><p>This header will allow user to access service with GET method and get JSON data from the service.</p><p>Then, continue to set data :</p><pre>$data = array(<br>array(<br>&#39;id&#39; =&gt; &#39;1&#39;,<br>&#39;name&#39; =&gt; &#39;Bandung&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;2&#39;,<br>&#39;name&#39; =&gt; &#39;Jakarta&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;3&#39;,<br>&#39;name&#39; =&gt; &#39;Surabaya&#39;<br>),<br>);</pre><p>In this post, I use array data. But you can also set the data from database query.</p><p>And then, we need to create search function for data.</p><pre>if(!empty($_GET[&#39;search&#39;])) {<br>$key = array_search($_GET[&#39;search&#39;], array_column($data, &#39;name&#39;),true);<br>$id = $data[$key][&#39;id&#39;];<br>$name = $data[$key][&#39;name&#39;];<br>$result = array(<br>&#39;id&#39; =&gt; $id,<br>&#39;name&#39; =&gt; $name,<br>&#39;status&#39; =&gt; &#39;success&#39;<br>);<br>} else {<br>foreach($data as $d) {<br>$result[&#39;city&#39;][] = array(<br>&#39;id&#39; =&gt; $d[&#39;id&#39;],<br>&#39;name&#39; =&gt; $d[&#39;name&#39;],<br>);<br>}<br>$result[&#39;status&#39;][] = &#39;success&#39;;<br>}</pre><p>In this post, I use “search” for key. So, we can search City on data by this key.</p><p>Finally, we store the result as JSON data.</p><pre>http_response_code(200);<br>echo json_encode($result);</pre><p>Now, we can test this service with Postman. For example, if we want to get city with name “Bandung”, we can use key “search” with value “Bandung”. So, you can get the result like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*qGLUX_bggLUH1yE7gvmDqg.png" /></figure><p>But, if we don’t input the key, result will be show all data in JSON.</p><pre>{<br>&quot;city&quot;: [<br>{<br>&quot;id&quot;: &quot;1&quot;,<br>&quot;name&quot;: &quot;Bandung&quot;<br>},<br>{<br>&quot;id&quot;: &quot;2&quot;,<br>&quot;name&quot;: &quot;Jakarta&quot;<br>},<br>{<br>&quot;id&quot;: &quot;3&quot;,<br>&quot;name&quot;: &quot;Surabaya&quot;<br>}<br>],<br>&quot;status&quot;: [<br>&quot;success&quot;<br>]<br>}</pre><p>You can test this service with Postman from <a href="https://dzkrrbb.com/tutorial/php-restapi/get_city.php">https://dzkrrbb.com/tutorial/php-restapi/get_city.php</a></p><h3>2. REST API — POST Method</h3><p>This method usually used to create new resources on the REST server.</p><p>Now, we create file <strong>post_city.php </strong>and define the header like this :</p><pre>header(&quot;Access-Control-Allow-Origin: *&quot;);<br>header(&quot;Content-Type: application/json; charset=UTF-8&quot;);<br>header(&quot;Access-Control-Allow-Methods: <strong>POST</strong>&quot;);<br>header(&quot;Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With&quot;);</pre><p>This header will allow user to access service with POST method and get JSON data from the service.</p><p>Then, continue to set data :</p><pre>$data = array(<br>array(<br>&#39;id&#39; =&gt; &#39;1&#39;,<br>&#39;name&#39; =&gt; &#39;Bandung&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;2&#39;,<br>&#39;name&#39; =&gt; &#39;Jakarta&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;3&#39;,<br>&#39;name&#39; =&gt; &#39;Surabaya&#39;<br>),<br>);</pre><p>In this post, I use array data. But you can also set the data from database query.</p><p>And then, we need to create post function for input new data.</p><pre>if(!empty($_POST[&#39;name&#39;]) &amp;&amp; !empty($_POST[&#39;id&#39;])) {</pre><pre><em>// New Data Input<br></em>$newdata = array(<br>&#39;id&#39; =&gt; $_POST[&#39;id&#39;],<br>&#39;name&#39; =&gt; $_POST[&#39;name&#39;]<br>);</pre><pre><em>// Add Data<br></em>$data[] = $newdata;</pre><pre><em>// New Data<br></em>foreach($data as $d) {<br>$result[&#39;city&#39;][] = array(<br>&#39;id&#39; =&gt; $d[&#39;id&#39;],<br>&#39;name&#39; =&gt; $d[&#39;name&#39;],<br>);<br>}</pre><pre>$result[&#39;status&#39;] = &#39;success&#39;;<br>} else {<br>foreach($data as $d) {<br>$result[&#39;city&#39;][] = array(<br>&#39;id&#39; =&gt; $d[&#39;id&#39;],<br>&#39;name&#39; =&gt; $d[&#39;name&#39;],<br>);<br>}</pre><pre>$result[&#39;status&#39;] = &#39;success&#39;;</pre><pre>}</pre><p>As you see in this function, we just add new data if we post id and name as a key to the REST. If we don’t post id and name, we just show the all data.</p><p>Finally, we store the result as JSON data.</p><pre>http_response_code(200);<br>echo json_encode($result);</pre><p>Now, we can test this service with Postman. For example, if we want to post new city with name “Solo” and id “4”, we can post in the body form-data using this key “id” with value “4” and “name” with value “Solo”. So, you can get the result like this :</p><pre>{<br>&quot;city&quot;: [<br>{<br>&quot;id&quot;: &quot;1&quot;,<br>&quot;name&quot;: &quot;Bandung&quot;<br>},<br>{<br>&quot;id&quot;: &quot;2&quot;,<br>&quot;name&quot;: &quot;Jakarta&quot;<br>},<br>{<br>&quot;id&quot;: &quot;3&quot;,<br>&quot;name&quot;: &quot;Surabaya&quot;<br>},<br>{<br>&quot;id&quot;: &quot;4&quot;,<br>&quot;name&quot;: &quot;Solo&quot;<br>}<br>],<br>&quot;status&quot;: &quot;success&quot;<br>}</pre><p>You can test this service with Postman from <a href="https://dzkrrbb.com/tutorial/php-restapi/post_city.php">https://dzkrrbb.com/tutorial/php-restapi/post_city.php</a></p><h3>3. REST API — PUT Method</h3><p>This method usually used to update resources on the REST server.</p><p>Now, we create file <strong>put_city.php </strong>and define the header like this :</p><pre>header(&quot;Access-Control-Allow-Origin: *&quot;);<br>header(&quot;Content-Type: application/json; charset=UTF-8&quot;);<br>header(&quot;Access-Control-Allow-Methods: <strong>PUT</strong>&quot;);<br>header(&quot;Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With&quot;);</pre><p>This header will allow user to access service with PUT method and get JSON data from the service.</p><p>Then, continue to set data :</p><pre>$data = array(<br>array(<br>&#39;id&#39; =&gt; &#39;1&#39;,<br>&#39;name&#39; =&gt; &#39;Bandung&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;2&#39;,<br>&#39;name&#39; =&gt; &#39;Jakarta&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;3&#39;,<br>&#39;name&#39; =&gt; &#39;Surabaya&#39;<br>),<br>);</pre><p>In this post, I use array data. But you can also set the data from database query.</p><p>And then, we need to create put function for replace data value.</p><pre>$method = $_SERVER[&#39;REQUEST_METHOD&#39;];<br>if (&#39;PUT&#39; === $method) {<br>parse_str(file_get_contents(&#39;php://input&#39;), $_PUT);<br>}</pre><pre><em>// Function Edit Data<br></em>if(!empty($_PUT[&#39;id&#39;]) &amp;&amp; !empty($_PUT[&#39;name&#39;])) {<br>foreach($data as &amp; $value){<br>if($value[&#39;id&#39;] === $_PUT[&#39;id&#39;]){<br>$value[&#39;name&#39;] = $_PUT[&#39;name&#39;];<br>break; <em>// Stop the loop after we&#39;ve found the item<br></em>}<br>}</pre><pre><em>// New Data<br></em>foreach($data as $d) {<br>$result[&#39;city&#39;][] = array(<br>&#39;id&#39; =&gt; $d[&#39;id&#39;],<br>&#39;name&#39; =&gt; $d[&#39;name&#39;],<br>);<br>}<br>$result[&#39;status&#39;] = &#39;success&#39;;<br>} else {<br>foreach($data as $d) {<br>$result[&#39;city&#39;][] = array(<br>&#39;id&#39; =&gt; $d[&#39;id&#39;],<br>&#39;name&#39; =&gt; $d[&#39;name&#39;],<br>);<br>}<br>$result[&#39;status&#39;] = &#39;success&#39;;<br>}</pre><p>As you see in this function, we just replace data if we put id and name as a key to the REST. If we don’t put id and name, we just show the all data.</p><p>Finally, we store the result as JSON data.</p><pre>http_response_code(200);<br>echo json_encode($result);</pre><p>Now, we can test this service with Postman. For example, if we want to replace “Bandung” from the data, we can post in the body x-www-form-urlencoded using this key “id” with value “1” and “name” with value “Solo”. So, you can get the result like this :</p><pre>{<br>&quot;city&quot;: [<br>{<br>&quot;id&quot;: &quot;1&quot;,<br>&quot;name&quot;: &quot;Solo&quot;<br>},<br>{<br>&quot;id&quot;: &quot;2&quot;,<br>&quot;name&quot;: &quot;Jakarta&quot;<br>},<br>{<br>&quot;id&quot;: &quot;3&quot;,<br>&quot;name&quot;: &quot;Surabaya&quot;<br>}<br>],<br>&quot;status&quot;: &quot;success&quot;<br>}</pre><p>You can test this service with Postman from <a href="https://dzkrrbb.com/tutorial/php-restapi/put_city.php">https://dzkrrbb.com/tutorial/php-restapi/put_city.php</a></p><h3>4. REST API — DELETE Method</h3><p>This method usually used to delete resources from the REST server.</p><p>Now, we create file <strong>delete_city.php </strong>and define the header like this :</p><pre>header(&quot;Access-Control-Allow-Origin: *&quot;);<br>header(&quot;Content-Type: application/json; charset=UTF-8&quot;);<br>header(&quot;Access-Control-Allow-Methods: <strong>DELETE</strong>&quot;);<br>header(&quot;Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With&quot;);</pre><p>This header will allow user to access service with DELETE method and get JSON data from the service.</p><p>Then, continue to set data :</p><pre>$data = array(<br>array(<br>&#39;id&#39; =&gt; &#39;1&#39;,<br>&#39;name&#39; =&gt; &#39;Bandung&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;2&#39;,<br>&#39;name&#39; =&gt; &#39;Jakarta&#39;<br>),<br>array(<br>&#39;id&#39; =&gt; &#39;3&#39;,<br>&#39;name&#39; =&gt; &#39;Surabaya&#39;<br>),<br>);</pre><p>In this post, I use array data. But you can also set the data from database query.</p><p>And then, we need to create delete function for delete data value.</p><pre>$method = $_SERVER[&#39;REQUEST_METHOD&#39;];<br>if (&#39;DELETE&#39; === $method) {<br>parse_str(file_get_contents(&#39;php://input&#39;), $_DELETE);<br>}</pre><pre><em>// Function Edit Data<br></em>if(!empty($_DELETE[&#39;id&#39;])) {</pre><pre><em>// New Data<br></em>foreach($data as $d) {<br>if($d[&#39;id&#39;] != $_DELETE[&#39;id&#39;]) {<br>$result[&#39;city&#39;][] = array(<br>&#39;id&#39; =&gt; $d[&#39;id&#39;],<br>&#39;name&#39; =&gt; $d[&#39;name&#39;],<br>);<br>}<br>}<br>$result[&#39;status&#39;] = &#39;success&#39;;<br>} else {<br>foreach($data as $d) {<br>$result[&#39;city&#39;][] = array(<br>&#39;id&#39; =&gt; $d[&#39;id&#39;],<br>&#39;name&#39; =&gt; $d[&#39;name&#39;],<br>);<br>}<br>$result[&#39;status&#39;] = &#39;success&#39;;<br>}</pre><p>As you see in this function, we just delete data if we post id as a key to the REST. If we don’t put id and name, we just show the all data.</p><p>Finally, we store the result as JSON data.</p><pre>http_response_code(200);<br>echo json_encode($result);</pre><p>Now, we can test this service with Postman. For example, if we want to delete “Jakarta” from the data, we can post in the body x-www-form-urlencoded using this key “id” with value “1”. So, you can get the result like this :</p><pre>{<br>&quot;city&quot;: [<br>{<br>&quot;id&quot;: &quot;1&quot;,<br>&quot;name&quot;: &quot;Solo&quot;<br>},<br>{<br>&quot;id&quot;: &quot;3&quot;,<br>&quot;name&quot;: &quot;Surabaya&quot;<br>}<br>],<br>&quot;status&quot;: &quot;success&quot;<br>}</pre><p>You can test this service with Postman from <a href="https://dzkrrbb.com/tutorial/php-restapi/delete_city.php">https://dzkrrbb.com/tutorial/php-restapi/delete_city.php</a></p><h3>Conclusion</h3><p>The four methods listed above allow you to get, add, update, and delete data with REST API using PHP. You can download this REST service example on my Github <a href="https://github.com/dzikrirobbi/tutorial/tree/main/php-restapi">https://github.com/dzikrirobbi/tutorial/tree/main/php-restapi</a></p><p>Thank you :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8365fe092618" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>