NATIVE APP DEVELOPMENT
USING JAVA
UNIT-II
Native App
Native App: A native app is built specifically
for a particular platform (e.g., Android, iOS,
Windows) using the platform's native
programming language (Java/Kotlin for
Android, Swift/Objective-C for iOS). It's
installed directly on a user's device and has
full. access to the device's capabilities
Web App
Web App: A web app, on the other hand, is
accessed through a web browser and built
using web technologies like HTML, CSS, and
JavaScript.
Native Web App
A native web app refers to a web application
that is built using web technologies (HTML,
CSS, and JavaScript)
Benefits of Native App
Performance
User Experience
Access to Device Features
Offline Functionality
App Store Distribution
Security
Better Integration
Performance Analytics
Drawbacks of Native App
Higher development costs
Longer development timelines
Scenarios to create Native App
Performance-Critical Applications
Utilizing Device Features
Offline Functionality
Platform-Specific User Experience:
App Store Distribution
Security and Data Protection
Complex Business Applications
High Interactivity and Rich User Interface
Tools for creating Native App
Android Studio (Java/Kotlin)
Xcode (Swift/Objective-C):
React Native:
Flutter
Xamarin
Ionic
Native Script
App celerator
Cons of Native App
Development Cost and Time
Platform Dependence
App Store Approval Process
Skill Set Requirements
Updates and Maintenance
Distribution Limitations
Fragmentation
User Adoption Barrier
Cross-Platform Challenges
Popular Native App Development Frameworks
React Native
Flutter
Xamarin
Native Script
Kotlin Multi plat form Mobile (KMM):
Ionic
Appcelerator Titanium
Phone Gap/Cordova
Swift UI
Java & Kotlin for Android
Java and Kotlin are popular programming
languages used for Android app
development.
Java: Java has been the traditional and
official programming language for Android
app development for many years
Kotlin: Kotlin, introduced by JetBrains, is a
modern and officially supported programming
language for Android development.
Swift & Objective-C for iOS
Swift and Objective-C are the primary
programming languages used for iOS app
development.
Objective-C: Objective-C was the original
programming language used for iOS app
development.
Swift: Swift is a modern and powerful
programming language introduced by Apple in
2014. It
Basics of React Native
React Native is a popular open-source framework for
building cross-platform mobile apps. It allows developers
to use the same codebase written in JavaScript and
React to create native apps for both iOS and Android
platforms.
The basics of react native
JavaScript and React:
Components:
Cross-Platform:
Native Modules:
Styling:
Community and Libraries:
Performance:
JavaScript and React: React Native apps are built using JavaScript,
a widely used programming language for web development.
Components: In React Native, the user interface is composed of
reusable components. Components are small, self-contained
building blocks that encapsulate UI elements and logic.
Cross-Platform: One of the key advantages of React Native is its
ability to develop cross- platform apps.
Native Modules: Although the majority of the app is written in
JavaScript, In such cases, React Native allows developers to write
native modules in Swift, Objective-C, Java, or Kotlin and expose
them to the JavaScript layer.
Styling: React Native uses a style system similar to CSS for styling
components.
Community and Libraries: React Native has a vibrant and active
community
Performance: While React Native provides a near-native
experience, it might not achieve the same level of
performance as fully native apps, especially for complex and
graphics- intensive applications.
Native Components
Native components in the context of React
Native refer to UI elements that are
rendered using native platform-specific
views. These components allow
developers to build user interfaces that
look and feel like native apps on iOS and
Android. React Native bridges JavaScript
code with the native platform's components
to provide a seamless and performant user
experience.
Some examples of native components in React Native include:
View: The <View> component is similar to a <div> in
web development. It is a container used to group and
layout other components and does not render any
visual output itself.
Text: The <Text> component is used for displaying
text content. It renders text in a platform-specific
manner, taking into account the platform's fonts and
text rendering features.
Image: The <Image> component is used for
displaying images. It loads and displays images
efficiently using the native platform's image handling
capabilities.
○ ScrollView: The <ScrollView> component provides a
scrollable view, enabling users to scroll through a list or
content that exceeds the screen's height.
○ TextInput: The <TextInput> component is used for
capturing user input. It provides a native input field where
users can enter text.
○ Button: The <Button> component is used for creating
buttons that trigger actions when pressed. It is styled as a
platform-specific button.
○ StatusBar: The <StatusBar> component allows developers
to customize the status bar (the area displaying time,
battery, and other indicators) on the device's screen.
○ Touchable Components: React Native provides various
touchable components like
<TouchableOpacity>, <TouchableHighlight>,and
<TouchableWithoutFeedback>,
allowing developers to add touch interaction to elements.