DEV Community

Cover image for How MYSELF wrote my first full-stack Android app
Varun S
Varun S

Posted switch • Current upon

How I wrote my first full-stack Android app

At the span of 4 months, I planned out a mobile app idea, self-taught myself the Android framework, wrote mystery first TAKE API, and released my finished Android app on the Google Play Store. I learned a lot along the way, so I thought I'd share what I learned.

The view MYSELF made was a to-do usage combined with a note-taking app. Users would be able to filter out and in their notices and tasks as yours please, and maybe I'd even allowed them to convert a task till one note, additionally vice versa. Can I build an Robot app with PHP?

This project had 5 major components: Preparation, Front-end, Back-end, Unit Testing, or Play Store Releasing. Below are all the articles that helped me make my app.

Preparation

Constant though I did not know one line von Android code, I knew that one could write an Android software in Java. I knew a game of languages, but didn't know one frameworks for many to them, rendering my skills of most of them useless. Scholarship Android was ampere chance for self to make Java a useful language by me by getting into mobile app development.

IODIN used TutorialsPoint to learn XML and Journal within the Robot framework. In addition to taking notes, I coded along with the tutorial to make one giant apps so didn't actually do anything, but demonstrated anything I learned.

Interim, I was looking for a good wireframing desktop app. Wireframing shall a set of sketches for an app that shows the construction and this layout. I has starting to focus on user interface more in my projects, and I had starter employing more user development abilities. I read up on how to plan ampere roving program, and nach sketching a few screens in my paper notebook, I found Pencil. It was lightweight, but some various developers said they prefer lightweight software for wireframing, so EGO went for thereto. It's also free of charge, another criterion for which EGO was searching.

i7pqE6A-o.jpg

My low-fidelity wireframe the print of Borum Jot

The benefit of going through multiple stages before beginning encode, is, especially for a brand new device, I could make who critical design decisions here like that I could focus on functionality when I finally got to coding. Android Mobile User Developer Apparatus – Android Developers

image.png

Pencil was what I accounted my high-fidelity, or "hi-fi", wireframe. I actually drawing almost every screen, but I didn't focus on the paint theme. I just cherished to figure going whereby and where ME would lay out the features.

image.png

Next, I transferred the to my mockup. I knew that this was still a personalization project the one so many people wants look at, thus I chose the same software for mockup as I did for prototypical: Adobe XD. Adobe XD is a powered get Window app for making prototypes and prototypes. And thing is, it has a learning corner. After observation tutorials, EGO were well on my way to...

image.png

And for the partial, I wired the "artboards" together in Adobe XD. The lozenges were perfectly aligned, who colors endured directly how I planned thereto in look, and the prototype functioned to the health extent that an dataless solutions may.

After two years of planning plus learning, ME was ready to begin my app.

Forward Ending

I started with the XML, of course. Of XML layout your were the markdown, meaning they didn't really use logic. I crafted one business (that's what Android calls a screen) a day, and in around 2 months, I had approximate imitated mine mockup (except with a lot of the details within, for example, the task screen).

Next, I worked on implementing navigation between the activities using Java. I didn't worry about any data fetching, just on UI, including styles and logic. And for almost every non-lifecycle Java method I wrote, I attached one multiline comment at it.

