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
| 1) ListView=>Use android:cacheColorHint=”@android:color/transparent” to avoid black highlighting while Scrolling. | |
| 2) To resolve this issue “Failed to install *.apk on device timeout Launch canceled! , increase ADB connection timeout | |
| 3) use setError() to display error message for your EditText | |
| 4) To Block the default animation for startActivity() For ex: myIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); | |
| 5) Android Action Bar Style Generator http://jgilfelt.github.com/android-actionbarstylegenerator | |
| 6) create library with reusable code and reference it in future projects. | |
| 7) Don’t use right-pointing carets on line items http://developer.android.com/design/media/migrating_ios_settings.png | |
| 8) 10 amazing Android development tips http://www.netmagazine.com/features/10-amazing-android-development-tips | |
| 9) Define these attributes for displaying multiline EditText => android:singleLine=”false”, android:lines=”5″ | |
| 10) Follow Dashboard design pattern. Easy to implement and handle Navigation. |
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
| /** | |
| * Getting external files/cache dir [compatibility]. | |
| * | |
| * @author johnkil | |
| * | |
| */ | |
| public class FileUtils { | |
| private static final String LOG_TAG = FileUtils.class.getSimpleName(); | |
| /** |
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
| package com.cyrilmottier.android.tests; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| /** | |
| * @author Cyril Mottier | |
| */ | |
| public class ViewAdditions { |
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
| /** | |
| * This method convets dp unit to equivalent device specific value in pixels. | |
| * | |
| * @param dp A value in dp(Device independent pixels) unit. Which we need to convert into pixels | |
| * @param context Context to get resources and device specific display metrics | |
| * @return A float value to represent Pixels equivalent to dp according to device | |
| */ | |
| public static float convertDpToPixel(float dp,Context context){ | |
| Resources resources = context.getResources(); | |
| DisplayMetrics metrics = resources.getDisplayMetrics(); |
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 java.io.BufferedWriter; | |
| import java.io.File; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| import travel.opas.core.Consts; | |
| import android.os.Handler; | |
| import android.os.HandlerThread; | |
| import android.os.Process; | |
| import android.text.format.DateFormat; |
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
| // more information here: http://blog.tomtasche.at/2012/10/use-built-in-feedback-mechanism-on.html | |
| try { | |
| int i = 3 / 0; | |
| } catch (Exception e) { | |
| ApplicationErrorReport report = new ApplicationErrorReport(); | |
| report.packageName = report.processName = getApplication() | |
| .getPackageName(); | |
| report.time = System.currentTimeMillis(); | |
| report.type = ApplicationErrorReport.TYPE_CRASH; |
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 java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileNotFoundException; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.util.LinkedList; | |
| import java.util.List; | |
| import java.util.zip.GZIPInputStream; |
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
| package com.cyrilmottier.android.citybikes; | |
| import android.os.Bundle; | |
| import com.cyrilmottier.android.avelov.R; | |
| import com.cyrilmottier.android.citybikes.app.BaseActivity; | |
| public class LicensesActivity extends BaseActivity { | |
| private WebView mWebView; |
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 java.io.File; | |
| import android.annotation.TargetApi; | |
| import android.content.Context; | |
| import android.os.Build; | |
| import android.os.Environment; | |
| import android.util.Log; | |
| /** | |
| * File Util's. |
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 java.io.BufferedInputStream; | |
| import java.io.BufferedOutputStream; | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.util.Enumeration; | |
| import java.util.zip.ZipEntry; | |
| import java.util.zip.ZipFile; | |
| /** |
OlderNewer