<?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: Carol Musyoka</title>
    <description>The latest articles on DEV Community by Carol Musyoka (@carolmusyoka).</description>
    <link>https://dev.to/carolmusyoka</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%2F269463%2Fd743e18e-e704-4462-b915-13bf1ec1e382.jpg</url>
      <title>DEV Community: Carol Musyoka</title>
      <link>https://dev.to/carolmusyoka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/carolmusyoka"/>
    <language>en</language>
    <item>
      <title>Android Intents with Kotlin</title>
      <dc:creator>Carol Musyoka</dc:creator>
      <pubDate>Sun, 01 Mar 2020 11:43:10 +0000</pubDate>
      <link>https://dev.to/carolmusyoka/android-intents-with-kotlin-80f</link>
      <guid>https://dev.to/carolmusyoka/android-intents-with-kotlin-80f</guid>
      <description>&lt;p&gt;We all have come across intents in different apps. Whether it is being able to share an image, start another activity or open a browser. Well, before an app can perform an action, it needs to know what that actions purpose is, or intent,  in order to carry out that action properly. So what exactly is an intent?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An intent is a messaging object you can use to request an action from another app component.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are an android Dev you might have used intents to launch an activity from an existing activity or to launch an app . There are number of tasks on apps that depend on the use of intents. In this blog we are going to cover implicit android intents using Kotlin. &lt;/p&gt;

&lt;h4&gt;
  
  
  There are two types of Intents.
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Implicit Intents – Allows you to have a separate app that performs an action such as “Send an email”
&lt;/h5&gt;

&lt;h5&gt;
  
  
  Explicit Intents – These are intents used to navigate between activities in your own app. This can be by launching another activity on the click of a button
&lt;/h5&gt;

&lt;p&gt;With Intents in your app you can perform some actions such as, Call📞, sending an email✉️, Browse, capture images 📷 or view the gallery. The idea of using intents is not having to build an individual activity or another app to perform an action, you can pass the intent and let another app perform the assigned action.  If you call the Implicit Intent, the android system searches for components that can be used to start the activity. This is done by comparing the contents of the intent with content present in the intent-filters declared in the &lt;i&gt;AndroidManifist.xml&lt;/i&gt;.&lt;br&gt;
 Intent Filters are expressions that are used to specify the type of components or actions that can be received by the application.&lt;/p&gt;

&lt;p&gt;In this tutorial we shall build a simple Bio App where you shall be able to call, send an email and view the location with the use of implicit Intents.&lt;br&gt;
 Unlike in Explicit intents where we declare the class name of the components to start, with implicit intents, we declare an action to be performed. Depending on the intent you want to create, the data might be an Uri(Uniform Resource Identifier).the intent might also not need data at all.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 1.&lt;/b&gt;  Crete a new Android Studio Project&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 2.&lt;/b&gt;  Open the activity _main.xml and add the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"&amp;gt;


    &amp;lt;com.androdocs.circleimagelibrary.CircleImageView
        android:id="@+id/circleImageView"
        android:layout_width="178dp"
        android:layout_height="178dp"
        android:src="@drawable/carol"
        app:border_color="#000000"
        app:border_width="2dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.496"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.145" /&amp;gt;

    &amp;lt;Button
        android:id="@+id/bioview"
        android:layout_width="152dp"
        android:layout_height="53dp"
        android:background="@drawable/roundbutton"
        android:text="View My Bio"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/circleImageView"
        app:layout_constraintVertical_bias="0.085" /&amp;gt;

&amp;lt;/androidx.constraintlayout.widget.ConstraintLayout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;From the above xml code, I created an imageView and a button. I used a Circle image view and constraint layout. Well, it all depends on your preference when it comes to it. &lt;br&gt;
My drawable/roundbutton.xml&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
&amp;lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&amp;gt;&lt;br&gt;
&amp;lt;solid android:color="@color/transparent"/&amp;gt;&lt;br&gt;
   &amp;lt;stroke android:width="1dp" android:color="#ffff" /&amp;gt;&lt;br&gt;
    &amp;lt;corners android:radius="20dp"/&amp;gt;&lt;br&gt;
