13 August, 2015

Gradle Windows Instructions

******************* Windows Instructions *******************
First, head over to https://gradle.org/downloads/, and download the latest
version of Gradle. Note that we want the complete distribution. Next, we'll
unzip Gradle and move it to where we want it to live. Our recommendation is in
To tell Windows where to find Gradle, we need to add an environment variable.
Navigate to the Control Panel > System > Advanced system settings > Advanced >
Environment Variables... > System variables > New...
Set the variable name to: GRADLE_HOME Set the variable value to the location
you unzipped Gradle if you followed our suggestion it should be: C:\gradle-2.3
Then edit the PATH user variable by appending: ;%GRADLE_HOME%\bin
Your path will then look something like:
When you're done, run `gradle --version` to ensure the installation is
Finally, let's add a properties file to tell Gradle to use the daemon by
default. All we need to do is put a file named `gradle.properties` in
C:\Users\\.gradle, and add the line `org.gradle.daemon=true`.
******************* When you're done *******************
Once you've installed Gradle, you no longer need to use the wrapper script,
and you can simply use the `gradle` command. To see if Gradle was installed
successfully, try running
    $ gradle --version
To see the effect of the Gradle daemon, first run
    $ gradle --stop
to ensure the daemon is stopped, then run the `helloWorld` task using
    $ gradle helloWorld
and note how long it takes. Then run the `helloWorld` task again and see how
much faster the second run is.

10 December, 2014

Android L notification

For Android L:
If you set [Show all notification content], and if we are using custom view, then we can make actions without unlock the screen regardless the security level (Pin, Pattern, Password).

But if we want to hide notification from some sensitive app when the screen is locked, then we can follow this procedure to make notifications be hidden.

·  Open your device's Settings menu
·  Under "Device," touch Sound & notification.
·  Touch App notifications.
·  Select the app you want to change notifications for.
·  You can change the following settings, depending on the app:  

Sensitive: You need to be in "Show all notifications" mode and have a pin, password, or pattern set up as your screen lock in order to see this setting. Notifications for the app selected will still appear on your lock screen, but their contents will not be visible.
So we can make sure some apps be sensitive like Email, Contact, SMS.

For Android L below:
Only set security level as Swipe or None, which allow users to slide down the notification panel.

24 September, 2014

iOS Key Fob Simulator

Ref: From http://chipk215.github.io/keyfobsimulation/

iOS Key Fob Simulator

The iOS Key Fob Simulator simulates the key fob peripheral that comes with the CC2540 Mini Development Kit from Texas Instruments. The simulator enables an iPhone to masquerade as a key fob peripheral providing accelerometer data, key press notifications, battery level data, a dual tone immediate alert and transmit power data. Master devices (Centrals) which can connect to a key fob peripheral should also be able to discover and connect to the simulator without any modifications.

The simulator requires the hosting iOS device to support Bluetooth 4.0. iPhone models beginning with the 4S and 3rd generation iPads are capable of hosting the simulator.

The services and characteristics of the simulator are described below. The simulator fails the Turing test compared to an actual key fob in specific use cases which are documented.  However, the simulator does enable some test cases that are not possible using the key fob hardware. The simulator is a complementary tool for developers working with the CC2540 Mini Development Kit.

17 September, 2014




03 September, 2014

Eclipse: Development tips including code template, formatter, keys, and content assistent.

Code Template:

Here I will focus on comments template:
Here is the sample for class comments:

Normally we only need to add comments for class and method:

 * FileName: ${file_name}
 * Description: 
 * Author: [your name]
 * Created Date: ${date} ${time}
 * Copyright (C)  Your company 2014
 * All Rights Reserved

 * Author: your name
 * Created date: ${date} ${time}
 * ${tags}

Note: please make sure your eclipse is using En-us language.
Go to eclipse.ini,
Add one line:


Content assistent:

add .abcdefghijklmnopqrstuvwxyz to auto activation triggers for java,
and prompt for xml.

29 August, 2014

ConnectGatt function usage

public BluetoothGatt connectGatt (Context context, boolean autoConnect, BluetoothGattCallback callback)

Afte I tested with different modals, I think the parameter autoConnect is not functional correctly.
I still don't know what's usage is, maybe because my test devices are all Samsung.

Anyway, here is the final solution for connection to any peripherals:

int build = android.os.Build.VERSION.SDK_INT;
        if (build == VERSION_CODES.JELLY_BEAN_MR2) {
            currentBLEGatt = device.connectGatt(weakContext.get(), true, gattCallback);
        } else {
            currentBLEGatt = device.connectGatt(weakContext.get(), false, gattCallback);

26 August, 2014

How to set custom keystore, How to import Android source code

How to set custom keystore:

Goto Preferences -> Android -> Build -> Select Custom debug keystore

How to import Android Source code:

Goto Project Properties -> Java Build Path -> Libraries -> Android 4.4.2->Android.jar -> Set Source attachment

25 August, 2014

Skype cannot connect?

Skype cannot connect?
Today I met a Skype issue which was not allowed me to connect, I tried to use proxy, restarted this app, still did't work.

Skype version is 6.3.4xxx.

After upgrading to the lastest version 6.18.0xxx, everything goes well.