android app development tips

8
Android Development Tips By Srinivas Zoftino.com

Upload: zoftino

Post on 13-Apr-2017

27 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Android app development tips

Android Development Tips

By Srinivas

Zoftino.com

Page 2: Android app development tips

Exception Handling

Android application exceptions can be handled like other Java based applications.

While developing apps, you can check console output from logcat monitor to find out exceptions and take appropriate action like fixing code, showing a message to user.

Page 3: Android app development tips

Exception Handling Unhandled exceptions in your app,

thrown when your app runs on user device, causes your app to crash.

To analyze and fix these issues, you need crash report from the device on which your app is crashed.

Page 4: Android app development tips

Exception Handling You can add global exception

handler to each component to catch unhandled exceptions and send it your server or to you via email for analysis

Or You can use libraries to handle exceptions and get crash reports, like ACRA library.

Page 5: Android app development tips

Logging

You can use Log class to log messages.

Log class has several methods to log different level of information, for debug Log.d,Log.e for error, Log.i for information etc.

It is a good practice to make sure that debug statements are used only in development.

Page 6: Android app development tips

Android Studio Tips

To import classes, press Alt + Enter pointing to the unresolved class.

To remove unused imports, you can use Ctrl + Alt + Enter.

Use refactoring options to make code changes like class signature, method signature changes, parameter renaming etc. 

Page 7: Android app development tips

Testing

You can test android apps on mobile devices connected to computer via USB or using android emulator. 

To create virtual device you can use Android emulator tool (Tools > Android > AVD Manager)

Setup hardware acceleration to improve the performance of virtual device

Page 8: Android app development tips

Thank You

Visit http://www.zoftino.com/ for more info.