Showing posts with label development. Show all posts
Showing posts with label development. Show all posts

2011/11/15

Devoxx11: Jackpot 3.0 - Large Custom Refactorings



Jan Lahoda
Jackpot:
  • originally from Sun labs
  • uses the Abstract Syntax Tree (AST) --> knows java-language / syntax: smarter than simple regexp's
  • ideal to refactor deprecated API's
  • remove anti-patterns
Jackpot is now included in Netbeans 7.1
  • use special 'Hint' syntax: Class.oldMethod => NewClass.newMethod ;;
  • completely integrated in standard Netbeans hints / refactoring logic
    • hints are show in the IDE, directly to the developer
    • batch refactorings are allowed: completely integrated in the "Inspect and refactor" dialog (incl. managing hints)
    • run headless from the command line
  • can be highly fine-tuned:
    • use instanceof checks
    • match on specific Java constructs: e.g. only look for Fields
    • check on target java version
    • combine multiple checks
    • write repeatable tests in ".test" file
  • definitely worthwhile looking at for large refactorings of legace Java projects!

Devoxx11: Java 7 toolbox


Project coin brought some minor improvements to the Java language. Most notably:
  • easier generics:
    • diamond operator <>: less copy/paste thanks to smarter compiler
    • less warnings on vararg's
  • easier error-handling:
    • multicatch: less copy/paste
    • 'try-with-resource' contstruct: automatic & correct closing and error handling
  • consistency / clarity
    • Strings in Switch
    • numbers improvements:
      • direct binary format: 0b0101001
      • logical grouping of large number in sub-chunks: 123_435_576L --> java ignores the underscores.
IDE support
  • Netbeans & Intellij have excellent support for Java 7
    • inline hints and refactorings are offered
    • batch refactorings throughout the 'inspect and transform' dialog
  • Eclipse is somewhat lagging behind.

2011/11/14

Devoxx11: Android awesomeness

Chet Haase, Romain Guy and Philip Milne

Android 4.0: Tablet (3.0) & Phone (2.3) reunited

GridLayout: powerful & flexible lay-outing -- way too complex explanation.

Tools for profiling / debugging Android apps. "Experience matters"

  • Memory
    • dumpsys: dump info of processes running on the device
      • adb shell dumpsys meminfocom.android.Launcher: dumps heap usage details
      • dumpsys gfxinfo: graphics chip
      • dumpsys window: decompose window objects used
    • DDMS: heap dump
    • jhat:
      • generate hprof
      • convert it with hprof-conv
      • in eclipse
      • check out "rootset references" for potentially memory leaks
    • MAT: Eclipse Allocation Tracker - http://eclipse.org/mat
  • Performance
    • "use your eyes"
    • DDMS
    • track frames per second -> "trackFPS()" call in a PreDrawListener
  • UI
    • 'crazy' stuff like high speed cams: Casio Ex-F1: replay the animation in slow motion
    • HierarchyViewer:
      • ViewTree
      • PixelPerfectTree
    • ViewServer

Devoxx11: Android Jumpstart

Lars Vogel

Excellent introduction to the Android development experience.

  • tutorials on Android: www.vogella.de
  • java --> class -- through dx-tool --> dex
  • development environment: ADT for eclipse.
    • emulator: QEMU
    • DDMS: very powerful device debug mode
  • API Components:
    • View for single views & ViewGroup for combining
    • Activity: app lifecycle - onPause() is the guaranteed last call to persist data
    • Intent: transitions to other apps
      • Implicit: Android decides
      • explicit: hard coded coupling to called app
    • Toast class: display quick temporary message
    • Preferences
    • DIY Views:
      • onDraw() method
      • Path class
      • selective invalidate() call to improve performance
    • ListActivity & ListAdapter
    • Threading & Async behaviour:
      • Threads: use runOnUiThread for async updates of the UI
      • Services
      • Broadcast & Receiver