Using mocking GPS app to test app
In your development option, you pick an app to mock your GPS location. I used this way to pretend I was in Hong Kong to test some apps for my clients in Hong Kong. But I found after that, even I switched off that GPS mocking. I found some funny behaviors. I turned on the navigation in Google map. Yes, at the first, GPS position is right, back to Australia, not in Hong Kong anymore. But my car was driving, the GPS position won't update. After I turned off my phone and turn it back on again. Then that is normal. I think after mocking GPS position, you need to reset the GPS. I know some apps can do.
Picture and Stickers Status in Facebook Messenger and Whatsapp
Today, I got updates from Whatsapp and Facebook Messenger. The major change in these updates is to allow the user post a status with picture and stickers. This feature is in Snapchat before. This is a kind of social media feature. Facebook is social media, that is making sense to have this feature, but Whatsapp is an Instance Messenger, it is to have this feature, that is a bit strange. Moreover, a lot of contacts in Whatsapp are not my friend, they are my clients. This is not good to share my personal status. I need to change my privacy setting, I selected my friends can view the status(I have to select them, one by one, so far, I cannot find a way to select a group of friends in one go), thus this feature in Whatsapp is not very useful for me.
[Xamarin-Android] LocationListener
If you want to use RequestLocationUpdates method in LocationManager, you need to add a class which implements ILocationListener to receive the callback from LocationManager. Most of the examples on the internet used the Activity as ILocationListener. That is easy if you choose the implementation in this way. But I wish to build a self-contained class which does not inherit any UI class.
locationManager.RequestLocationUpdates(LocationProviders.GPS, 10, 10, this);
Firstly, I just implemented all methods from the interface. Then I got an invalid casting exception. It is because LocationManager required the class is a sub-class of Java.lang.Object. In the native Android SDK, all classes are sub-class of Java.lang.Object, but we are using Xamarin, that is .Net, not Java. Thus we need to inherit our class to be a Java Object. After I make my class to be a sub-class of Java.lang.The object, I got an exception about the invalid handle. That is because ILocationListener has a property
public IntPtr Handle
I built a property to get from Application Context
Application.Context.Handle
Actually, Handle Property is in the Java.lang.Object. I do not need to build my own, I need to remove the section. Then it works.
Meteor Collection Skip and Limit
To pagination of reccords, Skip and Limit on a MongoDB collection is a "must" . "Skip" is to set the starting point of collection, "Limit" is to set the end point of Collection. That is very easy
Code
Customers.find({},{skip:10,limit:10}) |
Just like that!
The fastest speed home broadband -NBN
I came from Hong Kong. The high-speed internet is an essential item at home. A lot of my friends in Hong Kong got 100Mbps internet at home, some of them got 1Gbps. What Even I have heard about the fastest speed is 20Gbps in Hong Kong, that is crazy. I believe Hong Kong is the highest density of optic fiber networks. In contrast, Australia population are more density. Even in the urban area, the population is less density than Hong Kong. Thus, we need to spend money on the infrastructure, but fewer people can use, comparing to Hong Kong.
I have used ADSL2+ for 10 ten years. Normally, that is 6Mbps download. Nowadays, even 4G is faster this speed. Recently, NBN is finally available in my area. Then I ordered an upgrade from ADSL2+ to NBN. The NBN I can have is the best option which is fiber to the premise. That is not using the old copper telephone line. Therefore, rewiring is required. The NBN Co. Technicians did wiring from outside my house to my living room where my router is siting. Then they installed an NBN box which is a kind of optical fiber modem. Finally, my router and phone need to connect to this box. Then I got the fastest speed broadband is 100Mbps download, 40Mbps upload. Well, I need to pay $30 extra per month. Unless, I only can get 12Mbps download and 1Mbps Upload.
That is a bit downside to use NBN, we have to use VOIP over NBN, the old copper phone line will be phased out. In Australia, if the area has NBN, the phone line will be phased out within a year after the date of NBN activated in your area.