Friday, June 21, 2019

My Realme C2 budget phone with Color OS 6

Realme is a brand of OPPO. Realme C2 is a decent budget phone which you can get at the price of slightly below RM400.

Realme C2 is a successor of C1. I would say it is an alternative option of C1, which both of them are identical in terms of actual performance, which in some areas C2 is slightly better than C1 and some other C1 is slightly better than C2.

The 2 main differences are that C2 is using Mediatek MT6762 Helio P22 (12 nm) chipset and running on Android 9 OS, while C1 is using Qualcomm SDM450 Snapdragon 450 (14 nm) chipset and running on Android 8.1 OS.

Its size of 6.1" is big enough to have a screen suitable for elderly people to use after the font size is configured to be the largest.

Although it is a budget phone, it has pretty well performance with just a little bit of speed lagging compared with those flagship phones for normal applications. Its back cover is pretty nice and modern looking too. Therefore, it is also very suitable for kids and for people that just need a decent phone.

The Realme C2 comes with 2 options of specification: one with 2GB RAM & 16GB storage, and another more expensive one with 3GB RAM & 32GB storage. Bear in mind that the actual usable storage for the 2/16GB option is only around 6GB. The other 10GB was already used by the system and OS. It has a dedicated slot for microSD and supports external storage up to 256GB.

This phone only supports 2.4GHz WiFi and does not support 5GHz WiFi. However, it does support dual SIM 4G LTE.

It has a normal 13MP f/2.2 main camera working together with a 2MP f/2.4 camera for depth sensor. At its front is a 5MP f/2.0 camera, not a good option for people who loves selfie, but still usable.

Its Color OS 6 has a Control Center with big icons, provides convenient and easy access particularly to elderly people.

Color OS 6 also comes with  the Android App Drawer, which you have a choice to switch it on or off.

It's home screen has a handy smart sidebar for quick access to your favourite apps, which you can access by swiping from the side of the screen. The apps listing in the sidebar is configurable. You are also given the option to switch it off if you don't want to use it.

The phone has all the essential features in Android 9. It has quite a number of security related functions.

The anti-harassment/fraud function is actually the call and/or SMS blocking function. It has interesting features such as blocking of one-ring incoming calls, which you might not find in other phones.

The Realme C2 4,000 mAh Li-Po battery can last for more than 1 day for normal use.

One thing I dislike is its battery saving feature, which I think is too over. It always kill a lot of background running processes and apps, which might stop automation app and widgets from working after a while.

A lot of tweaking needs to be done to find the way to let the automation app and widgets continue working at normal even when the phone is in sleep. Smart Power Saver will always kill them off. You need to use Custom Power Consumption Protection option, and manually configure each of the apps for them to be able to continue running in background, and to automatically start when the phone starts.

All in all, this is a nice phone with high performance/cost ratio. Most apps (including the not so resource demanding games) can run pretty well on it, also I found Facebook is quite slow (takes a few seconds) in launching up in it.

Thursday, May 30, 2019

How to implement select all function for multiple sets of checkbox items on the same webpage using simple JavaScript

When designing a webpage with list of checkbox items, it is common and useful to implement a Select All/None function so that the user can easily select/unselect all items with a single mouse click.

This can be done with a simple JavaScript function, even without the need of using jQuery.

Now, the challenge is, when you have multiple sets of checkbox items on the same webpage, how to implement a shared JavaScript function to handle the Select All/None action to each set of the items respectively, so that when the user Select All in one of the sets, the other sets will remain unaffected by the action?

Let's say, we have 3 sets of item as below:

You can use separate FORM for each of the sets, and use FORM ID to distinguish each of the FORM. Each FORM will need to handle their own SUBMIT action separately.

If the different sets are within the same FORM and share the same SUBMIT action, you can make use of CLASS name in their CHECKBOX elements to distinguish and separate out the sets.

Here is the JavaScript codes to implement the Select All/None function (click the image to enlarge it):

and below is the HTML BODY part of the sample webpage (click the image to enlarge it):

Set 1 is in separate FORM from Set 2 and Set 3 with a different FORM ID. Note that even though Set 1 and Set 2 are both using the same CHECKBOX CLASS name, their checkboxes will can be selected all/none separately.

Set 2 and Set 3 are within the same FORM. We can still separate them by using different CHECKBOX CLASS names.

