<?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 Riddhi Shah on Medium]]></title>
        <description><![CDATA[Stories by Riddhi Shah on Medium]]></description>
        <link>https://medium.com/@riddhipshah?source=rss-ff0322702391------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dMadVHpBTpD4IMw1m5We3w.png</url>
            <title>Stories by Riddhi Shah on Medium</title>
            <link>https://medium.com/@riddhipshah?source=rss-ff0322702391------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:22:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riddhipshah/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[Streamlining Your UI: Traditional XML vs Jetpack Compose in native Android]]></title>
            <link>https://medium.com/@riddhipshah/streamlining-your-ui-traditional-xml-vs-jetpack-compose-in-native-android-b75857b58af6?source=rss-ff0322702391------2</link>
            <guid isPermaLink="false">https://medium.com/p/b75857b58af6</guid>
            <category><![CDATA[xml]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[modern-android]]></category>
            <dc:creator><![CDATA[Riddhi Shah]]></dc:creator>
            <pubDate>Thu, 01 Aug 2024 23:05:05 GMT</pubDate>
            <atom:updated>2024-08-01T23:05:05.378Z</atom:updated>
            <content:encoded><![CDATA[<p>In the ever-evolving world of Android development, crafting engaging and user-friendly interfaces remains paramount. Jetpack Compose, a modern UI framework, has emerged as a powerful alternative to the traditional XML-based approach. This article delves into the key differences between Compose and XML, equipping you to make informed decisions for your next project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bZqXSxU3d0yqywSzrMmsCA.jpeg" /></figure><h4><strong>Core Differences:</strong></h4><p><strong>Minimum SDK Version: <br></strong>Traditional XML projects offer more flexibility regarding the minimum supported Android version. <br>While Compose has a higher baseline (typically 21 or later), it ensures compatibility with features essential for a smooth UI experience.</p><p><strong>No More Layout XML Files:<br></strong>One of the most significant contrasts lies in the way UIs are defined. Compose eliminates the need for separate XML layout files. <br>Instead, it embraces a declarative approach where UIs are built directly using Kotlin code. This offers greater control and flexibility for developers.</p><p><strong>Project Setup:<br></strong>To integrate Compose into your project, you’ll need to add specific configurations to your build.gradle file:</p><pre>buildFeatures {     <br>    compose true <br>} <br>composeOptions {     <br>    kotlinCompilerExtensionVersion &#39;1.3.2&#39; // Adjust based on your project&#39;s requirements<br>}</pre><p>These configurations enable Compose functionality and specify the Kotlin compiler extension version, which should be compatible with your chosen Compose version.</p><p><strong>Activities and Themes:<br></strong>In traditional projects, activities typically extend AppCompatActivity. Compose introduced ComponentActivity as the base class. <br>Theme management also differs. While AppCompatActivity provides built-in support for material themes, Compose allows more granular control through ui.theme.</p><p><strong>Defining UI Layouts:<br></strong>The traditional approach uses setContentView(R.id.my_layout) to set the layout for an activity based on an XML file. <br>Compose takes a different route. You define the UI layout declaratively within the setContent { ... } lambda function.</p><p>Here&#39;s a basic example:</p><pre>setContent {     <br>    // A surface container using the &#39;background&#39; color from the theme<br>    Surface(         <br>        modifier = Modifier.fillMaxSize(),         <br>        color = MaterialTheme.colorScheme.background     <br>    ) {         <br>        Text(text = &quot;Hi, Riddhi&quot;)     <br>    } <br> }</pre><p>This code snippet displays the text “Hi, Riddhi” on the screen. <br>The Surface component acts as a container and Text renders the actual text content.</p><h4><strong>Integrating Compose with Existing Views Projects:</strong></h4><p>If you’re working with an existing XML-based project, you can gradually integrate Compose components following the below process:</p><p><strong>Step 1: </strong>Add the necessary Compose dependencies to your build.gradle file.</p><pre>dependencies {<br>    implementation &#39;androidx.compose.ui:ui:1.5.2&#39;<br>    implementation &#39;androidx.compose.material:material:1.5.2&#39;<br>    implementation &#39;androidx.compose.ui:ui-tooling-preview:1.5.2&#39;   <br><br>   // Optional dependencies<br>    implementation &#39;androidx.compose.foundation:foundation:1.5.2&#39;<br>    implementation &#39;androidx.compose.runtime:runtime:1.5.2&#39;<br>    implementation &#39;androidx.compose.animation:animation:1.5.2&#39;<br>    implementation &#39;androidx.compose.material3:material3:1.0.1&#39;<br>}</pre><p><strong>Step 2:</strong> Use ComposeView in your XML layout file, assigning it an ID.</p><pre>&lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;   <br><br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;&gt;<br><br>    &lt;androidx.compose.ui.platform.ComposeView<br>        android:id=&quot;@+id/compose_view&quot;   <br><br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;match_parent&quot; /&gt;<br><br>&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</pre><p>Step 3: Access this view in your code using findViewById and set its content using the setContent function.</p><pre>override fun onCreate(savedInstanceState: Bundle?) {<br>    super.onCreate(savedInstanceState)<br>    setContentView(R.layout.activity_main)   <br><br>    val composeView = findViewById&lt;ComposeView&gt;(R.id.compose_view)<br>    composeView.setContent   <br>    {<br>        MyComposeComponent() // Your Compose component<br>    }<br>}</pre><h4><strong>Conclusion</strong></h4><p>Compose offers a distinct approach to UI development in Android compared to the traditional XML method. <br>While both have their pros and cons, Compose boasts advantages like declarative UI definition and potentially improved developer experience.<br>However, it comes with a higher minimum SDK requirement and a steeper learning curve for developers accustomed to XML layouts.</p><p>Please don’t forget to clap 👏 for this article if you liked it. It will motivate me to post more such content ✨.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b75857b58af6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Potential of Jetpack Compose: Part III — The Power of Recomposition]]></title>
            <link>https://medium.com/@riddhipshah/unleashing-the-potential-of-jetpack-compose-part-iii-the-power-of-recomposition-a6874ffe3d9b?source=rss-ff0322702391------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6874ffe3d9b</guid>
            <category><![CDATA[state]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[recomposition]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Riddhi Shah]]></dc:creator>
            <pubDate>Tue, 07 May 2024 03:16:02 GMT</pubDate>
            <atom:updated>2024-05-07T03:16:02.858Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unleashing the Potential of Jetpack Compose: Part III — The Power of Recomposition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xh1e2KNTuwlKVn4H8ApVsw.jpeg" /></figure><p>In the previous parts of this series, we explored the advantages of Jetpack Compose over the View system and how radio buttons can be implemented in both approaches.</p><p><a href="https://medium.com/@riddhipshah/conquering-complexity-composition-vs-inheritance-in-jetpack-compose-4f1163a4debb">Unleashing the Potential of Jetpack Compose: Part II — Composition Vs Inheritance</a></p><p>This section, the final part of the series, dives deeper into a core concept of Jetpack Compose — recomposition.</p><h4><strong>What is recomposition?</strong></h4><p>Unlike the View approach where you manually update UI elements based on state changes, Jetpack Compose utilizes a powerful mechanism called recomposition. Here’s how it works:</p><p><strong>Event-Driven State Changes:</strong> When a UI element emits an event (e.g., onClick for a radio button), an event handler determines if a state change is necessary.</p><p><strong>Dependency Re-execution:</strong> If the state changes, the functions for all UI elements dependent on that state are re-executed. This process of rebuilding the UI based on the updated state is called <strong>recomposition</strong>.</p><blockquote>In simple words: Whenever your state changes, your UI will be recreated</blockquote><p>In essence, recomposition ensures your UI always reflects the current state of your application data, eliminating the need for manual UI updates and simplifying development.</p><h4>Lifecycle of Composables: Initial Composition and Recomposition</h4><p>Composable functions play a crucial role in recomposition. Here’s a breakdown of their lifecycle:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1Lnfkt76jpW8KRpFRrqsg.png" /></figure><ul><li><strong>Initial Composition:</strong> The first time a composable function is called to generate the UI based on the initial state of your data.</li><li><strong>Recomposition:</strong> Whenever the data state changes due to user interaction or other events, the composable functions dependent on that state are re-executed. This ensures the UI reflects the updated state.</li></ul><h4><strong>Example: Custom Composable Radio Button Card</strong></h4><p>Consider a scenario where we want to display a question with four answer choices represented by radio buttons. Each answer choice is displayed within a card. Here’s a simplified example of how we can achieve this with a custom composable function utilizing state management:</p><pre>@Composable<br>fun AnswerCard(<br>    question: String,<br>    answer: String,<br>    isSelected: Boolean,<br>    onAnswerSelected: (String) -&gt; Unit<br>) {<br>    Card {<br>        Row(<br>            modifier = Modifier.fillMaxWidth().padding(16.dp),<br>            verticalAlignment = Alignment.CenterVertically<br>        ) {<br>            RadioButton(<br>                selected = isSelected,<br>                onClick = { onAnswerSelected(answer) }<br>            )<br>            Text(text = answer, modifier = Modifier.padding(start = 8.dp))<br>        }<br>    }<br>}</pre><p>In this example, AnswerCard is a custom composable function that takes arguments like the question, answer text, selection state (isSelected), and a callback (onAnswerSelected) for handling user interaction. The UI within the card is rebuilt based on changes to the isSelected state or user interaction with the radio button.</p><h4><strong>Benefits of Recomposition</strong></h4><p><strong>Reduced Complexity and Improved Efficiency:</strong> Recomposition eliminates the need for manual UI updates, simplifying development and ensuring efficient UI rendering based on state changes.</p><p><strong>Automatic Updates:</strong> UI elements automatically adapt to state changes, ensuring a consistent and responsive user experience.</p><p><strong>Declarative Approach:</strong> Developers focus on declaring the desired UI based on data, and Jetpack Compose handles the UI updates through recomposition.</p><h4><strong>Conclusion</strong></h4><p>Recomposition is a cornerstone of Jetpack Compose, enabling the creation of dynamic and efficient UIs with minimal boilerplate code. By leveraging this mechanism, developers can focus on building intuitive user interfaces with the confidence that Jetpack Compose automatically handles UI updates based on the current state of the application.</p><p>If you enjoyed this series on Jetpack Compose, share it with your developer friends and give it a clap! 👏👏👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6874ffe3d9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Potential of Jetpack Compose: Part II — Composition Vs Inheritance]]></title>
            <link>https://medium.com/@riddhipshah/conquering-complexity-composition-vs-inheritance-in-jetpack-compose-4f1163a4debb?source=rss-ff0322702391------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f1163a4debb</guid>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[inheritance]]></category>
            <category><![CDATA[composition]]></category>
            <category><![CDATA[xml]]></category>
            <dc:creator><![CDATA[Riddhi Shah]]></dc:creator>
            <pubDate>Sat, 20 Apr 2024 04:50:07 GMT</pubDate>
            <atom:updated>2024-05-07T03:23:22.382Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*ndPh9A3MSlDUZrwUyO8erA.jpeg" /></figure><p>In the previous part, we explored the fundamentals of Jetpack Compose and its advantages over XML UI development</p><p><a href="https://medium.com/@riddhipshah/jetpack-compose-a-modern-approach-to-android-ui-development-546669b86d6c">Jetpack Compose: A Modern Approach to Android UI Development</a></p><h4><strong>The Challenge of Inheritance in Android Views:</strong></h4><p>The existing UI of Android or the View system is based on inheritance.</p><p>All the views such as TextView, ImageView, etc. inherit from the View class. All the common code was mainly written in the view class such as Visibility, onClickListener, etc.</p><p>It works perfectly for a small codebase, but for a larger codebase, it becomes complex.</p><h4><strong>Let’s understand the Inheritance of View via an Example:</strong></h4><p>For <strong>a Butto</strong>n, the hierarchy in the View system is Button extends TextView, TextView extends View and View extends Object</p><blockquote>Button → TextView → View → object</blockquote><p>Similarly, the Hierarchy of <strong>ImageButton </strong>would be something like this:</p><blockquote>ImageButton → ImageView → View → Object</blockquote><p>Now, What if I need to create a view in which I can show Images and text both? 🤔</p><p>The answer is: I can not create them easily as both hierarchies are different. And in Java and Kotlin, We can not extend from multiple parents.</p><p><strong>PS:</strong> I can not extend from button and image both</p><h4><strong>The Power of Composition in Jetpack Compose</strong></h4><p>👉It’s considered a good practice to consider composition over inheritance</p><p>Compose is based on the concept of Composition. You include the functionalities that you need.</p><p>In Compose, it’s possible to create a custom view that extends both the functionalities like Image and Text. As in the above example we can see, it’s not possible in the traditional Android View way.</p><p>In the case of Compose, Whichever functionalities are required we simply include them, There’s no hierarchy.</p><h4><strong>Benefits of Composition over Views</strong></h4><p>Imagine a screen with a question and 4 answers that are displayed with different cards and a radio button. We’ll try to create this UI using both methods, using the view approach as well as using the compose approach.</p><p><strong>👉View approach</strong></p><p>Now, to define the UI for answers, we need to create a card and a radio button within that. we have to define every option. We also need to handle the UI for selected and unselected states and update them accordingly. So if a view is selected we want other views to be unselected as a side effect.</p><blockquote><strong>Having to manually update views when the state changes is error-prone.</strong></blockquote><p>It’s possible to forget to update a view with its dependent state. In cases like screen rotation, or configuration changes, we might forget to remember states.</p><p>Synchronizing state changes throughout the lifespan of an app is a recurring challenge working with views. This complexity problem also increases when the number of views and dependent states grows in the app.</p><p>It’s a solvable problem, but a common source of bugs.</p><p><strong>👉Composable approach</strong></p><p>Instead of defining XML, we’d define those elements directly in the code, in Kotlin. By doing this we don’t have to jump between XML and code as UI would’ve already been declared in the code</p><p>In compose, UI elements are functions and not objects. It means we can’t find the ref of them but call methods to mutate them</p><p>UI elements in compose are entirely controlled by the arguments that we pass. i.e. we’re passing the properties to the function to display that particular UI.</p><p>Now, imagine that in our radio button composable function, we’re passing false( as unselected). Another difference from the view is, If we tap the radio button it won’t be selected. Because we’re always passing false from the code regardless of user interaction.</p><p>But In view, the radio button state automatically changes due to the user event.</p><p>In conclusion, Jetpack Compose’s approach to composition offers a more flexible and maintainable way to build UIs compared to inheritance-based Views.</p><p>By composing functionalities instead of inheriting them, developers can create complex UI elements with ease.</p><p>We’ve explored the advantages of Jetpack Compose over the View system. Now, let’s see how Jetpack Compose leverages recomposition for dynamic UI updates. Head over to the final part of the series:</p><p><a href="https://medium.com/@riddhipshah/unleashing-the-potential-of-jetpack-compose-part-iii-the-power-of-recomposition-a6874ffe3d9b">Unleashing the Potential of Jetpack Compose: Part III — The Power of Recomposition</a></p><p><strong>Appreciate this breakdown of Compose? Show some love with a </strong>👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f1163a4debb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Potential of Jetpack Compose: Part I — Fundamentals and Advantages]]></title>
            <link>https://medium.com/@riddhipshah/jetpack-compose-a-modern-approach-to-android-ui-development-546669b86d6c?source=rss-ff0322702391------2</link>
            <guid isPermaLink="false">https://medium.com/p/546669b86d6c</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[declarative-programming]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[xml]]></category>
            <dc:creator><![CDATA[Riddhi Shah]]></dc:creator>
            <pubDate>Wed, 10 Apr 2024 21:14:31 GMT</pubDate>
            <atom:updated>2024-04-20T05:00:54.971Z</atom:updated>
            <content:encoded><![CDATA[<p>Embrace a new era of Android UI development with Jetpack Compose!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*UoX6nM8IG9Qn63oDGwAjIw.png" /></figure><h4>Let’s Understand, what is Jetpack Compose?</h4><p>This modern toolkit empowers you to create beautiful and responsive user interfaces with less code. Leveraging the power and expressiveness of Kotlin, Jetpack Compose simplifies UI development, improves maintainability, and elevates the overall developer experience.</p><p>Jetpack Compose is not a part of the framework. It’s a library — <strong>Jetpack Library</strong></p><p><strong>The fundamental building blocks of Jetpack Compose are composable functions </strong>— Kotlin functions annotated with @Composable. These composables define how UI elements should look and behave.</p><p>Unlike traditional UI construction with XML, composable functions let you describe your app’s UI programmatically by specifying its desired appearance and data dependencies. You don’t need to worry about the underlying process of element creation and attachment.</p><h4>Why you should consider switching to Compose UI from XML?</h4><p>In traditional Android development, UI development is handled using an <strong>imperative</strong> <strong>approach.</strong></p><p>This means you explicitly tell the system <strong>what</strong> UI elements(views) to create and <strong>how </strong>to manipulate them at each step. You define the UI structure in XML layouts and then write code to find those views and update their properties (text, images, click listeners, etc.).</p><p>Jetpack Compose, on the other hand, takes a <strong>declarative</strong> <strong>approach.</strong></p><p>You describe the desired UI state (<strong>what</strong> you want the UI to look like) in composable functions written in Kotlin. Compose handles the rendering logic itself, making your code more concise and easier to maintain.</p><h4>Compare both approaches using the example of showing a text</h4><p><strong>Imperative (Traditional Views):</strong></p><pre>//in layout XML file<br>&lt;TextView<br>    android:id=&quot;@+id/text_view&quot;<br>    android:layout_width=&quot;wrap_content&quot;<br>    android:layout_height=&quot;wrap_content&quot;<br>    android:text=&quot;Hello World!&quot; /&gt;</pre><pre>//in Activity Kotlin class<br><br>val textView = findViewById&lt;TextView&gt;(R.id.text_view) <br>textView.text = &quot;Updated Text&quot;</pre><p><strong>Declarative (Jetpack Compose):</strong></p><pre>Text(text = &quot;Hello World!&quot;)<br><br>// Later, to update the text:<br>Text(text = &quot;Updated Text&quot;)</pre><h4>How to create and define composable functions?</h4><p>The setContent block defines the activity&#39;s layout where these composable functions are called. Importantly, <strong>composable functions can only be called from other composable functions</strong>, building a hierarchical UI structure.</p><pre>setContent {<br> Text(“Hello world!”)<br>}</pre><p>To create a composable function, simply add the @Composable annotation to the function name.</p><p>For example, let’s look at a simple composable function called DisplayText:</p><pre>@Composable<br>fun DisplayText() {<br>    Text(text = &quot;Hello, World!&quot;)<br>}</pre><p>In this example, the DisplayText function is marked as @Composable to indicate that it&#39;s a composable function. Inside the function, we use the built-in Text composable to display the text &quot;Hello, World!&quot;. You can use this DisplayText function in your Jetpack Compose UI to show a text element.</p><p>There are many other built-in composable functions available, along with the ability to create your own custom composables for reusable UI components.</p><p>Behind the scenes, Jetpack Compose uses a Kotlin compiler plugin to transform these composable functions into the app’s UI elements. This allows you to focus on the <strong>what</strong> (the desired UI) rather than the <strong>how</strong> (the underlying implementation).</p><p>To learn more about the technical details and advanced features, visit the official documentation: <a href="https://developer.android.com/develop/ui/compose">https://developer.android.com/develop/ui/compose</a></p><p>If you found this introduction to Jetpack Compose helpful, consider giving this article a clap👏.</p><p>Stay tuned for Part 2: <strong>Composition vs. Inheritance in Jetpack Compose</strong></p><p><a href="https://medium.com/@riddhipshah/conquering-complexity-composition-vs-inheritance-in-jetpack-compose-4f1163a4debb">Unleashing the Potential of Jetpack Compose: Part II — Composition Vs Inheritance</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=546669b86d6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A security feature of android very less people know about.]]></title>
            <link>https://medium.com/@riddhipshah/a-security-feature-of-android-very-less-people-know-about-336bda17cc4?source=rss-ff0322702391------2</link>
            <guid isPermaLink="false">https://medium.com/p/336bda17cc4</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[securitysettings]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Riddhi Shah]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 17:42:01 GMT</pubDate>
            <atom:updated>2019-04-08T19:02:00.673Z</atom:updated>
            <content:encoded><![CDATA[<h3>A security feature of android very few people know about.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lXmosg-n_Ks7lEUH31fvqw.jpeg" /></figure><p>Imagine, you are showing something (for example any picture or video or something like that) to your friend or colleague and suddenly some random message appeared which you don’t want to be seen by them but couldn’t do anything at that time…</p><p>Or have you faced a situation when you have given your phone to someone for a phone call but after that they ended up seeing any personal data or read any personal messages?</p><p>So, here comes the <strong>Screen Pinning</strong> in the picture.</p><h3>What is Screen Pinning?</h3><p>Screen pinning allows you to pin (lock) the screen to a certain app. Screen pinning is a feature of Android devices that enables the user to only show a specific app screen. This means all other functions of the phone are locked, apart from the one app that is pinned.</p><p>This feature is useful for anyone who give their phones to some other person,and they take advantage of that ,It is also useful for parents who give their phones to their children to prevent children from opening any other app or view or delete any useful file on the device.</p><p>This feature was introduced in Lollipop (android 5.0).</p><h3>How to turn on Screen Pinning ?</h3><p><strong>Step 1: </strong>Go to your phone’s settings-&gt; Security Settings -&gt; advanced -&gt; Screen Pinning</p><p><strong>Step 2: </strong>Now, slide the switch to turn on Screen Pinning.</p><p>Now, Screen pinning is enabled on your phone, so you can turn on screen pinning for any app.</p><p><strong>Step 3:</strong> To turn on screen pinning press the overview button (the square button on the bottom of the device)</p><h4>For Android 8.1 and above follow these steps.</h4><p><strong>Step 4: </strong>Swipe to the app you want to be pinned and click on the app’s icon</p><p><strong>Step 5:</strong> Now, Click on the pin</p><h4>For below Android 8.1 devices follow these steps.</h4><p>step 4: make the app in the centre by dragging title bar of the app you would like to pin</p><p>Step 5: Now click on the pin icon.</p><h3>How to unpin the Screen?</h3><p>Press and hold the back and overview button together. If this does not work, try using back and home button.</p><p>If you chose to be asked for your PIN, pattern, or password before unpinning, you’ll need to enter it.</p><p><strong>Caution: </strong>Note that if<strong> </strong>anyone who thinks this is a good way to show someone a photo on your phone and not have to worry about them swiping left or right to other pictures; this feature pins the app so you can navigate anywhere around the app, the screen will change but only within that app. This means if you open a photo on your phone and pin the photo screen, you can still swipe right or left to view the next and/or previous one. Proceed with caution.</p><p>Thank you, For reading the article, Please clap, follow and share to your friends (Don’t forget that you can clap 👏 for multiple times).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=336bda17cc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding git for beginners]]></title>
            <link>https://medium.com/@riddhipshah/understanding-git-for-beginners-20d4b55cc72c?source=rss-ff0322702391------2</link>
            <guid isPermaLink="false">https://medium.com/p/20d4b55cc72c</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Riddhi Shah]]></dc:creator>
            <pubDate>Tue, 24 Jul 2018 09:56:01 GMT</pubDate>
            <atom:updated>2018-07-27T09:06:34.289Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*a37P_uCuAlNSzhfw7t1AMw.png" /><figcaption>github</figcaption></figure><h3><strong>What is Github?</strong></h3><p>As a beginner, I always had a question, wth is this “git”? and why people use it so much? So, I decided to write a post.</p><p>so, “git is version control system.” Let’s say if you are having a project and working in a team, then you will need a version control system to manage your project in different versions more efficiently. as it allows developers to easily collaborate, as they can download a new version of the software, make changes, and upload the newest revision. Every developer can see these new changes, download them, and contribute.</p><p><strong>GitHub</strong> is a Git repository hosting service, but it adds many of its own features. While Git is a command line tool, <strong>GitHub</strong> provides a Web-based graphical interface. It also provides access control and several collaboration features, such as a wikis and basic task management tools for every project</p><h3><strong>Understanding Terminologies</strong></h3><p><strong>Repository: </strong>A directory or storage space where your projects can live. Sometimes GitHub users shorten this to “repo.” It can be local to a folder on your computer, or it can be a storage space on GitHub or another online host. You can keep code files, text files, image files, you name it, inside a repository.</p><p><strong>Fork: </strong>Creates a copy of a repository.</p><p><strong>Remote: </strong>These are “remote” locations of your repository, normally on some central server.</p><p><strong>Branch: </strong>A version of the repository that diverges from the main working project. Branches can be a new version of a repository, experimental changes, or personal forks of a repository for users to alter and test changes.</p><p><strong>Master: </strong>The primary branch of all repositories. All committed and accepted changes should be on the master branch. You can work directly from the master branch, or create other branches.</p><p><strong>Checkout: </strong>Switching branch git checkout command is used to switch the branches</p><p><strong>Clone: </strong>A clone is a copy of a repository or the action of copying a repository.</p><p><strong>Fetch:</strong> By fetching any branch you can download and copy that branch’s file to your workstations. Multiple branches can be fetched at once, and you can rename the branches when running the command to suit your needs.</p><p><strong>Pull:</strong> Pull refers to when you are fetching remote changes to your local branch and merging them. For instance, if someone has edited the remote file you’re both working on, you’ll want to <em>pull</em> in those changes to your local copy so that it’s up to date.</p><p><strong>Push: </strong>Pushing refers to sending your committed changes from local copy to a remote repository, such as a repository hosted on GitHub. For instance, if you change something locally, you’d want to then <em>push</em> those changes so that others may access them.</p><p><strong>Commit: </strong>A commit, or “revision”, is an individual change to a file (or set of files). It’s like when you <em>save</em> a file, except with Git, every time you save it creates a unique ID (a.k.a. the “SHA” or “hash”) that allows you to keep record of what changes were made when and by who. Commits usually contain a commit message which is a brief description of what changes were made.</p><p><strong>Head:</strong> HEAD is a reference variable used to denote the most current commit of the repository in which you are working. When you add a new commit, HEAD will then become that new commit.</p><p><strong>Merge:</strong> Taking the changes from one branch and adding them into another branch. These commits are usually first requested via pull request before being merged by a project maintainer.</p><p><strong>SSH Key:</strong> SSH keys are a way to identify yourself to an online server, using an encrypted message. It’s as if your computer has its own unique password to another service. GitHub uses SSH keys to securely transfer information to your computer.</p><h3><strong>Getting started with GitHub</strong></h3><p>First you’ll need to signup on <a href="https://github.com/">github.com</a></p><p>After that, you’’ll need to install git in your machine. you can install it in your mac, Linux or windows machine by following this <a href="https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/">link</a></p><p>Now, after that open your terminal (for windows user, open Git Bash) and type following commands :</p><pre>git config --global user.name &quot;Your Name Here&quot;</pre><p>You need to replace your name or username with “Your Name Here”. after that you need to provide email and make sure it’s the same email you used when you signed up for a GitHub.com account.</p><pre>git config --global user.email &quot;your_email@youremail.com&quot;</pre><p>That’s all.</p><h3>Some useful git commands</h3><h4><strong>Create a new local Repository</strong></h4><pre>mkdir mygitrepo<br>cd mygitrepo</pre><p>Now, initialize repo with init command</p><pre>git init</pre><h4><strong>Check current status</strong></h4><pre>git status</pre><p>by using this command you can get information of modified or unmodified files, your current branch name and its status etc.</p><h4>Add files for commit</h4><pre>git add &lt;file path+name&gt;</pre><p>This command updates the index to prepare the content staged for the next commit.</p><p><strong>Note: </strong>git add . adds all modified and new (untracked) files in the current directory and all sub-directories to the staging area (a.k.a. the index). but it will not do anything about deleted files.</p><p>To include deletions in the index (and the comming commit) you need to do git add -A</p><h4>Commit</h4><pre>git commit -m &quot;commit message&quot;</pre><h4>Push</h4><pre>git push</pre><p>push your local changes to your remote branch by using this command.</p><h4>Pull</h4><pre>git pull origin </pre><p>by using this command, you can pull remote changes to your local branch.</p><p><strong>Note: </strong>to pull other branch into your local branch use following code.</p><p>git pull &lt;branch name&gt;</p><h4>Create a new branch</h4><pre>git checkout -b &quot;branch name&quot;</pre><h4>Switch to another branch</h4><pre>git checkout &quot;branch name&quot;</pre><h4>Merge another branch into current branch</h4><pre>git merge &lt;branch_name&gt;</pre><p>That’s all! I hope you enjoyed reading. Please 👏 (clap) and share if you find this post useful .(This is my first attempt at writing an article for Medium so any suggestion would be appreciated :)). Thank you .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20d4b55cc72c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>