Learn Something New

For requests or suggestions, send an email to learnsomethingnew@yahoo.com.

First Time – Building An Android App

Mid-2018, I was fortunate to be admitted to take a graduate diploma course in Computer Science at the University of the Philippines – Open University. One of my first subjects was Principles in Programming (CMSC 202), with a focus on JavaScript, and required a little HTML and CSS.

Until that time, all I practically knew about HTML was marquee, which I probably never should have learned, so I was quite surprised when our lecturer required us to submit an Android App for the Midterms. I knew we would have to do it some time in the course, but never imagined it to be about one month in. And although I did end up having many sleepless nights, the experience was surprisingly quite easy.

Don’t get me wrong, it was very challenging, especially for someone who in the immediate past only knew how to make text go back and forth a browser. It’s just that building an actual installable and working Android app turned out to be a lot easier than I had imagined.

Below is a screenshot from the User Manual we were required to submit along with the app for the Finals.

Hugo Finals Manual Capture

For our Finals, we had been required to build an app with six functions (four from the midterms plus two additional):

  1. Show Battery Status
  2. Geolocation
  3. Vibrate Phone
  4. Take Photo
  5. Send SMS
  6. Push Notification

I’ll save the details of the actual coding on separate posts, but allow me to give a high level of what I used to achieve this. Keep in mind that I was a beginner so my methods might not have been the most efficient, but they’re enough for me to get top marks in my class.

  • Up to the time we’ve been required to do the app, I’ve been following our main reference which was Eloquent JavaScript by Marijn Haverbeke. It’s a good starting point for JavaScript even for newbies like myself.
  • I combed through w3schools for HTML and CSS tips and tricks (at least for the parts I needed), including a Modal Window which I used for my SMS.
  • I used Cordova as initially instructed. I initialized the basic structure using the Cordova Command Line Interface (CLI) and then modified config.xml, index.html, and index.js to fit our requirement.
  • For my coding (i.e. actually typing/modifying the codes), I used Notepad++.
  • I created buttons for each of the required functions. Since I was a beginner, I was afraid of messing up a completed code, so my style was to create separate .JS files for each of my buttons.
  • For all of the functions, I installed Cordova Plugins, mostly using the CLI.

Cordova CLI Add Plugin

  • For Push Notification, I used OneSignal as instructed. This was actually a very interesting discovery and quite straightforward, following the instructions for Cordova and PhoneGap.
  • Once I’m done coding, I packaged all my files and uploaded them to PhoneGap Build, which is a cloud service for creating the APK. It just needed to load for a few minutes, and I’m done. The result is a downloadable APK which I then installed on my device.

That’s it! But that’s not really it. I was having problems testing remotely, so I resorted to building the app, testing it, then recoding and repackaging it iteratively until I finally got it completely working.

It was really quite a learning experience, and I look forward to knowing more language, and probably learning a more structured approach than what I did. My intention with this entry is not to pretend that I’m an expert, but to show that it’s possible and that there’s a way to learn it. (And for me to debrief what I just learned so that I don’t forget.)

In addition to the app and manual, we were also requested by our instructor to share our self-reflection on what we learned. Let me share a portion of it to close this entry.

More than the technical knowledge, it was important that I learned how to learn further, beyond the proverbial confines of our virtual classroom. The four phases I mentioned were not straightforward. In addition to Eloquent JavaScript, I spent hours going through various sources like w3schools and Stack Overflow, reading plugin and API documentations, and testing my app over and over. Outside the class, I plan to improve my craft by working through the resources and tutorials I’ve encountered along the way.



German Word of the Day : (Die) Hochzeit

Today my wife and I are celebrating our second wedding anniversary. I am truly blessed to have her in my life (plus our little baby angel who is now a little over 3 months old).

My word for the day is the German noun Hochzeit which means wedding. It is a feminine noun, the plural of which is Hochzeiten.

Here are some phrases from german.about.com used for congratulating people on wedding-related events:

  • Herzlichen Glückwunsch zu eurem zweiter Hochzeitstag! “Best wishes on your second anniversary!”
  • Wir wünschen Euch eine glückliche Ehe! “We wish you a happy marriage!”


German Word of the Day: (Die) Milch

Now that I have a baby, I think it’s time for me to learn a few more words that are related to her. At the top of my list is (die) Milch which is the German word for milk. Since I’m quite bad with plurals,  I add these nouns and their plurals (after |) to my list:

  • die Tochter – the daughter | die Töchter
  • das Mädchen – the girl | die Mädchen
  • das Baby – the baby | die Babys
  • das Kind – the child | die Kinder
  • das Krankenhaus – the hospital | die Krankenhäuser


On Becoming A New Dad

Last night (03 February 2014) at 11:52 PM, my daughter was delivered via CS. I saw my 4-kg baby girl about half an hour after that and, although I had thought it was just an exaggeration, I was indeed filled with emotions that I cannot express through words. As much as I would want to share that experience with you, you need to be there to understand the tremendous amount of joy that came with seeing your very own little bundle of cuteness for the first time.

