Adding a float value to your resources
Earlier today, I was trying to figure out how to add a float value to constants file. What I used to do was add a string value in my strings.xml
, retrieve the string value, and convert it to float.
float floatFromFile = Float.valueOf(getResources().getString(R.string.my_float));
Quick Tip: git cloning
A user-friendly way of cloning a git
repo is through the eGit plug-in in Eclipse. But sometimes, especially on Windows machines, Eclipse has trouble cleaning up after itself after completing a clone operation. The best workaround for this is to clone the repo from git bash
and then import the repo in Eclipse.
default@ZDOMINGUEZ-T420 ~
$ git clone git@github.com:<your git repo> <local folder to check out to>
Selenium and File Downloads
Lately, one of my tasks has been to automate regression tests on one of our apps. Since this is a web app, we are using Selenium. Here, I enumerate the steps to configure Firefox for file downloading using Selenium and JUnit by foregoing the downloads dialog box.
MongoDB and Authentication
By default, MongoDB allows access to the database without authentication. Adding a user with a username/password is easy, but authenticating might be a bit tricky since the official documentation does not say the command directly.
Hello, it’s me again.
To my two readers out there, hello! It’s been a while since I posted here. I was transferred to another (non-Android) project and lost all my Internet privileges, hence the silence. I still can’t believe almost every other site is blocked by the office firewall! Makes software development ten times harder. Ugh.
Where’s my R.java?
This afternoon, I tried importing an existing project into Eclipse. Doing a Project > Clean usually clears up the R.java not found errors, but this time it didn’t work. I tried re-importing the project, copy-and-pasting it into a new workspace, restarting Eclipse, but the error is still there.
ADT 12: Not so shiny after all
A break: When I grow up
Tearing my hair out on my latest project. So here’s some Garbage to cheer me up.
Passing complex objects to another Activity
Several months ago, I was faced with a problem of passing a complex object to another Activity. There are several ways of doing this:
- “Deconstructing” the complex object to simple data types and passing them as extras through
putExtra()
- Making the object
Parcelable
- Making the object
Serializable
Dreaming of Google I/O: ADT preview
It is my dream to one day attend Google I/O. But seeing as I’m from a Third World country where everyday is a practice in cost-cutting, it is very unlikely that I would fulfill that dream anytime soon. I haven’t sat down and computed the actual cost, but thinking about it makes my head spin. Off the top of my head:
- US Visa application = P6500 (~USD150)
- Round trip plane fare ticket = P90,000 (~USD2000, if I’m lucky)-
- Google I/O ticket = P21,000 (~USD450, if my research is correct)