&amp;lt;/shape&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Intent filters declared in the AndroidManifest.xml&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
&amp;lt;intent-filter&amp;gt;&lt;br&gt;
    &amp;lt;action android:name="android.intent.action.MAIN" /&amp;gt;&lt;br&gt;
&amp;lt;category android:name="android.intent.category.LAUNCHER" /&amp;gt;&lt;br&gt;
&amp;lt;/intent-filter&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 3&lt;/b&gt;. Create another activity.  &lt;/p&gt;

&lt;p&gt;&lt;i&gt;File&amp;gt;New&amp;gt;Activity&amp;gt;EmptyActivity&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 4.&lt;/b&gt;  Editing the activity_dets.xml&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;com.androdocs.circleimagelibrary.CircleImageView
    android:id="@+id/image"

    android:layout_width="178dp"
    android:layout_height="178dp"
    app:border_color="#000000"
    app:border_width="3dp"
    app:contentDescription="TODO"
    android:src="@drawable/carol"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.068"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.07" /&amp;gt;

&amp;lt;Button
    android:id="@+id/callme"
    android:layout_width="176dp"
    android:layout_height="43dp"
    android:layout_alignParentEnd="true"
    android:background="@drawable/roundbutton"
    android:backgroundTint="#DFA71CC4"
    android:paddingStart="20dp"
    android:paddingEnd="20dp"
    android:text="Call me"
    android:textAlignment="center"
    android:textSize="12sp"
    android:visibility="visible"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.885"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.079"
    tools:visibility="visible" /&amp;gt;

&amp;lt;Button
    android:id="@+id/emailme"
    android:layout_width="176dp"
    android:layout_height="43dp"
    android:layout_below="@+id/callme"
    android:layout_alignParentEnd="true"
    android:background="@drawable/roundbutton"
    android:backgroundTint="#DFA71CC4"
    android:text="Send me an email"
    android:textAlignment="center"
    android:textSize="12sp"
    android:visibility="visible"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.885"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/callme"
    app:layout_constraintVertical_bias="0.087"
    tools:visibility="visible" /&amp;gt;

&amp;lt;Button
    android:id="@+id/location"
    android:layout_width="176dp"
    android:layout_height="43dp"
    android:layout_below="@id/emailme"
    android:layout_alignParentEnd="true"
    android:background="@drawable/roundbutton"
    android:backgroundTint="#DFA71CC4"
    android:text="My Location"
    android:textAlignment="center"
    android:textSize="12sp"
    app:layout_constraintBottom_toBottomOf="parent"

    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.885"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.334" /&amp;gt;

&amp;lt;ScrollView
    android:id="@+id/scroll"
    android:layout_width="376dp"
    android:layout_height="291dp"
    android:layout_marginStart="8dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.813"&amp;gt;

    &amp;lt;TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"

        android:text="@string/article"
        android:textAlignment="center"
        android:textSize="20sp" /&amp;gt;
&amp;lt;/ScrollView&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;From the above code, we have created three buttons. One to allow a call to be made, another to send an email and another to view the location.&lt;br&gt;
 First Lets add functionality to the button in the main activity to open our second activity. We shall use an explicit intents .&lt;/p&gt;

&lt;p&gt;Step 4.  Adding functionality to the button in the main activity&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    val viewbio = findViewById&amp;lt;Button&amp;gt;(R.id.bioview)
    viewbio.setOnClickListener {
        val intent = Intent(this, Dets::class.java)
        startActivity(intent)
    }


}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;On button click, we shall start our Dets activity. &lt;/p&gt;

