Whatsoever – My Forth Android App

Link to the app in Play Store: https://play.google.com/store/apps/details?id=thack.ac.whatsoever

It all started out as an experiment on new views in Android L developer preview(now known as Android Lollipop). Sometime at late September, I was researching on how to Card-like views in Android and found out that CardView is part of the new Widgets introduced in Android L, together with RecyclerView.

When trying out RecyclerView(which is a replacement for old ListView), I thought of this idea to develop a Android app as a search engine for social media sites. I liked the Facebook style where each post is wrapped inside a card, so I want to build a interface where there is a RecyclerView, inside RecyclerView there would be a list of statuses/posts, each wrapped in a CardView.

For the social media site integration, I started with Twitter, and the integration with Twitter API was quite straight-forward thanks to a library called twitter4j. Everything is well-formatted and follows Java conventions and I did not have to do to much to populate the data into my CardView and RecyclerView.

Then I went on to try integrate Facebook, however, unfortunately, it appears that Facebook Graph API does not allow searching of posts/statuses. Hence, I had to give up on Facebook and try other social media sites.

The next one was Google+, there is a Google+ API client for Android, however, it requires logging in. I did not want that since I want to user to be able to search without having the trouble to log in. So in the end I used the Google APIs and parsed the json “half manually”. That is to take advantage of the pre-defined Google+ classes on Google+ provided in the Google+ API Java client, such as com.google.api.services.plus.model.Activity . This was pretty cool as all I had to do was to use response.parseAs(ActivityFeed.class).

Then I decided that Instagram should be also integrated. Instagram has a pretty well-documented API although it is a relatively new platform, however, there are no native or 3rd party libraries for Java or Android so I have to manually parse the json response. This involves some error handling but was still manageable. A good practice would be to create a Class and use response.parseAs, but I was a bit lazy and decided to just use some local variables.

At that point of time, CardView and RecyclerView were not well-documented, in fact there were no official documentations (now they are documented). So I have to work with limited resources and try to figure out how to use them by myself, it was a painful but exciting experience for me. Of course I put in a lot of time in designing the UI and improving the UX. I also got quite a few suggestions from my friends I tried to do modifications to improve the app.

So here it is, the Android App is in Google Play Store, please do give it a try!

Questioning probability – Controlled probability theory

Questioning the premise

We have been taught concepts of probability theory since young. A common probability theory statement goes like this:

“If we toss a fair coin, there are two equally likely outcomes: a head, or a tail.” This would imply that both the outcomes have 50% chance of happening. However, I would like to question this premise that chance of each outcome is 50%, i.e. a predefined constant.

Proposing an alternative theory

I propose that the probability can be controlled, given a fair environment (in this case a fair coin is used).

There are three methods that the control(manipulation) can be achieved:

1. The observable physical parameters(such as wind speed or humidity of air) can be manipulated, without being noticed by ordinary human beings.

In this method, the change in physical parameters can be very minor. Hence it would appear to ordinary human beings that the event occurs in a fair environment, but in actual fact the parameters have been manipulated to favour a certain outcome.

2. The measurable physics constants(such as gravity or speed or light) can be manipulated, without being noticed by ordinary human beings.

Similarly in this method, the manipulation can be done in a subtle manner such that the event appears to be fair but in actual fact the slight change of physics constants can be controlled to favour a certain outcome.

3. There exist non-observable parameters that can be manipulated, which have impact on observable events.

If this is true, it would be impossible for someone who has no knowledge of such parameters to know that manipulation is carried out, hence the event would appear to be fair. This would also imply that our knowledge about the observables is not complete.

It should be noted that although the nature of the three methods are different, they are not mutually exclusive, i.e. they can be combined to controlled an event.

(Attempted) Proof of the theory

The proof would involve proving the three proposed methods to control the event:

1. On controlling the observable physical parameters:

This method can be proved in the future. It is already theoretically possible to control these parameters. The only reason that this may be impractical is that ordinary human beings lack the abilities to interpret and manipulate such parameters. Hence, as soon as we can develop such abilities through evolution or artificial engineering, and we are able to take advantage of that to control the outcome of events, we can prove that this way is valid and practical.

2.On controlling the measurable physics constants:

This method is hard to prove.  Currently we lack equipments to detect minor change in physics constants. In fact, we cannot even accurately measure these constants due to Heisenberg’s Uncertainty Principle.

3. On controlling the non-observable parameters: 

This method is even harder to prove. It would require the knowledge of non-observable parameters to prove that such way exists. Even if the proof is done, it would be impossible for ordinary human beings without the required knowledge to comprehend and agree upon.

Implications of the theory

The implications, if the theory is true, is beyond imagination. It would mean that everything based on probability and statistics theory would collapse. Essentially almost everything can be controlled by those who have such ability.

