shell find . -type f -name "*.aar" -exec cp {} /run/media/rinav/sdk/video\ aar/ \;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create a launcher on your prefered Desktop Environment, mine is XFCE and add the below line to 'command' section. | |
| # next, Select an icon for the launcher and thats it. | |
| ``` fish | |
| /run/media/rinav/sdk/android-sdk/tools/emulator -avd Nexus_6P_API_25 -use-system-libs | |
| ``` | |
| OR | |
| you can also add the following environment to your shell. I am using fish shell, so below is the syntax for the same |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import static java.lang.Math.acos; | |
| import static java.lang.Math.cos; | |
| import static java.lang.Math.sin; | |
| /** | |
| * Calculate distance between coordinates. | |
| */ | |
| public class DistanceCalculator { | |
| static double PI_RAD = Math.PI / 180.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Toolbar text and popup color tests | |
| 1) | |
| Input: | |
| app:theme="@style/ThemeOverlay.AppCompat.Light" | |
| app:popupTheme="@style/ThemeOverlay.AppCompat.Light" | |
| Output: | |
| Toolbar: black text, primaryColor background | |
| Popup: black text, white background |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Activity; | |
| import android.app.Service; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.IntentFilter; | |
| import android.os.Bundle; | |
| import android.os.IBinder; | |
| import android.support.v4.content.LocalBroadcastManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private class HttpInterceptor implements Interceptor { | |
| @Override | |
| public Response intercept(Chain chain) throws IOException { | |
| Request request = chain.request(); | |
| //Build new request | |
| Request.Builder builder = request.newBuilder(); | |
| builder.header("Accept", "application/json"); //if necessary, say to consume JSON | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://gist.github.com/pksunkara/988716 | |
| # https://gist.github.com/arlimus/5883472 | |
| [user] | |
| name = Rinav Gangar | |
| email = rinav4all@gmail.com | |
| [core] | |
| # excludesfile = /home/rinav/.gitignore-global | |
| pager = less -FRX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AnimatedActivity extends Activity | |
| { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) | |
| { | |
| super.onCreate(savedInstanceState); | |
| //opening transition animations | |
| overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ionic and ngCordova upload example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2012 Square, Inc. | |
| package com.squareup.widgets; | |
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.util.AttributeSet; | |
| import android.widget.ImageView; | |
| /** Maintains an aspect ratio based on either width or height. Disabled by default. */ | |
| public class AspectRatioImageView extends ImageView { |