Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Lightning-Fast Mobile App Development with Galio
Lightning-Fast Mobile App Development with Galio

Lightning-Fast Mobile App Development with Galio: Build stylish cross-platform mobile apps with Galio and React Native

Arrow left icon
Profile Icon Gheorghe
Arrow right icon
€15.99 €23.99
eBook Nov 2021 272 pages 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Gheorghe
Arrow right icon
€15.99 €23.99
eBook Nov 2021 272 pages 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Lightning-Fast Mobile App Development with Galio

Chapter 2: Basics of React Native

We started by learning about why React Native and Galio form the best combination for us to start building our first cross-platform mobile application. After setting up our environment and configuring the necessary files, we created our first React Native project with Expo and we learned about the different ways we can test the app both physically and digitally.

I believe that learning about the whys before the hows helps build a better, more robust knowledge base. Having passed through the whys, it is now time to learn about how React Native works and how to use it to create our apps.

That is why we'll start this chapter by going through the file structure of our React Native project for us to understand how these files and folders are connected. We'll then go through the App.js file and explain how this works for us as the main entry point into our application.

Once we've learned about the file structure, it is time for us to learn about what JSX is and how to use it – the skeleton of any React application. We'll be comparing JSX to HTML a lot, so you'll have to know a bit of HTML beforehand. Rest easy if you don't know much about web development – we'll lay down some HTML concepts as well, but learning a bit about it on your own may help you a lot in the long run. Understanding the concept of JSX is where we'll deal with the concept of components, a concept we barely touched on in the first chapter. This should be completely understood by the end of this chapter.

Once we've understood the main concepts of JSX and how it is connected to React and React Native, we'll do our first component import. We'll learn what npm/yarn is and how to use it for importing and uploading components or libraries on the web. This is exciting as you'll see the importance of having a huge community backing a framework and how you can participate and make new friends.

It is now time to learn about the core components of React Native. We'll understand how and in which contexts they're useful while we discuss different ways of improving them or even changing them completely. The core components are the base components for all the components we'll find online. That means that almost every component inherits from the core ones, which makes them important to learn about and understand.

By the end of this chapter, you'll have learned how to build a component. You'll have also learned how to use it in our app or future apps and how to organize the files so that you'll never get lost searching for your components.

I believe that by the end of this chapter, you will be able to start building really simple apps that can serve as a stepping stone for building bigger, more complex projects. Understanding these concepts doesn't stop at reading this book – it goes further than that, and you'll see me always encouraging you to check out the official documentation of whatever project/framework we're using as the documentation should always be something a programmer should feel comfortable reading. Learning to read the documentation is a skill you'll develop in time by reading and being as interested as possible in the project you're passionate about.

This chapter will cover the following topics:

  • Using App.js – the main entry point
  • Understanding the concept of JSX
  • Importing your first component
  • Core components
  • Understanding and creating a component

Technical requirements

You can check out this chapter's code by going to GitHub at https://github.com/PacktPublishing/Lightning-Fast-Mobile-App-Development-with-Galio. You'll find a folder called Chapter 02 that contains all the code we've written inside this chapter. To use that project, please follow the instructions in the README.md file.

Using App.js – the main entry point

As we know, React Native is an open source framework used for building iOS and Android applications. It uses React to describe the UI while accessing the platform's capabilities through the methods we have at our disposal.

Understanding our folder structure is important because we're not supposed to touch some of the files– at least at the beginning of our development. Let's take a look at our newly created project's structure.

Tip

Don't forget that you can use any text editor you want to; I'm only using VSCode because I like the way it looks and it has lots of plugins that I use, but that doesn't mean you can't open up the project with whatever text editor you feel comfortable with. Of course, that'll mean you won't be able to use the code. command as that's only used for VSCode.

First, let's open our Terminal and navigate to our folder. Now, if we write code. once we get to the folder, it will open Visual Studio Code.

Once our text editor has opened, we will see the following output in the project directory:

Figure 2.1 – Project directory once you open the text editor

Figure 2.1 – Project directory once you open the text editor

As we can see, there are several folders and files here and they're all meant to help bundle the project once you finish your app. We'll look at each of these folders in the next few sections.

The .expo and .expo-shared folders

We'll start with the folders with a dot in front of them: .expo and .expo-shared. The dot is there to show a hidden file. That's a file you can't see directly while opening the file browser; you can only see it if you specifically choose to see it. Such files are hidden because you don't need to touch them. They're config files that are created when you first use the expo start command.

The assets folder

The next folder is the assets folder. Inside, you'll find several .png images, which are used by Expo for the splash screen – the screen that appears while the app is loading – and icons for the app to use when it's installed on a device.

The node_modules folder

Now, you'll see a folder called node_modules. If you open that folder, you'll be able to see lots and lots of folders. All these folders are packages and dependencies that we're using to make this app work. Everything that you're installing or bringing in from over the internet is going to go straight into this folder. This folder is going to get bigger and bigger, depending on how many external packages you'll be using for your app.

Once we get past these folders, we've got some files with some interesting features.

The files within

First, we can see .gitignore, which helps us save size when uploading on GitHub. If you open the file, you'll see there's already some text written in it. Everything you see in there will be ignored once you upload your project on GitHub. You'll find that .expo is there because those folders are only relevant for the programmer and they're not intended for sharing. You can edit this file by using any filename you don't want to move over to online or you don't intend on changing.

Important Note

