Sunday, January 6, 2019

Lenovo K8 Note 3GB/32GB in exchange for Nubia Z11 mini

Recently the Nubia that my sister was using started showing death signs. The power button died, mobile started restarting at random. It's been over three years of good use, so I decided to get something else for my sister in exchange for this while it's still alive.

After browsing both Amazon and Flipkart and also checking other old mobile selling websites like Cashify, I decide on Lenovo K8 Note on Amazon. It's price was 8000/- Rs and in exchange of Nubia I was getting about 1000 Rs off. There were many other latest phones within my budget but they did not have exchange option. And I didn't want to keep this dying phone around if I was getting some money for it. So anyway I went for it. The phone was shipped from Hyderabad and I received it in 3 days time. Amazon delivery was good as usual.

Coming to the new phone - it's not exactly latest. in fact, it's quite old, released in Sep 2017 with Android 7 on board. If I remember correctly it was launched for 11K and after about a year and quarter, a 3K discount is good enough.

Below are the specs:

Network Technology GSM / HSPA / LTE
Launch Announced 2017, August
Status Available. Released 2017, August
Body Dimensions 154.5 x 75.9 x 8.5 mm (6.08 x 2.99 x 0.33 in)
Weight 180 g (6.35 oz)
Build Aluminum body
SIM Dual SIM (Nano-SIM, dual stand-by)
 - Splash Resistant
Display Type IPS LCD capacitive touchscreen, 16M colors
Size 5.5 inches, 83.4 cm2 (~71.1% screen-to-body ratio)
Resolution 1080 x 1920 pixels, 16:9 ratio (~401 ppi density)
Protection Corning Gorilla Glass 3
Platform OS Android 7.1.1 (Nougat), upgradable to Android 8.0 (Oreo)
Chipset Mediatek MT6797D Helio X23 (20 nm)
CPU Deca-core 2.3 GHz
GPU Mali-T880 MP4
Memory Card slot microSD, up to 256 GB (dedicated slot)
Internal 64 GB, 4 GB RAM or 32 GB, 3 GB RAM
Main Camera Dual 13 MP, f/1.7, PDAF
5 MP, depth sensor
Features Dual-LED dual-tone flash, HDR, panorama
Video 1080p@30fps
Selfie camera Single 13 MP, f/2.0
Features LED flash
Video
Sound Loudspeaker Yes
3.5mm jack Yes
 - Dolby Atmos audio enhancement
- Active noise cancellation with dedicated mic
Comms WLAN Wi-Fi 802.11 b/g/n/ac, Wi-Fi Direct, hotspot
Bluetooth 4.2, A2DP, LE
GPS Yes, with A-GPS
Radio FM radio
USB microUSB 2.0, USB On-The-Go
Features Sensors Fingerprint (rear-mounted), accelerometer, gyro, proximity, compass
Messaging SMS(threaded view), MMS, Email, Push Email, IM
Browser HTML5
 - Fast battery charging (Turbo Charge)
Battery   Non-removable Li-Po 4000 mAh battery
Stand-by Up to 378 h (3G)
Talk time Up to 25 h (3G)
Misc Colors Fine Gold, Venom Black

First impression: Build quality is great. The box comes with phone wrapped in a clear case, 15W Fast Charger, Sim Tray Pin and documentation. The phone is not too big, and not too heavy. Display is great, 2D glass feels great for touch. Interface is snappy, cameras are quite good. Portrait mode in v7 firmware is not quite upto the mark, but does not matter.

Performance wise - it's a deca-core chipset and also at 20nm process, should be efficient. Won't be as efficient as A22/P22 in Redmi 6's which are at 12nm, but sufficient coupled with fast charger.

So overall feels like value for money. Lets see how it ages.

Tuesday, August 28, 2018

Marshalling/unmarshalling struct containing array of structs

While handling a change request I stumbled into this very peculiar scenario. I had a structure which had array of structs and I had to read/write this in a file. So to and from buffer conversions, I knew marshalling will be most effective.
I had previously used it very effectively for CAN communication.
So I had to google a bit n found how to handle this peculiar case. Below is the code.

[StructLayout(LayoutKind.Sequential)]
public struct tagX
{
public UInt32 a;
public UInt32 b;
}

[StructLayout(LayoutKind.Sequential)]
public struct tagY
{
public UInt32 x;
public UInt32 y;
[MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.Struct, SizeConst = 20)]
public tagX[] stX;
}

To initialize this:

tagY stY = new tagY();
StY.stX = new tagX[20]; // Ensure size of array is equal to size const supplied in marshalAs directive.

Then on this object we can run marshalling / unmarshalling routines.