char str[25];
memset(str,0,sizeof(str));
Device::setAccelerometerEnabled(true);
auto listener = EventListenerAcceleration::create([](Acceleration *a,Event *event){
sprintf(str,"X: %g,Y: %g,Z: %g",a->x,a->y,a->z);
MessageBox(str,"Hello");
});
Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraPHPriority(listener,this);