Setting up Philips Hue with Android

Philips Hue:

Philips Hue is an intelligent light collection; it will help you control your home’s lights using a smartphone, tabs, etc. Philips Hue can welcome you home, wake you up, get you energized, help you feel safe, improve your mood and much more.

Philips Hue uses two communication protocols to control the bulbs: Wifi/Ethernet and ZigBee.

Installation Steps:

  • Connect your bridge with a wifi router and electricity plug.
  • Plugging smart bulb to bulb holder in wifi network.
  • Install the Philips application on your smartphone to connect with the hue bridge.
  • After app installation, connect with hue bridge using a smartphone and after on connect with bulbs.
  • The app is compatible with Android or iOS operating systems.

How it works:

In the below picture, you will get an exact idea of how it works.
Android Philips Hue

  • Smartphone with Android or iOS or a desktop application device, using that user controls the smart bulbs.
  • A router that gets data from devices and forwards it to the hue bridge.
  • A bridge, get data and set commands for smart bulbs.
  • Smart bulbs get commands from the hue bridge and work as per the given command.

A few days ago, I got a chance to work on this technology. It’s very interesting!!! Hope you also enjoy it.

Here I will give you one example using the Android platform. In this example, we will see how we will connect with bridges and connect with bulbs ON/OFF bulbs using mobile.

Steps To Connect With Bridge :

Need to create a “PHHueSDK” instance.
We can directly get the quick start demo of hue Philips; click here.

// Gets an instance of the Hue SDK.
PHHueSDK phHueSDK = PHHueSDK.create();

// Set the Device Name (name of your app). This will be stored in your bridge whitelist entry.

// Register the PHSDKListener to receive callbacks from the bridge.

Search available bridges in a network

PHWizardAlertDialog.getInstance().showProgressDialog(R.string.search_progress, PHHomeActivity.this);
PHBridgeSearchManager sm = (PHBridgeSearchManager) phHueSDK.getSDKService(PHHueSDK.SEARCH_BRIDGE);
// Start the UPNP Searching of local bridges., true);

Using PH Listeners we can get the result of search bridge methods :

