Core Components and Native Components

Ashera Native is an open source framework for building Android, iOS applications, swt and browser using Apache Cordova and the app platform’s native capabilities. With Ashera, you use Android Studio (Android XML files) to describe the appearance and TypeScript to describe the behavior of your UI like event handlers. You can learn more about Ashera in the next section. But first, let’s cover how components work in Ashera Native.

Views and mobile development

In Android and iOS development, a view is the basic building block of UI: a small rectangular element on the screen which can be used to display text, images, or respond to user input. Even the smallest visual elements of an app, like a line of text or a button, are kinds of views. Some kinds of views can contain other views. It’s views all the way down!
Diagram of Android and iOS app showing them both built on top of atomic elements called views.

Native Components (Android first)

In Android, you write views using xml files backed by java / kotlin files for event and lifecycle handling; in iOS development, you use Swift or Objective-C ; In swt, you use java ; In browser, you use html. With Ashera Native, you write views using xml files backed by typescript files for event and lifecycle handling. Because Native components are backed by the same views as Android, iOS, swt and browser, Ashera Native apps look, feel, and perform like any other apps. We call these platform-backed components Native Components.

Ashera Native comes with a set of essential, ready-to-use Native Components you can use to start building your app today. These are Ashera Native's Core Components.

Ashera Native also lets you build your own Native Components to suit your app’s unique needs. Components built with Ashera are android first. This means that you first find the android widget and then create alaises to these widgets in other platforms.

Fragment which is basic building block of android has been simulated in other platforms. Version 1.0.0 of Ashera does not support nested fragments and future releases will support nested fragments.

Core Components

Ashera Native has many Core Components for everything from controls to activity indicators. You can find them all documented in the API section. You will mostly work with the following Core Components:

ANDROID VIEW IOS VIEW WEB ANALOG SWT ANALOG DESCRIPTION
View, FrameLayout, LinearLayout etc <ASUIView> A non-scrolling <div> <Composite> Containers that supports layout.
TextView <ASUILabel>, <ASUITextView> <label> <Label><StyledText> Displays text and rich text support based on widget.
ImageView <ASUIImageView> <label> <Label><StyledText> Displays png, jpg images.
ScrollView <ASUIScrollView> <div> <ScrolledComposite> A generic scrolling container that can contain multiple components and views.
EditText <ASUITextField> <input type="text"> <Text><StyledText> Allows the user to enter text.

In the next section, you will start combining these Core Components to learn about how Ashera works. Have a play with them here now!