BigAndroidBBQ 2012: XDA Session - Future of Android Development


Published on

Presentation given at the Big Android BBQ 2012 by Jerdog of XDA-Developers. This session was a panel discussion with some of the most well-known developers in the Android world. We discussed their current projects, what excites them about Android development, what they see as the future of Android development, and maybe even some answers to questions like, "To Kang of Not to Kang?" The panel featured XDA Recognized Developers Agrabren, Supercurio, Entropy512, Decad3nce, and Chainfire.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Last minute replacement No PowerPoint special effects
  • - No “ fapped ”
  • -For app-devs not familiar with FAAPT Patch not very interesting -Attributes looked up ( android:layout_width ) -Simple lookup table
  • Debugged / went through sources / reverse engineered many apps -Helped quite a few people fixing their app -Article code often requested. ChainsDD signed off on it too!
  • exec() , ProcessBuilder: su –c “command”  one parameter. Quotes problem -writing script: AND executing it – space in paths! -rapid: expensive! Batch, as many commands in as little processes -many/lifecycle: expensive! Create su shell and keep it open, read/writing to stdin/stdout -hardcoded checks: su location, java package name -su parameters: it will start a shell if parameter not supported ! (see: VERSION checks)
  • - Works around all common pitfalls
  • - id is not always available, libsuperuser has workaround for that --- will not verify uid=0, but “ su ” will exist
  • - strictmode: network I/O on main thread  crash, flash red on disk I/O
  • - ProgressDialog
  • Example only does one specific action -Add service to manifest
  • -Triggers flash counters
  • -Others: depend on bootloader state
  • Bye!
  • BigAndroidBBQ 2012: XDA Session - Future of Android Development

    1. 1. The Future of AndroidDevelopmentXDA Developer Panel 2012
    2. 2. Session SummaryIntroductionsApplicationsROMsKernelsCore AndroidQuestions & Answers
    3. 3. Introductions
    4. 4. Supercurio
    5. 5. AgrabrenSoftware Developer for NVIDIA CorporationDeveloped ROMs and Kernels for the HTC EVO4G and EVO 3DTwitter: @agrabren
    6. 6. Decad3nceBorn in Bosnia22-yr old student at the University of Nebraska-Lincoln studying Computer Science &EngineeringOpen-source fanatic and Device Maintainer forCyanogenModTwitter: @Decad3nce
    7. 7. Entropy512
    8. 8. Chainfire• Web:• Twitter: @ChainfireXDA• G+:
    9. 9. ApplicationsSupercurio
    10. 10. Project Voodoo Audio and Display low level mods from Linux Kernel patches to Android apps
    11. 11. Starting from scratch: How XDAcommunity promotes developmentGalaxy S lag: pauses during OS executionXDA Bounty thread raises donations to encourage development of a lagfix.Galaxy S sound quality tuning: enthusiasts test, donate and later buy the control app.Galaxy S and Nexus S Super AMOLED tuning: new kind of hack becoming quickly popular.
    12. 12. WTF is this thick French accentIll progress on that, its in my TODO list.My real name is François Simond, 30 year old. coming from France to attend this BBQ and meet you here.
    13. 13. R&D methodology: tests,measurements and feedback drivenForums members are supportive but often emotional.Strict testing and measurement methodology allow to publish safe improvements instead of half improvement half regression.Placebo is the enemy of innovation.
    14. 14. Voodoo LagfixGalaxy S original filesystem introduces latency and slow down during file writes.Development of a reliable RFS to Ext4 and Ext4 to RFS converter allowed Galaxy owners to enjoy their phone.Ext4 settings chosen for safety and speed now re-used by most manufacturers
    15. 15. Voodoo Sound first stepsTuning Wolfsonmicro codecs by hacking kernel driver source, rewriting selectively some i2c command sent to the hardwareRequirement: flashing a kernel implementing kernel patches.sysfs "text" interface.Android control application
    16. 16. Voodoo Sound and LOUDERlong term strategyHardware-agnostic generic i2c commands interceptor design.Implementation:• Minimalistic programmable Linux Kernel Module using rootkit-like methods to rewrite hardware commands• Complexity deported to an Android Java/C driver, mixer and UI communicating via ioctl with the kernel driver
    17. 17. Voodoo color basic Simple patch:Super AMOLED driver tuningSamsung Super AMOLED gamma points tuning, via the v1 gamma hack method.Affecting the image but inherently inaccurate.Considered as a panel rendering customization but not yet calibration.Now re-used in every Super AMOLED hacks
    18. 18. Voodoo Display Expert, long term1,5 year of development and preview soon to be released.Goals:• Fixing panel mis-configuration leading to sharpening artifacts, banding and shadows crushing/clipping• Panel calibration for accuracy and custom color tones.
    19. 19. Misc tools and one-shot apps,connections with the pressA few tools, most of them Open Source under WTFPL:• OTA RootKeeper (now merged)• Screen Test Patterns for display measurements• Audio Measurements Player for audio measurements• Voodoo Report for bug reporting and virtual teardowns• CIQ detector, FreeOrNot
    20. 20. Thanks to supportersWhat encouraged me to develop and share was solely the incredible initial support from XDA community.What allowed me to continue development is solely financial support from XDA enthusiasts, later extended to Google Play through app sales.
    21. 21. Thanks to manufacturersWolfsonmicro• providing access to datasheet under NDA• listening and integrating feedback in their new drivers and chips.• sharing knowledge and audio cultureSamsung Mobile Korea and USA• helping by sending development hardware• supporting and encouraging (albeit discreetly)
    22. 22. Q&A and meet me after the sessionPleased to meet you in person!You can reach me on twitter as well: website:
    23. 23. ROMsAgrabrenDecad3nce
    24. 24. Developing for the HTCEVO 3DAgrabren
    25. 25. Why the EVO 3D?I love 3D... That’s why I work for NVIDIAReasonable size, great processorObvious successor to the HTC EVO 4G
    26. 26. Disarmed ToasterBring the AOSP experience to the EVO 3D Improved Battery Life Better Responsiveness Latest Versions of Android Support for 3D Camera and Panel
    27. 27. The Future of Android...Disarmed Toaster isn’t a ROM, it’s an idea... (and my wife’s XBox 360 handle)What if we could make a baseline ROM, and“apply” the flavor we want? CyanogenMod 10 ParanoidAndroid Android Open Kang Project (AOKP)Three ROMs in one package...
    28. 28. Variation is the spice oflife...Reduce the pain of flashing: Flashing between flavors does not require a factory reset Baseline framework ensures feature parity Consistent experience for the end user
    29. 29. Working withDevelopers Different types of Developers Kernel Developers Kernel Hackers ROM Developers ROM Hackers A Trademarked brand of Building Block Builders Themers
    30. 30. Working withDevelopers (cont.)Courtesy Don’t call people stupid for asking questions or pointing out “the obvious” Point out what may be “obvious”, as a ROM is large and sometimes it’s easy to overlook things
    31. 31. Examples fromDisarmed Toaster“Camera is rotated 90 degrees on first use, butfixes after taking the first picture. But youprobably already knew that, sorry.”User 1: “Video playback with [particular app]causes the device to reboot with [this video]. Ican upload if it would help?” OP: “Yes, please!” User 2: “I’ve run the video he was having trouble with, and here’s the logcat.”
    32. 32. CyanogenMod on Samsung Epic the perspective of aUnderstanding CyanogenMod from device maintainer. A presentation by Decad3nce Decad3nc
    33. 33. To cover:•• epicmtd: Fixing all the variances, nuances, and figuring out workarounds for a specific device.• you: How to get involved, where to find resources, and who to ask.• TODO: What I see as the future of Android/CyanogenMod. aries-common: Sharing the build environment with similar devices and working with maintainers outside of your devices scope.
    34. 34. aries-common:• o The common device sources shared between all the Galaxy S siblings. o Put forth by members of TeamHacksung and EpicCM o Contains:  Multiple shared libraries(from camera to audio)  releasetools  Common board declarations and overlays aries-common:
    35. 35. aries-common:• o commonalities:  The need for bdaddr reading  The need for bml over mtd  The need for custom releasetools aries-common:
    36. 36. aries-common:• o bdaddr:  Samsung lack of following conventions leads to some very elegant solutions  bdaddr_read in aries-common reads the custom SAMSUNG_BDADDR_PATH  Runs on board init aries-common:
    37. 37. aries-common:
    38. 38. aries-common:
    39. 39. aries-common:• o bml_over_mtd:  Collection of scripts, binaries, and update tools to convert bml partition scheme into mtd.  Useful to mimic Nexus S like environment.  Breakdown: • Checks for conversion • Initiliaizes bml_over_mtd binary • Converts to new partition layout aries-common:
    40. 40. aries-common:
    41. 41. aries-common:
    42. 42. aries-common:• o releastools:  Custom releasetools allow a device vendor to override compile time arguments for packaging.  Used along with script to create a working boot.img(android standard)  The python scripts also set the edify scripting in the update package. aries-common:
    43. 43. aries-common:
    44. 44. aries-common:• o teamhacksung members:  atinm  Kolja Dummann  Chrayu Desai  Rafael Salas  Pawit Pornkitprasan  Andrew Dodd  Andrew Mahone  Daniel Hillenbrand  Daniel Bateman  jt1134 aries-common:
    45. 45. aries-common:• o Different teams of developers working on similar devices. o teamhacksung, freeXperia, EpicCM, etc. o All are a component of the contributors that are within CyanogenMod. aries-common:
    46. 46. epicmtd:• o The device repo for the Samsung Epic (Sprint) o MTD suffix is because of the partitioning changes. o Maintained by EpicCM  Members include: • Will Keaney • Mike Kasick • Shareef Ali • Brian Beloshapka • Wispoffates • Donovan Bartish • nubecoder • nullghost epicmtd:
    47. 47. epicmtd:• o The epicmtd vendor is a derivative of the aries- common vendor. o Much like the aries-common vendor, it contains the necessities of:  bdaddr_read  custom releasetools  bml_over_mtd epicmtd:
    48. 48. epicmtd:• o However, epicmtds implementations of these are varied compared to aries due to hardware differences. o Differences:  Wimax/CDMA device  Keyboard(gpio shuffle)  Larger oneNAND  Unable to read BT MAC from /efs  Kernel driver variances • Touchscreen driver embedded the touchkey lights epicmtd:
    49. 49. epicmtd:• o Samsung had made things difficult for us. epicmtd:
    50. 50. epicmtd:• o The CDMA/Wimax/Sprint Quirks:  Utilizing the CDMA stack embedded in SamsungRIL in Cyanogenmod.  Pppd had to be manually started to get data connection, and modified for 100ms intervals for the epic radio.  The Samsung CDMA "ring of death" bug. • The phone emitted an "old fashioned ring" whenever there was an incoming call or someone was put on call waiting.  Emergency 911. • In original testing, e911 was not functional. epicmtd:
    51. 51. epicmtd:
    52. 52. epicmtd:
    53. 53. epicmtd:• o The larger OneNAND  Epic would end up utilizing Samsung OneNAND driver for the AUDI controller.  Varies with aries siblings.  Allowed for larger /data partitions, more space for users.  Did not need a dedicated /efs partition. epicmtd:
    54. 54. epicmtd:
    55. 55. epicmtd:• o Need for a custom bdaddr_read  The samsung epic didnt store bt mac address in /efs  Could only be read from a RIL property when stack was initialized  Fixed without having to modify BT stack in CyanogenMod.  Read from RIL, store, check on every init. epicmtd:
    56. 56. epicmtd:
    57. 57. epicmtd:
    58. 58. How to get Involved:• o Learn git, learn gerrit, use the cm wiki resources:   o If not so advanced, take a heads up from Cyanogen:  "Stop. Write an app or two first, learn how the system works from a developer standpoint. Learn some Java. Read the developer documentation. Learn how to use Git. Then learn how to build AOSP from source. Read the porting guides, and learn how the build system works….. Now try to put your new found skills to work on enhancing the platform by writing code or making theme overlays. And share! And put that s**t on your resume. There is a *ton* of information out there but any kind of “step-by- step rom cooking guide” is going to be a complete fail- it’s too broad of a subject."
    59. 59. How to get Involved:• o Feel free to contact any device maintainer or general developer in CyanogenMod.  Contact via Google+, Contact via Twitter s o If youre a developer looking to contribute in a meaningful right away, utilize you:
    60. 60. How to get Involved:• o THANK YOUR MENTORS AND PEERS.  Thanks to Richard Ross(toastcfh)  Thanks to Warren Togami(warren)  Thanks to Will Keaney(Uberpinguin)  Thanks to Brian Beloshapka(bbelos)  Thanks to Shareef Ali(noobnl)  Thanks to Donovan Bartish(DRockstar)  Thanks to Justin Wood(nullghost)  Thanks to Troy Smith(wispoffates)  Thanks to Timothy Lusk  Thanks to Scott Warner(tortel)  Thanks to nubecoder, chris41gl, Rodderik, jt1134, nemith, AproSamurai and on and on... you:
    61. 61. KernelsEntropy512
    62. 62. Core Android• Chainfire
    63. 63. Chainfire Web: Twitter: @ChainfireXDA G+:
    64. 64. Subjects • FAAPT • SuperSU • CF-Auto-Root
    65. 65. FAAPT• “Fast” Android Asset Packaging Tool• Significantly accelerates XML compilation• “Build Automatically” no longer taboo
    66. 66. Patch status • AOKP: Merged • CM: Merged • AOSP: Under review Binaries for Linux, OS X and Windowsavailable on XDA - Sources available on Gerrit
    67. 67. SuperSU Most su problems are caused by: • Calling su in the wrong way • Calling su at the wrong time Article and sample code (libsuperuser) will be available online soon.
    68. 68. Common pitfalls calling su• Runtime.exec() or ProcessBuilder with parameters• Writing a script with commands• Rapid successive su calls• Many su calls throughout the app’s lifecycle• Hardcoded checks• Assuming the su binary takes parameters
    69. 69. Best way to call su • Create an interactive su shell • Write commands to su’s STDIN • Read output from su’s STDOUT
    70. 70. List<String> command)List<String><String>commands)List<String>[]commands)List<String> command)List<String><String>commands)List<String>[]commands)
    71. 71. Checking for suavailability • Do not check for Java packages • Locate su in PATH, or • Try running su and check id output (preferred) boolean Shell.SU.available()
    72. 72. Blocking I/O• su is a blocking I/O call - it might return in milliseconds, or next week• Do not make blocking I/O calls from the main thread (see strictmode)• Calling su on the main thread is the primary source of crashes and freezes when apps try to run commands as root• libsuperuser will throw an exception when called from the main thread in debug mode
    73. 73. Main thread ?• All Activity-based code is run on the main thread• All manifest-declared BroadcastReceivers run on the main thread. May cause deadlock even if not running on the main thread• Most Service-based code is run on the main thread. Notable exception: IntentService
    74. 74. if (Looper.myLooper() ==Looper.getMainLooper()) { // running on the main thread } else { // not running on the main thread }
    75. 75. AsyncTask
    76. 76. public class MainActivity extends Activity { private class Startup extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... params) { // this method is executed in a background thread // no problem calling su here return null; } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // start background task (new Startup()).execute(); }}
    77. 77. IntentService
    78. 78. public class BackgroundIntentService extends IntentService { public static void launchService(Context context) { if (context == null) return; context.startService( new Intent(context, BackgroundIntentService.class) ); } public BackgroundIntentService() { super("BackgroundIntentService"); } @Override protected void onHandleIntent(Intent intent) { // the code you put here will be executed in a background thread }}public class BootCompleteReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { BackgroundIntentService.launchService(context); }}
    79. 79. CF-Auto-Root• Automated root creator, for funsies• Takes a stock recovery image and produces an automated recovery+cache image, which: • Installs SuperSU • Wipes cache • Reinstalls stock recovery
    80. 80. Compatibility• Still in testing, about 30 roots already available• Starting with Samsung devices: • Exynos • Snapdragon • OMAP • Tegra (under development)• Others may follow
    81. 81. Future • Live, but still in testing, no public upload yet • How long will this work ? • What about the improved security features in Android 4.1.2 and 4.2 ?
    82. 82. Chainfire Web: Twitter: @ChainfireXDA G+:
    83. 83. Questions & Answers