Lean Mobile App Development
上QQ阅读APP看书,第一时间看更新

Inability to dynamically load libraries

Native app development tool chains only permit static linking of libraries. What this means is that there is no straightforward way to dynamically load library components into your app, the way that a web developer may choose to pull different JavaScript modules over the web on the fly.

In the case of iOS, there are a few tricks through which libraries can be loaded. The default iOS Xcode settings don't permit you to create a dynamic library, but that can be worked around by copying over the MacOS settings. However, while this can be tested out locally, roadblocks appear during code signing, and the kernel kills app libraries that are not signed by Apple with the same certificate. That said, since the app review process bars dynamic loading, it's unlikely to make it through their checklist.

Workarounds such as this-or others that can be found online-can be tried and tested to see if they will make it through the submission process. However, in the event that they don't succeed, it may pay to develop a static-loading strategy for your app:

In case of Android, there are similar tricks through which a Dex file may be loaded, extracted, and invoked. This is because the Dalvik VM permits some levels of custom class loading from alternate locations such as local storage or a remote network. However, this is not suitable for all apps and has a fair bit of complexity when it comes to properly dealing with all scenarios.

Whereas a web developer can easily flip a switch and change the components rendering on his dashboard, the app developer needs to perform a juggling act. If he would rather focus on the core problem of his app, he would need to push a new app build to the marketplaces and then wait for users to download the new version.

In real-world terms, this could translate into anything from weeks to months before an experiment starts to hit the target user base. Though such delays could be very problematic, in the later chapters we will discuss workflows and techniques that can help you workaround technical roadblocks such as these.