Vijay Samuel's Blog

With Push Notification contribution that is available, implementing push notifications was very simple and straightforward. A big thanks to the contributor.

  • To get push notifications working on Android, one needs to set up Google Cloud Messaging. Google has this well documented and the steps can be found here.
  • Once GCM has been set up, goto your Drupal website and install push_notifications and drupalgap_mobile_notifications plugins. Enable them after installation. Once you have enabled the plugins, goto the permissions of push_notifications and adjust the permissions of creating and removing device tokens as per your application needs. In my case, I wanted tokens to be created even for anonymous users so I had granted permissions for the same and had made the required changes in the drupalgap push_notifications module. Also place the GCM_SENDER_ID that was generated while setting up GCM in the variable defined in push_notifications.js right at the top.
  • After that, goto Administration -> Structure -> Services -> Drupalgap and enable the push notifications checkbox to make the REST endpoint live.
  • Goto Configuration -> Push Notifications -> Configuration to setup the push notifications module. In the bottom provide the API key that was generated in your GCM developer console and save the configuration.
  • Now we’re all set in the Drupal end to send notifications. Setting up the Drupalgap end is very straight forward. Download the push_notifications module and place it in the apps/modules/custom/push_notifications directory.
  • Add an entry to the settings.js to register the custom module.
  • Once this is done, launch the app to make sure that the device token gets registered with the Drupal push_notifications module. It can be verified by going to Configuration -> Push Notifications -> Overview which shows the number of device tokens registered per platform.
  • When you’ve verified that there are registered tokens, click on the Send Push tab to compose a Push message and send it across.

Hope this helps. Happy pushing! Cheers! 🙂


More insights on my ventures in to app development using Drupalgap. I had received a lot of complaints from users that there is considerable flickering in the mobile app that I had built. The flickering wasn’t very much visible in Kit Kat devices but as I went down API levels it was very much visible. The solve was a two part problem:

1) Drupalgap uses the ‘Fade’ transition to move from one page to another. By changing the transition from fade to ‘Slide’ the transitions became much smoother than it was earlier. Sample code on how to change the transition can be seen here.

2) ICS and lower versions of Android seem to have the flickering issue even after the transitions change was implemented. That got fixed when I disabled hardware acceleration. To disable it just goto the AndroidManifest.xml and change the values of hardwareAcceleration to false.

This did the trick. Hope this helps!

Cheers!! 🙂

I’ve been playing around with Drupalgap for a while now and have been very impressed with the contribution done by Tyler Frankenstein. One problem that I had run into is, when doing cross platform testing, Android 4.0.* was throwing a white screen of death. There were multiple solutions out there and experimenting with each one was a pain. I’ve finally solved the issue and here is how I got about it.

Turns out that corodova-android-3.7.0 has the fix to the white screen of death and it can be used as the cordova.js to build the target app for Android.

Follow the instructions in the below link to generate the 3.7.0 version of cordova.js:

The resultant cordova.js can be found in the source cordova-js directory under pkg/ Copy that file into platforms/android/platform_www/cordova.js and rebuild your cordova app. It should fix the issue.

Hope this helps. Cheers! 🙂

The 4th release of the GreenLake series is out. Major changes include:

Clang support by Brian Aker
Sysbench Qewpie testing suite by Sharan and Patrick Crews
Numerous bug fixes by coldtobi
Dynamic plugin support by Anshu Kumar
Improved Documentation

On a side note, a proof of concept was done for Drizzle as a backend for OpenStack during this release as well.

Here is a piece of code that illustrates how to create a Drizzle object, a connection object, establish a connection, execute a query, buffer its result and do some basic operations on it. The code is pretty straight forward. DRIZZLE_RETURN_OK indicates the successful execution of a function. Make sure that you have libdrizzle installed in your machine.

#include <libdrizzle/libdrizzle.h>
#include <stdio.h>
#include <stdlib.h>

int main()
drizzle_st *drizzle;
drizzle_con_st *con;

if ((drizzle= drizzle_create(NULL)) == NULL)
printf(“Error creating drizzle object\n”);
return -1;
con= drizzle_con_add_tcp(drizzle, NULL, “localhost”, 4427, “root”, “password”, “db”, DRIZZLE_NON_BLOCKING);

drizzle_return_t ret= drizzle_con_connect(con);
printf(“Connection Established\n”);

drizzle_result_st *result;
int count= 0;

result= drizzle_query(con, result, “SHOW DATABASES”, strlen(“SHOW DATABASES”), &ret);
ret= drizzle_result_buffer(result);
printf(“%d\n”, (int)drizzle_result_row_count(result));
return 0;

To compile this program, one needs to link to libdrizzle. Use the following command to compile the code file. (Assuming that the code file is connect.c and that you installed libdrizzle-1.0 headers at /usr/include)
gcc -o connect connect.c -ldrizzle -I /usr/include/libdrizzle-1.0 -L /usr/lib

Hope this helps. Happy hacking folks!

This year was my third consecutive Google Summer of Code and I’ve done all three of my GSoCs for the Drizzle community. The first time I worked on refactoring the commandline options processing system using boost::program_options. The second time I worked on a stored procedure interface for Drizzle. This year I got a very interesting project to work on. My mentor, Brian Aker, asked me if I could work on adding Drizzle backend support for OpenStack. I was very thrilled since I’ve been long trying to contribute to the OpenStack community and OpenStack is a community that I’ve admired since its infant days. So, I happily said yes. Brian charted out a plan asking me to try adding a plugin for Collectd which could be used to collect the Drizzle server’s statistics from time to time. As part of this I had to work with libdrizzle. There were not many concrete examples of libdrizzle usage. I somehow managed to write a simple “Hello,World” kind of libdrizzle based C program which I had used as a base to start working on the plugin. But, because of all the relocating and stuff that was happening in my personal life I never got to finish the plugin and it is still left in a half baked state. I will add a blog showing the basic program that I had written using libdrizzle so that people could use it as a base to build on.

I then moved on to modifying devstack to script so that it uses Drizzle as a backend instead of MySQL. Monty Taylor had already told me that all the Drizzle support is already built in as a part of SQLAlchemy and I wouldn’t have to do much. Hence I started to remove all the MySQL related code and adding its equivalent Drizzle code. Diving further in I had noticed that I would have to modify some of the SQLAlchemy library code and some of the code in Nova which I did and got working OpenStack with Drizzle. I will add another blog post covering how I had achieved the backend support as well.

All in all, I had fun working on this project this year and the amount of satisfaction that I got on seeing OpenStack run with Drizzle in the backend is priceless. Ultimately I too have contributed to OpenStack in one form. Now, Drizzle is truely “on the cloud”.

The GA of Drizzle is available for public use. You can see our blog post for the new improvements available with this release. I’ve been with Drizzle for two years now and it is good to see Drizzle mature. This release has given more importance to the users as we’ve done a lot of work on improving documentation and fixing a lot of bugs. We’ve also moved forward in the quest of bringing true multi tenancy.  The release is right on time for Percona Live MySQL Conference which is scheduled for next week. This release is even more special to me as I have the privilege of being Drizzle’s Release Manager and had the opportunity to announce to the world the GA of Drizzle 7.1. As always I’m proud to be a Drizzle dev 🙂

My Timeline

October 2018
« Jan    

I, Me and Myself

My Blog Stats

  • 6,969 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 4 other followers