After several years of making android applications, I've collected a bunch of tips and techniques to improve the development process. These are going from discovering non-standard tools, knowing better your IDE, using fundamental and some uncommon libraries and other stuff.
This presentation is aimed for those in the beginner and intermediate levels but I'm sure advanced developers will learn a couple a things as well
7. Proxy
• Charles
Proxy
• ¿Cómo?
• Configurar
Android
(si
lo
permite)
• Usar
aplicación
(si
Kenes
móvil
rooteado)
• Por
código:
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpHost proxy = new HttpHost("1.2.3.4", 8080);
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
8. Colored
logcat
Permite
personaliza
la
salida
editando
el
fichero
~/.logcat-‐color
h$ps://github.com/marshall/logcat-‐color.git
9. Re-‐aprender
Eclipse
• Técnica
milenaria
de
vista
dual
para
edición
de
interfaces
• Otros
• Refactors
• expresiones
regulares
• Shortcuts:
desplazar
líneas
13. Roboguice
h$p://code.google.com/p/roboguice/
Reduce
el
código
+
Inyección
de
dependencias
@ContentView(R.layout.main)
class RoboWay extends RoboActivity {
@InjectView(R.id.name) TextView name;
@InjectView(R.id.thumbnail) ImageView thumbnail;
@InjectResource(R.drawable.icon) Drawable icon;
@InjectResource(R.string.app_name) String myName;
@Inject LocationManager loc;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
name.setText( "Hello, " + myName );
}
}
Google
14. Reporte
de
Crashes
Envío
automá^co
de
crashes
h$p://code.google.com/p/acra/
@ReportsCrashes(formKey = ”apiKey")
public class MyApplication extends Application {
Mejor
visualización
h$p://www.bugsense.com/
Kevin
23. Comunicación
entre
Activities
public static Intent getCallingIntent
(Context ctx, String url, String title) {
Intent i = new Intent(ctx, BrowserActivity.class);
i.putExtra(EXTRAS_OPEN_URL, url);
i.putExtra(EXTRAS_WEB_TITLE, title);
return i;
}
• Si
los
parámetros
son
clases
personalizadas:
• Si
son
pequeños,
Serializable
• Si
no,
implementar
Parcelable
(si
es
una
imagen
pasar
filepath)
24. Custom
Logger
public class DebugLog
{
public final static boolean DEBUG = true;
public static void log(String message)
{
if (DEBUG)
{
StackTraceElement stack = Thread.currentThread().getStackTrace()[3];
String fullCN = stack.getClassName();
String className = fullCN.substring(fullClassName.lastIndexOf(".") + 1);
String methodName = stack.getMethodName();
int lineNumber = stack.getLineNumber();
Log.d(className + "." + methodName + "():" + lineNumber, message);
}
}
}
Implementar guidelines, lo que no ha hechogoogle..Android library for implementing the action bar design pattern using the native ActionBar on 3.0+ and a custom implementation on pre-3.0 through a single API and theme.Se basan en Android compatibility libraryJacktieneotraslibreríascomo:ViewPagerIndicator, NineOldAndroidsNotificationCompat2 An extension of the NotificationCompat helper in the support library which actually supports all of the features of the Android 4.1 (Jelly Bean) release. ActivityCompat2 Extension of ActivityCompat helper which supports the new startActivity and ActivityOptions features of Android 4.1.
No laconsidero entre lasfundamentales, pero no dudarénunca de usarlaBasado en Google guiceInyección de dependencias = ready for testing! (roboelectric o robotium)
Cualquiera de laslibreríasquehemosdicho anteshttps://github.com/androidhttps://github.com/github/android, y llegas a esto https://github.com/kevinsawicki/wishlistSquareVer los starred
DescompilarPuedesverlaslibreríasqueusanFacebook, path, foursquare, google plus, ted photoparty
DescompilarPuedesverlaslibreríasqueusanFacebook, path, foursquare, google plus, ted photoparty