&lt;p&gt;Step 5. Add functionality to the three buttons in DetsActivity. &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_dets)



    val callme = findViewById&amp;lt;View&amp;gt;(R.id.callme)
    callme.setOnClickListener {
        val callIntent: Intent = Uri.parse("tel:+254712345678").let { number -&amp;gt;
            Intent(Intent.ACTION_DIAL, number)
        }
        startActivity(callIntent)


        Handler().postDelayed({
            Toast.makeText(
                this,
                "Please leave a message if I am not available",
                Toast.LENGTH_LONG
            ).show()
        }, 4000)
    }


    val emailme = findViewById&amp;lt;View&amp;gt;(R.id.emailme)
    emailme.setOnClickListener {
        val intent = Intent(Intent.ACTION_SENDTO)
        intent.data = Uri.parse("mailto:youremail@gmail.com") // only email apps should handle this
        intent.putExtra(Intent.EXTRA_EMAIL, "")
        intent.putExtra(Intent.EXTRA_SUBJECT, "Feedback")
        startActivity(intent)

    }

         val locateme = findViewById&amp;lt;View&amp;gt;(R.id.location)
     locateme.setOnClickListener {
       // Build the intent
       val location =
           Uri.parse("geo:0,0?q=Home+Taita+Taveta+University&amp;amp;ftid=0x0:0xcc0f6fda95558a7e")
       val mapIntent = Intent(Intent.ACTION_VIEW, location)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;From the above code we have three intents, callme, emailme and locateme. &lt;br&gt;
"callme" will initiate a phone call using the Uri data to specify the telephone number (“:+254712345678”). When your app invokes this intent by calling startActivity(), the Phone app initiates a call to the given phone number. The same applies to "locateme" whereas "emailme" does not require the use of an Uri.&lt;br&gt;
locateme also requires the use an Uri&lt;/p&gt;

&lt;p&gt;Other Intents you can try adding to your app; &lt;/p&gt;

&lt;h6&gt;
  
  
  To open a browser
&lt;/h6&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
btn_browser.setOnClickListener(View.OnClickListener {&lt;br&gt;
    val intent = Intent(Intent.ACTION_VIEW)&lt;br&gt;
    intent.data = Uri.parse("https://github.com/user/myportfolio")&lt;br&gt;
    startActivity(intent)&lt;br&gt;
})&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  To capture an image
&lt;/h6&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
btn_camera.setOnClickListener(View.OnClickListener {&lt;br&gt;
    val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)&lt;br&gt;
    startActivity(intent)&lt;br&gt;
})&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;PS: If you invoke an intent and there is no app on the device to handle it, your app will crush.&lt;/p&gt;

&lt;p&gt;To verify there is an activity available that can respond to the intent, call queryIntentActivities() to get a list of activities capable of handling your Intent. If the returned List is not empty, you can safely use the intent.&lt;/p&gt;

&lt;p&gt;Consider the one we used to verify if the app to handle the intent exists. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;br&gt;
// Verify it resolves&lt;br&gt;
           val activities: List = packageManager.queryIntentActivities(mapIntent, 0)&lt;br&gt;
           val isIntentSafe: Boolean = activities.isNotEmpty()&lt;/p&gt;

&lt;p&gt;// Start an activity if it's safe&lt;br&gt;
           if (isIntentSafe) {&lt;br&gt;
               startActivity(mapIntent)&lt;br&gt;
           }&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Get the full code from &lt;a href="https://github.com/carolinemusyoka/Bio"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The internet is resourceful. It does not come to an end from that. There is so much to learn about intents. From receiving and responding to intents from other apps, Verifying if there is an app to receive the intent and so much more. &lt;/p&gt;

&lt;p&gt;Keep learning and share what you learn!!! 😎&lt;/p&gt;

</description>
      <category>intents</category>
      <category>kotlin</category>
      <category>android</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to start another activity on button click using Kotlin</title>
      <dc:creator>Carol Musyoka</dc:creator>
      <pubDate>Sun, 12 Jan 2020 18:44:43 +0000</pubDate>
      <link>https://dev.to/carolmusyoka/how-to-start-another-activity-on-button-click-using-kotlin-50lk</link>
      <guid>https://dev.to/carolmusyoka/how-to-start-another-activity-on-button-click-using-kotlin-50lk</guid>
      <description>&lt;p&gt;In this tutorial you will learn how to start another activity when a button is clicked. We will begin from scratch(starting a new android studio project)&lt;/p&gt;

