<?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: Morrison Chang</title>
    <description>The latest articles on DEV Community by Morrison Chang (@codeledger).</description>
    <link>https://dev.to/codeledger</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%2F47764%2Fc4d6ba7f-f41a-459f-8475-f4db5cc3b818.png</url>
      <title>DEV Community: Morrison Chang</title>
      <link>https://dev.to/codeledger</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codeledger"/>
    <language>en</language>
    <item>
      <title>How to get Visual Studio Code to run on Android with Termux -- Mar 2023 Update</title>
      <dc:creator>Morrison Chang</dc:creator>
      <pubDate>Tue, 06 Oct 2020 05:51:39 +0000</pubDate>
      <link>https://dev.to/codeledger/how-to-get-visual-studio-code-to-run-in-termux-on-android-405j</link>
      <guid>https://dev.to/codeledger/how-to-get-visual-studio-code-to-run-in-termux-on-android-405j</guid>
      <description>&lt;p&gt;Every below is from before 2020 so &lt;strong&gt;Don't use Termux from the Play Store&lt;/strong&gt; use &lt;a href="https://f-droid.org/en/packages/com.termux/" rel="noopener noreferrer"&gt;Termux from F-droid&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Getting &lt;code&gt;code-server&lt;/code&gt; is now easier with the following commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pkg install tur-repo
pkg install code-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Start old stuff&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;del&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.termux" rel="noopener noreferrer"&gt;Termux from Play Store&lt;/a&gt;&lt;/del&gt; is an app which provides a Unix/Linux-like environment on your Android device. But getting an familiar IDE like Visual Studio Code previous required a number of steps. Recently this seems to have been streamlined by the various package maintainers and now can be done in fewer steps.&lt;/p&gt;

&lt;p&gt;First is that we will be installing the the open source version of Visual Studio Code (VS Code), called &lt;a href="https://github.com/cdr/code-server" rel="noopener noreferrer"&gt;code-server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;code-server&lt;/code&gt; is an &lt;a href="https://en.wikipedia.org/wiki/Electron_(software_framework)" rel="noopener noreferrer"&gt;Electron app&lt;/a&gt; and needs support from &lt;a href="https://en.wikipedia.org/wiki/Node.js" rel="noopener noreferrer"&gt;&lt;code&gt;nodejs&lt;/code&gt; environment&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In Termux run the following commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pkg install nodejs

pkg install yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Per the &lt;a href="https://wiki.termux.com/index.php?title=Node.js" rel="noopener noreferrer"&gt;Termux NodeJS wiki&lt;/a&gt; also install:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pkg install build-essential

pkg install python

pkg install git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;As they are needed for building native extensions.&lt;/p&gt;

&lt;p&gt;And finally install &lt;code&gt;code-server&lt;/code&gt; itself.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn global add code-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note: Installing &lt;code&gt;code-server&lt;/code&gt; will take a while&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;code-server&lt;/code&gt; is now installed and will be the back end server to your front end client, a &lt;a href="https://en.wikipedia.org/wiki/Chromium_(web_browser)" rel="noopener noreferrer"&gt;Chromium&lt;/a&gt; browser, like Chrome for Android or Microsoft Edge.&lt;/p&gt;

&lt;p&gt;Now from the command line run &lt;code&gt;code-server&lt;/code&gt; or have it run in the background by adding an ampersand like &lt;code&gt;code-server &amp;amp;&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code-server &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You'll get some output logs about where the password is located.&lt;/p&gt;

&lt;p&gt;In my case I used &lt;code&gt;cat ~/.config/code-server/config.yaml&lt;/code&gt; to find out what was configured.&lt;/p&gt;

&lt;p&gt;Open up a browser, as I was using Samsung DeX as a desktop, I used Samsung Internet, connected to 127.0.0.1:8080 and entered the password.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F59kr39foh7nseihcgcs2.jpg" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F59kr39foh7nseihcgcs2.jpg" alt="Screenshot_20201005-220244_Samsung Internet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once connected, you can install plugins. As you can see, the MS Python plugin appears to work. &lt;/p&gt;