It was a little over midnight and the lights of the hospital lobby were turned off (yes, this is a true story), but when the pedia carried my daughter out, my baby almost literally glowed from within like she produced her own light. My mother-in-law, my sister-in-law, and the pedia carrying my baby seemed to have disapparated. It’s like she was the only thing in front of me, suspended in mid-air like a celestial body and I was her satellite.

I was overwhelmed, but I did not cry, or at least I’m denying that I did. 🙂 My daughter’s own cries bounced off the walls of the dark hospital lobby, and although it was music to my ears that she was breathing (and wailing), I wanted to just hug her and kiss her and tell her that it’s gonna be alright.

I can say that the anxiety that came with the long wait has finally subsided. Now it’s time for me to enter this exciting world of parenting, and I think I’ll start by learning how to change her diapers. 🙂

Welcome to the world, my daughter Elaina Rebecca (Laica)!


My Baby Laica :)

My Baby Laica 🙂

German Word of the Year: Neu

Here’s a new word for the new year 2014: the adjective neu, which means – tada – “new”.

I Google-translated “Happy New Year” and the app suggested two translations:

  • Frohes neues Jahr!
  • Glückliches neues Jahr!

I think this depends on where the speaker is (like Samstag and Sonnabend which are both used to mean Saturday).

Both used the same form neues because the German word for “year” – which is Jahr – is a neuter (das). Notice also that Frohes and Glückliches – which can be used as synonyms for happy – also have -es ending.

  • froh – glad; happy; joyful
  • glückliches – lucky; fortunate; happy
  • neu – new
  • (das) Jahr – year

You can read more about the basics of adjectives here.

Things I Learned From My Parents

Remember, remember the 30th of November (?). My parents are celebrating their 30th wedding anniversary this year!

You are probably trying to guess how old I am, but to distract you, let me share a few of the important things I learned from my parents.

(1) Dad: Listen to your parents. Learn from your mistakes.

Dad used to say a lot, “I told you not to go to, but you go to, now look at?” which is basically the same as, “I told you so” but with awkward sentence construction. Many people don’t like getting an I-told-you-so, because admittedly it doesn’t really help with the current situation.

In popular culture, “I told you so” is usually offensive, but when said in bad English, the sting is sort of diminished. You learn to take a step back and really “look at” what you did wrong and how you can improve next time.


What does G.R. in Philippine Case Citations stand for?

A friend recently posted this question: “What does G.R. in case numbers mean?”

She was actually referring to Supreme Court case citations. A case citation is basically a way to refer to past court case decisions. The example in the Wikipedia article is: Fortich v. Corona, G.R. No. 131457, 24 April 1998, 289 SCRA 624.

From the same article, it was pointed out that “G.R. No 131457” is the “case docket number originally assigned by the Supreme Court… .” The article, however, does not say what G.R. represents.

Although a bit trivial, this was a question I could not leave unanswered. 🙂


Basic Filipino Pronunciation: Stressing Tagalog Words

On this article, I will give a high level on stress classifications of typical Filipino words – particularly Tagalog (as used in Metro Manila) which is my native language – and give examples for each classification.

I did not need to know the term “transitive verb” to be able to use transitive verbs. However, my knowledge of the term gave me a vehicle to learn on my own and a way to ask native/fluent speakers about transitive verbs. Similarly, the stress classifications to be discussed are probably not essential to your everyday conversation – many Filipinos do not even know them! – but they give you a starting point on learning more.

Stress (in pronunciation) is important to many languages, as it sometimes changes the meaning of the word altogether. In English, these are heteronyms, an example of which is the word desert, which can be pronounced as désert (noun – dry, usually sandy, land) or desért (verb – to abandon).


German Word of the Day : (Der) Geburtstag

Today I want you to know the German phrase for “Happy Birthday.” 🙂

Google Translate returns it as “Alles Gute zum Geburtstag.” This is practically wishing someone “all the best for your birthday.” Both About.com and Wiki-how (along with other forums) note that you can also use “Alles das Beste zum Geburtstag.


Basics of Using German Adjectives

I knew I reached a milestone in my self-study of the German language when I learned how to use adjectives correctly. Sentences like “Der Junge hat ein Spielzeugauto had become boring, even though the word Spielzeugauto still sounded cool.

Actually, I could already use the few adjectives I knew but only when they were acting as predicate adjectives (or adjectives after a linking verb). For example:

  • Das Auto ist groß. “The car is big.”
  • Meine Frau ist schön. “My wife is beautiful.”
  • Sein Sohn ist klein. “His son is small.”
  • Die Blumen sind gelb. “The flowers are yellow.”

For predicate adjectives, as shown in the examples above, only the base form of the adjective is used, regardless of the gender of the subject noun (including plural).

It is a different scenario, however, when using the adjective with a noun (i.e. not predicate), for example when saying “the big boy.”