<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Android on Codrut Constantin Gusoi</title>
    <link>https://www.codrut.pro/tags/android/</link>
    <description>Recent content in Android on Codrut Constantin Gusoi</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Fri, 27 Nov 2020 14:16:37 +0000</lastBuildDate>
    <atom:link href="https://www.codrut.pro/tags/android/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Remove any app from your phone</title>
      <link>https://www.codrut.pro/snippets/remove-any-app-from-your-phone/</link>
      <pubDate>Fri, 27 Nov 2020 14:16:37 +0000</pubDate>
      <guid>https://www.codrut.pro/snippets/remove-any-app-from-your-phone/</guid>
      <description>&lt;p&gt;Every app can be uninstalled, you just need to do it via CLI.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.codrut.pro/snippets/enable-developer-options-on-your-phone/&#34;&gt;Enable &amp;lsquo;Developer options&amp;rsquo; on your phone&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Install &lt;code&gt;adb&lt;/code&gt; via the &lt;code&gt;android-tools&lt;/code&gt; package:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo pacman -S android-tools&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Plug in the USB cable between phone and computer, you will have to accept the&#xA;debugging authorization on your phone.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Start the shell:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;adb shell&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;5&#34;&gt;&#xA;&lt;li&gt;List packages:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pm list packages&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;6&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Copy the list and filter it to only contain the packages you want to remove.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Enable &#39;Developer options&#39; on your phone</title>
      <link>https://www.codrut.pro/snippets/enable-developer-options-on-your-phone/</link>
      <pubDate>Sun, 15 Nov 2020 12:21:12 +0000</pubDate>
      <guid>https://www.codrut.pro/snippets/enable-developer-options-on-your-phone/</guid>
      <description>&lt;ol&gt;&#xA;&lt;li&gt;Open your phone&amp;rsquo;s &lt;code&gt;Settings&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Go to &lt;code&gt;About phone&lt;/code&gt; &amp;gt; &lt;code&gt;Software information&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Tap 7 times in quick succession on &lt;code&gt;Build number&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Unlock your phone using your passcode, fingerprint, or pattern.&lt;/li&gt;&#xA;&lt;li&gt;Go back to the &lt;code&gt;Settings&lt;/code&gt; main menu, you will see &lt;code&gt;Developer options&lt;/code&gt; at the&#xA;bottom.&lt;/li&gt;&#xA;&lt;li&gt;Enable whatever you want, most likely you are after the &lt;code&gt;USB debugging&lt;/code&gt;&#xA;setting.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Don&amp;rsquo;t forget to disable &lt;code&gt;Developer options&lt;/code&gt; when done with your work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bypass screenshot security policy</title>
      <link>https://www.codrut.pro/snippets/bypass-screenshot-security-policy/</link>
      <pubDate>Fri, 23 Oct 2020 00:12:05 +0000</pubDate>
      <guid>https://www.codrut.pro/snippets/bypass-screenshot-security-policy/</guid>
      <description>&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.codrut.pro/snippets/enable-developer-options-on-your-phone/&#34;&gt;Enable &amp;lsquo;Developer options&amp;rsquo; on your phone&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Install &lt;code&gt;scrcpy&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo pacman -S scrcpy&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Plug in your phone and open the app.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Start recording:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;scrcpy -r file.mp4&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Compile Android projects from CLI</title>
      <link>https://www.codrut.pro/snippets/compile-android-projects-from-cli/</link>
      <pubDate>Mon, 08 Jun 2020 17:21:28 +0000</pubDate>
      <guid>https://www.codrut.pro/snippets/compile-android-projects-from-cli/</guid>
      <description>&lt;ol&gt;&#xA;&lt;li&gt;Install java:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo pacman -S jdk8-openjdk jre8-openjdk jre8-openjdk-headless&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;2&#34;&gt;&#xA;&lt;li&gt;Install Android SDK:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo pacman -S snapd&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo snap install androidsdk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;Configure your SDK location in your &lt;code&gt;~/.bash_profile&lt;/code&gt; or &lt;code&gt;~/.bashrc&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;export ANDROID_SDK_ROOT&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;~/snap/androidsdk/current/AndroidSDK/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;4&#34;&gt;&#xA;&lt;li&gt;Install the platform tools for your target android version:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;androidsdk &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;platform-tools&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;platforms;android-28&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;5&#34;&gt;&#xA;&lt;li&gt;Compile the project. This will install all dependencies, make sure to accept&#xA;licenses when prompted.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;./gradlew assembleDebug&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;6&#34;&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;If you haven&amp;rsquo;t done already, then&#xA;&lt;a href=&#34;https://www.codrut.pro/snippets/enable-developer-options-on-your-phone/&#34;&gt;Enable &amp;lsquo;Developer options&amp;rsquo; on your phone&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
