<?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 Ashutosh Singh Tomar on Medium]]></title>
        <description><![CDATA[Stories by Ashutosh Singh Tomar on Medium]]></description>
        <link>https://medium.com/@thegypsydev?source=rss-c861fa29d5d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JfPAY-yliEPXOowEoy6_Tg.jpeg</url>
            <title>Stories by Ashutosh Singh Tomar on Medium</title>
            <link>https://medium.com/@thegypsydev?source=rss-c861fa29d5d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:47:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thegypsydev/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[Creating a Custom Vertical Color-Splitting TextView in Android]]></title>
            <link>https://medium.com/@thegypsydev/creating-a-custom-vertical-color-splitting-textview-in-android-e91407cf546b?source=rss-c861fa29d5d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/e91407cf546b</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-custom-textview]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[custom-view-android]]></category>
            <dc:creator><![CDATA[Ashutosh Singh Tomar]]></dc:creator>
            <pubDate>Sun, 06 Oct 2024 12:44:10 GMT</pubDate>
            <atom:updated>2024-10-06T12:44:10.676Z</atom:updated>
            <content:encoded><![CDATA[<p>In Android development, the TextView widget is one of the most commonly used components. However, sometimes you want to enhance its functionality to create a more visually appealing user interface. One such enhancement is the ability to split the text color vertically, allowing for custom visual effects. In this article, we will create a custom TextView that splits its text color based on a specified ratio, making it easy to implement this feature in your applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*9vHNaNZoEVKMheqXm9bJcQ.png" /><figcaption>Before Applying the Effect with a Single Solid Color</figcaption></figure><blockquote>Bored, of using such plane texts, let’s add some colors to it 🤩</blockquote><h3>Prerequisites</h3><p>Before we start, make sure you have:</p><ul><li>Basic knowledge of Android development and Kotlin.</li><li>An Android project set up in Android Studio.</li></ul><h3>Step 1: Create the Custom TextView Class</h3><p>We’ll create a new class VerticalColorTextView that extends AppCompatTextView. This class will have custom attributes for the top and bottom colors and a split ratio.</p><pre>import android.content.Context<br>import android.graphics.Canvas<br>import android.graphics.Color<br>import android.graphics.Paint<br>import android.graphics.Rect<br>import android.util.AttributeSet<br>import androidx.appcompat.widget.AppCompatTextView<br>import com.example.yourapp.R<br><br>class VerticalColorTextView @JvmOverloads constructor(<br>    context: Context,<br>    attrs: AttributeSet? = null,<br>    defStyleAttr: Int = 0<br>) : AppCompatTextView(context, attrs, defStyleAttr) {<br><br>    private val topPaint = Paint(paint)<br>    private val bottomPaint = Paint(paint)<br>    private var splitRatio: Float = 0.5f<br><br>    init {<br>        // Initialize with XML attributes<br>        context.theme.obtainStyledAttributes(attrs, R.styleable.VerticalColorTextView, 0, 0).apply {<br>            try {<br>                topPaint.color = getColor(R.styleable.VerticalColorTextView_topColor, Color.RED)<br>                bottomPaint.color = getColor(R.styleable.VerticalColorTextView_bottomColor, Color.GREEN)<br>                splitRatio = getFloat(R.styleable.VerticalColorTextView_splitRatio, 0.5f)<br>            } finally {<br>                recycle()<br>            }<br>        }<br>    }<br><br>    // Function to set the colors separately<br>    fun setVerticalTextColors(topColor: Int, bottomColor: Int) {<br>        topPaint.color = topColor<br>        bottomPaint.color = bottomColor<br>        invalidate() // Redraw the view<br>    }<br><br>    // Function to set the split ratio separately<br>    fun setSplitRatio(ratio: Float) {<br>        splitRatio = ratio.coerceIn(0f, 1f) // Ensure ratio is between 0 and 1<br>        invalidate() // Redraw the view<br>    }<br><br>    override fun onDraw(canvas: Canvas) {<br>        val text = text.toString()<br>        if (text.isEmpty()) return<br><br>        val textBounds = Rect()<br>        paint.getTextBounds(text, 0, text.length, textBounds)<br><br>        val baseline = (height - textBounds.height()) / 2f + textBounds.height() - paint.descent()<br>        val splitY = baseline - textBounds.height() * (1 - splitRatio)<br><br>        // Draw the top half (from top to the split position)<br>        canvas.save()<br>        canvas.clipRect(0f, 0f, width.toFloat(), splitY) // Clip the top half<br>        canvas.drawText(text, (width - paint.measureText(text)) / 2, baseline, topPaint)<br>        canvas.restore()<br><br>        // Draw the bottom half (from split position to the bottom)<br>        canvas.save()<br>        canvas.clipRect(0f, splitY, width.toFloat(), height.toFloat()) // Clip the bottom half<br>        canvas.drawText(text, (width - paint.measureText(text)) / 2, baseline, bottomPaint)<br>        canvas.restore()<br>    }<br>}</pre><h3>Step 2: Define Custom Attributes in XML</h3><p>To allow for customization directly from the XML layout, we need to define custom attributes for our VerticalColorTextView. Create a new XML file in the res/values folder named attrs.xml.</p><pre>&lt;resources&gt;<br>    &lt;declare-styleable name=&quot;VerticalColorTextView&quot;&gt;<br>        &lt;attr name=&quot;topColor&quot; format=&quot;color&quot;/&gt;<br>        &lt;attr name=&quot;bottomColor&quot; format=&quot;color&quot;/&gt;<br>        &lt;attr name=&quot;splitRatio&quot; format=&quot;float&quot;/&gt;<br>    &lt;/declare-styleable&gt;<br>&lt;/resources&gt;</pre><h3>Step 3: Using the Custom TextView in XML</h3><p>You can now use your custom VerticalColorTextView in your layout files, specify the colors, and split ratio as desired.</p><pre>&lt;com.example.yourapp.VerticalColorTextView<br>    android:id=&quot;@+id/verticalColorTextView&quot;<br>    android:layout_width=&quot;wrap_content&quot;<br>    android:layout_height=&quot;wrap_content&quot;<br>    android:text=&quot;Split Text Example&quot;<br>    android:textSize=&quot;24sp&quot;<br>    app:topColor=&quot;@android:color/holo_red_dark&quot;<br>    app:bottomColor=&quot;@android:color/holo_green_dark&quot;<br>    app:splitRatio=&quot;0.4&quot; /&gt;</pre><h3>Step 4: Programmatic Updates</h3><p>If you want to change the colors or split the ratio programmatically, you can call the respective methods from your activity or fragment:</p><pre>val verticalColorTextView: VerticalColorTextView = findViewById(R.id.verticalColorTextView)<br>verticalColorTextView.setVerticalTextColors(Color.BLUE, Color.YELLOW)<br>verticalColorTextView.setSplitRatio(0.6f)</pre><h3>Conclusion</h3><p>In this article, we successfully created a custom TextView that splits text color vertically based on a specified ratio. By separating the functionality to set colors and the split ratio into distinct methods, we improve the clarity and usability of our custom view. This simple yet powerful enhancement can add a unique touch to your Android applications. You can further extend this idea by adding animations or additional customization options.</p><p>Feel free to experiment with different ratios and colors to find the perfect combination for your app!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*gd7vvZ1JUghTWyU8grZB4A.png" /><figcaption>After Applying the Effect with just 2 colors</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*F7Dc0qF_PS1v4lrem5qEOw.png" /><figcaption>After Applying the Effect with 2 colors, and also providing a custom ratio of 30/70</figcaption></figure><blockquote>If you found this article helpful, please follow me for more Android development tips and tricks. Share your thoughts or questions in the comments below!</blockquote><p>Thanks, for giving it a read, I hope it helps you in the future.</p><p>If you like the article make sure to leave some claps 👏 👏 👏 👏</p><blockquote><em>Until next time, “may the code be with you”.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e91407cf546b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sharing Glide Images Instantly]]></title>
            <link>https://medium.com/bobble-engineering/sharing-glide-images-instantly-50fee6f1ced8?source=rss-c861fa29d5d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/50fee6f1ced8</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[glide]]></category>
            <dc:creator><![CDATA[Ashutosh Singh Tomar]]></dc:creator>
            <pubDate>Thu, 05 Nov 2020 06:26:34 GMT</pubDate>
            <atom:updated>2020-11-05T06:26:34.717Z</atom:updated>
            <content:encoded><![CDATA[<p>Well, yes you read that correct. As an android developer we deal a lot with images loaded from the server or any API, mostly we display images in a list, or we might even display them on a page like UI, depends totally on your scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*PMsnbHavnWO0PLwk6uCcmA.png" /></figure><p>Glide is quite a popular Android Library, used for Image Loading, this article isn’t about how to setup glide, rather it’s one step ahead.</p><blockquote><strong>If you wanna share the image that you just showed in the list, how would you do that?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*HUFwNz6YIFEQh6APd6gDEw.gif" /></figure><p>A normal approach is first to make a network call to <strong>load all the images</strong> in the list, saving all the urls in a POJO/Model class, then on the click of the image or the share button, you read the url from the pojo and then you make another network call to <strong>download the image from the url, </strong>meanwhile the image is getting ready to be shared you show a progress bar.</p><p>Well, guess what, there is no need for making two separate network calls, all this could be done with just one network call, and your users would get an amazing experience as how instantly the images are shared on a single tap without any time wasted in showing the progress bar.</p><p>Here is a small glimpse of how things look on a 3g or slower network, here you see a list of gifs that can be shared from the keyboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0nwLRnEiiH3ggIu6QrMtTg.gif" /></figure><p>Earlier it took more than 30 seconds to share the image on a 3g network after the images have already been shown to the user.</p><p>Here is how the <strong>onBindViewHolder</strong> of an Adapter usually looks</p><pre><strong>// Loading the image in the recycler view</strong></pre><pre>if (gif.<em>url </em>!= null) {<br>    gifUrl=<em>gif</em>.<em>url<br>    </em>Glide.with(mContext)<br>            .asGif()<br>            .load(gif.<em>url</em>)<br>            .fitCenter()<br>            .diskCacheStrategy(DiskCacheStrategy.<em>DATA</em>)<br>            .into(gifHolder.gifImage)<br>}</pre><pre><br><strong>// Handling clicks on the image</strong></pre><pre>gifHolder.gifImage.setOnClickListener(View.OnClickListener {</pre><pre>                    val gifs = mGif[gifHolder.adapterPosition]<br>                    mGifInterface!!.clickOnGif(gifs)<br></pre><pre>})</pre><p>We load the image into the ImageView and set an OnClickListener, and then with the help of the interfaces, we handle the click event and download the image using the <strong>downloadGif</strong> function.</p><pre>private fun downloadGif(url: String) {<br>        progress_bar.<em>visibility</em>= View.<em>VISIBLE</em></pre><pre><strong><em>//Creating a file for the downloaded image</em></strong></pre><pre><em>        </em>val folderPath=SaveUtils.createDirAndGetPath(mContext,     &quot;resources&quot;, &quot;folderName&quot;)<br>        var fileName = test.gif<br>        val file = File(folderPath + File.<em>separator </em>+ fileName)</pre><pre><strong>// Network call for downloading the image </strong><br>        Rx2AndroidNetworking<br>                .download(url, folderPath, fileName)<br>                .setPriority(Priority.IMMEDIATE)<br>                .build().startDownload(object : DownloadListener {<br>                    override fun onDownloadComplete() {<br>                        if (mGIFViewListener != null) {<br>                            progress_bar.<em>visibility</em>= View.<em>GONE</em></pre><pre><strong><em>// File that you share at last                           </em></strong></pre><pre>val uri = FileProvider.getUriForFile(mContext, BobbleConstants.<em>PROVIDER_AUTHORITY</em>, file)<br>                            mGIFViewListener!!.onGIFShare(uri)<br>                        }<br><br><br>                    }<br><br>                    override fun onError(anError: ANError) {<br>                        progress_bar.<em>visibility</em>= View.<em>GONE<br>                        </em>Log.d(TAG,&quot;Networking error &quot;+anError.message);<br>                    }<br>                })<br><br>    }</pre><p>Now let’s see how do we improve our code and instead of making two network calls, get this done with a single network call and save time and processing.</p><p>As we all understand that glide keeps a cache of the image which we downloaded while showing in the list, why can’t we use the same image, or can we?</p><blockquote>Well we tried using the cache images, but the issue with the caches is that they have .0 or some weird extensions which are not compatible with the URI and hence you will get File Format Not Supported Error.</blockquote><p>So how do we do it?</p><p>Well, the adapter is still similar, it has now an extra method <strong>loadGif</strong>, which gets the url of the image and returns us a sharable image format.</p><pre><strong>// Loading the image in the recycler view</strong></pre><pre>if (gif.<em>url </em>!= null) {<br>    gifUrl=<em>gif</em>.<em>url<br>    </em>Glide.with(mContext)<br>            .asGif()<br>            .load(gif.<em>url</em>)<br>            .fitCenter()<br>            .diskCacheStrategy(DiskCacheStrategy.<em>DATA</em>)<br>            .into(gifHolder.gifImage)</pre><pre>   loadGif(gifUrl,gif)<br>}</pre><pre><strong>// Using the cache image </strong></pre><pre>private fun loadGif(url:String,gif:Gif){<br>    Single.fromFuture(Glide.with(mContext).asGif().load(url).submit())<br>            .subscribeOn(Schedulers.io())<br>            .observeOn(AndroidSchedulers.mainThread())<br>            .subscribe(object : SingleObserver&lt;GifDrawable&gt; {<br>                override fun onSubscribe(d: Disposable) {}<br>                override fun onSuccess(gifDrawable: GifDrawable) {<br>                    if (mGifPagerInterface != null) {<br>                        mGifPagerInterface!!.clickOnGif(gifDrawable)<br>                    }<br>                }<br>                override fun onError(e: Throwable) {<br>                    Log.d(TAG,&quot;loadGIF errror&quot;+e.message) }<br>            })<br>}</pre><p>Glide internally handles this, if we load an image from an url, then it makes a cache of it, and passing the same url again and calling the submit() function, you would get a Future, now you can easily share this file.</p><p>The process for storing the image in a file and then sharing the file still remains the same.</p><p>And here it is how it would look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*tP2mgT2NoAEkpFS_zqhycA.gif" /></figure><p>See, how fast that was on the same network 😍 😍 😍</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*3FuRB9-bSxmpARWHK3gHsQ.gif" /></figure><p>Thanks, for giving it a read, hope it helps you in the future.</p><p>If you like the article make sure to leave some claps 👏🏿 👏🏿 👏🏿</p><blockquote><em>Until next time, “may the code be with you”.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50fee6f1ced8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bobble-engineering/sharing-glide-images-instantly-50fee6f1ced8">Sharing Glide Images Instantly</a> was originally published in <a href="https://medium.com/bobble-engineering">Bobble Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is DirectBoot, what you’re looking for?]]></title>
            <link>https://medium.com/bobble-engineering/is-directboot-what-youre-looking-for-a363a9ec20e3?source=rss-c861fa29d5d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a363a9ec20e3</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[direct-boot-aware]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[directboot]]></category>
            <dc:creator><![CDATA[Ashutosh Singh Tomar]]></dc:creator>
            <pubDate>Wed, 22 Jul 2020 09:08:41 GMT</pubDate>
            <atom:updated>2020-07-22T09:08:41.186Z</atom:updated>
            <content:encoded><![CDATA[<p>Android brings various features for users and developers, one such feature was added in Android 7, called DirectBoot, but what exactly is DirectBoot? Let’s try to find that in the next few minutes, and also when, why, and how to use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*pUFbm4-R0QDCVTh8QcN9tQ.gif" /><figcaption>Let’s dive into it.</figcaption></figure><h3><strong>What is DirectBoot?</strong></h3><p>Starting with Android N, a device that has been powered on can boot into a new mode called Direct Boot before the user has a chance to unlock it for the first time. In this mode, the operating system is fully operational, but access to private app data is limited and only apps that have been updated to be Direct Boot Aware can run, which basically means that you can perform actions even before the user unlocks the device.</p><h3><strong>Does your app even need the DirectBoot?</strong></h3><p>Let’s consider a real-world scenario, of an Alarm Clock App. Suppose a user sets an Alarm for 6&#39;o clock in the morning and if the device gets rebooted during the sleep cycle, the user won’t be able to receive the alarm and might miss out on important things for which they scheduled the alarm. So to prevent such scenarios from happening Google included Direct Boot Aware in Android 7.</p><p>Any application that <strong>schedules alarms</strong> like the alarm clock we discussed, provides <strong>important and timely notifications</strong> like a messaging app or provides <strong>services to other apps or the system</strong> like a keyboard or a launcher, all these apps need to update to Direct Boot Aware for better user experience and special scenarios.</p><h3>How does Direct Boot help if the device is rebooted?</h3><p>To support DirectBoot, the system provides two storage locations for data:</p><p><strong><em>Credential encrypted storage</em></strong>, which is the default storage location and only available after the user has unlocked the device. The data could be found in <strong>/user</strong> folder in rooted devices.</p><p><strong><em>Device encrypted storage</em></strong>, which is a storage location available both during Direct Boot mode and after the user has unlocked the device. For this mode, all the data is present in the <strong>/user_de</strong> folder.</p><p>So even if the device is rebooted the application can perform actions and use the user data that is present in the Device Encrypted Storage</p><h3>How to use Direct Boot Aware?</h3><p>1. Analyze the components of your app, which you would like to make boot-ware. A service launched on boot, for instance, which is responsible for initiating the alarms. Declare those components as boot-aware in manifest</p><pre>&lt;activity|provider|receiver|service …<br>android:directBootAware=”true”&gt;</pre><p>If you implement a custom Application class and register any sub-component as boot-aware, the Application class automatically inherits the boot-aware property.</p><p>2. Components that rely on broadcast <a href="https://developer.android.com/reference/android/content/Intent#ACTION_BOOT_COMPLETED"><strong>ACTION_BOOT_COMPLETED</strong></a> as a trigger to start, must switch to the broadcast <a href="https://developer.android.com/reference/android/content/Intent#ACTION_LOCKED_BOOT_COMPLETED"><strong>ACTION_LOCKED_BOOT_COMPLETED</strong></a>. This broadcast is received by all boot-aware components, as soon as the device is booted. At this moment only Device protected storage is accessible.</p><p>P.S: <a href="https://developer.android.com/reference/android/content/Intent#ACTION_BOOT_COMPLETED"><strong>ACTION_BOOT_COMPLETED</strong></a> will also be received by boot-aware components but only once the device has been unlocked by the user. At this moment, both Credential protected storage and Device protected storage are accessible.</p><h3>How do I access the two different storage paths?</h3><p>Android APIs have made this extremely easy, as the only variable that differentiates between the two storage paths is Context. The default context points to Credential protected storage. A new context can be requested anytime by <a href="https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()"><strong>createDeviceProtectedStorageContext()</strong></a> whose storage APIs point to the Device protected storage.</p><pre>Context credentialProtectedContext =getApplicationContext();<br>Context deviceProtectedContext = credentialProtectedStorage.createDeviceProtectedStorageContext();</pre><h3>Worried about the Data already present in Credential Storage?</h3><p>If the app hasn’t been rolled out to the public yet, you wouldn’t face this issue, because you would, by default, place boot-aware data at device protected storage. But, updating an app that is already available to users, you might consider moving the data which is required by boot-aware components from Credential protected storage to Device protected storage to maintain the integrity of the app after the update. This can be done by <a href="https://developer.android.com/reference/android/content/Context#moveSharedPreferencesFrom(android.content.Context,%20java.lang.String)"><strong>moveSharedPreferencesFrom()</strong></a><strong> </strong>or<strong> </strong><a href="https://developer.android.com/reference/android/content/Context#moveDatabaseFrom(android.content.Context,%20java.lang.String)"><strong>moveDatabaseFrom()</strong></a><strong> </strong>respectively.</p><pre>// For Shared Preferences<br>deviceProtectedContext.moveSharedPreferencesFrom(credentialProtectedContext,SHARED_PREFERENCE_NAME);</pre><pre>//For Databases<br>deviceProtectedContext.moveDatabaseFrom(credentialProtectedContext,DATABASE_NAME);</pre><p>To move any other files residing at internal app storage, which may be required by boot-aware components, you can manually copy the file :</p><pre>File fileAtCredentialStorage= credentialProtectedContext.getFilesDir()+File.seperator+FILE_NAME;<br>File fileAtDeviceStorage= deviceProtectedContext.getFilesDir()+File.seperator+FILE_NAME; FileUtils.copyFile(fileAtCredentialStorage, fileAtDeviceStorage);</pre><h3>Using 3rd party libraries, we got you covered!!!!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*inR9kouKYuZOQn3GUVEScg.png" /></figure><p>3rd party libraries like Firebase, Crashylitics, AdMob, etc. require to be initialized at app startup. They internally use SharedPreferences and databases, and most of them don’t support device protected storage. So, it’s a good idea to take care of them only after the device has been unlocked else they will throw an exception.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*h_6Se-mkeKQ0DJxPNslUsA.png" /></figure><p>To check at runtime, whether credential protected storage is available or not, this function may help <a href="https://developer.android.com/reference/android/os/UserManager#isUserUnlocked()"><strong>UserManagerCompat.isUserUnlocked()</strong></a></p><h3><strong>Things to be taken care of :</strong></h3><p>A common mistake may arise while moving databases. If a connection to a database is opened, a singleton for the database is persisted by the system. Upon moving the database to another location, the singleton may not be aware of the move and subsequent call to the database may throw an exception:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*keV6U-FcA9bAQLXYkTRzUA.png" /></figure><p>It is not guaranteed that this exception is thrown for all devices, as it is system dependent, but it is always better to be on a safe side. Make sure that the migration always takes place before opening the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*_kISsROXghLZSE8LYbjoLg.png" /></figure><h3>Is it safe to use Direct Boot Aware?</h3><p>You should not migrate private user information, such as passwords or authorization tokens, to device encrypted storage. In some scenarios, you might need to manage separate sets of data in the two encrypted stores. Use this feature wisely and only take advantage of it, when there is a real reason for doing that!</p><p>This article is co-authored by <a href="https://medium.com/u/6a0611312027">RISHABH KHEMKA</a> and <a href="https://medium.com/u/c08d05d9e3dc">Saurabh Tomar</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*yoYDffXJ2O9I1ev1.gif" /></figure><blockquote>Until next time, “may the code be with you”.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a363a9ec20e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bobble-engineering/is-directboot-what-youre-looking-for-a363a9ec20e3">Is DirectBoot, what you’re looking for?</a> was originally published in <a href="https://medium.com/bobble-engineering">Bobble Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s “Debug” the bug]]></title>
            <link>https://medium.com/@thegypsydev/lets-debug-the-bug-dd49b045dcae?source=rss-c861fa29d5d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd49b045dcae</guid>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[plugins]]></category>
            <dc:creator><![CDATA[Ashutosh Singh Tomar]]></dc:creator>
            <pubDate>Thu, 30 Apr 2020 19:16:22 GMT</pubDate>
            <atom:updated>2023-11-21T05:59:27.960Z</atom:updated>
            <content:encoded><![CDATA[<p>Trust me on this and ask any developer in your friend circle, what’s the part that they hate the most about development/programming? The answer, my friend, is Debugging, especially if you are an Android Developer, that freaking loose cable connection irritates a lot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*_nLj2S6wtFoDeGNo.gif" /><figcaption>That’s me every time the device is disconnected</figcaption></figure><p>We will be seeing in this post how to debug the Android Apps on your device. There are several ways to do that :</p><p><strong>First, and the simplest one</strong> is turning your Debug Mode On, and run the app. To turn the debug mode on and allow USB debugging, you need to find Developer’s option on your device and turn that on(just Google it, it’s simple). Once you see the Developer’s option on your device turn on USB Debugging and you are good to go. In case you find that difficult, <a href="https://developer.android.com/studio/debug/dev-options#enable">check this out</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wfRPo8h9zTrHW5V-.png" /></figure><p>Now that you have the device attached, just select the device name and click</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/50/0*V-iKbZvsaXeICFUz.png" /><figcaption><strong>“the buggy bug” icon</strong></figcaption></figure><blockquote>Let’s go wireless now, just remember for this you need to connect your system/laptop and the Android Device to the same wifi.</blockquote><p><strong>Second </strong>and a bit handy way<strong> </strong>is using the <strong>Wireless Debugger Plugins </strong>provided by Android Community within the Android Studio IDE. These plugins are easy to use tools, few open-source as well, feel free to contribute to the community, that’s how we grow. <a href="https://plugins.jetbrains.com/plugin/7983-android-wifi-adb"><strong>Android WiFi ADB</strong></a> by <a href="https://github.com/pedrovgs"><em>Pedro Vicente Gomez Sanchez</em></a> is one of the best plugins, I have used for years.’</p><p><strong>Third </strong>and the best solution to this is, why not let’s create a plugin of our own?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*XwrFyL2OmYm92Ih6.gif" /></figure><p>If you’re thinking the same that this is gonna be difficult, just HOLD ON!</p><ol><li>Open up Terminal Window in Android Studio, migrate to the platform-tools directory within your Sdk folder of Android, an example in case of Windows User’s would be, C:\Users\YOUR_WINDOWS_USERNAME\AppData\Local\Android\Sdk\platform-tools</li><li>Create a TCP port using adb by typing in</li></ol><blockquote>adb tcpip 5555</blockquote><p>3. Connect to your device by using the IP Address and typing adb connect IP_ADDRESS: PORT_NO</p><blockquote>adb connect 192.172.0.0:5555</blockquote><h4><strong>Final steps for Mac OS:</strong></h4><blockquote><em>cd ~/Library/Android/sdk/platform-tools<br>adb tcpip 5555<br>adb connect 192.172.0.0:5555</em></blockquote><p>It was just 2 lines of code and 🌟🌟🌟 BOOM 🌟🌟🌟 now you have the freedom to debug your app seamlessly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd49b045dcae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Journey of the NOOBS]]></title>
            <link>https://medium.com/@thegypsydev/journey-of-the-noobs-c8cf2c2bf61e?source=rss-c861fa29d5d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8cf2c2bf61e</guid>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[getting-started]]></category>
            <dc:creator><![CDATA[Ashutosh Singh Tomar]]></dc:creator>
            <pubDate>Fri, 25 May 2018 14:45:44 GMT</pubDate>
            <atom:updated>2018-05-25T14:45:44.152Z</atom:updated>
            <content:encoded><![CDATA[<p>Yup, you read that correct I was a total Noob in programming or technical stuff when I got into my college. It has never been that difficult to make friends, so on the first day itself, I met two of my friends who were good at everything I have ever heard of. They were great at programming, web development and lots of other stuff.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*Q7fvleNwmWdSsKK-MY2TZg.gif" /><figcaption><strong>That was the So Damn Reaction of Mine</strong></figcaption></figure><p><strong>So one fine day</strong>, I also decided that I’ll start something from the basics that didn’t require much of high-level knowledge, so the first thing that came to my mind was Java as I had that as one of the subjects in 11th standard but I only knew basic stuff like loops, variables, etc. Soon I got through the concepts of Java and realized it was not even that tough. Soon it was the near end of the semester when everyone’s busy making files and completing other college stuff. I was there just chatting around on social media, Suddenly a notification popped up and it was none other than my friend asking if anyone would like to take part in a <strong>Hackathon?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*IPSojVcwGLiKMPh7ojKJsA.gif" /><figcaption><strong>Wait? What’s That ?</strong></figcaption></figure><h3>What The Hack Is a Hackathon?</h3><p>A Hackathon is usually a day long (can be 36 hours, 48 hours, etc.) coding competition where software programmers, developers, designers, etc. come together to build and design something cool.<br><strong>But isn’t hacking illegal? — </strong>Haha, my favorite part! The word “hack” has so much negativity attached to it that most people think hackathons are a way to “hack” into something. NOOOO. Hacking is basically building something. It could be anything.<br>So Back to the Journey, after checking Google for more Such questions, within no time I asked him who else is going and said I would love to go. Soon a decent team of all the Newbies was formed and within few days we went to the event. I was totally amazed to see such an audience over there, OH MY GOSH! these many talented people all at one place some with their High-Tech Hardware devices, some with those cool Swags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RPGM0NNDbngEKC5vspGhqA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*hAjUWZiWSkcLViRqcc7w9w.gif" /></figure><p>All the teams were given an hour to present their idea to the mentors. And when judges came to us we told them all that we had planned and with all our basic knowledge how are we gonna build it.</p><blockquote><strong>Me: I’m finally Happy :) <br>Life: Oh Bad, that can’t happen let me throw something bad in …..</strong></blockquote><p>Well that keeps on happening and to our surprise, the mentors told us that another team is making the same stuff involving high technologies, So give your idea another shot. We were all shattered by those words. But what else option did we have, so we worked upon the new idea pitched that to the mentors and they sort of liked it. And was even willing to help if we got Stuck anywhere. In that one night, We all worked on different stuff we never had touched in our life, One’s handling the Backend, the other is Working on the Frontend, while I was responsible for developing the Android Application, “Yup, That’s How I Started my Journey in Android “.</p><p>Ever thought of being so involved in the work, that you totally forget the Time. Yes, the same happened with us, We were so involved in work that none of us realized that it was already 6&#39;o clock in the morning. And our App or Web Platform nothing was working well enough to showcase. But that&#39;s when we realized the importance of time as we had to finish up our project within just 2 Hrs. Anyhow we made it at least a bit presentable.</p><h3>At Last One More Twist !!!</h3><p>The thing that I’m most afraid of is speaking in front of a huge crowd. And I don’t know why they had given my name for a 2 Min Presentation that too in front of more than 50 people and the Jury. Now it was me roaming around here and there mumbling words to myself, rubbing my fingers and possibly doing every stupid thing around. At last, I had to go in and present there, I just went and seeing the product I had in my Hand (that we sort of made in a single Night), realizing that all of our efforts couldn’t go in Waste gave the best I could. I still remember coming out of that hall and my friends saying to me “We all did Great Man! , No Matter if We Win this or Not, It was an amazing experience”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*LPOiSP0FwUC4VQLxFu2zaA.gif" /><figcaption><strong>Bye-Bye Hope to see you in some upcoming Hackathons.</strong></figcaption></figure><p>Till then “May The Code Be With You”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8cf2c2bf61e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>