&lt;h2&gt;
  
  
  Start a new Android Studio Project
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fiehgs0uyhkjdjl47gjjk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fiehgs0uyhkjdjl47gjjk.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the activity_main.xml add a textView and a button. Here is is what you can use&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;TextView
    android:id="@+id/textView"
    android:layout_width="292dp"
    android:layout_height="63dp"
    android:layout_marginEnd="60dp"
    android:text="Click on the button to open another activity!"
    android:textSize="18sp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.446"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.459" /&amp;gt;

&amp;lt;Button
    android:id="@+id/button"
    android:layout_width="159dp"
    android:layout_height="63dp"
    android:text="Click Me!!"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/textView"
    app:layout_constraintVertical_bias="0.197" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdc769gt4kv3fm614cv2p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdc769gt4kv3fm614cv2p.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a new second activity
&lt;/h2&gt;

&lt;p&gt;app&amp;gt;&amp;gt;java&amp;gt;&amp;gt;new&amp;gt;&amp;gt;activity&amp;gt;&amp;gt;Empty activity&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhagojonz6oclqmz2ccq0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fhagojonz6oclqmz2ccq0.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the second activity you can add an imageView and textView&lt;/p&gt;

&lt;p&gt;You now have two activities, the main activity and the second activity. Now all we have to do is to add functionality to the button in the (MainActivity.kt)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    val button = findViewById&amp;lt;Button&amp;gt;(R.id.button)
        button.setOnClickListener{
            val intent = Intent(this, second::class.java)
            startActivity(intent)
        }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now run your app on your emulator or hardware device&lt;/p&gt;

&lt;p&gt;You will get something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgslq49haee69kjq02j91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgslq49haee69kjq02j91.png"&gt;&lt;/a&gt; &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftnxjv0cs7rjzwrj5un16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftnxjv0cs7rjzwrj5un16.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the Source Code on &lt;a href="https://github.com/carolinemusyoka/demo" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s a wrap for this post. We have learnt how to start another activity on button click for our app’s first time users. &lt;/p&gt;

&lt;p&gt;My ‘images’ don’t quite match with the ones you see on the Drive app 😄. But I’m sure you can come up with something better! Drop ’em in the comments below.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>kotlin</category>
      <category>android</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>How to create a simple portfolio with GitHub pages</title>
      <dc:creator>Carol Musyoka</dc:creator>
      <pubDate>Wed, 27 Nov 2019 10:41:14 +0000</pubDate>
      <link>https://dev.to/carolmusyoka/how-to-create-a-simple-portfolio-with-github-pages-1ffd</link>
      <guid>https://dev.to/carolmusyoka/how-to-create-a-simple-portfolio-with-github-pages-1ffd</guid>
      <description>&lt;p&gt;One of the ways of scaling up as a developer is building a portfolio. Basically, a portfolio is a way of showcasing work samples and skills stated in your resume.&lt;/p&gt;

&lt;p&gt;One of the ways of creating a simple portfolio is using GitHub pages. This is a site hosting service that takes HTML, CSS and JavaScript files directly from a repo on GitHub. The good thing about GitHub pages is the fact that it is free as it supports custom domains, with deploys straight from Git.&lt;/p&gt;


&lt;h1&gt; Getting Started &lt;/h1&gt; 

&lt;ul&gt;
&lt;li&gt;Make sure you have a &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; account.&lt;/li&gt;
&lt;li&gt;Have basic knowledge of how &lt;a href="https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners" rel="noopener noreferrer"&gt;Git and GitHub&lt;/a&gt; Works.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Lets do this 💪🏻 &lt;/h1&gt;

&lt;p&gt;Login to your &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; account&lt;/p&gt;


