"What a Terrible Failure: Report a condition that should never happen. The error will always be logged at level ASSERT with the call stack..."
Показаны сообщения с ярлыком android. Показать все сообщения
Показаны сообщения с ярлыком android. Показать все сообщения
пятница, 27 июля 2012 г.
android.util.Log#wtf ))
funny android developers: android.util.Log#wtf
вторник, 24 июля 2012 г.
Ubuntu x64, avd device creation error
in order to use android sdk in ubuntu (12.04) x64 you need to install x32 java libraries (~270mb), otherwise: Error: Failed to create the SD card
вторник, 7 февраля 2012 г.
how to save static fields in android junit tests?
if you have "extends ActivityInstrumentationTestCase2" android junit tests then their static fields will be cleared out after each method run (if you call super.tearDown()), the problem is with android.test.ActivityTestCase#scrubClass()
Non static fields will be cleared by default JUnit implemention, so you should not get any regression issues here ))
p.s. +SO question
protected void scrubClass(final Class<?> testCaseClass) throws IllegalAccessException { final Field[] fields = getClass().getDeclaredFields(); for (Field field : fields) { final Class fieldClass = field.getDeclaringClass(); if (testCaseClass.isAssignableFrom(fieldClass) && !field.getType().isPrimitive()) { try { field.setAccessible(true); field.set(this, null); } catch (Exception e) { android.util.Log.d("TestCase", "Error: Could not nullify field!"); } if (field.get(this) != null) { android.util.Log.d("TestCase", "Error: Could not nullify field!"); } } } }-which is called from android.test.ActivityInstrumentationTestCase2#tearDown(). Just override it with empty method:
@Override protected void scrubClass(Class testCaseClass) { // ignore }-and you'll save your static variables!
Non static fields will be cleared by default JUnit implemention, so you should not get any regression issues here ))
p.s. +SO question
четверг, 2 февраля 2012 г.
faced gotcha: puzzle with google account in android emulator
When creating your device in AVD - if you select configuration by android version like android 2.2 - you 'll fail to add google account on it ))
Only if you select device configuration by Google API Version (like API Level 8) - you'll get an ability to have google/gmail sign-on on you emulator. Quite a funny.
- related SO question.
Only if you select device configuration by Google API Version (like API Level 8) - you'll get an ability to have google/gmail sign-on on you emulator. Quite a funny.
- related SO question.
вторник, 27 декабря 2011 г.
Подписаться на:
Сообщения (Atom)