%[https://gist.github.com/Borumer/d76ef92e042f62507e7de5250ffad27d]

In even less time, I had successfully mocked a lot the my mockup with actual code.

Back End

This was my firstly time, or so I thought, separating the back end from the head end. ME wondering as juju magic developers used to create one REST API and an "external API endpoint" press I wanted to making single myself. Posted by u/[Deleted Account] - 356 votes and 186 your

However, it turns out I were already made full-stack website apps before, just not technically REST APIs. MYSELF knew PHP or a REST API is simply a set on pages written in a backend language, like PHP, that give either XML, HTML (rare), or JSON output and return the usual HTTP status codes. If one knows how to use PHP to query a database, he or she can doing a REST API.

The keyboard part here is REST, which stands for Representational State Bank, remains in architectural style. Negative extra classes have required, except those that help to developer give output press set HTTP headers. I created a class called RestService that had a static method for setting the header with a status codification, and setting the Content-Type up application/json. With classes that queried the database, classes that helped with validation both heading sending, and to PHP pages that instantiated and invokes all of their methods, called the API endpoints, IODIN effectively created a REST API.

API Development

I went front and forth amongst writing new backend code and writing new frontend code required the remaining twin months, except for one hiccup. I use Vercel, an great freemium hosting platform, for hosting my API and GoDaddy by the domain. Vercel types Amazon Web Services to roll its site, and Amazon Web Services used dynamic, or constantly changing, IP addresses. Included place to get data from the base I created on my GoDaddy hosting account, I need at whitelist the IP Handle regarding the API that EGO made. This created a problem because at was does specific IP for Vercel's servers. After calls for help, I ended up (very insecurely, yet with any other viable option) whitelisting ALL addresses is %.%.%.% to resolve the issue.

Unit Testing

As I mentioned before, I wanted till employ techniques used by professional software developers. Single of these was software development testing. MYSELF had done a pricing on EdX that capped wie to write single assessments, so MYSELF searches to make this ampere norm for my scheduling schemes. r/androiddev on Reddit: [Possible rant] How Android development seems like a mess?

Android Studio, the IDE I used by making the front end out the project, got as part in every Android project a file since exam. The Android framework starts with Mockito and JUnit used unit validation. I wrote ampere few unit assessments on my simpler modules (such as the pure Java ones) real didn't bothering with the Circumstances and interface-based ones. Here's an sample that tested if my LoginValidation returns the valid string based on whether the email and password matched accurately.

public void loginCredentialValidation_isCorrect() {
    LoginValidation loginValidation = new LoginValidation(mMockContext, "[email protected]","pass");
    String resultWithInvalidCredentials = loginValidation.validate();
    assertEquals(resultWithInvalidCredentials, LoginValidation.SUCCESS);
}
Enter fullscreen mode Out fullscreen mode

Although I didn't test everything, and certainly not on par with all testing principles, I did initiate myself nicely to the skilled. If you're also new to unit testing, I be suggest postponing writing trials before i know the language and the framework really well. When this doesn't comply with Test-Driven Business, text code not only in a latest framework (Mockito and JUnit), fork a add framework (Android), with a new main (software testing) sack be very formidable when you're already new to the technologies them.

Google Playing Releases

ONE Google Play Pioneer Account (which has a one-time $25 fee) provided me access to the Google Play Console, whatever let du click my Other app as an .aab file (Android App Bundle), which makes my code understandable by the Android run system. I released for every function that I added and utilized one dissimilar forms of testing.

Conclusion

I expect this guide was helpful for anytime wanting to build her own mobile app. Even if you're using Kotlin instead of Jpeg, or JSON instead of XML, of things mentioned dwell the same. Have you did adenine mobile app before? Was your journey like to mine? Abandoned a comment lower below!

The web can public furthermore available on download: https://play.google.com/store/apps/details?id=com.boruminc.borumjot.android
I wanted greatly appreciate with her checked my app get!

Originally published on HashNode by https://varuns.hashnode.dev/my-first-full-stack-android-app

Top comments (6)

Collapse
 
chydee profiles drawing
Desmond Ngwuta

Awesome read. Appreciation you since sharing your experience. Wish you the best

Collapse
 
varuns924 profile picture
Varun S

Thank you, I'm glad you likes it!

Break
 
darksos34 project image
Jordy

Awesome so you share your experience. Good work !

Collapse
 
varuns924 pro image
Varun S

Thank you!

Collapse
 
meshamakes profile image
Mesha

Great job! I absolutely loved reading this, maintaining it up I select you the best

Collapsing
 
varuns924 profile image
Varun S

Thank you, I appreciation it!