Thursday, July 2, 2015

Useful Links

How to Enable the Developer Options in Android 4.2 on Nexus 4

INSTALL_FAILED_UPDATE_INCOMPATIBLE when I try to install compiled Trebuchet.apk on device

Gradle and Android Studio.....
Once you provide a resource in your application (discussed in Providing Resources), you can apply it by referencing its resource ID

Undo 'git add' before commit


Android unitTest support

make android emulator smaller

Implements vs. Extends in Java

List vs. Arraylist

Array vs. Arraylist
First and Major difference between Array and ArrayList in Java is that Array is a fixed length data structure while ArrayList is a variable length Collection class. You can not store primitives in ArrayList.

Android Category
The BROWSABLE category is required in order for the intent filter to be accessible from a web browser. Without it, clicking a link in a browser cannot resolve to your app. The DEFAULT category is optional, but recommended. Without this category, the activity can be started only with an explicit intent, using your app component name.

Android Webview

Purpose of using buildscript in build.gradle

Androidmanifest path&pathprefix&path
The path part of a URI which must begin with a /. The path attribute specifies a complete path that is matched against the complete path in an Intent object. The pathPrefix attribute specifies a partial path that is matched against only the initial part of the path in the Intent object. The pathPattern attribute specifies a complete path that is matched against the complete path in the Intent object, but it can contain the following wildcards:

scheme://host:port/path or pathPrefix or pathPattern
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!--  For Deep Linking -->
                    android:scheme="https" />

logansquare com.bluelinelabs.logansquare.nosuchmapperexception could not be mapped to a json object
Sol: proguard-rules.txt!!

hashMap vs arrayMap
ArrayMap is a generic key->value mapping data structure that is designed to be more memory efficient than a traditional HashMap.

pass class into the method is slow

Remove files from Git commit
If I made the wrong commit, not pushed yet....

Merge latest two commits into one
$ git reset --soft "HEAD^"
$ git commit --amend

Transparent activity in Android

 To allow your app to take advantage of these changes and ensure that your app fits the style of each user's device, you should set the targetSdkVersion value to match the latest Android version available.

action -- The general action to be performed, such as ACTION_VIEW, ACTION_EDIT, ACTION_MAIN, etc.
data -- The data to operate on, such as a person record in the contacts database, expressed as a Uri.

Android click event outside a dialog
Dialog dialog = new Dialog(getActivity());
Window window = dialog.getWindow();

Git patch apply
$ git apply ../rb562855.patch

No underline for drawable in android

FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), which means that the view wants to be as big as its parent (minus padding)
WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding)

bring view on front of everything

Set radius in Android
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="">
    <solid android:color="#FFFFFF"/>
    <corners android:radius="10dip"/>

Slide down and gone
    .setListener(new AnimatorListenerAdapter() {
        public void onAnimationEnd(Animator animation) {

Error:Timeout waiting to lock buildscript class cache for build file
delete everything under ~/.gradle/caches