&lt;h2&gt;Creating a project site.&lt;/h2&gt;
&lt;br&gt;
With project sites, you get to use templates downloaded online or pick a theme from the settings on the repository. 

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;create a new repository named &lt;em&gt;username.github.io&lt;/em&gt;. Say if you name is carolyne, your repository name will be &lt;em&gt;carolyne.github.io&lt;/em&gt;. This will be your homepage. PS: You can add a description if you like.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check out the following websites to download free portfolio website templates from &lt;a href="https://colorlib.com/wp/cat/portfolio/" rel="noopener noreferrer"&gt;colorlib&lt;/a&gt;, &lt;a href="https://startbootstrap.com/themes/" rel="noopener noreferrer"&gt;Start Bootstrap&lt;/a&gt;, &lt;a href="https://www.themezy.com/" rel="noopener noreferrer"&gt;Themezy&lt;/a&gt;, &lt;a href="https://www.bootstrapzero.com/" rel="noopener noreferrer"&gt;BootStrap zero&lt;/a&gt; or &lt;a href="https://bootstrapmade.com/" rel="noopener noreferrer"&gt;Bootstrap made&lt;/a&gt;. You can as well use this link (&lt;a href="https://github.com/evanca/quick-portfolio" rel="noopener noreferrer"&gt;https://github.com/evanca/quick-portfolio&lt;/a&gt;) to create one by forking the repo. 
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub-images.s3.amazonaws.com%2Fhelp%2Fbootcamp%2FBootcamp-Fork.png"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Go to repository Settings and scroll down to the “GitHub Pages” section. Select “master branch” under the “Source”.&lt;/p&gt;

&lt;p&gt;Add a theme to the portfolio to changeits look and feel&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhelp.github.com%2Fassets%2Fimages%2Fhelp%2Fpages%2Fchoose-a-theme.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhelp.github.com%2Fassets%2Fimages%2Fhelp%2Fpages%2Fchoose-a-theme.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the theme you want and then , Select Theme&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhelp.github.com%2Fassets%2Fimages%2Fhelp%2Fpages%2Fselect-theme.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhelp.github.com%2Fassets%2Fimages%2Fhelp%2Fpages%2Fselect-theme.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may be asked to edit your site`s README.md file&lt;br&gt;
Your chosen theme will automatically apply to files in your repo.&lt;/p&gt;

&lt;h2&gt;Steps to create personal or organization site&lt;/h2&gt;

&lt;p&gt;You can work with the repo already created  or create a new one.&lt;/p&gt;

&lt;h3&gt;Clone the repository.&lt;/h3&gt;

&lt;p&gt;create a folder where you want to store the project on your desktop and clone the new repository &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;~ $ git clone https://github.com/carolmusyoka18/carolmusyoka18.github.io&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;add index.html file &lt;/h3&gt; 

&lt;p&gt;You can now create an index.html file in the project folder&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;br&gt;
~ $ cd carolmusyoka18.github.io&lt;br&gt;
~ $ echo "Hello World" &amp;gt; index.html &lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;Push the Repo &lt;/h3&gt;

&lt;p&gt;Add commit and push all your changes&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`~ $ git add --all&lt;/p&gt;

&lt;p&gt;~ $ git commit -m "Initial commit"&lt;/p&gt;

&lt;p&gt;~ $ git push -u origin master&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And you are good to go 😎🎉🎉&lt;/p&gt;

&lt;p&gt;Check out your website  &lt;a href="https://username.github.io" rel="noopener noreferrer"&gt;https://username.github.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are deploying Github pages for the first time, you might need to wait for a while before you see the actual site. If you need to make any change to your portfolio, you can make them locally and push the changes as shown above. It is not advisable to make changes directly on the portfolio.&lt;/p&gt;

&lt;p&gt;You can edit files directly on GitHub in any of your repositories using the file editor, which uses CodeMirror. You can check out this short &lt;a href="https://help.github.com/en/github/managing-files-in-a-repository/editing-files-in-your-repository" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt; to get it right&lt;/p&gt;

&lt;p&gt;The secret is trying and practicing. With time you will, get pretty good at creating portfolios. Share your thoughts or ideas down below. &lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Contributing to Open-source for beginners</title>
      <dc:creator>Carol Musyoka</dc:creator>
      <pubDate>Tue, 19 Nov 2019 03:28:11 +0000</pubDate>
      <link>https://dev.to/carolmusyoka/contributing-to-open-source-and-hacktoberfest-1k36</link>
      <guid>https://dev.to/carolmusyoka/contributing-to-open-source-and-hacktoberfest-1k36</guid>
      <description>&lt;p&gt;One of the ways of leveling up as a programmer is writing more code and the other is reading other peoples’ code. This is  by contributing to open-source projects. I know, making that first contribution can be overwhelming and a bit scary. For me, I remember the first time I tried it, around October 2018 during the #HacktoberFest18 and I remember thinking about how little I know about programming and how many mistakes I might end up making. Well with time I got over my fear and tried out again during this years' hacktoberfest. Here are a few tips that might help a beginner dive into open-source contribution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why contribute to open-source?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contributing to open-source helps in building skills which can be helpful in your career because it gives the bigger picture. You get to meet like-minded people with the same interest as you and if you are lucky enough you can get a mentor. It can also be lots of fun, ie, if you are participating in sprints or a month long celebration like Hacktoberfest (run by DigitalOcean in partnership with GitHub and DEV)&lt;/p&gt;

&lt;h3&gt;
  
  
  What you need to do before contributing to Open-source.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create a GitHub account &lt;a href="https://github.com/join"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check if you have Git installed don your computer, if not install it. For windows, you can simply download it from their &lt;a href="https://git-scm.com/downloads"&gt;website&lt;/a&gt;. As for Linux users simply type in the following in the terminal;&lt;/p&gt;

&lt;p&gt;Sudo apt install git //to install git&lt;br&gt;
git --version  //to check if it is installed successfully&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Get to understand how GitHub works. It is one of the most popular open-source collaboration platforms. After creating an account, learn how to create and use a repository, start and merge a new branch, make changes to a file and pushing them to GitHub as commits and opening and merging a pull request. You can check out &lt;a href="https://guides.github.com/activities/hello-world/"&gt;this &lt;/a&gt; tutorial to make things a bit easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you need to know;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The programming language you will go for.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Behind every software lies the most important technology, the language. According to the latest State of the Octoverse (a report that provides insight into the development industry), JavaScript is the most widely used programming language on GitHub over the past year. Closely followed by Python, Java. Java has maintained its popularity because of its use for Android Development although usage of Kotlin might lead to reduced usage.&lt;br&gt;
But then again it all boils down to your preference (both skills and taste).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project volume&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is how large a project is. There are softwares such as Microsoft&lt;code&gt;s code editor Visual Studio, Google&lt;/code&gt;s development kit for UIs, Flutter, etc., with thousands of lines of code. These might not be the best choice for a beginner. One thing about contributing to these huge projects is the requirements you are required to meet. So why not start small first and get good along the way. You can check out issue labels. Some are labeled ‘easy’, ‘good first issue’, ‘junior job’, ‘beginner’ etc. You can check out &lt;a href="https://github.com/MunGell/awesome-for-beginners"&gt;this&lt;/a&gt; list of awesome beginner-friendly projects on GitHub.&lt;/p&gt;

&lt;p&gt;If you are interested in learning more about open-source you  can checkout &lt;a href="https://opensource.google/"&gt;Google Open Source&lt;/a&gt; . One good thing about open source, is the fact that you do not need to be the best at it. It is welcome to everyone with all skill levels, whether you are a programmer or not. As a non-programmer you can help in documentation of a project, writing, updating and translating documents or even designing user interfaces for non-programmers who have design skills.&lt;/p&gt;

&lt;p&gt;The bottom line is, contributing is learning and with time you get super good at it. It is fun too. I believe and hope that we raise a generation of coders, creators who think out of the box and contribute to open-source projects.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>hacktoberfest</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