&lt;p&gt;A few caveats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/cdr/code-server/blob/v3.5.0/doc/FAQ.md#differences-compared-to-vs-code" rel="noopener noreferrer"&gt;&lt;code&gt;code-server&lt;/code&gt; is not Microsoft Visual Studio Code&lt;/a&gt; The summary is that not all plugins are supported, YMMV.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I'm using Termux and code-server with Samsung DeX so I don't have any the soft keyboard issues that others have encountered.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Updating VS Code/&lt;code&gt;code-server&lt;/code&gt; to latest (1.50.0)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Step 1: kill &lt;code&gt;code-server&lt;/code&gt; if running&lt;/p&gt;

&lt;p&gt;Step 2: Now update all of the packages (check above list)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pkg update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Step 3: In order to force a rebuild, use &lt;code&gt;yarn&lt;/code&gt; to remove &lt;code&gt;code-server&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn global remove code-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Step 4: And add/install &lt;code&gt;code-server&lt;/code&gt; (yes it will take a while)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn global add code-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Getting Search to work&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href="https://github.com/cdr/code-server/issues/1730#issuecomment-721515979" rel="noopener noreferrer"&gt;yozman on this issue ticket&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install the package ripgrep:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pkg install ripgrep
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And add to the &lt;code&gt;code-server&lt;/code&gt; directory &lt;/p&gt;

&lt;p&gt;which is in my setup can be reached by:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;a softlink to the &lt;code&gt;rg&lt;/code&gt; binary:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ln -s $PREFIX/bin/rg ./lib/vscode/node_modules/vscode-ripgrep/bin/rg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>android</category>
      <category>termux</category>
      <category>vscode</category>
      <category>samsungdex</category>
    </item>
    <item>
      <title>The Story on SD card storage for Android on Chromebook</title>
      <dc:creator>Morrison Chang</dc:creator>
      <pubDate>Sat, 02 Dec 2017 18:07:04 +0000</pubDate>
      <link>https://dev.to/codeledger/the-story-on-sd-card-storage-for-android-on-chromebook-8kd</link>
      <guid>https://dev.to/codeledger/the-story-on-sd-card-storage-for-android-on-chromebook-8kd</guid>
      <description>&lt;p&gt;Since Android apps are now available on Chromebooks via ARC++ (Android Runtime for Chrome 2nd version), developers coming from a traditional File storage background will have to make sure their apps conform to take advantage of how to access the SD card.&lt;/p&gt;

&lt;p&gt;The Chromium team has implemented USB On-The-Go access for the SD card on ChromeOS 62 (Chromium M-61?) or higher. What this means is that developers who expect their apps to work with the SD card as if it was under the battery in their phone will be disappointed. This is due to the fact that a 'hot swappable' SD card such as those found on a Chromebook isn't considered &lt;a href="https://source.android.com/devices/storage/adoptable"&gt;Adaptable Storage&lt;/a&gt; by the Android Framework.&lt;/p&gt;

&lt;p&gt;Additionally if you want to use the MediaStore APIs to access it, you are still out of luck as the Android Framework does not support access to removable hardware. The Chromium team is aware and considering options: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://bugs.chromium.org/p/chromium/issues/detail?id=789045&amp;amp;desc=3"&gt;https://bugs.chromium.org/p/chromium/issues/detail?id=789045&amp;amp;desc=3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So what to do?&lt;/p&gt;

&lt;p&gt;Use: &lt;a href="https://developer.android.com/guide/topics/providers/document-provider.html"&gt;Android Storage Access Framework&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See this Commonware's post on &lt;a href="https://commonsware.com/blog/2017/11/15/storage-situation-removable-storage.html"&gt;Removable Storage&lt;/a&gt; for further details.&lt;/p&gt;

&lt;p&gt;Originally a StackOverflow answer: &lt;a href="https://stackoverflow.com/a/44123748/295004"&gt;https://stackoverflow.com/a/44123748/295004&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>chromebook</category>
      <category>chromeos</category>
    </item>
  </channel>
</rss>
