In the last tutorial you learned how to build a basic Android App using Android Studio. Once you have created the App how can you test it ? Or how can you run it ?
For this we use the Emulator which comes with Android SDK. It simulates a real world Android Device. Alternatively if you have an Android device like a smartphone then you can run the app on that as well. It’s fairly easy.
Let’s look at how to use the Emulator. Please refer to the below video to understand the steps needed.
To get started you will have to setup Android Virtual Device in the Android Studio. For this open the Android Virtual Device Manager from Android Studio. You can setup multiple Virtual Devices and use any of them to run the App as long as it’s compatible.
In the next tutorial we will see what happens behind the scene when you run the App.
In the earlier tutorial we created an Android App Project using the Android Studio. In this video tutorial we look at the key files which are part of the Android Project.
We look at the Activity file, the layout file and also talk about the role of Gradle which helps build and deploy the App.
Activities We use Activity to define what the App does. Like when we click on a button what needs to happen can be defined using an Activity. It’s a class written in Kotlin.
Layouts To define how a screen in your App will look like we use an XML file. A screen can have various elements like images, text etc.
We use Layouts to define the UI and Activities to define the behaviour. Similar to what we do with websites – HTML, CSS and Javascript.
Like if you need to add a button then we use Layout to specify its position on screen and Activity to add functionality.
We bundle all these files together and that’s what an App is.
What happens when you start an App ?
Sequence of events when you start an Android App
When you start an Android App the main activity is called.
This tells Android to use a particular Layout.
The layout is displayed on the device.
The user interacts with the layout.
The activity responds to these interactions, and updates the display.
Why Kotlin ? It’s preferred because of additional features and it’s concise nature.
Why Android Studio ? It includes a set of code editors, UI tools and templates, which are all designed to make development easier and faster. It also comes with Android SDK which is needed to develop Apps. It includes Android source code and also a compiler to compile the code you write to Android format.
Select a project template – Choose the Empty Activity option.
Configure the project – Specify the app name, package name and save location. Be careful with the version you select. We will discuss more on this in future blog, but you need to consider which versions of Android you want the app to be compatible with. If you specify that the app is only compatible with the very latest version of the SDK, you might find that it can’t be run on many devices.
That is it, your first app is ready. Congratulations !!
When your App is built to run on Android devices only. The advantages of building a Native app includes high performance, access to native APIs and features and better user experience. The disadvantages may include longer development time, higher development costs and platform-specific development.
What Tools and Technologies can be used to build a Native Android App ?
For native Android development, you can use the following tools and technologies
Java or Kotlin programming languages – Both Java and Kotlin are popular programming languages for Android development. While Java has been the traditional language for Android development, Kotlin is gaining popularity due to its concise syntax and modern features.
Android Studio – Android Studio is the official Integrated Development Environment (IDE) for Android app development. It comes with a set of tools and features that simplify the development process and speed up app development.
Android SDK – The Android SDK is a collection of software development tools and libraries required for building Android apps. It includes tools for developing, debugging, and testing Android apps.
Android Jetpack – Android Jetpack is a set of libraries and tools that help developers build high-quality apps faster. It includes components for handling UI, background processing, navigation, and more.
Firebase – Firebase is a mobile and web application development platform that provides a range of features and services to simplify the app development process, such as real-time databases, push notifications, authentication, and analytics.
Third-party libraries – There are various third-party libraries and tools available for Android development that can help you add functionality to your app or speed up development. Some popular ones include Retrofit for network communication, Glide for image loading and caching, and Dagger for dependency injection.
These are some of the most commonly used tools and technologies for native Android development. You can use them to create high-quality and feature-rich Android apps.
Steps to create a Native Android App
Let’s look at the steps to create a simple Native Android App
Set up your development environment: To develop native Android apps, you’ll need to download and install Android Studio, which is the official IDE for Android development. Android Studio comes with the Android SDK and all the necessary tools you need to build and test your app.
Create a new Android project: After setting up your development environment, create a new Android project in Android Studio. This will generate a default app structure with a basic user interface.
Design the user interface: Android Studio comes with a visual layout editor that allows you to drag and drop UI elements onto the screen and customize their properties. Use this editor to create the user interface for your app, and add functionality to the UI elements by writing code in Java or Kotlin.
Write your app logic: Once you’ve designed the user interface, write the code that handles user interactions and performs the necessary tasks to make your app work. This might include retrieving data from a database or web service, processing user input, or manipulating media files.
Test your app: After you’ve finished writing your app, test it on a physical Android device or an emulator to ensure that it works as expected. Android Studio comes with a built-in emulator that allows you to test your app on various Android versions and device configurations.
Publish your app: Once you’ve tested your app and made any necessary changes, you can publish it on the Google Play Store, which is the official app store for Android. To publish your app, you’ll need to create a developer account, submit your app for review, and follow Google’s guidelines for app publishing.
There are various tech stacks you can use to build an Android App. The choice depends on the requirements, skills and preferences.
Here are some popular options
Native Android Development This approach uses Java or Kotlin programming languages, Android Studio, and the Android SDK to create high-performance, feature-rich, and user-friendly apps for Android devices. This is the recommended approach for building complex and feature-rich apps that require optimal performance and integration with the platform.
Hybrid App Development This approach uses web technologies such as HTML, CSS, and JavaScript to create cross-platform apps that can run on multiple platforms, including Android. Popular hybrid app development frameworks include React Native, Ionic, and Xamarin.
Progressive Web Apps (PWA) PWAs use web technologies to create app-like experiences that can run on any device with a web browser, including Android devices. PWAs offer benefits such as offline capabilities, push notifications, and access to device features like camera and microphone.
As you can see, the best tech stack for your Android app depends on the specific requirements of your project.
You should consider factors such as development time, performance, scalability, maintainability, and user experience when making your decision.
In the next article we dive more into “Native Android Development” tech stack.
Introduction BlitzJS is a full stack framework. In simple terms it’s NextJS with additional features to make a developers life easy.
Quick Recap of NextJS (a Full Stack framework)
Server side rendering feature – good for SEO.
Page based Routing
Lets you create backend API’s.
Why Blitz then?
But when you create a new NextJS app it’s totally bare-bones. You need to spend time adding basic stuff like eslint, prettier etc.
This is where Blitzjs shines. It makes building a web application fun and easy.
Key features
No APIs needed You can import server side code to frontend directly, no API’s needed. Blitz does all the hard work for you. Alternatively you can continue using REST or GraphQL API’s to fetch data.
Authentication When you create a new application with Blitz you get Authentication feature out of the box. Features like Login, Signup and Forgot Password. This can save you lot of time as setting up authentication is not only time consuming but also tricky.
Code Scaffolding The initial code is scaffolded for you but doesnt limit you. This can save you tons of time. That said you are free to change it the way you like. To add additional modules there are recipes. Like if you want to add tailwind or material-ui it’s just one command away.
In the next article I will share steps to create a simple application using Blitzjs.
In this video tutorial you will understand the basics of CAP theorem in simple terms. A simple explanation has been provided with a couple of examples.
CAP theorem is used to make tradeoffs between consistency and availability in distributed systems.
A common trait that can be seen in successful people like Bill Gates, Elon Musk and Warren Buffett is their love for reading. They grew up reading heavily and still continue to do that. Be it reading fiction, biographies and what not.
In an interview when Warren Buffett was asked how he keeps up to date with so much information coming his way he shared his love for reading. He said he spends 5 to 6 hours everyday just reading books.
Back in 2005 Mark Zuckerberg took a “Computer Science” lecture at Harvard.
He started by talking about some of the strategies that Facebook used to improve its performance, one of them being caching.
After talking for a while he asked the audience for any questions. To his surprise there weren’t any technical questions as such. Well anyone will be surprised I guess. After answering a few questions he finally commented “No CS Questions”.