GitHub is a platform that acts like an internet hosting company for open source software programs while also providing the programmer with version control using Git. Developers are using Git to track changes in their projects and coordinating with their teammates.

For now, we'll ignore App.js because we'll explain this file at the end of this section. So, let's go directly to the app.json file. This file acts like a config file for your app – basically, everything that's not code-related will be found there. Let's say, for example, we want to change the image of our splash screen. We don't have any way of doing that besides going into this file and editing the splash image's path. From here, you can change almost everything related to your application, such as the icon or its orientation. You'll see yourself going there quite a lot, configuring your app for the final release version.

We don't care about babel.config.js but I'm pretty sure you'd be curious about that one as well. Babel is a JavaScript compiler almost everyone is using to get access to the latest standards of JavaScript. It's not necessary to edit this file but if you want to learn more about compilers, I recommend searching for more information about Babel.

The last two files are package-lock.json and package.json. The first one always gets created when you're using npm to install dependencies in your project. I've already told you that we'll learn about npm in this chapter, but not right now. Right now, I want you to become familiar with all the files in the project directory. By creating your app via the command line, Expo automatically used npm to bring lots of files you'd use in your project over the internet. Those files are stored in the node_modules folder. You can find out more about all the direct dependencies that you're using in package.json.

Now that we've finally got to the end of all the files, we should start talking about App.js. So, let's open that file and take a look at it.

The App.js file

Upon opening the App.js file, you will see the following:

Figure 2.2 – Code in the App.js file

Figure 2.2 – Code in the App.js file

You can immediately see the Open up App.js to start working on your app! text. I'm pretty sure you remember but in the previous chapter, when we tested our app, this was the text that appeared on the center of the screen. This means that by changing the text, we should also see a change in our app.

We won't do that right now as our focus is understanding the files and code, and then changing it to our liking.

I'm pretty sure you connected the dots after seeing this file and realized that this is the entry point of our app. An entry point is the main file that connects all the files and starts the application. Our main function for using Expo is the App() function. Your entire application will be living inside that function.

The reason you saw the centered text when you opened the app was because the text is inside the App() function. Here, we'll start building our app. For that to happen, we must understand what JSX is and how to use it inside our app. I'm assuming you can already read a bit of JavaScript and you understand notions such as functions and objects; we won't be covering this topic in this book. We'll get to grips with JSX in the next section.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand Galio and quickly build cross-platform mobile apps
  • Discover how to put Galio into practice by implementing it in real-world scenarios
  • Build beautiful apps using Galio by taking advantage of its carefully crafted components

Description

Galio is a free open source React Native framework that enables beginner-level programmers to quickly build cross-platform mobile apps by leveraging its beautifully designed ready-made components. This book helps you to learn about React Native app development while building impressive out-of-the-box apps with Galio. Lightning Fast Mobile App Development with Galio takes a hands-on approach to implementation and associated methodologies that will have you up and running and productive in no time. Complete with step-by-step explanations of essential concepts, practical examples, and self-assessment questions, you will begin by exploring the basics of React Native and understanding how Galio works. As you make progress, you'll learn how to initialize and configure a React Native app and get to grips with the basics of React Native development. You'll also discover how packages work and how to install Galio as the main dependency, along with understanding how and why Galio helps you to develop apps with ease. Finally, you'll build three practical and exciting apps using React Native and Galio. By the end of this app development book, you'll have learned how to use Galio to quickly create layouts and set up React Native projects for your personal ideas.

Who is this book for?

This book is for developers who are looking to learn new skills or build personal mobile apps. Anyone trying to change their job as well as beginners and intermediate web developers will also find this book useful. A basic understanding of CSS, HTML, and JavaScript is needed to get the most out of this book.

What you will learn

  • Explore Galio and learn how to build beautiful and functional apps
  • Familiarize yourself with the Galio ecosystem
  • Discover how to use npm and understand why Galio is needed
  • Get to grips with the basics of constructing a basic but attractive UI for an app
  • Find out how you can utilize Galio s ready-made components
  • Use Galio to drive the process of quickly building cross-platform mobile apps
  • Build three practical and exciting apps with React Native and Galio

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 02, 2021
Length: 272 pages
Edition : 1st
Language : English
ISBN-13 : 9781801076043
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Nov 02, 2021
Length: 272 pages
Edition : 1st
Language : English
ISBN-13 : 9781801076043
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 134.97
Modern DevOps Practices
€41.99
Lightning-Fast Mobile App Development with Galio
€29.99
React and React Native
€62.99
Total 134.97 Stars icon

Table of Contents

13 Chapters
Chapter 1:Introduction to React Native and Galio Chevron down icon Chevron up icon
Chapter 2: Basics of React Native Chevron down icon Chevron up icon
Chapter 3: The Correct Mindset Chevron down icon Chevron up icon
Chapter 4: Your First Cross-Platform App Chevron down icon Chevron up icon
Chapter 5: Why Galio? Chevron down icon Chevron up icon
Chapter 6: The Basics of Mobile UI Building Chevron down icon Chevron up icon
Chapter 7: Exploring the State of Our App Chevron down icon Chevron up icon
Chapter 8: Creating Your Own Custom Components Chevron down icon Chevron up icon
Chapter 9: Debugging and Reaching out for Help Chevron down icon Chevron up icon
Chapter 10: Building an Onboarding Screen Chevron down icon Chevron up icon
Chapter 11: Let's Build – Stopwatch App Chevron down icon Chevron up icon
Chapter 12: Where To Go from Here? Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.