Month: January 2014

  • Solve adb devices empty or Android not detected in Eclipse

    If ADB not showing your devices or Eclipse not showing your Android in running devices, probably you’re missing the USB driver. Please install the usb driver for your android devices. For samsung, you can search google for “Samsung_USB_Driver_for_Mobile_Phones_v1.5.14.0”

  • Dex Loader Unable to execute dex : Multiple dex files define Android

    When we using 3rd party library, sometimes we got this error while running our app, eg: 1Dex Loader Unable to execute dex : Multiple dex files define Lcom/google/gson/JsonSerializer; This happen when in our app, we have libs folder with gson jar (eg: gson-2.2.4.jar). In sametime, our Google Play Service library already have Gson as well. […]

  • Pitfalls in Android

    1. XML using same ID attribute 2. Editor always create on new instance 1        SharedPreferences.Editor editor = settings.edit();

  • Implement SSL in Android

    Please follow this links for implement SSL in Android : http://stackoverflow.com/questions/1217141/self-signed-ssl-acceptance-android#answer-15531475 faced this issue yesterday, while migrating our company’s RESTful API to HTTPS, but using self-signed SSL certs. I’ve looking everywhere but all the “correct” marked answers I’ve found consisted on disabling certificate validation, clearly overriding all the sense of SSL. I finally came to […]

  • Solve gitignore not working windows

    The solution gitignore not working windows 123git rm -r –cached . git add . git commit -m ".gitignore is now working" For android, .gitignore can be : 1234gen/ bin/ project.properties .gitignore

  • NumberPicker looping Android

    Here is to make NumberPicker looping in Android : 1234567final NumberPicker np1 = (NumberPicker) view                 .findViewById(R.id.numberPicker1); final String[] nums1 = generateHour(0); np1.setMaxValue(23); np1.setMinValue(0); np1.setWrapSelectorWheel(true); np1.setDisplayedValues(nums1);

  • Keep highlight selected item in Gridview Android

    Gridview have option to modify it’s selector (listSelector). When we click on item in Gridview, we saw blink blue and then dissapear after we release it. To make it stay, all we need just declare it at “android:listSelector” in GridView XML. For instance : 1234567891011121314<?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/calendar_gridview"     android:layout_width="match_parent" […]