My new Android App

Android app on Webview

Released: Clouds Of Thought Android App

Touching presence on Mobile

I was thinking to have a mobile app for my website - just because I can! Also, given my history of writing blogs every few weeks and being super lazy to even post it, I did not want to add another layer of work to do mobile releases whenever I post a blog.

Finally I released my Clouds of Thought app on Android - yay! :-)

Challenges

With maintainence being the biggest concern for me, I decided to settle for a webview. I implemented a simple caching into my webview and it worked insanely well. Posting some code snippets for reference:

  1. Initializing a WebView in layout file:

    
     <WebView android:id="@+id/siteWebview" android:layout_width="match_parent" android:layout_height="match_parent" tools:layout_editor_absoluteX="191dp" tools:layout_editor_absoluteY="207dp" />
     
  2. WebView settings in main activity:

    
         //private WebView siteWebview; // outside the onCreate(..) method
    
         siteWebview = (WebView) findViewById(R.id.siteWebview);
         WebSettings siteWebviewSettings = siteWebview.getSettings();
         siteWebviewSettings.setJavaScriptEnabled(true);
         siteWebviewSettings.setLoadWithOverviewMode(true);
         siteWebviewSettings.setJavaScriptCanOpenWindowsAutomatically(false);
         siteWebviewSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
         siteWebview.loadUrl("https://vishwarajanand.com/blog/");
         siteWebview.setWebViewClient(new WebViewClient());
     
  3. Implemented navigation for webview:

    
     if(siteWebview != null &amp;&amp; siteWebview.canGoBack()){
         siteWebview.goBack();
     } else{
         super.onBackPressed();
     }
     

I felt it was straightforward to implement and does not have any dependency on new blogs posted. Having a simple website mirror in my app works just fine for my usecases.

I felt it would be super awesome to have following features - which honestly I am still searching and it didn’t seem to be supported out of the box:

  1. Deeplinking to popular apps by default
  2. Filtering out web URLs which I do not want to allow - currently this app is just like a appified browser

I have hosted the sources on a private GitHub repo because it holds keys to upload the app to playstore too :-P , but for quick mental model check out some screenshots below:

Screenshot 1
Screenshot 2

Dialogue & Discussion