Android platform and Operating system (Linux Kernel, native libraries, Android runtime, hardware abstraction) is primarily written in C/C++. The application development, which is top layer of Android architecture, uses primarily Java or Kotlin. Java has been more tradational choice since the launch of platform, however Kotlin has gained more popularity in recent years due to its modern features and addressing some of the limitations with Java.
Native Android DevelopmentNative Android development refers to the process of developing Android applications using directly the native Android Software Development Kit (SDK) provided by Google. An application can completely utilize all available device features, like camera, sensors, accelerometer, contact list, GPS etc, by interacting with platform APIs, without any intermediatery middleware. Development of such apps offer maximum flexibility and control over performance, user interface design, and device capabilities. Feature are also not restricted by compatibility constraints of third plarty plugins with each new update of android platform APIs. Native development is recommended approach for complex applications requiring deep integration with the Android platform and SDK features.
Programming languages of Java or Kotlin are primarily used for native android development, which being completely interoperable, can also be used simultaneously for code of the same app. C/C++ can also be used for development with use of NDK (Native Development Kit), which can hold advantage for certain type of apps, where performance optimization is critical (gaming engines, drivers etc). Use of an IDE (Integrated Development Environment), such as Android Studio fascilitate the development. Due to its robuts features, integration with android platform and community support Android Studio is preferred choice, however it is possible to develop android apps without it too and can be suitable based on specific needs and preferences. Applications are usually downloaded from app stores (Google Play or Amazon AppStore) or from some web URL, directly to the android device, and can be launched without any external tools or browsers.
Hybrid Android DevelopmentHere, an external framework provides plugins and APIs for accessing Android SDK functionalities. Use of such framework fascilitates communication and interaction with the Android SDK. This approach access certain features and functionalities of the Android SDK, while also benefiting from the additional capabilities and conveniences offered by outside web framework.
They are called Hybrid as they take elements both from external framework (web-based or using programming langauges and tools not part of native android SDK) and native app development approach.
Most common types of Hybrid Android development include:- React Native Development: Based on React Javascript library, for cross-platform mobile applications. Uses a component-based architecture, where the user interface is composed of reusable UI components. Renders native UI components specific to each platform (Android and iOS), providing a native look and feel. Greately reduces but not eliminates completely writing of native platform specific code (Java/Kotlin for Android and Swift for iOS).
- Cordova/Ionic Development: Web applications (HTML5, CSS, JS/TS), along with some suitable plugin (Cordova or similar) to access mobile device features, for cross-platform mobile applications. Cordova plugins provide a bridge between the web-based code of mobile application and the native device features or functionalities of the underlying platform (Android and iOS). Custom Cordova plugins can be created to access device features unique to the app's requirements. There is still need for some platform-specific code in Android (Java/Kotlin) and iOS (Swift) to handle certain functionalities or optimizations.
- Xamarin Development: Microsoft platform for cross-platform mobile applications using C# and the .NET framework. The Xamarin compiler converts the C# code into Intermediate Language (IL) and Common Intermediate Language (CIL). For Android, Xamarin uses Just-In-Time (JIT) compilation or ahead-of-time (AOT) compilation to generate platform-specific bytecode.
- Flutter Development: Google's SDK providing cross-platform mobile applications. It attempts to build native-quality Android apps with a single codebase, using the Dart programming language.
- Web Applications: CSS, HTML and JavaScript based, with capabilities limited to mobile web browser. They are generally quick and easy to build but may have limitations when it comes to performance and accessing certain native device features.
The choice of development type (Native or some Hybrid) for a mobile app, for Android or iOS platform, depends on various factors including the type of the app (business, personal etc.). Additionally, the strengths and expertise of the development team and preference for using specific software tools can play a significant role in the decision-making process. It is important to have a solid understanding of the native Android platform SDK and its architecture, regardless of the chosen development approach.
Utilizing third-party tools can offer quick and relatively easy solutions, with possible cross-platform capabilities, however, there can be some limitations in accessing certain features offered by android platform APIs, something to be considered if required by desired application. Later, after android platform updates corresponding to implemented features, some of the apps may require significant code refactoring to keep native and external framework code compatibility.
Before adopting a specific development approach, careful considerations are necessary, as crucial business needs can be impacted by it. It's important to assess the long-term implications, scalability, maintenance, and potential impact with future updates of android platform.
Android platform code is open source in nature and can be customised based on internal business needs. The entire AOSP source code (framework and system apps) is hosted on the Android Git repository: Android AOSP source code. The official Android source code and project related information can be found on the AOSP website: AOSP information. Customizing the Android source code for native builds involve changes at the C/C++ level and may include modifications to system services, hardware drivers, or other low-level components, which requires Linux as Android platform is built on top of Linux Kernel. Any such modifications should be done within Android's open-source licensing terms and ensure compliance with relevant legal and licensing requirements.
Useful Links
Android App Architecture
Android basics with Compose
CodePath Android guide