Samsung Galaxy S8 Phone
Last week, I was in JB HiFi. I saw a real Samsung s8. That looks fancy. The screen is big and occupied every space on phone surface to be a screen.No Physical keys at all. It looks good. Moreover, the screen is very sharp and beautiful. This kind of screen is a signature feature of Samsung. The curved edge of the screen looks too! But I don't know the usage of this. Also, it has Android 7.0. I believe that will be a good price. But the price tag is $1199 which is a bit of too much for me!
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!