int main(void) {
  handle_init();

  app_event_loop();

  handle_deinit();
}
Beispiel #2
0
int main(void) {
    srand(time(NULL));
	handle_init();
    /*PebbleAppHandlers handlers = {
        .init_handler = &handle_init,
        .timer_handler = &handle_timeout
    };*/
    app_event_loop();
	handle_deinit();
}
Beispiel #3
0
int main(void) {
    handle_init();
    app_message_init();
    
    //get_events_handler();
    //time(&start);
    
    app_event_loop();
    handle_deinit();
}
Beispiel #4
0
int main(void)
{
	APP_LOG(APP_LOG_LEVEL_INFO, "RingMyPhone app started");
	
	handle_init();
	app_event_loop();
	handle_deinit();
	
	APP_LOG(APP_LOG_LEVEL_INFO, "RingMyPhone app exiting");
	
	return 0;
}
Beispiel #5
0
int main(void) {
    locale_init();
    
    handle_init();
    app_event_loop();
    
    if(launch_reason() == APP_LAUNCH_TIMELINE_ACTION) {
        //lastIdFromAppLaunch = (int)launch_get_args();
        // Start voice dictation UI
        //dictation_session_start(s_dictation_session);
    }
    
    handle_deinit();
}
Beispiel #6
0
int main(void) {
  if (launch_reason() == APP_LAUNCH_WAKEUP) {
    APP_LOG(APP_LOG_LEVEL_DEBUG, "launch wakeup");
    wakeup_service_subscribe(NULL);
    BatteryChargeState charge_state = battery_state_service_peek();
    save_charge_state(&charge_state);
    schedule_wakeup_measure_battery_state();
    app_event_loop();
  } else {
    handle_init();
    app_event_loop();
    handle_deinit();
  }
}
Beispiel #7
0
int main() {
  handle_init();
  app_event_loop();
  handle_deinit();
  return 0;
}
Beispiel #8
0
static void main_window_load(Window *window) {
  s_menu_icon_image = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_MENU_ICON_1);

  int num_a_items = 0;

  s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Dairy",
    .callback = menu_select_callback,
};
  s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Fruits and Veggies",
    .callback = menu_select_callback,
  };
  s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Meats and Fish",
    .callback = menu_select_callback,
  };
   s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Grains",
    .callback = menu_select_callback,
  };
 s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Misc.",
    .callback = menu_select_callback,
  };

  s_menu_sections[0] = (SimpleMenuSection) {
    .num_items = NUM_FIRST_MENU_ITEMS,
    .items = s_first_menu_items,
  };
  
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_frame(window_layer);

  s_simple_menu_layer = simple_menu_layer_create(bounds, window, s_menu_sections, NUM_MENU_SECTIONS, NULL);

  layer_add_child(window_layer, simple_menu_layer_get_layer(s_simple_menu_layer));
}

void main_window_unload(Window *window) {
  simple_menu_layer_destroy(s_simple_menu_layer);
  gbitmap_destroy(s_menu_icon_image);
}

static void init() {
  s_main_window = window_create();
  window_set_window_handlers(s_main_window, (WindowHandlers) {
    .load = main_window_load,
    .unload = main_window_unload,
  });

}

static void deinit() {
  window_destroy(s_main_window);
}

int main(void) {
  init();
  products_init();
  handle_init();
  app_event_loop();
  deinit();
  products_deinit();
  handle_deinit();
}
Beispiel #9
0
int main(void) {
  loadDogNames();
  handle_init();
  app_event_loop();
  handle_deinit();
}
Beispiel #10
0
int main() {
  handle_init();
  tick_timer_service_subscribe(SECOND_UNIT, handle_tick);
  app_event_loop();
  handle_deinit();
}
Beispiel #11
0
static void window_init(Window *window){
  bitcoin_img = gbitmap_create_with_resource(RESOURCE_ID_LG_BIT);
  dogecoin_img = gbitmap_create_with_resource(RESOURCE_ID_LG_DOGE);
  litecoin_img = gbitmap_create_with_resource(RESOURCE_ID_LG_LITE);
  
  first_it[0] = (SimpleMenuItem){
    .title = "BitCoin",
    .callback = coin_select_cb,
    .icon = bitcoin_img,
  };
  first_it[1] = (SimpleMenuItem){
    .title = "DogeCoin",
    .callback = coin_select_cb,
    .icon = dogecoin_img,
  };
  first_it[2] = (SimpleMenuItem){
    .title = "LiteCoin",
    .callback = coin_select_cb,
    .icon = litecoin_img,
  };
  menu_sec[0] = (SimpleMenuSection){
    .num_items = 3,
    .items = first_it,
  };
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_frame(window_layer);
  
  sml = simple_menu_layer_create(bounds, window, menu_sec, 2, NULL);
  
  layer_add_child(window_layer, simple_menu_layer_get_layer(sml));
  
  handle_wins_init();
  
  // Clicker
  // window_set_click_config_provider(window, click_config_provider);
}

static void window_deinit(void) {
  handle_wins_deinit();
  simple_menu_layer_destroy(sml);
}

static void handle_init(void) {
  window = window_create();
  window_init(window);
  
  //Register AppMessage events
  app_message_register_inbox_received(in_received_handler);           
  app_message_open(512, 512);    //Large input and output buffer sizes
  
  //Register to receive minutely updates
  tick_timer_service_subscribe(MINUTE_UNIT, tick_callback);
  
  window_stack_push(window, true /* Animated */);
}

static void handle_deinit(void) {
  APP_LOG(APP_LOG_LEVEL_DEBUG, "Hi im handeling deinit");
  gbitmap_destroy(bitcoin_img);
  gbitmap_destroy(dogecoin_img);
  gbitmap_destroy(litecoin_img);
  
  window_deinit();
  window_destroy(window);
  
  tick_timer_service_unsubscribe();
}

int main(void) {
  handle_init();
  app_event_loop();
  handle_deinit();
}