Earlier than You Start
This part tells you a number of issues that you must know earlier than you get began, akin to what {hardware} and software program you’ll want, the place to seek out the undertaking recordsdata for this e-book and extra.
Part I: Creating Actual World Apps
On this part, you’ll discover ways to design and implement PetSave for example of an expert, actual world app. You’ll discover ways to select the proper architectural sample and find out how to construction the code to make the app testable and maintainable.
To make your app simpler to vary, it’s a very good apply to outline completely different layers with particular tasks. Specifically, you’ll discover ways to design and implement the area layer for the PerSave app. You’ll additionally see find out how to entry the community effectively, by implementing the repository sample within the knowledge layer.
On the finish of this part, you’ll have a transparent thought about find out how to construction the code of your app.
The Android platform is greater than 10 years previous and the variety of frameworks, libraries and instruments you need to use to develop your app are numerous. This e-book covers the applied sciences and practices that you must comply with in the actual world if you wish to create a profitable Android app.
1
Constructing Android apps is not only a matter of writing code. You additionally want to make use of the very best structure and construction your recordsdata in a method that makes it simple to use modifications. Preserving excessive cohesion and low coupling is simply one of many fundamental ideas you may be taught on this chapter, the place you may begin engaged on the PetSave app.
2
The area layer is a set of entity objects and associated enterprise logic, designed to characterize the enterprise mannequin of any app. Right here, you may be taught what a site layer is and find out how to create a very good one. You may see the variations between entity and worth objects together with some great benefits of utilizing the repository abstraction. Lastly, you may check the area logic of your app.
3
Each helpful app permits customers to entry info that is both saved regionally or fetched from the community. That is what an information layer helps you do. On this chapter, you may be taught what the info layer is and what selections you’ve once you want one. You may be launched to the repository sample and discover ways to implement it from the design to the testing section.
4
Most apps entry knowledge from the community, which introduces completely different sorts of issues, like latency and connectivity prices. To enhance efficiency and cut back prices, it is a good apply to retailer knowledge regionally. Subsequently, that you must implement the repository sample as a cache or easy native retailer. On this chapter, you may discover ways to implement and check the repository sample within the PetSave app utilizing Room and Hilt.
5
PetSave permits customers to seek out animals near them primarily based on sure standards. There are a number of architectural design patterns you need to use to create this function. Right here, you may use MVVM and Unidirectional Knowledge Move to implement the “Animals Close to You” function. You may even have the chance to discover ways to use basic libraries like StateFlow, ViewModel and ViewBinding.
6
PetSave’s fundamental function is to allow you to seek for pets primarily based on sure standards. On this chapter, you may use a top-down strategy to implement the search, from defining the UI to fetching the info.
7
Part II: Modularizing Your App
As you add new options to your app, the code turns into extra complicated and tough to take care of. For that reason, it’s necessary to separate your app into completely different libraries to make your code each maintainable and reusable. This additionally improves the app’s construct time, which is an important metric in your CI.
On this part, you’ll discover ways to break up your app into completely different modules. Specifically, you’ll discover ways to use the dynamic function possibility, which optimizes the dimensions of the code your customers need to obtain to make use of your app.
Modularization is without doubt one of the most difficult issues you face with massive apps. Splitting the app into completely different modules permits you to cut back construct time whereas creating code you possibly can reuse in different apps. On this chapter, you may discover ways to create a function module for PetSave, specializing in the navigation.
8
This chapter covers the elemental ideas of dynamic options. Dynamic options allow you to break up the app into completely different modules to scale back the APK measurement and the obtain time and price.
9
Cell apps, particularly video games and apps with a lot of graphic belongings, usually have giant APKs. Google’s dynamic function possibility permits you to preserve your app glossy by splitting it into elements that customers can load if and after they really want them. On this chapter, you may discover ways to use dynamic options to put in PetSave extra effectively.
10
Part III: Enhancing Your UI
The person interface (UI) is without doubt one of the most necessary points of any actual world app. How your person interacts with the options of your app is what decides if the app is profitable or not.
Whenever you construct your app, you’ve three choices for creating your UI. More often than not you’ll use what the Android SDK supplies. In different circumstances, you customise the prevailing parts. Your third possibility is to create your personal customized parts.
On this part, you’ll discover ways to improve the person interface of your app. You’ll create and customise animation utilizing the brand new Animation Editor, which comes with latest variations of Android Studio. You’ll additionally discover ways to grasp themes and kinds and to create a customized view.
After studying this part, you’ll have a extra interesting app and happier customers.
Animations are important to creating your app each simple and nice to make use of. The Android platform supplies a number of APIs to implement several types of animations. On this chapter, you may discover ways to use each physics-based and Lottie animation.
11
Implementing animation within the Android platform could be tough and time-consuming. It is essential to make use of the proper software. In latest releases of Android Studio, the Movement Editor permits you to implement several types of animations in a easy and declarative method. On this chapter, you may discover ways to use Movement Editor and find out how to combine MotionLayout into your app.
12
The Android platform supplies completely different normal parts you need to use to create the UI in your app. More often than not, they’re sufficient. Generally, as within the PetSave app, you want one thing customized. To create customized UI parts, you employ the customized view, which you may be taught all about on this chapter.
13
Android supplies kinds and themes to customise the feel and appear of the UI parts of any app. They can help you utterly change any facet of the UI of your app in a declarative method by offering a easy XML file. On this chapter, you may see find out how to customise a UI that makes use of normal parts and find out how to use kinds and themes with a customized view.
14
Part IV: Securing Your App
Making your app safer is a facet of growth that’s usually ignored, however, on the similar time, is completely important. Think about what would occur if any individual would hack your code, stealing necessary knowledge and even the usernames and passwords of your customers. That will be a catastrophe.
On this chapter, you’ll discover ways to deal with safety from completely different factors of view. You’ll discover ways to defend person knowledge and find out how to securely connect with a server. Lastly, you’ll discover ways to make hackers’ lives tougher, by utilizing completely different strategies to guard your code and your knowledge.
On this chapter, you may be taught greatest practices for securing an Android app. You may see find out how to cope with permissions and find out how to forestall the most typical safety dangers.
15
Accessing knowledge from native storage has safety implications, so Android supplies completely different APIs and instruments to keep away from undesirable entry to your knowledge. Right here, you may discover ways to make your app safer by encrypting and decrypting knowledge and by utilizing biometrics to implement the person login.
16
On this chapter, you’ll be taught to safe the community connections of your app by utilizing HTTPS for community calls, trusting a reference to certificates pinning and verifying the integrity of transmitted knowledge.
17
Any cellular app could be susceptible to several types of assaults from hackers. It is common to examine hackers breaking apps and stealing necessary info. Due to this, avoiding code vulnerability and validating the enter from the person are essential subjects. On this chapter, you may discover ways to use among the most necessary strategies to make your app tough to hack.
18
Part V: Sustaining Your App
Whenever you’re creating your actual world app, you may assume that publishing is your finish aim. However actually, your work isn’t over simply since you’ve launched your app. You continue to want to grasp in case your app is working correctly and what issues your customers are experiencing.
On this part, you’ll be taught every part that you must find out about sustaining and controlling your app after it’s revealed and accessible to customers. Specifically, you’ll discover ways to use Firebase for logging crashes, find out how to allow or disable sure options and find out how to use A/B checks to grasp what answer is the very best in your customers.
Lastly, you’ll see find out how to optimize your app’s measurement and find out how to use Android Studio as a profiling software.
After studying this part, you’ll be prepared to make use of all of the accessible instruments for bettering your app’s high quality.
Firebase is a robust software to handle necessary points of your app. Right here, you may see find out how to use Crashlytics to observe crashes and errors. Then, you may see find out how to use Distant Config to regulate your app remotely. Lastly, you may discover ways to use Take a look at Lab to check your app on a variety of units.
19
Whenever you construct an app, it is not sufficient to implement its options and run checks. You additionally must spend time bettering your app’s high quality via optimization. For instance, decreasing the APK’s measurement is necessary to assist previous units and customers with gradual web connections. On this chapter, you may discover ways to optimize your app earlier than launch.
20
Whenever you implement an app or attempt to repair a bug, you want some instruments to examine what’s occurring. For instance, you expertise a crash and do not know why, otherwise you obtain invalid info from the community and must examine the info. This chapter comprises every part that you must find out about debugging, from reminiscence to community, from battery utilization to the definition of the UI and far more.
21
Generally, your app has issues and you do not know why. To resolve the issue, that you must do some deep investigation, not simply into your code but in addition into code you imported from third-party libraries. In different circumstances, the issue is not the code, however a corrupted file or database. On this chapter, you may discover ways to study the bytecode of your app and the recordsdata it makes use of to seek out bugs and safety issues.
22