Skip to content

Instantly share code, notes, and snippets.

View sanjogshrestha's full-sized avatar

Sanjog Shrestha sanjogshrestha

View GitHub Profile
@sanjogshrestha
sanjogshrestha / Android Studio Lint Inspections.md
Last active August 22, 2017 05:47
Android Lint Suppress Warning Usage

Local Inspections

@SuppressWarnings("UndesirableClassUsage")
@SuppressWarnings("FileEqualsUsage")
@SuppressWarnings("GtkPreferredJComboBoxRenderer")
@SuppressWarnings("UnsafeVfsRecursion")
@SuppressWarnings("ConstantConditions")
@SuppressWarnings("UnusedAssignment")
@SuppressWarnings("NumericOverflow")
@SuppressWarnings("RedundantCast")
public class FloatingActionButtonBehavior extends CoordinatorLayout.Behavior<FloatingActionButton> {
public FloatingActionButtonBehavior(Context context, AttributeSet attrs) {
}
@Override
public boolean layoutDependsOn(CoordinatorLayout parent, FloatingActionButton child, View dependency) {
return dependency instanceof SnackbarLayout;
}
<a href="iloop://event?id="dcab32f9f084418096e2ca9e949bca59">test</a>
f668fc5838624c21a1c9fccdc7a6bccb
@sanjogshrestha
sanjogshrestha / Setting log level for retrofit
Created January 5, 2017 06:42
Setting log level for retrofit
//build.gradle
buildTypes {
debug {
buildConfigField 'retrofit.RestAdapter.LogLevel', 'RETROFIT_LOG_LEVEL', 'retrofit.RestAdapter.LogLevel.FULL'
}
release {
buildConfigField 'retrofit.RestAdapter.LogLevel', 'RETROFIT_LOG_LEVEL', 'retrofit.RestAdapter.LogLevel.NONE'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:allowBackup="true"
@sanjogshrestha
sanjogshrestha / android_studio_shortcuts.md
Created September 13, 2016 07:02 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>
@sanjogshrestha
sanjogshrestha / service
Created July 22, 2016 08:31
location service example
public class LocationService extends Service
{
public static final String BROADCAST_ACTION = "Hello World";
private static final int TWO_MINUTES = 1000 * 60 * 2;
public LocationManager locationManager;
public MyLocationListener listener;
public Location previousBestLocation = null;
Intent intent;
int counter = 0;
{
"contacts": [
{
"id": "c200",
"name": "Sugam Shrestha",
"email": "pratik13butani@gmail.com",
"address": "xx-xx-xxxx,x - street, x - country",
"gender" : "male",
"profile_pic" : "http://lorempixel.com/100/100/",
"phone": {