public interface PHSDKListener {

void onCacheUpdated(List<Integer> cacheNotificationsList, PHBridge bridge);

void onBridgeConnected(PHBridge bridge, String userName);

void onAuthenticationRequired(PHAccessPoint accessPoint);

void onAccessPointsFound(List<PHAccessPoint> accessPoints);

void onError(int code, String message);

void onConnectionResumed(PHBridge bridge);

void onConnectionLost(PHAccessPoint accessPoint);

void onParsingErrors(List<PHHueParsingError> parsingErrors);


// Local SDK Listener

private PHSDKListener listener = new PHSDKListener() {

   public void onAccessPointsFound(List<PHAccessPoint> accessPoint) {

       Log.w(TAG, "Access Points Found. " + accessPoint.size());


       if (accessPoint != null && accessPoint.size() > 0) {



               runOnUiThread(new Runnable() {


                   public void run() {







   public void onCacheUpdated(List<Integer> arg0, PHBridge bridge) {

       Log.w(TAG, "On CacheUpdated");



   public void onBridgeConnected(PHBridge b, String username) {


       phHueSDK.enableHeartbeat(b, PHHueSDK.HB_INTERVAL);

       phHueSDK.getLastHeartbeat().put(b.getResourceCache().getBridgeConfiguration() .getIpAddress(), System.currentTimeMillis());   prefs.setLastConnectedIPAddress(b.getResourceCache().getBridgeConfiguration().getIpAddress());



       startMainActivity(); }


   public void onAuthenticationRequired(PHAccessPoint accessPoint) {

       Log.w(TAG, "Authentication Required.");


       startActivity(new Intent(PHHomeActivity.this, PHPushlinkActivity.class));


   public void onConnectionResumed(PHBridge bridge) {

       if (PHHomeActivity.this.isFinishing())


       Log.v(TAG, "onConnectionResumed" + bridge.getResourceCache().getBridgeConfiguration().getIpAddress());    phHueSDK.getLastHeartbeat().put(bridge.getResourceCache().getBridgeConfiguration().getIpAddress(),  System.currentTimeMillis());

       for (int i = 0; i < phHueSDK.getDisconnectedAccessPoint().size(); i++) {

           if (phHueSDK.getDisconnectedAccessPoint().get(i).getIpAddress().equals(bridge.getResourceCache().getBridgeConfiguration().getIpAddress())) {






   public void onConnectionLost(PHAccessPoint accessPoint) {

       Log.v(TAG, "onConnectionLost : " + accessPoint.getIpAddress());

       if (!phHueSDK.getDisconnectedAccessPoint().contains(accessPoint)) {





public void onError(int code, final String message) {

       Log.e(TAG, "on Error Called : " + code + ":" + message)





   public void onParsingErrors(List<PHHueParsingError> parsingErrorsList) {

       for (PHHueParsingError parsingError: parsingErrorsList) {

           Log.e(TAG, "ParsingError : " + parsingError.getMessage());




After getting the list of available bridges, select bridge and connect with a bridge using “PHBrideg”.

PHAccessPoint accessPoint = (PHAccessPoint) adapter.getItem(position);
PHBridge connectedBridge = phHueSDK.getSelectedBridge();
if (connectedBridge != null) {
String connectedIP = connectedBridge.getResourceCache().getBridgeConfiguration().getIpAddress();
if (connectedIP != null) { // We are already connected here:-
PHWizardAlertDialog.getInstance().showProgressDialog(R.string.connecting, PHHomeActivity.this);

Now select the bulbs and perform operations on selected bulbs.

Here we can switch ON/OFF lights, set brightness, set color of lights using “PHLightState”

List<PHLight> allLights = bridge.getResourceCache().getAllLights();
PHLightState lightState = new PHLightState();
bridge.updateLightState(allLights.get(position), lightState, listener);

Make sure brightness must be in between 0 – 254. 

Here we just learn basic functionalities of Philips hue. We can do so many things using Philips hue SDK.

The smart lights concept is becoming very popular nowadays; I enjoyed it a lot while learning about Philips hue development; I hope you guys will also enjoy it.

Hope it will be helpful to you!!!😊


Android Developer

Priyanka is an android developer with around 3.5 years of experience developing Android applications with core functionality. She has in-depth knowledge of Java and React Native. Priyanka likes to learn new things and share.

Get in touch for a detailed discussion.

Hear From Our 100+ Customers

Mindbowser helped us build an awesome iOS app to bring balance to people’s lives.


We had very close go live timeline and MindBowser team got us live a month before.

Shaz Khan
CEO, BuyNow WorldWide

They were a very responsive team! Extremely easy to communicate and work with!

Kristen M.
Founder & CEO, TotTech

We’ve had very little-to-no hiccups at all—it’s been a really pleasurable experience.

Chacko Thomas
Co-Founder, TEAM8s

Mindbowser is one of the reasons that our app is successful. These guys have been a great team.

Dave Dubier
Founder & CEO, MangoMirror

Mindbowser was very helpful with explaining the development process and started quickly on the project.

Hieu Le
Executive Director of Product Development, Innovation Lab

The greatest benefit we got from Mindbowser is the expertise. Their team has developed apps in all different industries with all types of social proofs.

Alex Gobel
Co-Founder, Vesica

Mindbowser is professional, efficient and thorough. 

MacKenzie R
Consultant at XPRIZE

Very committed, they create beautiful apps and are very benevolent. They have brilliant Ideas.

Laurie Mastrogiani
Founder, S.T.A.R.S of Wellness

MindBowser was great; they listened to us a lot and helped us hone in on the actual idea of the app.” “They had put together fantastic wireframes for us.

Bennet Gillogly
Co-Founder, Flat Earth

They're very tech-savvy, yet humble.

Uma Nidmarty
CEO, GS Advisorate, Inc.

Ayush was responsive and paired me with the best team member possible, to complete my complex vision and project. Could not be happier.

Katie Taylor
Founder, Child Life On Call

As a founder of a budding start-up, it has been a great experience working with Mindbower Inc under Ayush's leadership for our online digital platform design and development activity.

Radhika Kotwal
Founder of Courtyardly

The team from Mindbowser stayed on task, asked the right questions, and completed the required tasks in a timely fashion! Strong work team!

Michael Wright
Chief Executive Officer, SDOH2Health LLC

They are focused, patient and; they are innovative. Please give them a shot if you are looking for someone to partner with, you can go along with Mindbowser.

David Cain
CEO, thirty2give

We are a small non-profit on a budget and they were able to deliver their work at our prescribed budgets. Their team always met their objectives and I'm very happy with the end result. Thank you, Mindbowser team!!

Bart Mendel
Founder, Mindworks