Exploring Flutter: Building an Andorid Application

Android Development Flutter Hive Simple Recipe Manager

During my job search, I have been keeping myself busy with consulting and continual education—I can't sit with idle hands. I've been taking courses on AI and Cloud Computing, and consulting with various companies on their products, solutions, and approaches—I love to network. As I continue my search, I wanted to get hands-on with some development and decided to focus on mobile first. I have never developed a mobile application, so this was new territory for me.

The first thing I had to determine was what I was going to develop and what I would develop it in.

I started with a simple pet project, an idea I have had for many years—a simple solution to a common problem (one that I am sure has already been solved to some capacity, but I'm not looking to pay $9.99 a month for the solution). I decided to create an app to store all my favorite recipes, a solution that would allow me to filter my entire database of local recipes on a variety of parameters so I can pick and choose a recipe based on the ingredients I have on hand.

With an idea in hand, the next step was to choose the framework to develop in. Having managed a software development company through the creation of web, desktop, and mobile applications, I knew that I wanted to choose a framework that would allow me to deploy the solution on a variety of platforms.

There are certainly a few options in this space: React, MAUI, and Flutter, to name a few. In the end, I went with Flutter. My research found many tutorials and guides on developing with Flutter. Its primary language is Dart, which was fairly simple (with similarities to JavaScript and C#). With the development language set for the front end, I had to make some decisions about the backend. Again, I wanted to make my solution local initially and support a variety of platforms. My search led me to Hive. Hive is a NoSQL DB that was simple to use and supported cross-platform development.

The last decision to make was which IDE to use—this was a simple enough decision for me. Although there are a variety of options, I went with VS Code. Visual Studio Code supports a bunch of languages through a variety of plugins, and it's free to use (my favorite kind of software).

1717155534286-magic-camera

Where to start?

I needed to set up Flutter in my development environment. You can follow the official documentation on flutter.dev to install Flutter and set up your preferred IDE (Integrated Development Environment), whether it's Android Studio, VS Code, or another editor. Once Flutter was set up, it was time to dive into the basics. The initial MVP for the app was to allow users to create, view, edit, and delete recipes. I started by creating simple forms to enter data: recipe name, description, ingredients, directions... As it evolved (and your ideas would too), I added more parameters such as allergens, tags, rating, serving size, etc.

Storing the data

Now that I had forms filling data, the next step was to define models for the Hive DB. I created a model for the recipe and one for the ingredients (as ingredients were an array within recipes and I ultimately wanted to search based on ingredients, so I decided to separate them out). While continuing to build the app and creating the model, I also added the addition of a grocery list so users could add ingredients to a shopping list or enter them manually.

The Minimum Viable Product

After only a few weeks of development, I had successfully created a working Android application. It should be noted—while I would debug with an Android emulator, I also did the majority of my debugging and testing using Chrome. Due to Flutter being a cross-platform development solution, I was able to fire up my app in a web browser and test everything with ease. Ultimately, there were items that required testing within an Android phone or emulator, but the majority could be accomplished via the web (and it loaded much faster than the Android emulator).

So what had I created in this time?

Simple Recipe Manager

Recipe Manager: Users can create new recipes by providing details such as name, description, preparation time, cooking time, serving size, directions, and ingredients.

Ingredient Tracking: The app allows users to add, edit, and delete ingredients for each recipe. Ingredients can be categorized by name, quantity, and unit.

Search and Filter: Users can search for specific recipes by name or filter recipes based on various criteria such as preparation time, cooking time, or serving size.

Offline Access: Thanks to the local Hive database, users can access their recipes offline without an internet connection.

Customization: The app provides options for users to customize their recipes, such as adding images or tags for easy organization and retrieval.

Grocery List: Users can add ingredients to the grocery list from recipes or manually add individual items.

Sharing: Simple sharing of recipes and grocery lists was implemented via email.

Taking it to production!

After building the app and finding it useful personally, I decided I would attempt to get it into the app store. This is a little trickier than it sounds. As of November 2023, your app must be installed on at least 20 devices for an uninterrupted period of 20 days before Google will take your submission to the Play Store seriously.

I used Reddit groups and friends to assist me in my endeavor, and ultimately got my app out into the wild!

https://play.google.com/store/apps/details?id=com.highlandware.recipease3

What's next

Having gotten a taste for my little side project, I started planning my next steps:

Online Community: The ability to share recipes with other users of the app, download recipes locally, and sync local data to the cloud for backup.

Final thoughts...

Building a recipe app with Flutter and Hive is an excellent way to learn app development while creating something practical and useful. Throughout the process, I gained valuable experience in UI design, state management, database integration, and more.

Flutter has a plethora of packages to simplify processes such as image selection, cropping, compression, and string similarity comparison mechanisms, which will make your journey easier. You can find these packages on pub.dev.

As a new mobile application developer, ChatGPT was invaluable to me. Leverage it to get quick answers, troubleshoot issues, and learn new concepts efficiently!

Previous Post Next Post