Additional comments

This is one of the many interesting/crazy/random ideas that I have, you can check out here for more of them.

I am planning to develop a game, using the some of the concepts in this theory, leave a comment if you are interested to find out more about it.

This is too scary to be true.

Life with Android Wearable – LG G Watch

It has been almost one month since I bought LG G Watch, and I am happy with how it is changing my daily life.

LG G Watch is a gadget rather than watch

The purpose of buying this watch is really just to try out how it is like to have a wearable gadget rather than getting a nice watch. And of course if I have some good ideas, I can use Android wearable API to develop apps that make use of this new technology.

Appearance wise, it really look more like a gadget-on-the-wrist rather than a watch. Wherever I go, people who notice this will instantly recognize this as something that has much more functionalities than normal watches. The watch performed beyond my expectation in terms of functionalities that it provides. In fact, my friends often joke about what happens if I wear this into exam venues.

More useful than I thought

Some functions are triggered by the events that happened to the phone, these are most likely notifications. The phone sends the notifications to the watch, and then the watch would display them in a nice way. By default, firstly, there will be a card(similar to Google Now on the phone) at the bottom of the display, swiping up will show the main message on the screen, then swiping to the left will show another screen that allows you to open the corresponding app on the phone whereas swiping to the right will dismiss the notification. This default behaviour is not very useful, so the apps that want to take advantage of the wearables need to implement more actionable screens for the users. For example, for the updated Whatsapp, the main screen shows a list of conversations, you can see the full details of each conversation if you swipe to the left once, and you can also reply via voice input by swiping to the left again. However, others told me that it looks very weird if someone is staring at the watch for longer than 3 seconds, so better check long messages on the phone.

Other than reading chat notifications, the function that I use the most is agenda.

IMAG0603

By default, today’s events on the phone will be synced to the watch and displayed as a agenda card, swiping up will show more details such as venue, additional notes. Believe it or not, this saves a lot of time and frees up my hands from taking out the phone, especially on a crowded bus or during cycling.

It also comes with a simple step counter to record how many steps you have walk everyday.

IMAG0607

You can set a goal and motivate yourself to walk more rather than taking bus. Personally, I find it pretty effective. There are times that I wanted to take a bus but decided not to after looking at the step count. (My goal is set to 10k steps every day)

Voice control system is very important for the watch, most self-initiated actions are via the voice control. Saying “Okay, Google!” will trigger the voice control. It may not be able to match Siri as a personal assistant, but there are still a lot of things that you can do, including setting up reminders, sending SMS and email, calling someone, asking a question or just simply performing a Google search. Apart from the default commands, “start XXX” will trigger apps that are specifically developed to run on the wearable device.

Other cool features are music controller for the phone, navigation(with google map).

Update: Recently in December 2014, the music controller is updated with useful functions to control volume and go to next or previous track. The UI is also pretty good.

Orbital Project [Apollo 11] – Graphpedia

During the summer vacation, I joined the Orbital project in SoC. This is a module-bearing project for SoC freshmen to get some experience in developing real-life applications(mainly web app or mobile app).

The final product for my team is now hosted on Digital Ocean (initially on Heroku): https://viz.paradite.com/

This a team-based project so I partnered up with Dongyan. I was in charge of backend, routing and the visualization and she is in charge of UI and UX. Continue reading

Card Safe – My Third Android App

Link to the Android app in Play Store: https://play.google.com/store/apps/details?id=thack.ac.cardsafe (still waiting for listing as of now)

This project started off with the idea that I can take advantage of the NFC functionality in Android to read data from NUS Matric Card and develop some app to facilitate processes like registration and collection in various events.

Unfortunately, I realized that the matric number sector in the card is key-protected I believe the staff would not let me have the read/write access to the data inside. So that means I can only get my hands on the ID of the card, which is given by the manufacturer, public and most importantly unique(although there may exist techniques to duplicate the cards with the same ID illegally).

I was thinking about the card’s unique ID and necessity for NUS students. Then I suddenly got this idea, why not save some information and use the card as a key to access it. I thought this would be quite useful and relatively easy to implement, so I started working on a prototype. Setting up database and the single activity with a single layout file was quite easy for me, especially just after I have worked on a bigger Android project. The only thing that is troublesome is the different tags in different cards and their different ways to access the card. I have tried ezlink cards and DBS Debit Card, however, I was not able to get something like a unique ID from either of them. In the end, I only managed to get the NUS matric card working.

After a few hours of coding and designing, the version 1.0 with basic functionalities like setting up new “safe”, retrieving content of the safe and modifying existing safe was finished and uploaded to Google Play Store around 3am. Hope it gets good feedback and proves to be a fun and useful app for people(mostly for NUS students now).