Author: Catzie

  • This place will never be the same again

    When I first came to that place, that “existence” was there. It was at first an annoyance to me and made my blood boil quite a few times, even after moving to this new place. Occasionally this existence would speak of wise words such as “Be the better person.”

    Now, that existence is gone.

    But for a short while before it had left us, I felt that this once “only annoying” is one of the few who I could actually connect with. In this chaotic place, we need to laugh our negativity away to survive, and this existence and I found humour in the same simple things.

    We will surely miss how that loud contagious laughter would boom in the room.

    This place will never be the same again without you. All the best to you in the new place you chose.

  • Android Studio: add Google Map from empty activity (dev note)

    //Update: I prepared a simple Android app that features a Google Map with markers that form clusters together when zoomed out. Check it out: Simple Android Map Clustering on GitHub.

    This “dev note” of mine will give you a rough idea on how to add a Google Map to your Android up from an empty activity, not from a pre-made Google Maps activity.

    I won’t be able to write everything in detail here because I’m in a hurry, and so I’m calling this article a “dev note” instead of tutorial. 🙂 This dev note can be considered a “guide” too.

    This dev note was based on Android Studio v.2.1 running on MAC OS X

    From your Android Studio’s SDK Manager, install Google Play Services.

    Add this as child of <application> tag in AndroidManifest.xml:

    Later we’ll replace YOUR_API_KEY with a key from Google API Console.

    Also add these to your AndroidManifest.xml as direct child of manifest tag:

    We need to get an API KEY for the value attribute of this meta data. Let’s get one from the Google API Console — create a new project there and then search for Google Maps Android API. Enable it.

    After enabling it, you’ll find a way to get an API key that we need from Google API Console. Go to Credentials -> Create Credentials -> API Key -> Android Key. Before we are given the API key, we need to provide Google API Console a SHA1 certificate fingerprint from our computer and our app’s package name.

    To generate SHA1 certificate fingerprint on a Mac, type this on the terminal:

    On Windows, try this command:

    When prompted for a keystore password, enter the word debug as your password.

    Copy the SHA1 certificate fingerprint and then paste it into Google API Console. Enter your package name as well (e.g. com.yourdomain.projname). You’ll be given an API Key in return.

    Note: My Android Studio says ‘In the Google Developer Console (https://console.developers.google.com), ensure that the “Google Maps Android API v2” is enabled.’ but I can’t find the option for V2.

    Remember the meta-data tag we added in the AndroidManifest.xml? Replace the value with the API key that you just copied from Google API Console.

    Resource: https://developers.google.com/maps/documentation/android-api/signup

    Open app/build.gradle file and add the following as dependency:

    Sync your project with Gradle files.

    This was one of the tutorials I followed: GOOGLE MAPS ANDROID API V2 TUTORIAL USING ANDROID STUDIO and I based my XML plus Java codes on the author’s.

    My files in the end…

    Here were the codes of my Android app when I finally made the Google Map show up in the activity:

    app/build.gradle

    build.gradle

    app/src/main/res/layout/activity_main.xml

    app/src/main/java/net/catzie/maptest/MainActivity.java

    app/src/main/AndroidManifest.xml

    …even though the Google Map now shows up on my Android activity, I get these errors that I’m not able to fix yet:

  • Laravel update from v.5.0.35 to v.5.2.32 hiccups and solutions

    I tried to update Laravel 5 today and here were the steps I had to take.

    First checked my Laravel version before the update:

    Edited composer.json in my laravel’s root folder like such:

    Run this on command line:

    You might need to delete root folder’s composer.lock file before the update can actually begin.

    I got an error which I later fixed. Scroll to the bottom of the following message.

    So, Illuminate\Routing\ControllerServiceProvider’ could not be found.

    What I did was remove the following line from config/app.php:

    New error upon running php artisan –version:

    I created a folder named “cache” under bootstrap folder to solve that one.

    Tried to check my Laravel version again, but this was the new error:

    Solution was this:

    Then, finally!

    Oops, I can’t view my Laravel site on the web browser. It gives the following error:

    I opened App/Http/Controllers/Controller.php and replaced all instances of DispatchesCommands with DispatchesJobs.

    Next web browser error:

    So I replaced the content of my config/auth.php file with the following:

    Another error… Oh will this end soon?

    …which was caused by this code in my blade file:

    I simply passed a string “/” to the url() method to fix it. Then, ta-da! I could browse my Laravel site again via web browser.

  • Laravel 5: Create controller under new folder and routing

    So here I am on a Sunday, trying to make progress with a personal Laravel 5 site I need to work on. As I bear with the noise outside in the street (some crazy neighbors set up a swimming pool IN THE STREET! :oops:), I’m trying to figure out how too create a new Laravel 5 controller and place it inside a sub-folder.

    Thanks to a StackOverflow answer as my guide, it’s now working. Here, I’ll share how I did it. Just replace “New” with whatever name you want.

    First, create NewController.php on this folder: app\Http\Controllers\New\

    Then the first part of the code should be like:

    My call for the blade file in index() looks like this:

    In app\Http\routes.php, add this:

    $router->get(‘/new’, ‘New\PostsController@index’);

    Last, run composer dump-autoload or php artisan dump

    Guide: Laravel Controller Subfolder routing

  • Android Development: Permission denied when running ./gradlew in Mac

    I’m using a Mac at the moment to work on my Android app projects.

    For some reason I need to run ./gradlew in the terminal, but I was getting this error:

    -bash: ./gradlew: Permission denied

    To fix this, what I did was run the following commands:

    After those commands, my Mac downloaded numerous files and it took an hour to finish because of our poor Internet connection in the workplace. 🙁

    After an hour and a half, I was able to finally use the command ./gradlew on the Mac Mini. Phew!

  • Android Studio and the 64K methods limit (DEX error)

    Hi! I’ll share a few tips with you on how to find out the number of methods that your Android app has. I’m gonna show you a few tools such as APK file methods counter, and an Android plugin that will show you the number of methods each imported class or dependency has. These will help you figure out if you’re nearing the 64K methods limit, and determine which classes/dependencies must be causing it.

    First off, try this online drag-and-drop tool that will show you the total method count as well as breakdown based on the APK file you’ll use: APK Method Count

    Now, let’s install the plugin. After installation, you should be able to see method counts on your app/build.gradle file.

    Install plugin to check for unused dependencies: Jonnyzzz Dependencies. I used version 1.0.10. To do this, in [Windows] go to File -> Plugins, or in [Mac] go to Android Studio -> Preferences. Press “Browse Repositories” then find and install Jonnyzzz Dependencies. Restart Android Studio.

    To use, from the menu, select Tools -> Unused Module Dependencies -> Analyse All Modules

    You’ll be prompted for an option to remove all unused dependencies. I could not do that because I had a team mate who might use some of those in the list, so I manually deleted libraries that I’m sure we no longer need.

    Sync Gradle, Clean, or even Rebuild… and run your app again.

    I must admit that this DEX file error is a nightmare to me. xD I used to only code my Android app in a Windows 7 computer, which was very slow. Then some office friends decided to lend me a higher-specs Mac Mini that nobody’s using. It’s helping a lot, but the app I’m working on in Windows is getting 64K methods limit in Mac. I had the exact same copy of my Android Studio project in both Windows and Mac computers, but only the one in Mac was getting 64K methods limit error. 😆

    Now I’m thinking of the small differences in my Windows’ and Mac’s config for Android Studio…

    Could it be because ‘com.google.gms:google-services:2.0.0-alpha9’ and Android Studio v.2.1 in Mac, while my Windows 7 had ‘com.google.gms:google-services:2.0.0-alpha6’ and Android Studio v.1.4?

    From what I understand in the Methods Count pages for Google Services 2.0.0 Alpha 6 and Alpha 9, Alpha 6 has more methods than Alpha 9.

    My Android Studio v.1.4 in Windows using Alpha 6 (more methods) but the app runs without problem, while Android Studio 2.1 in Mac using Alpha 9 (less methods) triggers the 64K methods limit. 😆

    I don’t want to keep thinking about this right now because I have pending tasks to do. 😆 But it’s nice to know roughly what we can do next time I get this dreaded 64K methods limit error.

  • Oishinbo lunch at Little Tokyo, Makati

    Oishinbo lunch at Little Tokyo, Makati

    So I’m gonna write a really quick post about our meal at Oishinbo, a Japanese restaurant in Little Tokyo, Makati. I’m just passing time as my Android Studio is running its Gradle build. ^o^;; My workstation is a bit too slow for the job.

    We went there for our last lunch with an office friend whose last day in the company is the day after. She likes Japanese food and she chose this place since she hasn’t tried Oishinbo’s food yet.

    Here’s . 3 pieces for each kind: salmon, tuna and squid that’s cut into cute rings.

    Moriawase: 3 x 3 kinds sashimi, P590


    I never paid attention to the slices of lemon that Japanese restaurants serve with sashimi. But a friend suggested I squeeze some lemon juice on my sashimi, and I liked the extra flavor it lent to the raw fish.

    Moriawase: 3 x 3 kinds sashimi, P590

    (Moriawase: 3 x 3 kinds sashimi, P590)

    My friends always liked the Spicy Tuna Maki (P298) at Izakaya Kikufuji and craved for that item while in another restaurant 😆 Good thing Oishinbo serves it too. It looks different and is not spicy at all, at least for us. But it was enjoyable. I think the mayonnaise was the key.

    Delicious but I didn't find it spicy at all
    Delicious but I didn’t find it spicy at all

    And here’s their beef curry.

    Beef Curry

    Gyu Don with mushrooms (P298):

    Gyu Don (Donburi) P298

    I didn’t realize this until now – that I forgot to take a picture of my own food! 😆 It’s probably because I was hungry and began eating immediately when the bowl was placed in front of me. But it was yummy! I especially enjoyed the crispy parts of the chicken.

    Oishinbo address:

    Little Tokyo, 2277 Chino Roces Avenue, Legaspi Village, Makati City

    Oishinbo, Makati store hours:

    May change without notice!
    10:30 AM to 2:30 PM, 5:30 PM to 11 PM
    Mon10:30 AM to 2:30 PM, 5:30 PM to 11 PM
    Tue10:30 AM to 2:30 PM, 5:30 PM to 11 PM
    Wed10:30 AM to 2:30 PM, 5:30 PM to 11 PM
    Thu10:30 AM to 2:30 PM, 5:30 PM to 11 PM
    Fri10:30 AM to 2:30 PM, 5:30 PM to 11 PM
    Sat10:30 AM to 2:30 PM, 5:30 PM to 11 PM
    Sun10:30 AM to 2:30 PM, 5:30 PM to 11 PM

    For Oishinbo menu, refer to this page: Oishinbo page at Zomato