I just began learning Kotlin for work and one of the first errors I encountered is “overrides nothing” pointing at the overrides of the function instantiateItem() for my PagerAdapter The function/method signature was like this: override fun instantiateItem(parent: ViewGroup?, position: Int): Any { To fix the error, I simply removed the question mark from the […]
Laravel 5.X directory permissions / ownership setup
According to the Laravel docs, “After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run”. After running this command to install Laravel via Composer:
1 |
composer create-project --prefer-dist laravel/laravel blog |
Change directory ownership by running these commands:
1 2 |
sudo chown -R www-data:www-data /path/to/your/project/storage sudo chown -R www-data:www-data /path/to/your/project/bootstrap/cache |
Then you […]
Android: Facebook SDK “Invalid Key Hash” on Ubuntu
I kept getting a different Facebook key hash from the one being actually generated by my debug app when it runs. Turns out I’ve been entering the wrong keystore password. To get your key hash for Facebook SDK on Ubuntu, run the following command:
1 |
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 |
In case you don’t have the keytool program yet, you’ll […]
Swimming with fishes at Camayan Beach Resort (Subic, Philippines)
The unknown scares me. It was what triggered an injury on my toe back when I tried to snorkel in Samal Island. I was wearing a life vest but still felt nervous in the water… not only because I didn’t know how to swim back then, and I did not know what aquatic creatures I […]
Philippine Passport Renewal 2018 – DFA SM Manila (NCR West SM Manila Site)
On April 14, we had an appointment at DFA SM Manila for Philippine passport renewal. The process took 2 hours in total, which wasn’t so bad. We were holders of the older type of e-passport, which were only valid for 5 years. We received our renewed passports via LBC about 10 business days (rush) after […]
Android: SharedPreferences not accessible from SyncAdapter
When I was trying to access a SharedPreferences value from my Android app’s SyncAdapter, I kept on receiving an old value that was saved to the key. Quick solution to inaccessible SharedPreferences from SyncAdapter A quick solution (which may be a short-term one) I tried was to remove android:process=”:sync” from the following code:
1 2 3 4 |
<service android:name=".service.SyncService" android:exported="true" android:process=":sync"> |
But […]
Get your Postal ID: SM North EDSA (2018 January)
If you prefer to apply for a postal ID at one of the PHILPOST branches in malls, then I think you’ll get valuable information from this page. We chose to get our postal ID from SM North EDSA; it wasn’t an easy process for us because of things we didn’t know beforehand. And now, I’d […]
Android app dev: Intent extras set in onBackPressed() misssing when back to onActivityResult()
It’s funny how we spent about an hour trying to figure out why the Intent extras that we’re setting are not being sent back to onActivityResult(). If we only knew that the solution was as simple as moving one line of code. The call to super.onBackPressed() should be placed after setting Intent extras and after […]
Android app dev: Missing import org.apache.commons.lang3.text.WordUtils;
I use a few instances of WordUtils.capitalizeFully() on an Android app that I’ve been working on. And there are times when the import org.apache.commons.lang3.text.WordUtils; breaks, sometimes after merging with some of my git branches. To fix this, what I do is open app/build.gradle and add the following line under dependencies:
1 |
compile 'org.apache.commons:commons-lang3:3.4' |
Hope this saves somebody […]
Something to avoid when using Android RecyclerView
When using Android’s RecyclerView, don’t use the same inflated XML layout file for items you intend to shuffle on the fly! Their contents will overlap. -CK