Our simple checkAll JavaScript function accepts both the FORM ID (as 1st parameter) and CLASS NAME (as 2nd parameter), and making use of its 3rd parameter as toggle. In this way, you can use this checkAll function to handle all the sets on the same webpage.

You can create a HTML file to try it out. Since this is just an ordinary HTML with simple JavaScript, it can run even without any web server. Just create the HTML, and open it with your web browser to test it out.

Monday, May 13, 2019

How to choose a better maintenance free car battery

Car battery is a consumable product that will eventually fail over time. When we say a better car battery, the most important point is that it can last longer and degrade slower.

Below are some of the criteria to look for in selecting a better car battery.

1. Brand

The lifespan of battery is affected by high temperature. Certain brand of battery is manufactured for use in hot equatorial areas, such as Amaron, Exide, etc.


2. Size

The battery for normal passenger car is normally of NS40, NS60 or NS70. NS60 is more powerful than NS40, and NS70 is more powerful than NS60.

However, choosing the right size of battery that match with your car's alternator is important. If you car's alternator is generating smaller current and designed to work with NS40 type of battery, it is better for you to stick to NS40 or at most upgrade to NS60 but not beyond.

This is because if the charge supplied from alternator is not sufficient to make the battery fully charged, the battery will suffer premature death and therefore has a shorter life span.

In addition, bigger battery will cause heavier workload to the alternator, which might also reduce the life span of the alternator.

Regardless of the size of the battery, if the charging system is unstable, the battery will die fast.

3. Performance Rating

A battery number looks like this: 46B24L

The first 2 digit is its overall performance rating. The higher the better.

The alphabet after the first 2 digit is an indicator of the battery's width and height. This alphabet can be from A to H. Smaller alphabet indicates smaller width and height.

The number after the alphabet is its length in centimeter. For the battery number 46B24L, its length is 24cm.

The final alphabet indicates the position of its positive terminal. L means it is on the left, and R means it is on the right.

4. Amp Hour (AH)

Amp Hour is an indicator of how much energy is stored in a battery.

It is the energy a 12 volts battery can deliver continuously for 20 hours (C20) at 80°F (26.7°C) without falling below 10.5 volts.

The state when the battery's energy fall below 1.75 volts per cell (or 10.5 volts in a 6-cells 12 volts battery) is considered as "fully discharged".

There are several C-rating given to the batteries in relation to its AH, by giving the battery a specific load to discharge:
  • C3 means the battery will be fully discharged over a period of 3 hours.
  • C5 means the battery will be fully discharged over a period of 5 hours.
  • C8 means the battery will be fully discharged over a period of 8 hours.
  • C10 means the battery will be fully discharged over a period of 10 hours.
  • C20 means the battery will be fully discharged over a period of 20 hours.
  • C100 means the battery will be fully discharged over a period of 100 hours.
In normal practice, C20 is used to measure the AH of vehicle batteries.

The AH value among batteries with same size varies, and you should look for the one with higher AH value.

5. Reserve Capacity (RC)

RC is a general indicator of how long a fully charged new battery can continue to operate the vehicle's essential accessories when the alternator or fan belt fails.

It identifies how many minutes the battery can deliver a constant current of 25 amps at 80°F (26.7°C) without falling below the minimum voltage of 1.75 volts per cell in order to keep the vehicle running.

The higher the RC rating, the longer your vehicle can operate in the event your alternator or fan belt is faulty.

6. Cold Cranking Amps (CCA)

CCA is a rating used to define the battery's ability to start an engine in cold temperatures. It refers to the number of amps a 12-volt battery can deliver at 0°F (-17.8°C) for 30 seconds while maintaining a voltage of at least 7.2 volts.

The higher the CCA rating, the greater the starting power of the battery.

Battery starting power deteriorates as the battery ages. Therefore, a battery with higher starting power should give you more confidence over time.

Replacing a battery with one that has a lower CCA than the original may result in poor performance.

7. Price

Normally, the branded battery that suit with your car's alternator, with high performance rating, high AH, high RC and high CCA, will also come with a high price tag.

As such, you might want to strike a balance between the battery's price and its performance. Choose the above average battery, and it can probably last for at least 2 years.

Hint: Click on the "Older Posts" link to continue reading, or click here for a listing of all my past 3 months articles.