Install and Uninstall Android app from ADB

To Install: To install the apk from command line(after it is built successfully), adb install -t app.apk Don't forget to give the full path to the apk. To Uninstall: In short, to uninstall apk from command line type: adb uninstall package_name To be more precise: Find the exact package name by typing: adb shell su 0 pm list packages From the list, find the name of the package of your app (Say it is ) Now type: adb uninstall The app is now uninstalled from the emulator You can also find the package name by: Go to Device File Explorer in Android Studio -> data -> data -> Now scroll till you find the name of the package.

Sending Broadcast from ADB to Emulator

If you are testing an app and want to send a broadcast of an Intent from ADB, read through. To enable root access, use an emulator image like Google APIs Intel x86 Atom System Image not Google Play Intel x86 Atom System Image To test it, run  adb root . It should say restarting adbd as root or adbd is already running as root not adbd cannot run as root in production builds  Now either from a terminal app or from Terminal tab in Android Studio, type the following: adb shell su am broadcast -a android.intent.action.BOOT_COMPLETED You should get the following output: Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED } Broadcast completed: result=0

Retrofit 2 : REST Client for Android

Using RxJava with Retrofit Add the following dependencies in Module level  build.gradle file: dependencies { /// ... // Add Retrofit implementation 'com.squareup.retrofit2:retrofit:2.5.0' // Using gson as converter implementation 'com.squareup.retrofit2:converter-gson:2.5.0' // A Converter which supports converting strings and both primitives and their boxed types to text/plain bodies. implementation 'com.squareup.retrofit2:converter-scalars:2.5.0' implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' // Because RxAndroid releases are few and far between, it is recommended you also // explicitly depend on RxJava's latest version for bug fixes and new features. // (see for latest 2.x.x version) implementation 'io.reactivex.rxjava2:rxjava:2.2.8' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0' implement

Important GIT Techniques

To find the names of all files that were changed (deleted, modified or added) in a given commit git diff-tree --no-commit-id --name-only -r bd61ad98 To save those files' names to output.txt git diff-tree --no-commit-id --name-only -r bd61ad98 > output.tx ========================== Using diff2html-cli for generating preety diff between two commits: Install diff2html-cli: Install node first, In command line brew install node Then install diff2html-cli, in command line type: npm install -g diff2html-cli Run the command to find the diff.html file: git diff 8f8428f0d da63cef6c | diff2html -i stdin ============================= Scenario: You have cloned a project from github, you were working locally on it, changed the projects and commited to new local branch(Eg PostMethod). Now you want to also create a remote branch by same name(PostMethod) and push the local changes to that branch. git branch --set-upstream-to PostMethod origin/PostMethod

Cloning a Github Project

If you are planning to work on IT, having knowledge about Git is immensely important for tracking changes in computer files or coordinating work on those files among multiple people. If you have never heard about git before this, trust me, you must go through this article. After you have installed Git and created an account on Github already (if not follow this article ), go to the Github repository you want to clone to your local machine. Say you want to clone and work on the following repository: Click on Clone or Download. Click on "Use SSH" and copy the URL to clipboard. Go to the folder where you want to clone (download) this repository, right click on the white space and select Git Bash Here to open up the git bash on this location. On the git bash type: git clone If you haven't already added the SSH public key to your Github profile, then you may get this error:

Install Git on Windows

Go to the URL: Click on the " Download 2.16.1 for Windows " or whichever is the latest version that's written there. Run the downloaded installer file. When you arrive in this window, chose either the first or second option. If you chose the first option, you will have to run the Git commands from a different terminal not from the command prompt (cmd.exe) later on. Everything else is default. Complete the installation. Now go to and sign up. Now you will be able to create and clone git projects. Watch the following video tutorial for these above steps.

Import Excel Data into Firebase Database

I had a table of data that I wanted to feed into Firebase Realtime Database which has to be in JSON format. The table looks like this: Make sure that the key names for the JSON file should be the top row of the table. Now save the file as .csv in Excel: Go the  and browse the csv file and click on "CSV to JSON" button and then on "Download". In Firebase realtime database, click on the 3 dots icon on the right as shown in the image below: Then click on "Import JSON" as shown below: Then browse the downloaded JSON file and click on "Import". You will get the result as shown below: